]> git.openstreetmap.org Git - rails.git/blob - vendor/assets/iD/iD.js
Update to v2.37.2
[rails.git] / vendor / assets / iD / iD.js
1 "use strict";
2 (() => {
3   var __create = Object.create;
4   var __freeze = Object.freeze;
5   var __defProp = Object.defineProperty;
6   var __defProps = Object.defineProperties;
7   var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8   var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
9   var __getOwnPropNames = Object.getOwnPropertyNames;
10   var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11   var __getProtoOf = Object.getPrototypeOf;
12   var __hasOwnProp = Object.prototype.hasOwnProperty;
13   var __propIsEnum = Object.prototype.propertyIsEnumerable;
14   var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
15   var __typeError = (msg) => {
16     throw TypeError(msg);
17   };
18   var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19   var __spreadValues = (a2, b3) => {
20     for (var prop in b3 || (b3 = {}))
21       if (__hasOwnProp.call(b3, prop))
22         __defNormalProp(a2, prop, b3[prop]);
23     if (__getOwnPropSymbols)
24       for (var prop of __getOwnPropSymbols(b3)) {
25         if (__propIsEnum.call(b3, prop))
26           __defNormalProp(a2, prop, b3[prop]);
27       }
28     return a2;
29   };
30   var __spreadProps = (a2, b3) => __defProps(a2, __getOwnPropDescs(b3));
31   var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, {
32     get: (a2, b3) => (typeof require !== "undefined" ? require : a2)[b3]
33   }) : x3)(function(x3) {
34     if (typeof require !== "undefined") return require.apply(this, arguments);
35     throw Error('Dynamic require of "' + x3 + '" is not supported');
36   });
37   var __commonJS = (cb, mod) => function __require2() {
38     return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
39   };
40   var __export = (target, all) => {
41     for (var name in all)
42       __defProp(target, name, { get: all[name], enumerable: true });
43   };
44   var __copyProps = (to, from, except, desc) => {
45     if (from && typeof from === "object" || typeof from === "function") {
46       for (let key of __getOwnPropNames(from))
47         if (!__hasOwnProp.call(to, key) && key !== except)
48           __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
49     }
50     return to;
51   };
52   var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
53     // If the importer is in node compatibility mode or this is not an ESM
54     // file that has been converted to a CommonJS file using a Babel-
55     // compatible transform (i.e. "__esModule" has not been set), then set
56     // "default" to the CommonJS "module.exports" for node compatibility.
57     isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
58     mod
59   ));
60   var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
61   var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", { value: __freeze(raw || cooked.slice()) }));
62   var __await = function(promise, isYieldStar) {
63     this[0] = promise;
64     this[1] = isYieldStar;
65   };
66   var __yieldStar = (value) => {
67     var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
68     if (obj == null) {
69       obj = value[__knownSymbol("iterator")]();
70       method = (k3) => it[k3] = (x3) => obj[k3](x3);
71     } else {
72       obj = obj.call(value);
73       method = (k3) => it[k3] = (v3) => {
74         if (isAwait) {
75           isAwait = false;
76           if (k3 === "throw") throw v3;
77           return v3;
78         }
79         isAwait = true;
80         return {
81           done: false,
82           value: new __await(new Promise((resolve) => {
83             var x3 = obj[k3](v3);
84             if (!(x3 instanceof Object)) __typeError("Object expected");
85             resolve(x3);
86           }), 1)
87         };
88       };
89     }
90     return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x3) => {
91       throw x3;
92     }, "return" in obj && method("return"), it;
93   };
94
95   // node_modules/which-polygon/node_modules/quickselect/quickselect.js
96   var require_quickselect = __commonJS({
97     "node_modules/which-polygon/node_modules/quickselect/quickselect.js"(exports2, module2) {
98       (function(global2, factory) {
99         typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.quickselect = factory();
100       })(exports2, (function() {
101         "use strict";
102         function quickselect3(arr, k3, left, right, compare2) {
103           quickselectStep(arr, k3, left || 0, right || arr.length - 1, compare2 || defaultCompare2);
104         }
105         function quickselectStep(arr, k3, left, right, compare2) {
106           while (right > left) {
107             if (right - left > 600) {
108               var n3 = right - left + 1;
109               var m3 = k3 - left + 1;
110               var z3 = Math.log(n3);
111               var s2 = 0.5 * Math.exp(2 * z3 / 3);
112               var sd = 0.5 * Math.sqrt(z3 * s2 * (n3 - s2) / n3) * (m3 - n3 / 2 < 0 ? -1 : 1);
113               var newLeft = Math.max(left, Math.floor(k3 - m3 * s2 / n3 + sd));
114               var newRight = Math.min(right, Math.floor(k3 + (n3 - m3) * s2 / n3 + sd));
115               quickselectStep(arr, k3, newLeft, newRight, compare2);
116             }
117             var t2 = arr[k3];
118             var i3 = left;
119             var j3 = right;
120             swap3(arr, left, k3);
121             if (compare2(arr[right], t2) > 0) swap3(arr, left, right);
122             while (i3 < j3) {
123               swap3(arr, i3, j3);
124               i3++;
125               j3--;
126               while (compare2(arr[i3], t2) < 0) i3++;
127               while (compare2(arr[j3], t2) > 0) j3--;
128             }
129             if (compare2(arr[left], t2) === 0) swap3(arr, left, j3);
130             else {
131               j3++;
132               swap3(arr, j3, right);
133             }
134             if (j3 <= k3) left = j3 + 1;
135             if (k3 <= j3) right = j3 - 1;
136           }
137         }
138         function swap3(arr, i3, j3) {
139           var tmp = arr[i3];
140           arr[i3] = arr[j3];
141           arr[j3] = tmp;
142         }
143         function defaultCompare2(a2, b3) {
144           return a2 < b3 ? -1 : a2 > b3 ? 1 : 0;
145         }
146         return quickselect3;
147       }));
148     }
149   });
150
151   // node_modules/which-polygon/node_modules/rbush/index.js
152   var require_rbush = __commonJS({
153     "node_modules/which-polygon/node_modules/rbush/index.js"(exports2, module2) {
154       "use strict";
155       module2.exports = rbush;
156       module2.exports.default = rbush;
157       var quickselect3 = require_quickselect();
158       function rbush(maxEntries, format2) {
159         if (!(this instanceof rbush)) return new rbush(maxEntries, format2);
160         this._maxEntries = Math.max(4, maxEntries || 9);
161         this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
162         if (format2) {
163           this._initFormat(format2);
164         }
165         this.clear();
166       }
167       rbush.prototype = {
168         all: function() {
169           return this._all(this.data, []);
170         },
171         search: function(bbox2) {
172           var node = this.data, result = [], toBBox = this.toBBox;
173           if (!intersects2(bbox2, node)) return result;
174           var nodesToSearch = [], i3, len, child, childBBox;
175           while (node) {
176             for (i3 = 0, len = node.children.length; i3 < len; i3++) {
177               child = node.children[i3];
178               childBBox = node.leaf ? toBBox(child) : child;
179               if (intersects2(bbox2, childBBox)) {
180                 if (node.leaf) result.push(child);
181                 else if (contains2(bbox2, childBBox)) this._all(child, result);
182                 else nodesToSearch.push(child);
183               }
184             }
185             node = nodesToSearch.pop();
186           }
187           return result;
188         },
189         collides: function(bbox2) {
190           var node = this.data, toBBox = this.toBBox;
191           if (!intersects2(bbox2, node)) return false;
192           var nodesToSearch = [], i3, len, child, childBBox;
193           while (node) {
194             for (i3 = 0, len = node.children.length; i3 < len; i3++) {
195               child = node.children[i3];
196               childBBox = node.leaf ? toBBox(child) : child;
197               if (intersects2(bbox2, childBBox)) {
198                 if (node.leaf || contains2(bbox2, childBBox)) return true;
199                 nodesToSearch.push(child);
200               }
201             }
202             node = nodesToSearch.pop();
203           }
204           return false;
205         },
206         load: function(data) {
207           if (!(data && data.length)) return this;
208           if (data.length < this._minEntries) {
209             for (var i3 = 0, len = data.length; i3 < len; i3++) {
210               this.insert(data[i3]);
211             }
212             return this;
213           }
214           var node = this._build(data.slice(), 0, data.length - 1, 0);
215           if (!this.data.children.length) {
216             this.data = node;
217           } else if (this.data.height === node.height) {
218             this._splitRoot(this.data, node);
219           } else {
220             if (this.data.height < node.height) {
221               var tmpNode = this.data;
222               this.data = node;
223               node = tmpNode;
224             }
225             this._insert(node, this.data.height - node.height - 1, true);
226           }
227           return this;
228         },
229         insert: function(item) {
230           if (item) this._insert(item, this.data.height - 1);
231           return this;
232         },
233         clear: function() {
234           this.data = createNode2([]);
235           return this;
236         },
237         remove: function(item, equalsFn) {
238           if (!item) return this;
239           var node = this.data, bbox2 = this.toBBox(item), path = [], indexes = [], i3, parent2, index, goingUp;
240           while (node || path.length) {
241             if (!node) {
242               node = path.pop();
243               parent2 = path[path.length - 1];
244               i3 = indexes.pop();
245               goingUp = true;
246             }
247             if (node.leaf) {
248               index = findItem2(item, node.children, equalsFn);
249               if (index !== -1) {
250                 node.children.splice(index, 1);
251                 path.push(node);
252                 this._condense(path);
253                 return this;
254               }
255             }
256             if (!goingUp && !node.leaf && contains2(node, bbox2)) {
257               path.push(node);
258               indexes.push(i3);
259               i3 = 0;
260               parent2 = node;
261               node = node.children[0];
262             } else if (parent2) {
263               i3++;
264               node = parent2.children[i3];
265               goingUp = false;
266             } else node = null;
267           }
268           return this;
269         },
270         toBBox: function(item) {
271           return item;
272         },
273         compareMinX: compareNodeMinX2,
274         compareMinY: compareNodeMinY2,
275         toJSON: function() {
276           return this.data;
277         },
278         fromJSON: function(data) {
279           this.data = data;
280           return this;
281         },
282         _all: function(node, result) {
283           var nodesToSearch = [];
284           while (node) {
285             if (node.leaf) result.push.apply(result, node.children);
286             else nodesToSearch.push.apply(nodesToSearch, node.children);
287             node = nodesToSearch.pop();
288           }
289           return result;
290         },
291         _build: function(items, left, right, height) {
292           var N3 = right - left + 1, M3 = this._maxEntries, node;
293           if (N3 <= M3) {
294             node = createNode2(items.slice(left, right + 1));
295             calcBBox2(node, this.toBBox);
296             return node;
297           }
298           if (!height) {
299             height = Math.ceil(Math.log(N3) / Math.log(M3));
300             M3 = Math.ceil(N3 / Math.pow(M3, height - 1));
301           }
302           node = createNode2([]);
303           node.leaf = false;
304           node.height = height;
305           var N22 = Math.ceil(N3 / M3), N1 = N22 * Math.ceil(Math.sqrt(M3)), i3, j3, right2, right3;
306           multiSelect2(items, left, right, N1, this.compareMinX);
307           for (i3 = left; i3 <= right; i3 += N1) {
308             right2 = Math.min(i3 + N1 - 1, right);
309             multiSelect2(items, i3, right2, N22, this.compareMinY);
310             for (j3 = i3; j3 <= right2; j3 += N22) {
311               right3 = Math.min(j3 + N22 - 1, right2);
312               node.children.push(this._build(items, j3, right3, height - 1));
313             }
314           }
315           calcBBox2(node, this.toBBox);
316           return node;
317         },
318         _chooseSubtree: function(bbox2, node, level, path) {
319           var i3, len, child, targetNode, area, enlargement, minArea, minEnlargement;
320           while (true) {
321             path.push(node);
322             if (node.leaf || path.length - 1 === level) break;
323             minArea = minEnlargement = Infinity;
324             for (i3 = 0, len = node.children.length; i3 < len; i3++) {
325               child = node.children[i3];
326               area = bboxArea2(child);
327               enlargement = enlargedArea2(bbox2, child) - area;
328               if (enlargement < minEnlargement) {
329                 minEnlargement = enlargement;
330                 minArea = area < minArea ? area : minArea;
331                 targetNode = child;
332               } else if (enlargement === minEnlargement) {
333                 if (area < minArea) {
334                   minArea = area;
335                   targetNode = child;
336                 }
337               }
338             }
339             node = targetNode || node.children[0];
340           }
341           return node;
342         },
343         _insert: function(item, level, isNode) {
344           var toBBox = this.toBBox, bbox2 = isNode ? item : toBBox(item), insertPath = [];
345           var node = this._chooseSubtree(bbox2, this.data, level, insertPath);
346           node.children.push(item);
347           extend3(node, bbox2);
348           while (level >= 0) {
349             if (insertPath[level].children.length > this._maxEntries) {
350               this._split(insertPath, level);
351               level--;
352             } else break;
353           }
354           this._adjustParentBBoxes(bbox2, insertPath, level);
355         },
356         // split overflowed node into two
357         _split: function(insertPath, level) {
358           var node = insertPath[level], M3 = node.children.length, m3 = this._minEntries;
359           this._chooseSplitAxis(node, m3, M3);
360           var splitIndex = this._chooseSplitIndex(node, m3, M3);
361           var newNode = createNode2(node.children.splice(splitIndex, node.children.length - splitIndex));
362           newNode.height = node.height;
363           newNode.leaf = node.leaf;
364           calcBBox2(node, this.toBBox);
365           calcBBox2(newNode, this.toBBox);
366           if (level) insertPath[level - 1].children.push(newNode);
367           else this._splitRoot(node, newNode);
368         },
369         _splitRoot: function(node, newNode) {
370           this.data = createNode2([node, newNode]);
371           this.data.height = node.height + 1;
372           this.data.leaf = false;
373           calcBBox2(this.data, this.toBBox);
374         },
375         _chooseSplitIndex: function(node, m3, M3) {
376           var i3, bbox1, bbox2, overlap, area, minOverlap, minArea, index;
377           minOverlap = minArea = Infinity;
378           for (i3 = m3; i3 <= M3 - m3; i3++) {
379             bbox1 = distBBox2(node, 0, i3, this.toBBox);
380             bbox2 = distBBox2(node, i3, M3, this.toBBox);
381             overlap = intersectionArea2(bbox1, bbox2);
382             area = bboxArea2(bbox1) + bboxArea2(bbox2);
383             if (overlap < minOverlap) {
384               minOverlap = overlap;
385               index = i3;
386               minArea = area < minArea ? area : minArea;
387             } else if (overlap === minOverlap) {
388               if (area < minArea) {
389                 minArea = area;
390                 index = i3;
391               }
392             }
393           }
394           return index;
395         },
396         // sorts node children by the best axis for split
397         _chooseSplitAxis: function(node, m3, M3) {
398           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);
399           if (xMargin < yMargin) node.children.sort(compareMinX);
400         },
401         // total margin of all possible split distributions where each node is at least m full
402         _allDistMargin: function(node, m3, M3, compare2) {
403           node.children.sort(compare2);
404           var toBBox = this.toBBox, leftBBox = distBBox2(node, 0, m3, toBBox), rightBBox = distBBox2(node, M3 - m3, M3, toBBox), margin = bboxMargin2(leftBBox) + bboxMargin2(rightBBox), i3, child;
405           for (i3 = m3; i3 < M3 - m3; i3++) {
406             child = node.children[i3];
407             extend3(leftBBox, node.leaf ? toBBox(child) : child);
408             margin += bboxMargin2(leftBBox);
409           }
410           for (i3 = M3 - m3 - 1; i3 >= m3; i3--) {
411             child = node.children[i3];
412             extend3(rightBBox, node.leaf ? toBBox(child) : child);
413             margin += bboxMargin2(rightBBox);
414           }
415           return margin;
416         },
417         _adjustParentBBoxes: function(bbox2, path, level) {
418           for (var i3 = level; i3 >= 0; i3--) {
419             extend3(path[i3], bbox2);
420           }
421         },
422         _condense: function(path) {
423           for (var i3 = path.length - 1, siblings; i3 >= 0; i3--) {
424             if (path[i3].children.length === 0) {
425               if (i3 > 0) {
426                 siblings = path[i3 - 1].children;
427                 siblings.splice(siblings.indexOf(path[i3]), 1);
428               } else this.clear();
429             } else calcBBox2(path[i3], this.toBBox);
430           }
431         },
432         _initFormat: function(format2) {
433           var compareArr = ["return a", " - b", ";"];
434           this.compareMinX = new Function("a", "b", compareArr.join(format2[0]));
435           this.compareMinY = new Function("a", "b", compareArr.join(format2[1]));
436           this.toBBox = new Function(
437             "a",
438             "return {minX: a" + format2[0] + ", minY: a" + format2[1] + ", maxX: a" + format2[2] + ", maxY: a" + format2[3] + "};"
439           );
440         }
441       };
442       function findItem2(item, items, equalsFn) {
443         if (!equalsFn) return items.indexOf(item);
444         for (var i3 = 0; i3 < items.length; i3++) {
445           if (equalsFn(item, items[i3])) return i3;
446         }
447         return -1;
448       }
449       function calcBBox2(node, toBBox) {
450         distBBox2(node, 0, node.children.length, toBBox, node);
451       }
452       function distBBox2(node, k3, p2, toBBox, destNode) {
453         if (!destNode) destNode = createNode2(null);
454         destNode.minX = Infinity;
455         destNode.minY = Infinity;
456         destNode.maxX = -Infinity;
457         destNode.maxY = -Infinity;
458         for (var i3 = k3, child; i3 < p2; i3++) {
459           child = node.children[i3];
460           extend3(destNode, node.leaf ? toBBox(child) : child);
461         }
462         return destNode;
463       }
464       function extend3(a2, b3) {
465         a2.minX = Math.min(a2.minX, b3.minX);
466         a2.minY = Math.min(a2.minY, b3.minY);
467         a2.maxX = Math.max(a2.maxX, b3.maxX);
468         a2.maxY = Math.max(a2.maxY, b3.maxY);
469         return a2;
470       }
471       function compareNodeMinX2(a2, b3) {
472         return a2.minX - b3.minX;
473       }
474       function compareNodeMinY2(a2, b3) {
475         return a2.minY - b3.minY;
476       }
477       function bboxArea2(a2) {
478         return (a2.maxX - a2.minX) * (a2.maxY - a2.minY);
479       }
480       function bboxMargin2(a2) {
481         return a2.maxX - a2.minX + (a2.maxY - a2.minY);
482       }
483       function enlargedArea2(a2, b3) {
484         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));
485       }
486       function intersectionArea2(a2, b3) {
487         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);
488         return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
489       }
490       function contains2(a2, b3) {
491         return a2.minX <= b3.minX && a2.minY <= b3.minY && b3.maxX <= a2.maxX && b3.maxY <= a2.maxY;
492       }
493       function intersects2(a2, b3) {
494         return b3.minX <= a2.maxX && b3.minY <= a2.maxY && b3.maxX >= a2.minX && b3.maxY >= a2.minY;
495       }
496       function createNode2(children2) {
497         return {
498           children: children2,
499           height: 1,
500           leaf: true,
501           minX: Infinity,
502           minY: Infinity,
503           maxX: -Infinity,
504           maxY: -Infinity
505         };
506       }
507       function multiSelect2(arr, left, right, n3, compare2) {
508         var stack = [left, right], mid;
509         while (stack.length) {
510           right = stack.pop();
511           left = stack.pop();
512           if (right - left <= n3) continue;
513           mid = left + Math.ceil((right - left) / n3 / 2) * n3;
514           quickselect3(arr, mid, left, right, compare2);
515           stack.push(left, mid, mid, right);
516         }
517       }
518     }
519   });
520
521   // node_modules/lineclip/index.js
522   var require_lineclip = __commonJS({
523     "node_modules/lineclip/index.js"(exports2, module2) {
524       "use strict";
525       module2.exports = lineclip2;
526       lineclip2.polyline = lineclip2;
527       lineclip2.polygon = polygonclip2;
528       function lineclip2(points, bbox2, result) {
529         var len = points.length, codeA = bitCode2(points[0], bbox2), part = [], i3, a2, b3, codeB, lastCode;
530         if (!result) result = [];
531         for (i3 = 1; i3 < len; i3++) {
532           a2 = points[i3 - 1];
533           b3 = points[i3];
534           codeB = lastCode = bitCode2(b3, bbox2);
535           while (true) {
536             if (!(codeA | codeB)) {
537               part.push(a2);
538               if (codeB !== lastCode) {
539                 part.push(b3);
540                 if (i3 < len - 1) {
541                   result.push(part);
542                   part = [];
543                 }
544               } else if (i3 === len - 1) {
545                 part.push(b3);
546               }
547               break;
548             } else if (codeA & codeB) {
549               break;
550             } else if (codeA) {
551               a2 = intersect2(a2, b3, codeA, bbox2);
552               codeA = bitCode2(a2, bbox2);
553             } else {
554               b3 = intersect2(a2, b3, codeB, bbox2);
555               codeB = bitCode2(b3, bbox2);
556             }
557           }
558           codeA = lastCode;
559         }
560         if (part.length) result.push(part);
561         return result;
562       }
563       function polygonclip2(points, bbox2) {
564         var result, edge, prev, prevInside, i3, p2, inside;
565         for (edge = 1; edge <= 8; edge *= 2) {
566           result = [];
567           prev = points[points.length - 1];
568           prevInside = !(bitCode2(prev, bbox2) & edge);
569           for (i3 = 0; i3 < points.length; i3++) {
570             p2 = points[i3];
571             inside = !(bitCode2(p2, bbox2) & edge);
572             if (inside !== prevInside) result.push(intersect2(prev, p2, edge, bbox2));
573             if (inside) result.push(p2);
574             prev = p2;
575             prevInside = inside;
576           }
577           points = result;
578           if (!points.length) break;
579         }
580         return result;
581       }
582       function intersect2(a2, b3, edge, bbox2) {
583         return edge & 8 ? [a2[0] + (b3[0] - a2[0]) * (bbox2[3] - a2[1]) / (b3[1] - a2[1]), bbox2[3]] : (
584           // top
585           edge & 4 ? [a2[0] + (b3[0] - a2[0]) * (bbox2[1] - a2[1]) / (b3[1] - a2[1]), bbox2[1]] : (
586             // bottom
587             edge & 2 ? [bbox2[2], a2[1] + (b3[1] - a2[1]) * (bbox2[2] - a2[0]) / (b3[0] - a2[0])] : (
588               // right
589               edge & 1 ? [bbox2[0], a2[1] + (b3[1] - a2[1]) * (bbox2[0] - a2[0]) / (b3[0] - a2[0])] : (
590                 // left
591                 null
592               )
593             )
594           )
595         );
596       }
597       function bitCode2(p2, bbox2) {
598         var code = 0;
599         if (p2[0] < bbox2[0]) code |= 1;
600         else if (p2[0] > bbox2[2]) code |= 2;
601         if (p2[1] < bbox2[1]) code |= 4;
602         else if (p2[1] > bbox2[3]) code |= 8;
603         return code;
604       }
605     }
606   });
607
608   // node_modules/which-polygon/index.js
609   var require_which_polygon = __commonJS({
610     "node_modules/which-polygon/index.js"(exports2, module2) {
611       "use strict";
612       var rbush = require_rbush();
613       var lineclip2 = require_lineclip();
614       module2.exports = whichPolygon6;
615       function whichPolygon6(data) {
616         var bboxes = [];
617         for (var i3 = 0; i3 < data.features.length; i3++) {
618           var feature4 = data.features[i3];
619           if (!feature4.geometry) continue;
620           var coords = feature4.geometry.coordinates;
621           if (feature4.geometry.type === "Polygon") {
622             bboxes.push(treeItem(coords, feature4.properties));
623           } else if (feature4.geometry.type === "MultiPolygon") {
624             for (var j3 = 0; j3 < coords.length; j3++) {
625               bboxes.push(treeItem(coords[j3], feature4.properties));
626             }
627           }
628         }
629         var tree = rbush().load(bboxes);
630         function query(p2, multi) {
631           var output = [], result = tree.search({
632             minX: p2[0],
633             minY: p2[1],
634             maxX: p2[0],
635             maxY: p2[1]
636           });
637           for (var i4 = 0; i4 < result.length; i4++) {
638             if (insidePolygon(result[i4].coords, p2)) {
639               if (multi)
640                 output.push(result[i4].props);
641               else
642                 return result[i4].props;
643             }
644           }
645           return multi && output.length ? output : null;
646         }
647         query.tree = tree;
648         query.bbox = function queryBBox(bbox2) {
649           var output = [];
650           var result = tree.search({
651             minX: bbox2[0],
652             minY: bbox2[1],
653             maxX: bbox2[2],
654             maxY: bbox2[3]
655           });
656           for (var i4 = 0; i4 < result.length; i4++) {
657             if (polygonIntersectsBBox(result[i4].coords, bbox2)) {
658               output.push(result[i4].props);
659             }
660           }
661           return output;
662         };
663         return query;
664       }
665       function polygonIntersectsBBox(polygon2, bbox2) {
666         var bboxCenter = [
667           (bbox2[0] + bbox2[2]) / 2,
668           (bbox2[1] + bbox2[3]) / 2
669         ];
670         if (insidePolygon(polygon2, bboxCenter)) return true;
671         for (var i3 = 0; i3 < polygon2.length; i3++) {
672           if (lineclip2(polygon2[i3], bbox2).length > 0) return true;
673         }
674         return false;
675       }
676       function insidePolygon(rings, p2) {
677         var inside = false;
678         for (var i3 = 0, len = rings.length; i3 < len; i3++) {
679           var ring = rings[i3];
680           for (var j3 = 0, len2 = ring.length, k3 = len2 - 1; j3 < len2; k3 = j3++) {
681             if (rayIntersect(p2, ring[j3], ring[k3])) inside = !inside;
682           }
683         }
684         return inside;
685       }
686       function rayIntersect(p2, p1, p22) {
687         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];
688       }
689       function treeItem(coords, props) {
690         var item = {
691           minX: Infinity,
692           minY: Infinity,
693           maxX: -Infinity,
694           maxY: -Infinity,
695           coords,
696           props
697         };
698         for (var i3 = 0; i3 < coords[0].length; i3++) {
699           var p2 = coords[0][i3];
700           item.minX = Math.min(item.minX, p2[0]);
701           item.minY = Math.min(item.minY, p2[1]);
702           item.maxX = Math.max(item.maxX, p2[0]);
703           item.maxY = Math.max(item.maxY, p2[1]);
704         }
705         return item;
706       }
707     }
708   });
709
710   // node_modules/wgs84/index.js
711   var require_wgs84 = __commonJS({
712     "node_modules/wgs84/index.js"(exports2, module2) {
713       module2.exports.RADIUS = 6378137;
714       module2.exports.FLATTENING = 1 / 298.257223563;
715       module2.exports.POLAR_RADIUS = 63567523142e-4;
716     }
717   });
718
719   // node_modules/@mapbox/geojson-area/index.js
720   var require_geojson_area = __commonJS({
721     "node_modules/@mapbox/geojson-area/index.js"(exports2, module2) {
722       var wgs84 = require_wgs84();
723       module2.exports.geometry = geometry;
724       module2.exports.ring = ringArea;
725       function geometry(_3) {
726         var area = 0, i3;
727         switch (_3.type) {
728           case "Polygon":
729             return polygonArea(_3.coordinates);
730           case "MultiPolygon":
731             for (i3 = 0; i3 < _3.coordinates.length; i3++) {
732               area += polygonArea(_3.coordinates[i3]);
733             }
734             return area;
735           case "Point":
736           case "MultiPoint":
737           case "LineString":
738           case "MultiLineString":
739             return 0;
740           case "GeometryCollection":
741             for (i3 = 0; i3 < _3.geometries.length; i3++) {
742               area += geometry(_3.geometries[i3]);
743             }
744             return area;
745         }
746       }
747       function polygonArea(coords) {
748         var area = 0;
749         if (coords && coords.length > 0) {
750           area += Math.abs(ringArea(coords[0]));
751           for (var i3 = 1; i3 < coords.length; i3++) {
752             area -= Math.abs(ringArea(coords[i3]));
753           }
754         }
755         return area;
756       }
757       function ringArea(coords) {
758         var p1, p2, p3, lowerIndex, middleIndex, upperIndex, i3, area = 0, coordsLength = coords.length;
759         if (coordsLength > 2) {
760           for (i3 = 0; i3 < coordsLength; i3++) {
761             if (i3 === coordsLength - 2) {
762               lowerIndex = coordsLength - 2;
763               middleIndex = coordsLength - 1;
764               upperIndex = 0;
765             } else if (i3 === coordsLength - 1) {
766               lowerIndex = coordsLength - 1;
767               middleIndex = 0;
768               upperIndex = 1;
769             } else {
770               lowerIndex = i3;
771               middleIndex = i3 + 1;
772               upperIndex = i3 + 2;
773             }
774             p1 = coords[lowerIndex];
775             p2 = coords[middleIndex];
776             p3 = coords[upperIndex];
777             area += (rad(p3[0]) - rad(p1[0])) * Math.sin(rad(p2[1]));
778           }
779           area = area * wgs84.RADIUS * wgs84.RADIUS / 2;
780         }
781         return area;
782       }
783       function rad(_3) {
784         return _3 * Math.PI / 180;
785       }
786     }
787   });
788
789   // node_modules/circle-to-polygon/input-validation/validateCenter.js
790   var require_validateCenter = __commonJS({
791     "node_modules/circle-to-polygon/input-validation/validateCenter.js"(exports2) {
792       exports2.validateCenter = function validateCenter(center) {
793         var validCenterLengths = [2, 3];
794         if (!Array.isArray(center) || !validCenterLengths.includes(center.length)) {
795           throw new Error("ERROR! Center has to be an array of length two or three");
796         }
797         var [lng, lat] = center;
798         if (typeof lng !== "number" || typeof lat !== "number") {
799           throw new Error(
800             "ERROR! Longitude and Latitude has to be numbers but where ".concat(typeof lng, " and ").concat(typeof lat)
801           );
802         }
803         if (lng > 180 || lng < -180) {
804           throw new Error("ERROR! Longitude has to be between -180 and 180 but was ".concat(lng));
805         }
806         if (lat > 90 || lat < -90) {
807           throw new Error("ERROR! Latitude has to be between -90 and 90 but was ".concat(lat));
808         }
809       };
810     }
811   });
812
813   // node_modules/circle-to-polygon/input-validation/validateRadius.js
814   var require_validateRadius = __commonJS({
815     "node_modules/circle-to-polygon/input-validation/validateRadius.js"(exports2) {
816       exports2.validateRadius = function validateRadius(radius) {
817         if (typeof radius !== "number") {
818           throw new Error("ERROR! Radius has to be a positive number but was: ".concat(typeof radius));
819         }
820         if (radius <= 0) {
821           throw new Error("ERROR! Radius has to be a positive number but was: ".concat(radius));
822         }
823       };
824     }
825   });
826
827   // node_modules/circle-to-polygon/input-validation/validateNumberOfEdges.js
828   var require_validateNumberOfEdges = __commonJS({
829     "node_modules/circle-to-polygon/input-validation/validateNumberOfEdges.js"(exports2) {
830       exports2.validateNumberOfEdges = function validateNumberOfEdges(numberOfEdges) {
831         if (typeof numberOfEdges !== "number") {
832           const ARGUMENT_TYPE = Array.isArray(numberOfEdges) ? "array" : typeof numberOfEdges;
833           throw new Error("ERROR! Number of edges has to be a number but was: ".concat(ARGUMENT_TYPE));
834         }
835         if (numberOfEdges < 3) {
836           throw new Error("ERROR! Number of edges has to be at least 3 but was: ".concat(numberOfEdges));
837         }
838       };
839     }
840   });
841
842   // node_modules/circle-to-polygon/input-validation/validateEarthRadius.js
843   var require_validateEarthRadius = __commonJS({
844     "node_modules/circle-to-polygon/input-validation/validateEarthRadius.js"(exports2) {
845       exports2.validateEarthRadius = function validateEarthRadius(earthRadius2) {
846         if (typeof earthRadius2 !== "number") {
847           const ARGUMENT_TYPE = Array.isArray(earthRadius2) ? "array" : typeof earthRadius2;
848           throw new Error("ERROR! Earth radius has to be a number but was: ".concat(ARGUMENT_TYPE));
849         }
850         if (earthRadius2 <= 0) {
851           throw new Error("ERROR! Earth radius has to be a positive number but was: ".concat(earthRadius2));
852         }
853       };
854     }
855   });
856
857   // node_modules/circle-to-polygon/input-validation/validateBearing.js
858   var require_validateBearing = __commonJS({
859     "node_modules/circle-to-polygon/input-validation/validateBearing.js"(exports2) {
860       exports2.validateBearing = function validateBearing(bearing) {
861         if (typeof bearing !== "number") {
862           const ARGUMENT_TYPE = Array.isArray(bearing) ? "array" : typeof bearing;
863           throw new Error("ERROR! Bearing has to be a number but was: ".concat(ARGUMENT_TYPE));
864         }
865       };
866     }
867   });
868
869   // node_modules/circle-to-polygon/input-validation/index.js
870   var require_input_validation = __commonJS({
871     "node_modules/circle-to-polygon/input-validation/index.js"(exports2) {
872       var validateCenter = require_validateCenter().validateCenter;
873       var validateRadius = require_validateRadius().validateRadius;
874       var validateNumberOfEdges = require_validateNumberOfEdges().validateNumberOfEdges;
875       var validateEarthRadius = require_validateEarthRadius().validateEarthRadius;
876       var validateBearing = require_validateBearing().validateBearing;
877       function validateInput({ center, radius, numberOfEdges, earthRadius: earthRadius2, bearing }) {
878         validateCenter(center);
879         validateRadius(radius);
880         validateNumberOfEdges(numberOfEdges);
881         validateEarthRadius(earthRadius2);
882         validateBearing(bearing);
883       }
884       exports2.validateCenter = validateCenter;
885       exports2.validateRadius = validateRadius;
886       exports2.validateNumberOfEdges = validateNumberOfEdges;
887       exports2.validateEarthRadius = validateEarthRadius;
888       exports2.validateBearing = validateBearing;
889       exports2.validateInput = validateInput;
890     }
891   });
892
893   // node_modules/circle-to-polygon/index.js
894   var require_circle_to_polygon = __commonJS({
895     "node_modules/circle-to-polygon/index.js"(exports2, module2) {
896       "use strict";
897       var { validateInput } = require_input_validation();
898       var defaultEarthRadius = 6378137;
899       function toRadians(angleInDegrees) {
900         return angleInDegrees * Math.PI / 180;
901       }
902       function toDegrees(angleInRadians) {
903         return angleInRadians * 180 / Math.PI;
904       }
905       function offset(c1, distance, earthRadius2, bearing) {
906         var lat1 = toRadians(c1[1]);
907         var lon1 = toRadians(c1[0]);
908         var dByR = distance / earthRadius2;
909         var lat = Math.asin(
910           Math.sin(lat1) * Math.cos(dByR) + Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing)
911         );
912         var lon = lon1 + Math.atan2(
913           Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1),
914           Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat)
915         );
916         return [toDegrees(lon), toDegrees(lat)];
917       }
918       module2.exports = function circleToPolygon2(center, radius, options) {
919         var n3 = getNumberOfEdges(options);
920         var earthRadius2 = getEarthRadius(options);
921         var bearing = getBearing(options);
922         var direction = getDirection(options);
923         validateInput({ center, radius, numberOfEdges: n3, earthRadius: earthRadius2, bearing });
924         var start2 = toRadians(bearing);
925         var coordinates = [];
926         for (var i3 = 0; i3 < n3; ++i3) {
927           coordinates.push(
928             offset(
929               center,
930               radius,
931               earthRadius2,
932               start2 + direction * 2 * Math.PI * -i3 / n3
933             )
934           );
935         }
936         coordinates.push(coordinates[0]);
937         return {
938           type: "Polygon",
939           coordinates: [coordinates]
940         };
941       };
942       function getNumberOfEdges(options) {
943         if (isUndefinedOrNull(options)) {
944           return 32;
945         } else if (isObjectNotArray(options)) {
946           var numberOfEdges = options.numberOfEdges;
947           return numberOfEdges === void 0 ? 32 : numberOfEdges;
948         }
949         return options;
950       }
951       function getEarthRadius(options) {
952         if (isUndefinedOrNull(options)) {
953           return defaultEarthRadius;
954         } else if (isObjectNotArray(options)) {
955           var earthRadius2 = options.earthRadius;
956           return earthRadius2 === void 0 ? defaultEarthRadius : earthRadius2;
957         }
958         return defaultEarthRadius;
959       }
960       function getDirection(options) {
961         if (isObjectNotArray(options) && options.rightHandRule) {
962           return -1;
963         }
964         return 1;
965       }
966       function getBearing(options) {
967         if (isUndefinedOrNull(options)) {
968           return 0;
969         } else if (isObjectNotArray(options)) {
970           var bearing = options.bearing;
971           return bearing === void 0 ? 0 : bearing;
972         }
973         return 0;
974       }
975       function isObjectNotArray(argument) {
976         return argument !== null && typeof argument === "object" && !Array.isArray(argument);
977       }
978       function isUndefinedOrNull(argument) {
979         return argument === null || argument === void 0;
980       }
981     }
982   });
983
984   // node_modules/geojson-precision/index.js
985   var require_geojson_precision = __commonJS({
986     "node_modules/geojson-precision/index.js"(exports2, module2) {
987       (function() {
988         function parse(t2, coordinatePrecision, extrasPrecision) {
989           function point(p2) {
990             return p2.map(function(e3, index) {
991               if (index < 2) {
992                 return 1 * e3.toFixed(coordinatePrecision);
993               } else {
994                 return 1 * e3.toFixed(extrasPrecision);
995               }
996             });
997           }
998           function multi(l2) {
999             return l2.map(point);
1000           }
1001           function poly(p2) {
1002             return p2.map(multi);
1003           }
1004           function multiPoly(m3) {
1005             return m3.map(poly);
1006           }
1007           function geometry(obj) {
1008             if (!obj) {
1009               return {};
1010             }
1011             switch (obj.type) {
1012               case "Point":
1013                 obj.coordinates = point(obj.coordinates);
1014                 return obj;
1015               case "LineString":
1016               case "MultiPoint":
1017                 obj.coordinates = multi(obj.coordinates);
1018                 return obj;
1019               case "Polygon":
1020               case "MultiLineString":
1021                 obj.coordinates = poly(obj.coordinates);
1022                 return obj;
1023               case "MultiPolygon":
1024                 obj.coordinates = multiPoly(obj.coordinates);
1025                 return obj;
1026               case "GeometryCollection":
1027                 obj.geometries = obj.geometries.map(geometry);
1028                 return obj;
1029               default:
1030                 return {};
1031             }
1032           }
1033           function feature4(obj) {
1034             obj.geometry = geometry(obj.geometry);
1035             return obj;
1036           }
1037           function featureCollection(f2) {
1038             f2.features = f2.features.map(feature4);
1039             return f2;
1040           }
1041           function geometryCollection(g3) {
1042             g3.geometries = g3.geometries.map(geometry);
1043             return g3;
1044           }
1045           if (!t2) {
1046             return t2;
1047           }
1048           switch (t2.type) {
1049             case "Feature":
1050               return feature4(t2);
1051             case "GeometryCollection":
1052               return geometryCollection(t2);
1053             case "FeatureCollection":
1054               return featureCollection(t2);
1055             case "Point":
1056             case "LineString":
1057             case "Polygon":
1058             case "MultiPoint":
1059             case "MultiPolygon":
1060             case "MultiLineString":
1061               return geometry(t2);
1062             default:
1063               return t2;
1064           }
1065         }
1066         module2.exports = parse;
1067         module2.exports.parse = parse;
1068       })();
1069     }
1070   });
1071
1072   // node_modules/@aitodotai/json-stringify-pretty-compact/index.js
1073   var require_json_stringify_pretty_compact = __commonJS({
1074     "node_modules/@aitodotai/json-stringify-pretty-compact/index.js"(exports2, module2) {
1075       function isObject2(obj) {
1076         return typeof obj === "object" && obj !== null;
1077       }
1078       function forEach(obj, cb) {
1079         if (Array.isArray(obj)) {
1080           obj.forEach(cb);
1081         } else if (isObject2(obj)) {
1082           Object.keys(obj).forEach(function(key) {
1083             var val = obj[key];
1084             cb(val, key);
1085           });
1086         }
1087       }
1088       function getTreeDepth(obj) {
1089         var depth = 0;
1090         if (Array.isArray(obj) || isObject2(obj)) {
1091           forEach(obj, function(val) {
1092             if (Array.isArray(val) || isObject2(val)) {
1093               var tmpDepth = getTreeDepth(val);
1094               if (tmpDepth > depth) {
1095                 depth = tmpDepth;
1096               }
1097             }
1098           });
1099           return depth + 1;
1100         }
1101         return depth;
1102       }
1103       function stringify3(obj, options) {
1104         options = options || {};
1105         var indent = JSON.stringify([1], null, get5(options, "indent", 2)).slice(2, -3);
1106         var addMargin = get5(options, "margins", false);
1107         var addArrayMargin = get5(options, "arrayMargins", false);
1108         var addObjectMargin = get5(options, "objectMargins", false);
1109         var maxLength = indent === "" ? Infinity : get5(options, "maxLength", 80);
1110         var maxNesting = get5(options, "maxNesting", Infinity);
1111         return (function _stringify(obj2, currentIndent, reserved) {
1112           if (obj2 && typeof obj2.toJSON === "function") {
1113             obj2 = obj2.toJSON();
1114           }
1115           var string = JSON.stringify(obj2);
1116           if (string === void 0) {
1117             return string;
1118           }
1119           var length2 = maxLength - currentIndent.length - reserved;
1120           var treeDepth = getTreeDepth(obj2);
1121           if (treeDepth <= maxNesting && string.length <= length2) {
1122             var prettified = prettify(string, {
1123               addMargin,
1124               addArrayMargin,
1125               addObjectMargin
1126             });
1127             if (prettified.length <= length2) {
1128               return prettified;
1129             }
1130           }
1131           if (isObject2(obj2)) {
1132             var nextIndent = currentIndent + indent;
1133             var items = [];
1134             var delimiters;
1135             var comma = function(array2, index2) {
1136               return index2 === array2.length - 1 ? 0 : 1;
1137             };
1138             if (Array.isArray(obj2)) {
1139               for (var index = 0; index < obj2.length; index++) {
1140                 items.push(
1141                   _stringify(obj2[index], nextIndent, comma(obj2, index)) || "null"
1142                 );
1143               }
1144               delimiters = "[]";
1145             } else {
1146               Object.keys(obj2).forEach(function(key, index2, array2) {
1147                 var keyPart = JSON.stringify(key) + ": ";
1148                 var value = _stringify(
1149                   obj2[key],
1150                   nextIndent,
1151                   keyPart.length + comma(array2, index2)
1152                 );
1153                 if (value !== void 0) {
1154                   items.push(keyPart + value);
1155                 }
1156               });
1157               delimiters = "{}";
1158             }
1159             if (items.length > 0) {
1160               return [
1161                 delimiters[0],
1162                 indent + items.join(",\n" + nextIndent),
1163                 delimiters[1]
1164               ].join("\n" + currentIndent);
1165             }
1166           }
1167           return string;
1168         })(obj, "", 0);
1169       }
1170       var stringOrChar = /("(?:[^\\"]|\\.)*")|[:,\][}{]/g;
1171       function prettify(string, options) {
1172         options = options || {};
1173         var tokens = {
1174           "{": "{",
1175           "}": "}",
1176           "[": "[",
1177           "]": "]",
1178           ",": ", ",
1179           ":": ": "
1180         };
1181         if (options.addMargin || options.addObjectMargin) {
1182           tokens["{"] = "{ ";
1183           tokens["}"] = " }";
1184         }
1185         if (options.addMargin || options.addArrayMargin) {
1186           tokens["["] = "[ ";
1187           tokens["]"] = " ]";
1188         }
1189         return string.replace(stringOrChar, function(match, string2) {
1190           return string2 ? match : tokens[match];
1191         });
1192       }
1193       function get5(options, name, defaultValue) {
1194         return name in options ? options[name] : defaultValue;
1195       }
1196       module2.exports = stringify3;
1197     }
1198   });
1199
1200   // node_modules/aes-js/index.js
1201   var require_aes_js = __commonJS({
1202     "node_modules/aes-js/index.js"(exports2, module2) {
1203       (function(root3) {
1204         "use strict";
1205         function checkInt(value) {
1206           return parseInt(value) === value;
1207         }
1208         function checkInts(arrayish) {
1209           if (!checkInt(arrayish.length)) {
1210             return false;
1211           }
1212           for (var i3 = 0; i3 < arrayish.length; i3++) {
1213             if (!checkInt(arrayish[i3]) || arrayish[i3] < 0 || arrayish[i3] > 255) {
1214               return false;
1215             }
1216           }
1217           return true;
1218         }
1219         function coerceArray(arg, copy2) {
1220           if (arg.buffer && arg.name === "Uint8Array") {
1221             if (copy2) {
1222               if (arg.slice) {
1223                 arg = arg.slice();
1224               } else {
1225                 arg = Array.prototype.slice.call(arg);
1226               }
1227             }
1228             return arg;
1229           }
1230           if (Array.isArray(arg)) {
1231             if (!checkInts(arg)) {
1232               throw new Error("Array contains invalid value: " + arg);
1233             }
1234             return new Uint8Array(arg);
1235           }
1236           if (checkInt(arg.length) && checkInts(arg)) {
1237             return new Uint8Array(arg);
1238           }
1239           throw new Error("unsupported array-like object");
1240         }
1241         function createArray(length2) {
1242           return new Uint8Array(length2);
1243         }
1244         function copyArray2(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {
1245           if (sourceStart != null || sourceEnd != null) {
1246             if (sourceArray.slice) {
1247               sourceArray = sourceArray.slice(sourceStart, sourceEnd);
1248             } else {
1249               sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);
1250             }
1251           }
1252           targetArray.set(sourceArray, targetStart);
1253         }
1254         var convertUtf8 = /* @__PURE__ */ (function() {
1255           function toBytes(text) {
1256             var result = [], i3 = 0;
1257             text = encodeURI(text);
1258             while (i3 < text.length) {
1259               var c2 = text.charCodeAt(i3++);
1260               if (c2 === 37) {
1261                 result.push(parseInt(text.substr(i3, 2), 16));
1262                 i3 += 2;
1263               } else {
1264                 result.push(c2);
1265               }
1266             }
1267             return coerceArray(result);
1268           }
1269           function fromBytes(bytes) {
1270             var result = [], i3 = 0;
1271             while (i3 < bytes.length) {
1272               var c2 = bytes[i3];
1273               if (c2 < 128) {
1274                 result.push(String.fromCharCode(c2));
1275                 i3++;
1276               } else if (c2 > 191 && c2 < 224) {
1277                 result.push(String.fromCharCode((c2 & 31) << 6 | bytes[i3 + 1] & 63));
1278                 i3 += 2;
1279               } else {
1280                 result.push(String.fromCharCode((c2 & 15) << 12 | (bytes[i3 + 1] & 63) << 6 | bytes[i3 + 2] & 63));
1281                 i3 += 3;
1282               }
1283             }
1284             return result.join("");
1285           }
1286           return {
1287             toBytes,
1288             fromBytes
1289           };
1290         })();
1291         var convertHex = /* @__PURE__ */ (function() {
1292           function toBytes(text) {
1293             var result = [];
1294             for (var i3 = 0; i3 < text.length; i3 += 2) {
1295               result.push(parseInt(text.substr(i3, 2), 16));
1296             }
1297             return result;
1298           }
1299           var Hex = "0123456789abcdef";
1300           function fromBytes(bytes) {
1301             var result = [];
1302             for (var i3 = 0; i3 < bytes.length; i3++) {
1303               var v3 = bytes[i3];
1304               result.push(Hex[(v3 & 240) >> 4] + Hex[v3 & 15]);
1305             }
1306             return result.join("");
1307           }
1308           return {
1309             toBytes,
1310             fromBytes
1311           };
1312         })();
1313         var numberOfRounds = { 16: 10, 24: 12, 32: 14 };
1314         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];
1315         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];
1316         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];
1317         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];
1318         var T22 = [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];
1319         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];
1320         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];
1321         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];
1322         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];
1323         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];
1324         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];
1325         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];
1326         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];
1327         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];
1328         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];
1329         function convertToInt32(bytes) {
1330           var result = [];
1331           for (var i3 = 0; i3 < bytes.length; i3 += 4) {
1332             result.push(
1333               bytes[i3] << 24 | bytes[i3 + 1] << 16 | bytes[i3 + 2] << 8 | bytes[i3 + 3]
1334             );
1335           }
1336           return result;
1337         }
1338         var AES = function(key) {
1339           if (!(this instanceof AES)) {
1340             throw Error("AES must be instanitated with `new`");
1341           }
1342           Object.defineProperty(this, "key", {
1343             value: coerceArray(key, true)
1344           });
1345           this._prepare();
1346         };
1347         AES.prototype._prepare = function() {
1348           var rounds = numberOfRounds[this.key.length];
1349           if (rounds == null) {
1350             throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
1351           }
1352           this._Ke = [];
1353           this._Kd = [];
1354           for (var i3 = 0; i3 <= rounds; i3++) {
1355             this._Ke.push([0, 0, 0, 0]);
1356             this._Kd.push([0, 0, 0, 0]);
1357           }
1358           var roundKeyCount = (rounds + 1) * 4;
1359           var KC = this.key.length / 4;
1360           var tk = convertToInt32(this.key);
1361           var index;
1362           for (var i3 = 0; i3 < KC; i3++) {
1363             index = i3 >> 2;
1364             this._Ke[index][i3 % 4] = tk[i3];
1365             this._Kd[rounds - index][i3 % 4] = tk[i3];
1366           }
1367           var rconpointer = 0;
1368           var t2 = KC, tt2;
1369           while (t2 < roundKeyCount) {
1370             tt2 = tk[KC - 1];
1371             tk[0] ^= S3[tt2 >> 16 & 255] << 24 ^ S3[tt2 >> 8 & 255] << 16 ^ S3[tt2 & 255] << 8 ^ S3[tt2 >> 24 & 255] ^ rcon[rconpointer] << 24;
1372             rconpointer += 1;
1373             if (KC != 8) {
1374               for (var i3 = 1; i3 < KC; i3++) {
1375                 tk[i3] ^= tk[i3 - 1];
1376               }
1377             } else {
1378               for (var i3 = 1; i3 < KC / 2; i3++) {
1379                 tk[i3] ^= tk[i3 - 1];
1380               }
1381               tt2 = tk[KC / 2 - 1];
1382               tk[KC / 2] ^= S3[tt2 & 255] ^ S3[tt2 >> 8 & 255] << 8 ^ S3[tt2 >> 16 & 255] << 16 ^ S3[tt2 >> 24 & 255] << 24;
1383               for (var i3 = KC / 2 + 1; i3 < KC; i3++) {
1384                 tk[i3] ^= tk[i3 - 1];
1385               }
1386             }
1387             var i3 = 0, r2, c2;
1388             while (i3 < KC && t2 < roundKeyCount) {
1389               r2 = t2 >> 2;
1390               c2 = t2 % 4;
1391               this._Ke[r2][c2] = tk[i3];
1392               this._Kd[rounds - r2][c2] = tk[i3++];
1393               t2++;
1394             }
1395           }
1396           for (var r2 = 1; r2 < rounds; r2++) {
1397             for (var c2 = 0; c2 < 4; c2++) {
1398               tt2 = this._Kd[r2][c2];
1399               this._Kd[r2][c2] = U1[tt2 >> 24 & 255] ^ U22[tt2 >> 16 & 255] ^ U3[tt2 >> 8 & 255] ^ U4[tt2 & 255];
1400             }
1401           }
1402         };
1403         AES.prototype.encrypt = function(plaintext) {
1404           if (plaintext.length != 16) {
1405             throw new Error("invalid plaintext size (must be 16 bytes)");
1406           }
1407           var rounds = this._Ke.length - 1;
1408           var a2 = [0, 0, 0, 0];
1409           var t2 = convertToInt32(plaintext);
1410           for (var i3 = 0; i3 < 4; i3++) {
1411             t2[i3] ^= this._Ke[0][i3];
1412           }
1413           for (var r2 = 1; r2 < rounds; r2++) {
1414             for (var i3 = 0; i3 < 4; i3++) {
1415               a2[i3] = T1[t2[i3] >> 24 & 255] ^ T22[t2[(i3 + 1) % 4] >> 16 & 255] ^ T3[t2[(i3 + 2) % 4] >> 8 & 255] ^ T4[t2[(i3 + 3) % 4] & 255] ^ this._Ke[r2][i3];
1416             }
1417             t2 = a2.slice();
1418           }
1419           var result = createArray(16), tt2;
1420           for (var i3 = 0; i3 < 4; i3++) {
1421             tt2 = this._Ke[rounds][i3];
1422             result[4 * i3] = (S3[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255;
1423             result[4 * i3 + 1] = (S3[t2[(i3 + 1) % 4] >> 16 & 255] ^ tt2 >> 16) & 255;
1424             result[4 * i3 + 2] = (S3[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255;
1425             result[4 * i3 + 3] = (S3[t2[(i3 + 3) % 4] & 255] ^ tt2) & 255;
1426           }
1427           return result;
1428         };
1429         AES.prototype.decrypt = function(ciphertext) {
1430           if (ciphertext.length != 16) {
1431             throw new Error("invalid ciphertext size (must be 16 bytes)");
1432           }
1433           var rounds = this._Kd.length - 1;
1434           var a2 = [0, 0, 0, 0];
1435           var t2 = convertToInt32(ciphertext);
1436           for (var i3 = 0; i3 < 4; i3++) {
1437             t2[i3] ^= this._Kd[0][i3];
1438           }
1439           for (var r2 = 1; r2 < rounds; r2++) {
1440             for (var i3 = 0; i3 < 4; i3++) {
1441               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];
1442             }
1443             t2 = a2.slice();
1444           }
1445           var result = createArray(16), tt2;
1446           for (var i3 = 0; i3 < 4; i3++) {
1447             tt2 = this._Kd[rounds][i3];
1448             result[4 * i3] = (Si[t2[i3] >> 24 & 255] ^ tt2 >> 24) & 255;
1449             result[4 * i3 + 1] = (Si[t2[(i3 + 3) % 4] >> 16 & 255] ^ tt2 >> 16) & 255;
1450             result[4 * i3 + 2] = (Si[t2[(i3 + 2) % 4] >> 8 & 255] ^ tt2 >> 8) & 255;
1451             result[4 * i3 + 3] = (Si[t2[(i3 + 1) % 4] & 255] ^ tt2) & 255;
1452           }
1453           return result;
1454         };
1455         var ModeOfOperationECB = function(key) {
1456           if (!(this instanceof ModeOfOperationECB)) {
1457             throw Error("AES must be instanitated with `new`");
1458           }
1459           this.description = "Electronic Code Block";
1460           this.name = "ecb";
1461           this._aes = new AES(key);
1462         };
1463         ModeOfOperationECB.prototype.encrypt = function(plaintext) {
1464           plaintext = coerceArray(plaintext);
1465           if (plaintext.length % 16 !== 0) {
1466             throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
1467           }
1468           var ciphertext = createArray(plaintext.length);
1469           var block = createArray(16);
1470           for (var i3 = 0; i3 < plaintext.length; i3 += 16) {
1471             copyArray2(plaintext, block, 0, i3, i3 + 16);
1472             block = this._aes.encrypt(block);
1473             copyArray2(block, ciphertext, i3);
1474           }
1475           return ciphertext;
1476         };
1477         ModeOfOperationECB.prototype.decrypt = function(ciphertext) {
1478           ciphertext = coerceArray(ciphertext);
1479           if (ciphertext.length % 16 !== 0) {
1480             throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
1481           }
1482           var plaintext = createArray(ciphertext.length);
1483           var block = createArray(16);
1484           for (var i3 = 0; i3 < ciphertext.length; i3 += 16) {
1485             copyArray2(ciphertext, block, 0, i3, i3 + 16);
1486             block = this._aes.decrypt(block);
1487             copyArray2(block, plaintext, i3);
1488           }
1489           return plaintext;
1490         };
1491         var ModeOfOperationCBC = function(key, iv) {
1492           if (!(this instanceof ModeOfOperationCBC)) {
1493             throw Error("AES must be instanitated with `new`");
1494           }
1495           this.description = "Cipher Block Chaining";
1496           this.name = "cbc";
1497           if (!iv) {
1498             iv = createArray(16);
1499           } else if (iv.length != 16) {
1500             throw new Error("invalid initialation vector size (must be 16 bytes)");
1501           }
1502           this._lastCipherblock = coerceArray(iv, true);
1503           this._aes = new AES(key);
1504         };
1505         ModeOfOperationCBC.prototype.encrypt = function(plaintext) {
1506           plaintext = coerceArray(plaintext);
1507           if (plaintext.length % 16 !== 0) {
1508             throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
1509           }
1510           var ciphertext = createArray(plaintext.length);
1511           var block = createArray(16);
1512           for (var i3 = 0; i3 < plaintext.length; i3 += 16) {
1513             copyArray2(plaintext, block, 0, i3, i3 + 16);
1514             for (var j3 = 0; j3 < 16; j3++) {
1515               block[j3] ^= this._lastCipherblock[j3];
1516             }
1517             this._lastCipherblock = this._aes.encrypt(block);
1518             copyArray2(this._lastCipherblock, ciphertext, i3);
1519           }
1520           return ciphertext;
1521         };
1522         ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {
1523           ciphertext = coerceArray(ciphertext);
1524           if (ciphertext.length % 16 !== 0) {
1525             throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
1526           }
1527           var plaintext = createArray(ciphertext.length);
1528           var block = createArray(16);
1529           for (var i3 = 0; i3 < ciphertext.length; i3 += 16) {
1530             copyArray2(ciphertext, block, 0, i3, i3 + 16);
1531             block = this._aes.decrypt(block);
1532             for (var j3 = 0; j3 < 16; j3++) {
1533               plaintext[i3 + j3] = block[j3] ^ this._lastCipherblock[j3];
1534             }
1535             copyArray2(ciphertext, this._lastCipherblock, 0, i3, i3 + 16);
1536           }
1537           return plaintext;
1538         };
1539         var ModeOfOperationCFB = function(key, iv, segmentSize) {
1540           if (!(this instanceof ModeOfOperationCFB)) {
1541             throw Error("AES must be instanitated with `new`");
1542           }
1543           this.description = "Cipher Feedback";
1544           this.name = "cfb";
1545           if (!iv) {
1546             iv = createArray(16);
1547           } else if (iv.length != 16) {
1548             throw new Error("invalid initialation vector size (must be 16 size)");
1549           }
1550           if (!segmentSize) {
1551             segmentSize = 1;
1552           }
1553           this.segmentSize = segmentSize;
1554           this._shiftRegister = coerceArray(iv, true);
1555           this._aes = new AES(key);
1556         };
1557         ModeOfOperationCFB.prototype.encrypt = function(plaintext) {
1558           if (plaintext.length % this.segmentSize != 0) {
1559             throw new Error("invalid plaintext size (must be segmentSize bytes)");
1560           }
1561           var encrypted = coerceArray(plaintext, true);
1562           var xorSegment;
1563           for (var i3 = 0; i3 < encrypted.length; i3 += this.segmentSize) {
1564             xorSegment = this._aes.encrypt(this._shiftRegister);
1565             for (var j3 = 0; j3 < this.segmentSize; j3++) {
1566               encrypted[i3 + j3] ^= xorSegment[j3];
1567             }
1568             copyArray2(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
1569             copyArray2(encrypted, this._shiftRegister, 16 - this.segmentSize, i3, i3 + this.segmentSize);
1570           }
1571           return encrypted;
1572         };
1573         ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {
1574           if (ciphertext.length % this.segmentSize != 0) {
1575             throw new Error("invalid ciphertext size (must be segmentSize bytes)");
1576           }
1577           var plaintext = coerceArray(ciphertext, true);
1578           var xorSegment;
1579           for (var i3 = 0; i3 < plaintext.length; i3 += this.segmentSize) {
1580             xorSegment = this._aes.encrypt(this._shiftRegister);
1581             for (var j3 = 0; j3 < this.segmentSize; j3++) {
1582               plaintext[i3 + j3] ^= xorSegment[j3];
1583             }
1584             copyArray2(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
1585             copyArray2(ciphertext, this._shiftRegister, 16 - this.segmentSize, i3, i3 + this.segmentSize);
1586           }
1587           return plaintext;
1588         };
1589         var ModeOfOperationOFB = function(key, iv) {
1590           if (!(this instanceof ModeOfOperationOFB)) {
1591             throw Error("AES must be instanitated with `new`");
1592           }
1593           this.description = "Output Feedback";
1594           this.name = "ofb";
1595           if (!iv) {
1596             iv = createArray(16);
1597           } else if (iv.length != 16) {
1598             throw new Error("invalid initialation vector size (must be 16 bytes)");
1599           }
1600           this._lastPrecipher = coerceArray(iv, true);
1601           this._lastPrecipherIndex = 16;
1602           this._aes = new AES(key);
1603         };
1604         ModeOfOperationOFB.prototype.encrypt = function(plaintext) {
1605           var encrypted = coerceArray(plaintext, true);
1606           for (var i3 = 0; i3 < encrypted.length; i3++) {
1607             if (this._lastPrecipherIndex === 16) {
1608               this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);
1609               this._lastPrecipherIndex = 0;
1610             }
1611             encrypted[i3] ^= this._lastPrecipher[this._lastPrecipherIndex++];
1612           }
1613           return encrypted;
1614         };
1615         ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;
1616         var Counter = function(initialValue) {
1617           if (!(this instanceof Counter)) {
1618             throw Error("Counter must be instanitated with `new`");
1619           }
1620           if (initialValue !== 0 && !initialValue) {
1621             initialValue = 1;
1622           }
1623           if (typeof initialValue === "number") {
1624             this._counter = createArray(16);
1625             this.setValue(initialValue);
1626           } else {
1627             this.setBytes(initialValue);
1628           }
1629         };
1630         Counter.prototype.setValue = function(value) {
1631           if (typeof value !== "number" || parseInt(value) != value) {
1632             throw new Error("invalid counter value (must be an integer)");
1633           }
1634           if (value > Number.MAX_SAFE_INTEGER) {
1635             throw new Error("integer value out of safe range");
1636           }
1637           for (var index = 15; index >= 0; --index) {
1638             this._counter[index] = value % 256;
1639             value = parseInt(value / 256);
1640           }
1641         };
1642         Counter.prototype.setBytes = function(bytes) {
1643           bytes = coerceArray(bytes, true);
1644           if (bytes.length != 16) {
1645             throw new Error("invalid counter bytes size (must be 16 bytes)");
1646           }
1647           this._counter = bytes;
1648         };
1649         Counter.prototype.increment = function() {
1650           for (var i3 = 15; i3 >= 0; i3--) {
1651             if (this._counter[i3] === 255) {
1652               this._counter[i3] = 0;
1653             } else {
1654               this._counter[i3]++;
1655               break;
1656             }
1657           }
1658         };
1659         var ModeOfOperationCTR = function(key, counter) {
1660           if (!(this instanceof ModeOfOperationCTR)) {
1661             throw Error("AES must be instanitated with `new`");
1662           }
1663           this.description = "Counter";
1664           this.name = "ctr";
1665           if (!(counter instanceof Counter)) {
1666             counter = new Counter(counter);
1667           }
1668           this._counter = counter;
1669           this._remainingCounter = null;
1670           this._remainingCounterIndex = 16;
1671           this._aes = new AES(key);
1672         };
1673         ModeOfOperationCTR.prototype.encrypt = function(plaintext) {
1674           var encrypted = coerceArray(plaintext, true);
1675           for (var i3 = 0; i3 < encrypted.length; i3++) {
1676             if (this._remainingCounterIndex === 16) {
1677               this._remainingCounter = this._aes.encrypt(this._counter._counter);
1678               this._remainingCounterIndex = 0;
1679               this._counter.increment();
1680             }
1681             encrypted[i3] ^= this._remainingCounter[this._remainingCounterIndex++];
1682           }
1683           return encrypted;
1684         };
1685         ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;
1686         function pkcs7pad(data) {
1687           data = coerceArray(data, true);
1688           var padder = 16 - data.length % 16;
1689           var result = createArray(data.length + padder);
1690           copyArray2(data, result);
1691           for (var i3 = data.length; i3 < result.length; i3++) {
1692             result[i3] = padder;
1693           }
1694           return result;
1695         }
1696         function pkcs7strip(data) {
1697           data = coerceArray(data, true);
1698           if (data.length < 16) {
1699             throw new Error("PKCS#7 invalid length");
1700           }
1701           var padder = data[data.length - 1];
1702           if (padder > 16) {
1703             throw new Error("PKCS#7 padding byte out of range");
1704           }
1705           var length2 = data.length - padder;
1706           for (var i3 = 0; i3 < padder; i3++) {
1707             if (data[length2 + i3] !== padder) {
1708               throw new Error("PKCS#7 invalid padding byte");
1709             }
1710           }
1711           var result = createArray(length2);
1712           copyArray2(data, result, 0, 0, length2);
1713           return result;
1714         }
1715         var aesjs2 = {
1716           AES,
1717           Counter,
1718           ModeOfOperation: {
1719             ecb: ModeOfOperationECB,
1720             cbc: ModeOfOperationCBC,
1721             cfb: ModeOfOperationCFB,
1722             ofb: ModeOfOperationOFB,
1723             ctr: ModeOfOperationCTR
1724           },
1725           utils: {
1726             hex: convertHex,
1727             utf8: convertUtf8
1728           },
1729           padding: {
1730             pkcs7: {
1731               pad: pkcs7pad,
1732               strip: pkcs7strip
1733             }
1734           },
1735           _arrayTest: {
1736             coerceArray,
1737             createArray,
1738             copyArray: copyArray2
1739           }
1740         };
1741         if (typeof exports2 !== "undefined") {
1742           module2.exports = aesjs2;
1743         } else if (typeof define === "function" && define.amd) {
1744           define([], function() {
1745             return aesjs2;
1746           });
1747         } else {
1748           if (root3.aesjs) {
1749             aesjs2._aesjs = root3.aesjs;
1750           }
1751           root3.aesjs = aesjs2;
1752         }
1753       })(exports2);
1754     }
1755   });
1756
1757   // node_modules/diacritics/index.js
1758   var require_diacritics = __commonJS({
1759     "node_modules/diacritics/index.js"(exports2) {
1760       exports2.remove = removeDiacritics2;
1761       var replacementList = [
1762         {
1763           base: " ",
1764           chars: "\xA0"
1765         },
1766         {
1767           base: "0",
1768           chars: "\u07C0"
1769         },
1770         {
1771           base: "A",
1772           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"
1773         },
1774         {
1775           base: "AA",
1776           chars: "\uA732"
1777         },
1778         {
1779           base: "AE",
1780           chars: "\xC6\u01FC\u01E2"
1781         },
1782         {
1783           base: "AO",
1784           chars: "\uA734"
1785         },
1786         {
1787           base: "AU",
1788           chars: "\uA736"
1789         },
1790         {
1791           base: "AV",
1792           chars: "\uA738\uA73A"
1793         },
1794         {
1795           base: "AY",
1796           chars: "\uA73C"
1797         },
1798         {
1799           base: "B",
1800           chars: "\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0181"
1801         },
1802         {
1803           base: "C",
1804           chars: "\u24B8\uFF23\uA73E\u1E08\u0106C\u0108\u010A\u010C\xC7\u0187\u023B"
1805         },
1806         {
1807           base: "D",
1808           chars: "\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018A\u0189\u1D05\uA779"
1809         },
1810         {
1811           base: "Dh",
1812           chars: "\xD0"
1813         },
1814         {
1815           base: "DZ",
1816           chars: "\u01F1\u01C4"
1817         },
1818         {
1819           base: "Dz",
1820           chars: "\u01F2\u01C5"
1821         },
1822         {
1823           base: "E",
1824           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"
1825         },
1826         {
1827           base: "F",
1828           chars: "\uA77C\u24BB\uFF26\u1E1E\u0191\uA77B"
1829         },
1830         {
1831           base: "G",
1832           chars: "\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E\u0262"
1833         },
1834         {
1835           base: "H",
1836           chars: "\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"
1837         },
1838         {
1839           base: "I",
1840           chars: "\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"
1841         },
1842         {
1843           base: "J",
1844           chars: "\u24BF\uFF2A\u0134\u0248\u0237"
1845         },
1846         {
1847           base: "K",
1848           chars: "\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"
1849         },
1850         {
1851           base: "L",
1852           chars: "\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"
1853         },
1854         {
1855           base: "LJ",
1856           chars: "\u01C7"
1857         },
1858         {
1859           base: "Lj",
1860           chars: "\u01C8"
1861         },
1862         {
1863           base: "M",
1864           chars: "\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C\u03FB"
1865         },
1866         {
1867           base: "N",
1868           chars: "\uA7A4\u0220\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u019D\uA790\u1D0E"
1869         },
1870         {
1871           base: "NJ",
1872           chars: "\u01CA"
1873         },
1874         {
1875           base: "Nj",
1876           chars: "\u01CB"
1877         },
1878         {
1879           base: "O",
1880           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"
1881         },
1882         {
1883           base: "OE",
1884           chars: "\u0152"
1885         },
1886         {
1887           base: "OI",
1888           chars: "\u01A2"
1889         },
1890         {
1891           base: "OO",
1892           chars: "\uA74E"
1893         },
1894         {
1895           base: "OU",
1896           chars: "\u0222"
1897         },
1898         {
1899           base: "P",
1900           chars: "\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"
1901         },
1902         {
1903           base: "Q",
1904           chars: "\u24C6\uFF31\uA756\uA758\u024A"
1905         },
1906         {
1907           base: "R",
1908           chars: "\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"
1909         },
1910         {
1911           base: "S",
1912           chars: "\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"
1913         },
1914         {
1915           base: "T",
1916           chars: "\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"
1917         },
1918         {
1919           base: "Th",
1920           chars: "\xDE"
1921         },
1922         {
1923           base: "TZ",
1924           chars: "\uA728"
1925         },
1926         {
1927           base: "U",
1928           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"
1929         },
1930         {
1931           base: "V",
1932           chars: "\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"
1933         },
1934         {
1935           base: "VY",
1936           chars: "\uA760"
1937         },
1938         {
1939           base: "W",
1940           chars: "\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"
1941         },
1942         {
1943           base: "X",
1944           chars: "\u24CD\uFF38\u1E8A\u1E8C"
1945         },
1946         {
1947           base: "Y",
1948           chars: "\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"
1949         },
1950         {
1951           base: "Z",
1952           chars: "\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"
1953         },
1954         {
1955           base: "a",
1956           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"
1957         },
1958         {
1959           base: "aa",
1960           chars: "\uA733"
1961         },
1962         {
1963           base: "ae",
1964           chars: "\xE6\u01FD\u01E3"
1965         },
1966         {
1967           base: "ao",
1968           chars: "\uA735"
1969         },
1970         {
1971           base: "au",
1972           chars: "\uA737"
1973         },
1974         {
1975           base: "av",
1976           chars: "\uA739\uA73B"
1977         },
1978         {
1979           base: "ay",
1980           chars: "\uA73D"
1981         },
1982         {
1983           base: "b",
1984           chars: "\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0182"
1985         },
1986         {
1987           base: "c",
1988           chars: "\uFF43\u24D2\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"
1989         },
1990         {
1991           base: "d",
1992           chars: "\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\u018B\u13E7\u0501\uA7AA"
1993         },
1994         {
1995           base: "dh",
1996           chars: "\xF0"
1997         },
1998         {
1999           base: "dz",
2000           chars: "\u01F3\u01C6"
2001         },
2002         {
2003           base: "e",
2004           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"
2005         },
2006         {
2007           base: "f",
2008           chars: "\u24D5\uFF46\u1E1F\u0192"
2009         },
2010         {
2011           base: "ff",
2012           chars: "\uFB00"
2013         },
2014         {
2015           base: "fi",
2016           chars: "\uFB01"
2017         },
2018         {
2019           base: "fl",
2020           chars: "\uFB02"
2021         },
2022         {
2023           base: "ffi",
2024           chars: "\uFB03"
2025         },
2026         {
2027           base: "ffl",
2028           chars: "\uFB04"
2029         },
2030         {
2031           base: "g",
2032           chars: "\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\uA77F\u1D79"
2033         },
2034         {
2035           base: "h",
2036           chars: "\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"
2037         },
2038         {
2039           base: "hv",
2040           chars: "\u0195"
2041         },
2042         {
2043           base: "i",
2044           chars: "\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"
2045         },
2046         {
2047           base: "j",
2048           chars: "\u24D9\uFF4A\u0135\u01F0\u0249"
2049         },
2050         {
2051           base: "k",
2052           chars: "\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"
2053         },
2054         {
2055           base: "l",
2056           chars: "\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u026D"
2057         },
2058         {
2059           base: "lj",
2060           chars: "\u01C9"
2061         },
2062         {
2063           base: "m",
2064           chars: "\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"
2065         },
2066         {
2067           base: "n",
2068           chars: "\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509"
2069         },
2070         {
2071           base: "nj",
2072           chars: "\u01CC"
2073         },
2074         {
2075           base: "o",
2076           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"
2077         },
2078         {
2079           base: "oe",
2080           chars: "\u0153"
2081         },
2082         {
2083           base: "oi",
2084           chars: "\u01A3"
2085         },
2086         {
2087           base: "oo",
2088           chars: "\uA74F"
2089         },
2090         {
2091           base: "ou",
2092           chars: "\u0223"
2093         },
2094         {
2095           base: "p",
2096           chars: "\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u03C1"
2097         },
2098         {
2099           base: "q",
2100           chars: "\u24E0\uFF51\u024B\uA757\uA759"
2101         },
2102         {
2103           base: "r",
2104           chars: "\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"
2105         },
2106         {
2107           base: "s",
2108           chars: "\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u0282"
2109         },
2110         {
2111           base: "ss",
2112           chars: "\xDF"
2113         },
2114         {
2115           base: "t",
2116           chars: "\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"
2117         },
2118         {
2119           base: "th",
2120           chars: "\xFE"
2121         },
2122         {
2123           base: "tz",
2124           chars: "\uA729"
2125         },
2126         {
2127           base: "u",
2128           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"
2129         },
2130         {
2131           base: "v",
2132           chars: "\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"
2133         },
2134         {
2135           base: "vy",
2136           chars: "\uA761"
2137         },
2138         {
2139           base: "w",
2140           chars: "\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"
2141         },
2142         {
2143           base: "x",
2144           chars: "\u24E7\uFF58\u1E8B\u1E8D"
2145         },
2146         {
2147           base: "y",
2148           chars: "\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"
2149         },
2150         {
2151           base: "z",
2152           chars: "\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"
2153         }
2154       ];
2155       var diacriticsMap = {};
2156       for (i3 = 0; i3 < replacementList.length; i3 += 1) {
2157         chars = replacementList[i3].chars;
2158         for (j3 = 0; j3 < chars.length; j3 += 1) {
2159           diacriticsMap[chars[j3]] = replacementList[i3].base;
2160         }
2161       }
2162       var chars;
2163       var j3;
2164       var i3;
2165       function removeDiacritics2(str) {
2166         return str.replace(/[^\u0000-\u007e]/g, function(c2) {
2167           return diacriticsMap[c2] || c2;
2168         });
2169       }
2170       exports2.replacementList = replacementList;
2171       exports2.diacriticsMap = diacriticsMap;
2172     }
2173   });
2174
2175   // node_modules/alif-toolkit/lib/isArabic.js
2176   var require_isArabic = __commonJS({
2177     "node_modules/alif-toolkit/lib/isArabic.js"(exports2) {
2178       "use strict";
2179       Object.defineProperty(exports2, "__esModule", { value: true });
2180       exports2.isArabic = isArabic;
2181       exports2.isMath = isMath;
2182       var arabicBlocks = [
2183         [1536, 1791],
2184         // Arabic https://www.unicode.org/charts/PDF/U0600.pdf
2185         [1872, 1919],
2186         // supplement https://www.unicode.org/charts/PDF/U0750.pdf
2187         [2208, 2303],
2188         // Extended-A https://www.unicode.org/charts/PDF/U08A0.pdf
2189         [64336, 65023],
2190         // Presentation Forms-A https://www.unicode.org/charts/PDF/UFB50.pdf
2191         [65136, 65279],
2192         // Presentation Forms-B https://www.unicode.org/charts/PDF/UFE70.pdf
2193         [69216, 69247],
2194         // Rumi numerals https://www.unicode.org/charts/PDF/U10E60.pdf
2195         [126064, 126143],
2196         // Indic Siyaq numerals https://www.unicode.org/charts/PDF/U1EC70.pdf
2197         [126464, 126719]
2198         // Mathematical Alphabetic symbols https://www.unicode.org/charts/PDF/U1EE00.pdf
2199       ];
2200       function isArabic(char) {
2201         if (char.length > 1) {
2202           throw new Error("isArabic works on only one-character strings");
2203         }
2204         let code = char.charCodeAt(0);
2205         for (let i3 = 0; i3 < arabicBlocks.length; i3++) {
2206           let block = arabicBlocks[i3];
2207           if (code >= block[0] && code <= block[1]) {
2208             return true;
2209           }
2210         }
2211         return false;
2212       }
2213       function isMath(char) {
2214         if (char.length > 2) {
2215           throw new Error("isMath works on only one-character strings");
2216         }
2217         let code = char.charCodeAt(0);
2218         return code >= 1632 && code <= 1644 || code >= 1776 && code <= 1785;
2219       }
2220     }
2221   });
2222
2223   // node_modules/alif-toolkit/lib/unicode-arabic.js
2224   var require_unicode_arabic = __commonJS({
2225     "node_modules/alif-toolkit/lib/unicode-arabic.js"(exports2) {
2226       "use strict";
2227       Object.defineProperty(exports2, "__esModule", { value: true });
2228       var arabicReference = {
2229         "alef": {
2230           "normal": [
2231             "\u0627"
2232           ],
2233           "madda_above": {
2234             "normal": [
2235               "\u0627\u0653",
2236               "\u0622"
2237             ],
2238             "isolated": "\uFE81",
2239             "final": "\uFE82"
2240           },
2241           "hamza_above": {
2242             "normal": [
2243               "\u0627\u0654",
2244               "\u0623"
2245             ],
2246             "isolated": "\uFE83",
2247             "final": "\uFE84"
2248           },
2249           "hamza_below": {
2250             "normal": [
2251               "\u0627\u0655",
2252               "\u0625"
2253             ],
2254             "isolated": "\uFE87",
2255             "final": "\uFE88"
2256           },
2257           "wasla": {
2258             "normal": "\u0671",
2259             "isolated": "\uFB50",
2260             "final": "\uFB51"
2261           },
2262           "wavy_hamza_above": [
2263             "\u0672"
2264           ],
2265           "wavy_hamza_below": [
2266             "\u0627\u065F",
2267             "\u0673"
2268           ],
2269           "high_hamza": [
2270             "\u0675",
2271             "\u0627\u0674"
2272           ],
2273           "indic_two_above": [
2274             "\u0773"
2275           ],
2276           "indic_three_above": [
2277             "\u0774"
2278           ],
2279           "fathatan": {
2280             "normal": [
2281               "\u0627\u064B"
2282             ],
2283             "final": "\uFD3C",
2284             "isolated": "\uFD3D"
2285           },
2286           "isolated": "\uFE8D",
2287           "final": "\uFE8E"
2288         },
2289         "beh": {
2290           "normal": [
2291             "\u0628"
2292           ],
2293           "dotless": [
2294             "\u066E"
2295           ],
2296           "three_dots_horizontally_below": [
2297             "\u0750"
2298           ],
2299           "dot_below_three_dots_above": [
2300             "\u0751"
2301           ],
2302           "three_dots_pointing_upwards_below": [
2303             "\u0752"
2304           ],
2305           "three_dots_pointing_upwards_below_two_dots_above": [
2306             "\u0753"
2307           ],
2308           "two_dots_below_dot_above": [
2309             "\u0754"
2310           ],
2311           "inverted_small_v_below": [
2312             "\u0755"
2313           ],
2314           "small_v": [
2315             "\u0756"
2316           ],
2317           "small_v_below": [
2318             "\u08A0"
2319           ],
2320           "hamza_above": [
2321             "\u08A1"
2322           ],
2323           "small_meem_above": [
2324             "\u08B6"
2325           ],
2326           "isolated": "\uFE8F",
2327           "final": "\uFE90",
2328           "initial": "\uFE91",
2329           "medial": "\uFE92"
2330         },
2331         "teh marbuta": {
2332           "normal": [
2333             "\u0629"
2334           ],
2335           "isolated": "\uFE93",
2336           "final": "\uFE94"
2337         },
2338         "teh": {
2339           "normal": [
2340             "\u062A"
2341           ],
2342           "ring": [
2343             "\u067C"
2344           ],
2345           "three_dots_above_downwards": [
2346             "\u067D"
2347           ],
2348           "small_teh_above": [
2349             "\u08B8"
2350           ],
2351           "isolated": "\uFE95",
2352           "final": "\uFE96",
2353           "initial": "\uFE97",
2354           "medial": "\uFE98"
2355         },
2356         "theh": {
2357           "normal": [
2358             "\u062B"
2359           ],
2360           "isolated": "\uFE99",
2361           "final": "\uFE9A",
2362           "initial": "\uFE9B",
2363           "medial": "\uFE9C"
2364         },
2365         "jeem": {
2366           "normal": [
2367             "\u062C"
2368           ],
2369           "two_dots_above": [
2370             "\u08A2"
2371           ],
2372           "isolated": "\uFE9D",
2373           "final": "\uFE9E",
2374           "initial": "\uFE9F",
2375           "medial": "\uFEA0"
2376         },
2377         "hah": {
2378           "normal": [
2379             "\u062D"
2380           ],
2381           "hamza_above": [
2382             "\u0681"
2383           ],
2384           "two_dots_vertical_above": [
2385             "\u0682"
2386           ],
2387           "three_dots_above": [
2388             "\u0685"
2389           ],
2390           "two_dots_above": [
2391             "\u0757"
2392           ],
2393           "three_dots_pointing_upwards_below": [
2394             "\u0758"
2395           ],
2396           "small_tah_below": [
2397             "\u076E"
2398           ],
2399           "small_tah_two_dots": [
2400             "\u076F"
2401           ],
2402           "small_tah_above": [
2403             "\u0772"
2404           ],
2405           "indic_four_below": [
2406             "\u077C"
2407           ],
2408           "isolated": "\uFEA1",
2409           "final": "\uFEA2",
2410           "initial": "\uFEA3",
2411           "medial": "\uFEA4"
2412         },
2413         "khah": {
2414           "normal": [
2415             "\u062E"
2416           ],
2417           "isolated": "\uFEA5",
2418           "final": "\uFEA6",
2419           "initial": "\uFEA7",
2420           "medial": "\uFEA8"
2421         },
2422         "dal": {
2423           "normal": [
2424             "\u062F"
2425           ],
2426           "ring": [
2427             "\u0689"
2428           ],
2429           "dot_below": [
2430             "\u068A"
2431           ],
2432           "dot_below_small_tah": [
2433             "\u068B"
2434           ],
2435           "three_dots_above_downwards": [
2436             "\u068F"
2437           ],
2438           "four_dots_above": [
2439             "\u0690"
2440           ],
2441           "inverted_v": [
2442             "\u06EE"
2443           ],
2444           "two_dots_vertically_below_small_tah": [
2445             "\u0759"
2446           ],
2447           "inverted_small_v_below": [
2448             "\u075A"
2449           ],
2450           "three_dots_below": [
2451             "\u08AE"
2452           ],
2453           "isolated": "\uFEA9",
2454           "final": "\uFEAA"
2455         },
2456         "thal": {
2457           "normal": [
2458             "\u0630"
2459           ],
2460           "isolated": "\uFEAB",
2461           "final": "\uFEAC"
2462         },
2463         "reh": {
2464           "normal": [
2465             "\u0631"
2466           ],
2467           "small_v": [
2468             "\u0692"
2469           ],
2470           "ring": [
2471             "\u0693"
2472           ],
2473           "dot_below": [
2474             "\u0694"
2475           ],
2476           "small_v_below": [
2477             "\u0695"
2478           ],
2479           "dot_below_dot_above": [
2480             "\u0696"
2481           ],
2482           "two_dots_above": [
2483             "\u0697"
2484           ],
2485           "four_dots_above": [
2486             "\u0699"
2487           ],
2488           "inverted_v": [
2489             "\u06EF"
2490           ],
2491           "stroke": [
2492             "\u075B"
2493           ],
2494           "two_dots_vertically_above": [
2495             "\u076B"
2496           ],
2497           "hamza_above": [
2498             "\u076C"
2499           ],
2500           "small_tah_two_dots": [
2501             "\u0771"
2502           ],
2503           "loop": [
2504             "\u08AA"
2505           ],
2506           "small_noon_above": [
2507             "\u08B9"
2508           ],
2509           "isolated": "\uFEAD",
2510           "final": "\uFEAE"
2511         },
2512         "zain": {
2513           "normal": [
2514             "\u0632"
2515           ],
2516           "inverted_v_above": [
2517             "\u08B2"
2518           ],
2519           "isolated": "\uFEAF",
2520           "final": "\uFEB0"
2521         },
2522         "seen": {
2523           "normal": [
2524             "\u0633"
2525           ],
2526           "dot_below_dot_above": [
2527             "\u069A"
2528           ],
2529           "three_dots_below": [
2530             "\u069B"
2531           ],
2532           "three_dots_below_three_dots_above": [
2533             "\u069C"
2534           ],
2535           "four_dots_above": [
2536             "\u075C"
2537           ],
2538           "two_dots_vertically_above": [
2539             "\u076D"
2540           ],
2541           "small_tah_two_dots": [
2542             "\u0770"
2543           ],
2544           "indic_four_above": [
2545             "\u077D"
2546           ],
2547           "inverted_v": [
2548             "\u077E"
2549           ],
2550           "isolated": "\uFEB1",
2551           "final": "\uFEB2",
2552           "initial": "\uFEB3",
2553           "medial": "\uFEB4"
2554         },
2555         "sheen": {
2556           "normal": [
2557             "\u0634"
2558           ],
2559           "dot_below": [
2560             "\u06FA"
2561           ],
2562           "isolated": "\uFEB5",
2563           "final": "\uFEB6",
2564           "initial": "\uFEB7",
2565           "medial": "\uFEB8"
2566         },
2567         "sad": {
2568           "normal": [
2569             "\u0635"
2570           ],
2571           "two_dots_below": [
2572             "\u069D"
2573           ],
2574           "three_dots_above": [
2575             "\u069E"
2576           ],
2577           "three_dots_below": [
2578             "\u08AF"
2579           ],
2580           "isolated": "\uFEB9",
2581           "final": "\uFEBA",
2582           "initial": "\uFEBB",
2583           "medial": "\uFEBC"
2584         },
2585         "dad": {
2586           "normal": [
2587             "\u0636"
2588           ],
2589           "dot_below": [
2590             "\u06FB"
2591           ],
2592           "isolated": "\uFEBD",
2593           "final": "\uFEBE",
2594           "initial": "\uFEBF",
2595           "medial": "\uFEC0"
2596         },
2597         "tah": {
2598           "normal": [
2599             "\u0637"
2600           ],
2601           "three_dots_above": [
2602             "\u069F"
2603           ],
2604           "two_dots_above": [
2605             "\u08A3"
2606           ],
2607           "isolated": "\uFEC1",
2608           "final": "\uFEC2",
2609           "initial": "\uFEC3",
2610           "medial": "\uFEC4"
2611         },
2612         "zah": {
2613           "normal": [
2614             "\u0638"
2615           ],
2616           "isolated": "\uFEC5",
2617           "final": "\uFEC6",
2618           "initial": "\uFEC7",
2619           "medial": "\uFEC8"
2620         },
2621         "ain": {
2622           "normal": [
2623             "\u0639"
2624           ],
2625           "three_dots_above": [
2626             "\u06A0"
2627           ],
2628           "two_dots_above": [
2629             "\u075D"
2630           ],
2631           "three_dots_pointing_downwards_above": [
2632             "\u075E"
2633           ],
2634           "two_dots_vertically_above": [
2635             "\u075F"
2636           ],
2637           "three_dots_below": [
2638             "\u08B3"
2639           ],
2640           "isolated": "\uFEC9",
2641           "final": "\uFECA",
2642           "initial": "\uFECB",
2643           "medial": "\uFECC"
2644         },
2645         "ghain": {
2646           "normal": [
2647             "\u063A"
2648           ],
2649           "dot_below": [
2650             "\u06FC"
2651           ],
2652           "isolated": "\uFECD",
2653           "final": "\uFECE",
2654           "initial": "\uFECF",
2655           "medial": "\uFED0"
2656         },
2657         "feh": {
2658           "normal": [
2659             "\u0641"
2660           ],
2661           "dotless": [
2662             "\u06A1"
2663           ],
2664           "dot_moved_below": [
2665             "\u06A2"
2666           ],
2667           "dot_below": [
2668             "\u06A3"
2669           ],
2670           "three_dots_below": [
2671             "\u06A5"
2672           ],
2673           "two_dots_below": [
2674             "\u0760"
2675           ],
2676           "three_dots_pointing_upwards_below": [
2677             "\u0761"
2678           ],
2679           "dot_below_three_dots_above": [
2680             "\u08A4"
2681           ],
2682           "isolated": "\uFED1",
2683           "final": "\uFED2",
2684           "initial": "\uFED3",
2685           "medial": "\uFED4"
2686         },
2687         "qaf": {
2688           "normal": [
2689             "\u0642"
2690           ],
2691           "dotless": [
2692             "\u066F"
2693           ],
2694           "dot_above": [
2695             "\u06A7"
2696           ],
2697           "three_dots_above": [
2698             "\u06A8"
2699           ],
2700           "dot_below": [
2701             "\u08A5"
2702           ],
2703           "isolated": "\uFED5",
2704           "final": "\uFED6",
2705           "initial": "\uFED7",
2706           "medial": "\uFED8"
2707         },
2708         "kaf": {
2709           "normal": [
2710             "\u0643"
2711           ],
2712           "swash": [
2713             "\u06AA"
2714           ],
2715           "ring": [
2716             "\u06AB"
2717           ],
2718           "dot_above": [
2719             "\u06AC"
2720           ],
2721           "three_dots_below": [
2722             "\u06AE"
2723           ],
2724           "two_dots_above": [
2725             "\u077F"
2726           ],
2727           "dot_below": [
2728             "\u08B4"
2729           ],
2730           "isolated": "\uFED9",
2731           "final": "\uFEDA",
2732           "initial": "\uFEDB",
2733           "medial": "\uFEDC"
2734         },
2735         "lam": {
2736           "normal": [
2737             "\u0644"
2738           ],
2739           "small_v": [
2740             "\u06B5"
2741           ],
2742           "dot_above": [
2743             "\u06B6"
2744           ],
2745           "three_dots_above": [
2746             "\u06B7"
2747           ],
2748           "three_dots_below": [
2749             "\u06B8"
2750           ],
2751           "bar": [
2752             "\u076A"
2753           ],
2754           "double_bar": [
2755             "\u08A6"
2756           ],
2757           "isolated": "\uFEDD",
2758           "final": "\uFEDE",
2759           "initial": "\uFEDF",
2760           "medial": "\uFEE0"
2761         },
2762         "meem": {
2763           "normal": [
2764             "\u0645"
2765           ],
2766           "dot_above": [
2767             "\u0765"
2768           ],
2769           "dot_below": [
2770             "\u0766"
2771           ],
2772           "three_dots_above": [
2773             "\u08A7"
2774           ],
2775           "isolated": "\uFEE1",
2776           "final": "\uFEE2",
2777           "initial": "\uFEE3",
2778           "medial": "\uFEE4"
2779         },
2780         "noon": {
2781           "normal": [
2782             "\u0646"
2783           ],
2784           "dot_below": [
2785             "\u06B9"
2786           ],
2787           "ring": [
2788             "\u06BC"
2789           ],
2790           "three_dots_above": [
2791             "\u06BD"
2792           ],
2793           "two_dots_below": [
2794             "\u0767"
2795           ],
2796           "small_tah": [
2797             "\u0768"
2798           ],
2799           "small_v": [
2800             "\u0769"
2801           ],
2802           "isolated": "\uFEE5",
2803           "final": "\uFEE6",
2804           "initial": "\uFEE7",
2805           "medial": "\uFEE8"
2806         },
2807         "heh": {
2808           "normal": [
2809             "\u0647"
2810           ],
2811           "isolated": "\uFEE9",
2812           "final": "\uFEEA",
2813           "initial": "\uFEEB",
2814           "medial": "\uFEEC"
2815         },
2816         "waw": {
2817           "normal": [
2818             "\u0648"
2819           ],
2820           "hamza_above": {
2821             "normal": [
2822               "\u0624",
2823               "\u0648\u0654"
2824             ],
2825             "isolated": "\uFE85",
2826             "final": "\uFE86"
2827           },
2828           "high_hamza": [
2829             "\u0676",
2830             "\u0648\u0674"
2831           ],
2832           "ring": [
2833             "\u06C4"
2834           ],
2835           "two_dots_above": [
2836             "\u06CA"
2837           ],
2838           "dot_above": [
2839             "\u06CF"
2840           ],
2841           "indic_two_above": [
2842             "\u0778"
2843           ],
2844           "indic_three_above": [
2845             "\u0779"
2846           ],
2847           "dot_within": [
2848             "\u08AB"
2849           ],
2850           "isolated": "\uFEED",
2851           "final": "\uFEEE"
2852         },
2853         "alef_maksura": {
2854           "normal": [
2855             "\u0649"
2856           ],
2857           "hamza_above": [
2858             "\u0626",
2859             "\u064A\u0654"
2860           ],
2861           "initial": "\uFBE8",
2862           "medial": "\uFBE9",
2863           "isolated": "\uFEEF",
2864           "final": "\uFEF0"
2865         },
2866         "yeh": {
2867           "normal": [
2868             "\u064A"
2869           ],
2870           "hamza_above": {
2871             "normal": [
2872               "\u0626",
2873               "\u0649\u0654"
2874             ],
2875             "isolated": "\uFE89",
2876             "final": "\uFE8A",
2877             "initial": "\uFE8B",
2878             "medial": "\uFE8C"
2879           },
2880           "two_dots_below_hamza_above": [
2881             "\u08A8"
2882           ],
2883           "high_hamza": [
2884             "\u0678",
2885             "\u064A\u0674"
2886           ],
2887           "tail": [
2888             "\u06CD"
2889           ],
2890           "small_v": [
2891             "\u06CE"
2892           ],
2893           "three_dots_below": [
2894             "\u06D1"
2895           ],
2896           "two_dots_below_dot_above": [
2897             "\u08A9"
2898           ],
2899           "two_dots_below_small_noon_above": [
2900             "\u08BA"
2901           ],
2902           "isolated": "\uFEF1",
2903           "final": "\uFEF2",
2904           "initial": "\uFEF3",
2905           "medial": "\uFEF4"
2906         },
2907         "tteh": {
2908           "normal": [
2909             "\u0679"
2910           ],
2911           "isolated": "\uFB66",
2912           "final": "\uFB67",
2913           "initial": "\uFB68",
2914           "medial": "\uFB69"
2915         },
2916         "tteheh": {
2917           "normal": [
2918             "\u067A"
2919           ],
2920           "isolated": "\uFB5E",
2921           "final": "\uFB5F",
2922           "initial": "\uFB60",
2923           "medial": "\uFB61"
2924         },
2925         "beeh": {
2926           "normal": [
2927             "\u067B"
2928           ],
2929           "isolated": "\uFB52",
2930           "final": "\uFB53",
2931           "initial": "\uFB54",
2932           "medial": "\uFB55"
2933         },
2934         "peh": {
2935           "normal": [
2936             "\u067E"
2937           ],
2938           "small_meem_above": [
2939             "\u08B7"
2940           ],
2941           "isolated": "\uFB56",
2942           "final": "\uFB57",
2943           "initial": "\uFB58",
2944           "medial": "\uFB59"
2945         },
2946         "teheh": {
2947           "normal": [
2948             "\u067F"
2949           ],
2950           "isolated": "\uFB62",
2951           "final": "\uFB63",
2952           "initial": "\uFB64",
2953           "medial": "\uFB65"
2954         },
2955         "beheh": {
2956           "normal": [
2957             "\u0680"
2958           ],
2959           "isolated": "\uFB5A",
2960           "final": "\uFB5B",
2961           "initial": "\uFB5C",
2962           "medial": "\uFB5D"
2963         },
2964         "nyeh": {
2965           "normal": [
2966             "\u0683"
2967           ],
2968           "isolated": "\uFB76",
2969           "final": "\uFB77",
2970           "initial": "\uFB78",
2971           "medial": "\uFB79"
2972         },
2973         "dyeh": {
2974           "normal": [
2975             "\u0684"
2976           ],
2977           "isolated": "\uFB72",
2978           "final": "\uFB73",
2979           "initial": "\uFB74",
2980           "medial": "\uFB75"
2981         },
2982         "tcheh": {
2983           "normal": [
2984             "\u0686"
2985           ],
2986           "dot_above": [
2987             "\u06BF"
2988           ],
2989           "isolated": "\uFB7A",
2990           "final": "\uFB7B",
2991           "initial": "\uFB7C",
2992           "medial": "\uFB7D"
2993         },
2994         "tcheheh": {
2995           "normal": [
2996             "\u0687"
2997           ],
2998           "isolated": "\uFB7E",
2999           "final": "\uFB7F",
3000           "initial": "\uFB80",
3001           "medial": "\uFB81"
3002         },
3003         "ddal": {
3004           "normal": [
3005             "\u0688"
3006           ],
3007           "isolated": "\uFB88",
3008           "final": "\uFB89"
3009         },
3010         "dahal": {
3011           "normal": [
3012             "\u068C"
3013           ],
3014           "isolated": "\uFB84",
3015           "final": "\uFB85"
3016         },
3017         "ddahal": {
3018           "normal": [
3019             "\u068D"
3020           ],
3021           "isolated": "\uFB82",
3022           "final": "\uFB83"
3023         },
3024         "dul": {
3025           "normal": [
3026             "\u068F",
3027             "\u068E"
3028           ],
3029           "isolated": "\uFB86",
3030           "final": "\uFB87"
3031         },
3032         "rreh": {
3033           "normal": [
3034             "\u0691"
3035           ],
3036           "isolated": "\uFB8C",
3037           "final": "\uFB8D"
3038         },
3039         "jeh": {
3040           "normal": [
3041             "\u0698"
3042           ],
3043           "isolated": "\uFB8A",
3044           "final": "\uFB8B"
3045         },
3046         "veh": {
3047           "normal": [
3048             "\u06A4"
3049           ],
3050           "isolated": "\uFB6A",
3051           "final": "\uFB6B",
3052           "initial": "\uFB6C",
3053           "medial": "\uFB6D"
3054         },
3055         "peheh": {
3056           "normal": [
3057             "\u06A6"
3058           ],
3059           "isolated": "\uFB6E",
3060           "final": "\uFB6F",
3061           "initial": "\uFB70",
3062           "medial": "\uFB71"
3063         },
3064         "keheh": {
3065           "normal": [
3066             "\u06A9"
3067           ],
3068           "dot_above": [
3069             "\u0762"
3070           ],
3071           "three_dots_above": [
3072             "\u0763"
3073           ],
3074           "three_dots_pointing_upwards_below": [
3075             "\u0764"
3076           ],
3077           "isolated": "\uFB8E",
3078           "final": "\uFB8F",
3079           "initial": "\uFB90",
3080           "medial": "\uFB91"
3081         },
3082         "ng": {
3083           "normal": [
3084             "\u06AD"
3085           ],
3086           "isolated": "\uFBD3",
3087           "final": "\uFBD4",
3088           "initial": "\uFBD5",
3089           "medial": "\uFBD6"
3090         },
3091         "gaf": {
3092           "normal": [
3093             "\u06AF"
3094           ],
3095           "ring": [
3096             "\u06B0"
3097           ],
3098           "two_dots_below": [
3099             "\u06B2"
3100           ],
3101           "three_dots_above": [
3102             "\u06B4"
3103           ],
3104           "inverted_stroke": [
3105             "\u08B0"
3106           ],
3107           "isolated": "\uFB92",
3108           "final": "\uFB93",
3109           "initial": "\uFB94",
3110           "medial": "\uFB95"
3111         },
3112         "ngoeh": {
3113           "normal": [
3114             "\u06B1"
3115           ],
3116           "isolated": "\uFB9A",
3117           "final": "\uFB9B",
3118           "initial": "\uFB9C",
3119           "medial": "\uFB9D"
3120         },
3121         "gueh": {
3122           "normal": [
3123             "\u06B3"
3124           ],
3125           "isolated": "\uFB96",
3126           "final": "\uFB97",
3127           "initial": "\uFB98",
3128           "medial": "\uFB99"
3129         },
3130         "noon ghunna": {
3131           "normal": [
3132             "\u06BA"
3133           ],
3134           "isolated": "\uFB9E",
3135           "final": "\uFB9F"
3136         },
3137         "rnoon": {
3138           "normal": [
3139             "\u06BB"
3140           ],
3141           "isolated": "\uFBA0",
3142           "final": "\uFBA1",
3143           "initial": "\uFBA2",
3144           "medial": "\uFBA3"
3145         },
3146         "heh doachashmee": {
3147           "normal": [
3148             "\u06BE"
3149           ],
3150           "isolated": "\uFBAA",
3151           "final": "\uFBAB",
3152           "initial": "\uFBAC",
3153           "medial": "\uFBAD"
3154         },
3155         "heh goal": {
3156           "normal": [
3157             "\u06C1"
3158           ],
3159           "hamza_above": [
3160             "\u06C1\u0654",
3161             "\u06C2"
3162           ],
3163           "isolated": "\uFBA6",
3164           "final": "\uFBA7",
3165           "initial": "\uFBA8",
3166           "medial": "\uFBA9"
3167         },
3168         "teh marbuta goal": {
3169           "normal": [
3170             "\u06C3"
3171           ]
3172         },
3173         "kirghiz oe": {
3174           "normal": [
3175             "\u06C5"
3176           ],
3177           "isolated": "\uFBE0",
3178           "final": "\uFBE1"
3179         },
3180         "oe": {
3181           "normal": [
3182             "\u06C6"
3183           ],
3184           "isolated": "\uFBD9",
3185           "final": "\uFBDA"
3186         },
3187         "u": {
3188           "normal": [
3189             "\u06C7"
3190           ],
3191           "hamza_above": {
3192             "normal": [
3193               "\u0677",
3194               "\u06C7\u0674"
3195             ],
3196             "isolated": "\uFBDD"
3197           },
3198           "isolated": "\uFBD7",
3199           "final": "\uFBD8"
3200         },
3201         "yu": {
3202           "normal": [
3203             "\u06C8"
3204           ],
3205           "isolated": "\uFBDB",
3206           "final": "\uFBDC"
3207         },
3208         "kirghiz yu": {
3209           "normal": [
3210             "\u06C9"
3211           ],
3212           "isolated": "\uFBE2",
3213           "final": "\uFBE3"
3214         },
3215         "ve": {
3216           "normal": [
3217             "\u06CB"
3218           ],
3219           "isolated": "\uFBDE",
3220           "final": "\uFBDF"
3221         },
3222         "farsi yeh": {
3223           "normal": [
3224             "\u06CC"
3225           ],
3226           "indic_two_above": [
3227             "\u0775"
3228           ],
3229           "indic_three_above": [
3230             "\u0776"
3231           ],
3232           "indic_four_above": [
3233             "\u0777"
3234           ],
3235           "isolated": "\uFBFC",
3236           "final": "\uFBFD",
3237           "initial": "\uFBFE",
3238           "medial": "\uFBFF"
3239         },
3240         "e": {
3241           "normal": [
3242             "\u06D0"
3243           ],
3244           "isolated": "\uFBE4",
3245           "final": "\uFBE5",
3246           "initial": "\uFBE6",
3247           "medial": "\uFBE7"
3248         },
3249         "yeh barree": {
3250           "normal": [
3251             "\u06D2"
3252           ],
3253           "hamza_above": {
3254             "normal": [
3255               "\u06D2\u0654",
3256               "\u06D3"
3257             ],
3258             "isolated": "\uFBB0",
3259             "final": "\uFBB1"
3260           },
3261           "indic_two_above": [
3262             "\u077A"
3263           ],
3264           "indic_three_above": [
3265             "\u077B"
3266           ],
3267           "isolated": "\uFBAE",
3268           "final": "\uFBAF"
3269         },
3270         "ae": {
3271           "normal": [
3272             "\u06D5"
3273           ],
3274           "isolated": "\u06D5",
3275           "final": "\uFEEA",
3276           "yeh_above": {
3277             "normal": [
3278               "\u06C0",
3279               "\u06D5\u0654"
3280             ],
3281             "isolated": "\uFBA4",
3282             "final": "\uFBA5"
3283           }
3284         },
3285         "rohingya yeh": {
3286           "normal": [
3287             "\u08AC"
3288           ]
3289         },
3290         "low alef": {
3291           "normal": [
3292             "\u08AD"
3293           ]
3294         },
3295         "straight waw": {
3296           "normal": [
3297             "\u08B1"
3298           ]
3299         },
3300         "african feh": {
3301           "normal": [
3302             "\u08BB"
3303           ]
3304         },
3305         "african qaf": {
3306           "normal": [
3307             "\u08BC"
3308           ]
3309         },
3310         "african noon": {
3311           "normal": [
3312             "\u08BD"
3313           ]
3314         }
3315       };
3316       exports2.default = arabicReference;
3317     }
3318   });
3319
3320   // node_modules/alif-toolkit/lib/unicode-ligatures.js
3321   var require_unicode_ligatures = __commonJS({
3322     "node_modules/alif-toolkit/lib/unicode-ligatures.js"(exports2) {
3323       "use strict";
3324       Object.defineProperty(exports2, "__esModule", { value: true });
3325       var ligatureReference = {
3326         "\u0626\u0627": {
3327           "isolated": "\uFBEA",
3328           "final": "\uFBEB"
3329         },
3330         "\u0626\u06D5": {
3331           "isolated": "\uFBEC",
3332           "final": "\uFBED"
3333         },
3334         "\u0626\u0648": {
3335           "isolated": "\uFBEE",
3336           "final": "\uFBEF"
3337         },
3338         "\u0626\u06C7": {
3339           "isolated": "\uFBF0",
3340           "final": "\uFBF1"
3341         },
3342         "\u0626\u06C6": {
3343           "isolated": "\uFBF2",
3344           "final": "\uFBF3"
3345         },
3346         "\u0626\u06C8": {
3347           "isolated": "\uFBF4",
3348           "final": "\uFBF5"
3349         },
3350         "\u0626\u06D0": {
3351           "isolated": "\uFBF6",
3352           "final": "\uFBF7",
3353           "initial": "\uFBF8"
3354         },
3355         "\u0626\u0649": {
3356           "uighur_kirghiz": {
3357             "isolated": "\uFBF9",
3358             "final": "\uFBFA",
3359             "initial": "\uFBFB"
3360           },
3361           "isolated": "\uFC03",
3362           "final": "\uFC68"
3363         },
3364         "\u0626\u062C": {
3365           "isolated": "\uFC00",
3366           "initial": "\uFC97"
3367         },
3368         "\u0626\u062D": {
3369           "isolated": "\uFC01",
3370           "initial": "\uFC98"
3371         },
3372         "\u0626\u0645": {
3373           "isolated": "\uFC02",
3374           "final": "\uFC66",
3375           "initial": "\uFC9A",
3376           "medial": "\uFCDF"
3377         },
3378         "\u0626\u064A": {
3379           "isolated": "\uFC04",
3380           "final": "\uFC69"
3381         },
3382         "\u0628\u062C": {
3383           "isolated": "\uFC05",
3384           "initial": "\uFC9C"
3385         },
3386         "\u0628\u062D": {
3387           "isolated": "\uFC06",
3388           "initial": "\uFC9D"
3389         },
3390         "\u0628\u062E": {
3391           "isolated": "\uFC07",
3392           "initial": "\uFC9E"
3393         },
3394         "\u0628\u0645": {
3395           "isolated": "\uFC08",
3396           "final": "\uFC6C",
3397           "initial": "\uFC9F",
3398           "medial": "\uFCE1"
3399         },
3400         "\u0628\u0649": {
3401           "isolated": "\uFC09",
3402           "final": "\uFC6E"
3403         },
3404         "\u0628\u064A": {
3405           "isolated": "\uFC0A",
3406           "final": "\uFC6F"
3407         },
3408         "\u062A\u062C": {
3409           "isolated": "\uFC0B",
3410           "initial": "\uFCA1"
3411         },
3412         "\u062A\u062D": {
3413           "isolated": "\uFC0C",
3414           "initial": "\uFCA2"
3415         },
3416         "\u062A\u062E": {
3417           "isolated": "\uFC0D",
3418           "initial": "\uFCA3"
3419         },
3420         "\u062A\u0645": {
3421           "isolated": "\uFC0E",
3422           "final": "\uFC72",
3423           "initial": "\uFCA4",
3424           "medial": "\uFCE3"
3425         },
3426         "\u062A\u0649": {
3427           "isolated": "\uFC0F",
3428           "final": "\uFC74"
3429         },
3430         "\u062A\u064A": {
3431           "isolated": "\uFC10",
3432           "final": "\uFC75"
3433         },
3434         "\u062B\u062C": {
3435           "isolated": "\uFC11"
3436         },
3437         "\u062B\u0645": {
3438           "isolated": "\uFC12",
3439           "final": "\uFC78",
3440           "initial": "\uFCA6",
3441           "medial": "\uFCE5"
3442         },
3443         "\u062B\u0649": {
3444           "isolated": "\uFC13",
3445           "final": "\uFC7A"
3446         },
3447         "\u062B\u0648": {
3448           "isolated": "\uFC14"
3449         },
3450         "\u062C\u062D": {
3451           "isolated": "\uFC15",
3452           "initial": "\uFCA7"
3453         },
3454         "\u062C\u0645": {
3455           "isolated": "\uFC16",
3456           "initial": "\uFCA8"
3457         },
3458         "\u062D\u062C": {
3459           "isolated": "\uFC17",
3460           "initial": "\uFCA9"
3461         },
3462         "\u062D\u0645": {
3463           "isolated": "\uFC18",
3464           "initial": "\uFCAA"
3465         },
3466         "\u062E\u062C": {
3467           "isolated": "\uFC19",
3468           "initial": "\uFCAB"
3469         },
3470         "\u062E\u062D": {
3471           "isolated": "\uFC1A"
3472         },
3473         "\u062E\u0645": {
3474           "isolated": "\uFC1B",
3475           "initial": "\uFCAC"
3476         },
3477         "\u0633\u062C": {
3478           "isolated": "\uFC1C",
3479           "initial": "\uFCAD",
3480           "medial": "\uFD34"
3481         },
3482         "\u0633\u062D": {
3483           "isolated": "\uFC1D",
3484           "initial": "\uFCAE",
3485           "medial": "\uFD35"
3486         },
3487         "\u0633\u062E": {
3488           "isolated": "\uFC1E",
3489           "initial": "\uFCAF",
3490           "medial": "\uFD36"
3491         },
3492         "\u0633\u0645": {
3493           "isolated": "\uFC1F",
3494           "initial": "\uFCB0",
3495           "medial": "\uFCE7"
3496         },
3497         "\u0635\u062D": {
3498           "isolated": "\uFC20",
3499           "initial": "\uFCB1"
3500         },
3501         "\u0635\u0645": {
3502           "isolated": "\uFC21",
3503           "initial": "\uFCB3"
3504         },
3505         "\u0636\u062C": {
3506           "isolated": "\uFC22",
3507           "initial": "\uFCB4"
3508         },
3509         "\u0636\u062D": {
3510           "isolated": "\uFC23",
3511           "initial": "\uFCB5"
3512         },
3513         "\u0636\u062E": {
3514           "isolated": "\uFC24",
3515           "initial": "\uFCB6"
3516         },
3517         "\u0636\u0645": {
3518           "isolated": "\uFC25",
3519           "initial": "\uFCB7"
3520         },
3521         "\u0637\u062D": {
3522           "isolated": "\uFC26",
3523           "initial": "\uFCB8"
3524         },
3525         "\u0637\u0645": {
3526           "isolated": "\uFC27",
3527           "initial": "\uFD33",
3528           "medial": "\uFD3A"
3529         },
3530         "\u0638\u0645": {
3531           "isolated": "\uFC28",
3532           "initial": "\uFCB9",
3533           "medial": "\uFD3B"
3534         },
3535         "\u0639\u062C": {
3536           "isolated": "\uFC29",
3537           "initial": "\uFCBA"
3538         },
3539         "\u0639\u0645": {
3540           "isolated": "\uFC2A",
3541           "initial": "\uFCBB"
3542         },
3543         "\u063A\u062C": {
3544           "isolated": "\uFC2B",
3545           "initial": "\uFCBC"
3546         },
3547         "\u063A\u0645": {
3548           "isolated": "\uFC2C",
3549           "initial": "\uFCBD"
3550         },
3551         "\u0641\u062C": {
3552           "isolated": "\uFC2D",
3553           "initial": "\uFCBE"
3554         },
3555         "\u0641\u062D": {
3556           "isolated": "\uFC2E",
3557           "initial": "\uFCBF"
3558         },
3559         "\u0641\u062E": {
3560           "isolated": "\uFC2F",
3561           "initial": "\uFCC0"
3562         },
3563         "\u0641\u0645": {
3564           "isolated": "\uFC30",
3565           "initial": "\uFCC1"
3566         },
3567         "\u0641\u0649": {
3568           "isolated": "\uFC31",
3569           "final": "\uFC7C"
3570         },
3571         "\u0641\u064A": {
3572           "isolated": "\uFC32",
3573           "final": "\uFC7D"
3574         },
3575         "\u0642\u062D": {
3576           "isolated": "\uFC33",
3577           "initial": "\uFCC2"
3578         },
3579         "\u0642\u0645": {
3580           "isolated": "\uFC34",
3581           "initial": "\uFCC3"
3582         },
3583         "\u0642\u0649": {
3584           "isolated": "\uFC35",
3585           "final": "\uFC7E"
3586         },
3587         "\u0642\u064A": {
3588           "isolated": "\uFC36",
3589           "final": "\uFC7F"
3590         },
3591         "\u0643\u0627": {
3592           "isolated": "\uFC37",
3593           "final": "\uFC80"
3594         },
3595         "\u0643\u062C": {
3596           "isolated": "\uFC38",
3597           "initial": "\uFCC4"
3598         },
3599         "\u0643\u062D": {
3600           "isolated": "\uFC39",
3601           "initial": "\uFCC5"
3602         },
3603         "\u0643\u062E": {
3604           "isolated": "\uFC3A",
3605           "initial": "\uFCC6"
3606         },
3607         "\u0643\u0644": {
3608           "isolated": "\uFC3B",
3609           "final": "\uFC81",
3610           "initial": "\uFCC7",
3611           "medial": "\uFCEB"
3612         },
3613         "\u0643\u0645": {
3614           "isolated": "\uFC3C",
3615           "final": "\uFC82",
3616           "initial": "\uFCC8",
3617           "medial": "\uFCEC"
3618         },
3619         "\u0643\u0649": {
3620           "isolated": "\uFC3D",
3621           "final": "\uFC83"
3622         },
3623         "\u0643\u064A": {
3624           "isolated": "\uFC3E",
3625           "final": "\uFC84"
3626         },
3627         "\u0644\u062C": {
3628           "isolated": "\uFC3F",
3629           "initial": "\uFCC9"
3630         },
3631         "\u0644\u062D": {
3632           "isolated": "\uFC40",
3633           "initial": "\uFCCA"
3634         },
3635         "\u0644\u062E": {
3636           "isolated": "\uFC41",
3637           "initial": "\uFCCB"
3638         },
3639         "\u0644\u0645": {
3640           "isolated": "\uFC42",
3641           "final": "\uFC85",
3642           "initial": "\uFCCC",
3643           "medial": "\uFCED"
3644         },
3645         "\u0644\u0649": {
3646           "isolated": "\uFC43",
3647           "final": "\uFC86"
3648         },
3649         "\u0644\u064A": {
3650           "isolated": "\uFC44",
3651           "final": "\uFC87"
3652         },
3653         "\u0645\u062C": {
3654           "isolated": "\uFC45",
3655           "initial": "\uFCCE"
3656         },
3657         "\u0645\u062D": {
3658           "isolated": "\uFC46",
3659           "initial": "\uFCCF"
3660         },
3661         "\u0645\u062E": {
3662           "isolated": "\uFC47",
3663           "initial": "\uFCD0"
3664         },
3665         "\u0645\u0645": {
3666           "isolated": "\uFC48",
3667           "final": "\uFC89",
3668           "initial": "\uFCD1"
3669         },
3670         "\u0645\u0649": {
3671           "isolated": "\uFC49"
3672         },
3673         "\u0645\u064A": {
3674           "isolated": "\uFC4A"
3675         },
3676         "\u0646\u062C": {
3677           "isolated": "\uFC4B",
3678           "initial": "\uFCD2"
3679         },
3680         "\u0646\u062D": {
3681           "isolated": "\uFC4C",
3682           "initial": "\uFCD3"
3683         },
3684         "\u0646\u062E": {
3685           "isolated": "\uFC4D",
3686           "initial": "\uFCD4"
3687         },
3688         "\u0646\u0645": {
3689           "isolated": "\uFC4E",
3690           "final": "\uFC8C",
3691           "initial": "\uFCD5",
3692           "medial": "\uFCEE"
3693         },
3694         "\u0646\u0649": {
3695           "isolated": "\uFC4F",
3696           "final": "\uFC8E"
3697         },
3698         "\u0646\u064A": {
3699           "isolated": "\uFC50",
3700           "final": "\uFC8F"
3701         },
3702         "\u0647\u062C": {
3703           "isolated": "\uFC51",
3704           "initial": "\uFCD7"
3705         },
3706         "\u0647\u0645": {
3707           "isolated": "\uFC52",
3708           "initial": "\uFCD8"
3709         },
3710         "\u0647\u0649": {
3711           "isolated": "\uFC53"
3712         },
3713         "\u0647\u064A": {
3714           "isolated": "\uFC54"
3715         },
3716         "\u064A\u062C": {
3717           "isolated": "\uFC55",
3718           "initial": "\uFCDA"
3719         },
3720         "\u064A\u062D": {
3721           "isolated": "\uFC56",
3722           "initial": "\uFCDB"
3723         },
3724         "\u064A\u062E": {
3725           "isolated": "\uFC57",
3726           "initial": "\uFCDC"
3727         },
3728         "\u064A\u0645": {
3729           "isolated": "\uFC58",
3730           "final": "\uFC93",
3731           "initial": "\uFCDD",
3732           "medial": "\uFCF0"
3733         },
3734         "\u064A\u0649": {
3735           "isolated": "\uFC59",
3736           "final": "\uFC95"
3737         },
3738         "\u064A\u064A": {
3739           "isolated": "\uFC5A",
3740           "final": "\uFC96"
3741         },
3742         "\u0630\u0670": {
3743           "isolated": "\uFC5B"
3744         },
3745         "\u0631\u0670": {
3746           "isolated": "\uFC5C"
3747         },
3748         "\u0649\u0670": {
3749           "isolated": "\uFC5D",
3750           "final": "\uFC90"
3751         },
3752         "\u064C\u0651": {
3753           "isolated": "\uFC5E"
3754         },
3755         "\u064D\u0651": {
3756           "isolated": "\uFC5F"
3757         },
3758         "\u064E\u0651": {
3759           "isolated": "\uFC60"
3760         },
3761         "\u064F\u0651": {
3762           "isolated": "\uFC61"
3763         },
3764         "\u0650\u0651": {
3765           "isolated": "\uFC62"
3766         },
3767         "\u0651\u0670": {
3768           "isolated": "\uFC63"
3769         },
3770         "\u0626\u0631": {
3771           "final": "\uFC64"
3772         },
3773         "\u0626\u0632": {
3774           "final": "\uFC65"
3775         },
3776         "\u0626\u0646": {
3777           "final": "\uFC67"
3778         },
3779         "\u0628\u0631": {
3780           "final": "\uFC6A"
3781         },
3782         "\u0628\u0632": {
3783           "final": "\uFC6B"
3784         },
3785         "\u0628\u0646": {
3786           "final": "\uFC6D"
3787         },
3788         "\u062A\u0631": {
3789           "final": "\uFC70"
3790         },
3791         "\u062A\u0632": {
3792           "final": "\uFC71"
3793         },
3794         "\u062A\u0646": {
3795           "final": "\uFC73"
3796         },
3797         "\u062B\u0631": {
3798           "final": "\uFC76"
3799         },
3800         "\u062B\u0632": {
3801           "final": "\uFC77"
3802         },
3803         "\u062B\u0646": {
3804           "final": "\uFC79"
3805         },
3806         "\u062B\u064A": {
3807           "final": "\uFC7B"
3808         },
3809         "\u0645\u0627": {
3810           "final": "\uFC88"
3811         },
3812         "\u0646\u0631": {
3813           "final": "\uFC8A"
3814         },
3815         "\u0646\u0632": {
3816           "final": "\uFC8B"
3817         },
3818         "\u0646\u0646": {
3819           "final": "\uFC8D"
3820         },
3821         "\u064A\u0631": {
3822           "final": "\uFC91"
3823         },
3824         "\u064A\u0632": {
3825           "final": "\uFC92"
3826         },
3827         "\u064A\u0646": {
3828           "final": "\uFC94"
3829         },
3830         "\u0626\u062E": {
3831           "initial": "\uFC99"
3832         },
3833         "\u0626\u0647": {
3834           "initial": "\uFC9B",
3835           "medial": "\uFCE0"
3836         },
3837         "\u0628\u0647": {
3838           "initial": "\uFCA0",
3839           "medial": "\uFCE2"
3840         },
3841         "\u062A\u0647": {
3842           "initial": "\uFCA5",
3843           "medial": "\uFCE4"
3844         },
3845         "\u0635\u062E": {
3846           "initial": "\uFCB2"
3847         },
3848         "\u0644\u0647": {
3849           "initial": "\uFCCD"
3850         },
3851         "\u0646\u0647": {
3852           "initial": "\uFCD6",
3853           "medial": "\uFCEF"
3854         },
3855         "\u0647\u0670": {
3856           "initial": "\uFCD9"
3857         },
3858         "\u064A\u0647": {
3859           "initial": "\uFCDE",
3860           "medial": "\uFCF1"
3861         },
3862         "\u062B\u0647": {
3863           "medial": "\uFCE6"
3864         },
3865         "\u0633\u0647": {
3866           "medial": "\uFCE8",
3867           "initial": "\uFD31"
3868         },
3869         "\u0634\u0645": {
3870           "medial": "\uFCE9",
3871           "isolated": "\uFD0C",
3872           "final": "\uFD28",
3873           "initial": "\uFD30"
3874         },
3875         "\u0634\u0647": {
3876           "medial": "\uFCEA",
3877           "initial": "\uFD32"
3878         },
3879         "\u0640\u064E\u0651": {
3880           "medial": "\uFCF2"
3881         },
3882         "\u0640\u064F\u0651": {
3883           "medial": "\uFCF3"
3884         },
3885         "\u0640\u0650\u0651": {
3886           "medial": "\uFCF4"
3887         },
3888         "\u0637\u0649": {
3889           "isolated": "\uFCF5",
3890           "final": "\uFD11"
3891         },
3892         "\u0637\u064A": {
3893           "isolated": "\uFCF6",
3894           "final": "\uFD12"
3895         },
3896         "\u0639\u0649": {
3897           "isolated": "\uFCF7",
3898           "final": "\uFD13"
3899         },
3900         "\u0639\u064A": {
3901           "isolated": "\uFCF8",
3902           "final": "\uFD14"
3903         },
3904         "\u063A\u0649": {
3905           "isolated": "\uFCF9",
3906           "final": "\uFD15"
3907         },
3908         "\u063A\u064A": {
3909           "isolated": "\uFCFA",
3910           "final": "\uFD16"
3911         },
3912         "\u0633\u0649": {
3913           "isolated": "\uFCFB"
3914         },
3915         "\u0633\u064A": {
3916           "isolated": "\uFCFC",
3917           "final": "\uFD18"
3918         },
3919         "\u0634\u0649": {
3920           "isolated": "\uFCFD",
3921           "final": "\uFD19"
3922         },
3923         "\u0634\u064A": {
3924           "isolated": "\uFCFE",
3925           "final": "\uFD1A"
3926         },
3927         "\u062D\u0649": {
3928           "isolated": "\uFCFF",
3929           "final": "\uFD1B"
3930         },
3931         "\u062D\u064A": {
3932           "isolated": "\uFD00",
3933           "final": "\uFD1C"
3934         },
3935         "\u062C\u0649": {
3936           "isolated": "\uFD01",
3937           "final": "\uFD1D"
3938         },
3939         "\u062C\u064A": {
3940           "isolated": "\uFD02",
3941           "final": "\uFD1E"
3942         },
3943         "\u062E\u0649": {
3944           "isolated": "\uFD03",
3945           "final": "\uFD1F"
3946         },
3947         "\u062E\u064A": {
3948           "isolated": "\uFD04",
3949           "final": "\uFD20"
3950         },
3951         "\u0635\u0649": {
3952           "isolated": "\uFD05",
3953           "final": "\uFD21"
3954         },
3955         "\u0635\u064A": {
3956           "isolated": "\uFD06",
3957           "final": "\uFD22"
3958         },
3959         "\u0636\u0649": {
3960           "isolated": "\uFD07",
3961           "final": "\uFD23"
3962         },
3963         "\u0636\u064A": {
3964           "isolated": "\uFD08",
3965           "final": "\uFD24"
3966         },
3967         "\u0634\u062C": {
3968           "isolated": "\uFD09",
3969           "final": "\uFD25",
3970           "initial": "\uFD2D",
3971           "medial": "\uFD37"
3972         },
3973         "\u0634\u062D": {
3974           "isolated": "\uFD0A",
3975           "final": "\uFD26",
3976           "initial": "\uFD2E",
3977           "medial": "\uFD38"
3978         },
3979         "\u0634\u062E": {
3980           "isolated": "\uFD0B",
3981           "final": "\uFD27",
3982           "initial": "\uFD2F",
3983           "medial": "\uFD39"
3984         },
3985         "\u0634\u0631": {
3986           "isolated": "\uFD0D",
3987           "final": "\uFD29"
3988         },
3989         "\u0633\u0631": {
3990           "isolated": "\uFD0E",
3991           "final": "\uFD2A"
3992         },
3993         "\u0635\u0631": {
3994           "isolated": "\uFD0F",
3995           "final": "\uFD2B"
3996         },
3997         "\u0636\u0631": {
3998           "isolated": "\uFD10",
3999           "final": "\uFD2C"
4000         },
4001         "\u0633\u0639": {
4002           "final": "\uFD17"
4003         },
4004         "\u062A\u062C\u0645": {
4005           "initial": "\uFD50"
4006         },
4007         "\u062A\u062D\u062C": {
4008           "final": "\uFD51",
4009           "initial": "\uFD52"
4010         },
4011         "\u062A\u062D\u0645": {
4012           "initial": "\uFD53"
4013         },
4014         "\u062A\u062E\u0645": {
4015           "initial": "\uFD54"
4016         },
4017         "\u062A\u0645\u062C": {
4018           "initial": "\uFD55"
4019         },
4020         "\u062A\u0645\u062D": {
4021           "initial": "\uFD56"
4022         },
4023         "\u062A\u0645\u062E": {
4024           "initial": "\uFD57"
4025         },
4026         "\u062C\u0645\u062D": {
4027           "final": "\uFD58",
4028           "initial": "\uFD59"
4029         },
4030         "\u062D\u0645\u064A": {
4031           "final": "\uFD5A"
4032         },
4033         "\u062D\u0645\u0649": {
4034           "final": "\uFD5B"
4035         },
4036         "\u0633\u062D\u062C": {
4037           "initial": "\uFD5C"
4038         },
4039         "\u0633\u062C\u062D": {
4040           "initial": "\uFD5D"
4041         },
4042         "\u0633\u062C\u0649": {
4043           "final": "\uFD5E"
4044         },
4045         "\u0633\u0645\u062D": {
4046           "final": "\uFD5F",
4047           "initial": "\uFD60"
4048         },
4049         "\u0633\u0645\u062C": {
4050           "initial": "\uFD61"
4051         },
4052         "\u0633\u0645\u0645": {
4053           "final": "\uFD62",
4054           "initial": "\uFD63"
4055         },
4056         "\u0635\u062D\u062D": {
4057           "final": "\uFD64",
4058           "initial": "\uFD65"
4059         },
4060         "\u0635\u0645\u0645": {
4061           "final": "\uFD66",
4062           "initial": "\uFDC5"
4063         },
4064         "\u0634\u062D\u0645": {
4065           "final": "\uFD67",
4066           "initial": "\uFD68"
4067         },
4068         "\u0634\u062C\u064A": {
4069           "final": "\uFD69"
4070         },
4071         "\u0634\u0645\u062E": {
4072           "final": "\uFD6A",
4073           "initial": "\uFD6B"
4074         },
4075         "\u0634\u0645\u0645": {
4076           "final": "\uFD6C",
4077           "initial": "\uFD6D"
4078         },
4079         "\u0636\u062D\u0649": {
4080           "final": "\uFD6E"
4081         },
4082         "\u0636\u062E\u0645": {
4083           "final": "\uFD6F",
4084           "initial": "\uFD70"
4085         },
4086         "\u0636\u0645\u062D": {
4087           "final": "\uFD71"
4088         },
4089         "\u0637\u0645\u062D": {
4090           "initial": "\uFD72"
4091         },
4092         "\u0637\u0645\u0645": {
4093           "initial": "\uFD73"
4094         },
4095         "\u0637\u0645\u064A": {
4096           "final": "\uFD74"
4097         },
4098         "\u0639\u062C\u0645": {
4099           "final": "\uFD75",
4100           "initial": "\uFDC4"
4101         },
4102         "\u0639\u0645\u0645": {
4103           "final": "\uFD76",
4104           "initial": "\uFD77"
4105         },
4106         "\u0639\u0645\u0649": {
4107           "final": "\uFD78"
4108         },
4109         "\u063A\u0645\u0645": {
4110           "final": "\uFD79"
4111         },
4112         "\u063A\u0645\u064A": {
4113           "final": "\uFD7A"
4114         },
4115         "\u063A\u0645\u0649": {
4116           "final": "\uFD7B"
4117         },
4118         "\u0641\u062E\u0645": {
4119           "final": "\uFD7C",
4120           "initial": "\uFD7D"
4121         },
4122         "\u0642\u0645\u062D": {
4123           "final": "\uFD7E",
4124           "initial": "\uFDB4"
4125         },
4126         "\u0642\u0645\u0645": {
4127           "final": "\uFD7F"
4128         },
4129         "\u0644\u062D\u0645": {
4130           "final": "\uFD80",
4131           "initial": "\uFDB5"
4132         },
4133         "\u0644\u062D\u064A": {
4134           "final": "\uFD81"
4135         },
4136         "\u0644\u062D\u0649": {
4137           "final": "\uFD82"
4138         },
4139         "\u0644\u062C\u062C": {
4140           "initial": "\uFD83",
4141           "final": "\uFD84"
4142         },
4143         "\u0644\u062E\u0645": {
4144           "final": "\uFD85",
4145           "initial": "\uFD86"
4146         },
4147         "\u0644\u0645\u062D": {
4148           "final": "\uFD87",
4149           "initial": "\uFD88"
4150         },
4151         "\u0645\u062D\u062C": {
4152           "initial": "\uFD89"
4153         },
4154         "\u0645\u062D\u0645": {
4155           "initial": "\uFD8A"
4156         },
4157         "\u0645\u062D\u064A": {
4158           "final": "\uFD8B"
4159         },
4160         "\u0645\u062C\u062D": {
4161           "initial": "\uFD8C"
4162         },
4163         "\u0645\u062C\u0645": {
4164           "initial": "\uFD8D"
4165         },
4166         "\u0645\u062E\u062C": {
4167           "initial": "\uFD8E"
4168         },
4169         "\u0645\u062E\u0645": {
4170           "initial": "\uFD8F"
4171         },
4172         "\u0645\u062C\u062E": {
4173           "initial": "\uFD92"
4174         },
4175         "\u0647\u0645\u062C": {
4176           "initial": "\uFD93"
4177         },
4178         "\u0647\u0645\u0645": {
4179           "initial": "\uFD94"
4180         },
4181         "\u0646\u062D\u0645": {
4182           "initial": "\uFD95"
4183         },
4184         "\u0646\u062D\u0649": {
4185           "final": "\uFD96"
4186         },
4187         "\u0646\u062C\u0645": {
4188           "final": "\uFD97",
4189           "initial": "\uFD98"
4190         },
4191         "\u0646\u062C\u0649": {
4192           "final": "\uFD99"
4193         },
4194         "\u0646\u0645\u064A": {
4195           "final": "\uFD9A"
4196         },
4197         "\u0646\u0645\u0649": {
4198           "final": "\uFD9B"
4199         },
4200         "\u064A\u0645\u0645": {
4201           "final": "\uFD9C",
4202           "initial": "\uFD9D"
4203         },
4204         "\u0628\u062E\u064A": {
4205           "final": "\uFD9E"
4206         },
4207         "\u062A\u062C\u064A": {
4208           "final": "\uFD9F"
4209         },
4210         "\u062A\u062C\u0649": {
4211           "final": "\uFDA0"
4212         },
4213         "\u062A\u062E\u064A": {
4214           "final": "\uFDA1"
4215         },
4216         "\u062A\u062E\u0649": {
4217           "final": "\uFDA2"
4218         },
4219         "\u062A\u0645\u064A": {
4220           "final": "\uFDA3"
4221         },
4222         "\u062A\u0645\u0649": {
4223           "final": "\uFDA4"
4224         },
4225         "\u062C\u0645\u064A": {
4226           "final": "\uFDA5"
4227         },
4228         "\u062C\u062D\u0649": {
4229           "final": "\uFDA6"
4230         },
4231         "\u062C\u0645\u0649": {
4232           "final": "\uFDA7"
4233         },
4234         "\u0633\u062E\u0649": {
4235           "final": "\uFDA8"
4236         },
4237         "\u0635\u062D\u064A": {
4238           "final": "\uFDA9"
4239         },
4240         "\u0634\u062D\u064A": {
4241           "final": "\uFDAA"
4242         },
4243         "\u0636\u062D\u064A": {
4244           "final": "\uFDAB"
4245         },
4246         "\u0644\u062C\u064A": {
4247           "final": "\uFDAC"
4248         },
4249         "\u0644\u0645\u064A": {
4250           "final": "\uFDAD"
4251         },
4252         "\u064A\u062D\u064A": {
4253           "final": "\uFDAE"
4254         },
4255         "\u064A\u062C\u064A": {
4256           "final": "\uFDAF"
4257         },
4258         "\u064A\u0645\u064A": {
4259           "final": "\uFDB0"
4260         },
4261         "\u0645\u0645\u064A": {
4262           "final": "\uFDB1"
4263         },
4264         "\u0642\u0645\u064A": {
4265           "final": "\uFDB2"
4266         },
4267         "\u0646\u062D\u064A": {
4268           "final": "\uFDB3"
4269         },
4270         "\u0639\u0645\u064A": {
4271           "final": "\uFDB6"
4272         },
4273         "\u0643\u0645\u064A": {
4274           "final": "\uFDB7"
4275         },
4276         "\u0646\u062C\u062D": {
4277           "initial": "\uFDB8",
4278           "final": "\uFDBD"
4279         },
4280         "\u0645\u062E\u064A": {
4281           "final": "\uFDB9"
4282         },
4283         "\u0644\u062C\u0645": {
4284           "initial": "\uFDBA",
4285           "final": "\uFDBC"
4286         },
4287         "\u0643\u0645\u0645": {
4288           "final": "\uFDBB",
4289           "initial": "\uFDC3"
4290         },
4291         "\u062C\u062D\u064A": {
4292           "final": "\uFDBE"
4293         },
4294         "\u062D\u062C\u064A": {
4295           "final": "\uFDBF"
4296         },
4297         "\u0645\u062C\u064A": {
4298           "final": "\uFDC0"
4299         },
4300         "\u0641\u0645\u064A": {
4301           "final": "\uFDC1"
4302         },
4303         "\u0628\u062D\u064A": {
4304           "final": "\uFDC2"
4305         },
4306         "\u0633\u062E\u064A": {
4307           "final": "\uFDC6"
4308         },
4309         "\u0646\u062C\u064A": {
4310           "final": "\uFDC7"
4311         },
4312         "\u0644\u0622": {
4313           "isolated": "\uFEF5",
4314           "final": "\uFEF6"
4315         },
4316         "\u0644\u0623": {
4317           "isolated": "\uFEF7",
4318           "final": "\uFEF8"
4319         },
4320         "\u0644\u0625": {
4321           "isolated": "\uFEF9",
4322           "final": "\uFEFA"
4323         },
4324         "\u0644\u0627": {
4325           "isolated": "\uFEFB",
4326           "final": "\uFEFC"
4327         },
4328         "words": {
4329           "\u0635\u0644\u06D2": "\uFDF0",
4330           "\u0642\u0644\u06D2": "\uFDF1",
4331           "\u0627\u0644\u0644\u0647": "\uFDF2",
4332           "\u0627\u0643\u0628\u0631": "\uFDF3",
4333           "\u0645\u062D\u0645\u062F": "\uFDF4",
4334           "\u0635\u0644\u0639\u0645": "\uFDF5",
4335           "\u0631\u0633\u0648\u0644": "\uFDF6",
4336           "\u0639\u0644\u064A\u0647": "\uFDF7",
4337           "\u0648\u0633\u0644\u0645": "\uFDF8",
4338           "\u0635\u0644\u0649": "\uFDF9",
4339           "\u0635\u0644\u0649\u0627\u0644\u0644\u0647\u0639\u0644\u064A\u0647\u0648\u0633\u0644\u0645": "\uFDFA",
4340           "\u062C\u0644\u062C\u0644\u0627\u0644\u0647": "\uFDFB",
4341           "\u0631\u06CC\u0627\u0644": "\uFDFC"
4342         }
4343       };
4344       exports2.default = ligatureReference;
4345     }
4346   });
4347
4348   // node_modules/alif-toolkit/lib/reference.js
4349   var require_reference = __commonJS({
4350     "node_modules/alif-toolkit/lib/reference.js"(exports2) {
4351       "use strict";
4352       Object.defineProperty(exports2, "__esModule", { value: true });
4353       exports2.ligatureWordList = exports2.ligatureList = exports2.letterList = exports2.alefs = exports2.lams = exports2.lineBreakers = exports2.tashkeel = void 0;
4354       var unicode_arabic_1 = require_unicode_arabic();
4355       var unicode_ligatures_1 = require_unicode_ligatures();
4356       var letterList = Object.keys(unicode_arabic_1.default);
4357       exports2.letterList = letterList;
4358       var ligatureList = Object.keys(unicode_ligatures_1.default);
4359       exports2.ligatureList = ligatureList;
4360       var ligatureWordList = Object.keys(unicode_ligatures_1.default.words);
4361       exports2.ligatureWordList = ligatureWordList;
4362       var lams = "\u0644\u06B5\u06B6\u06B7\u06B8";
4363       exports2.lams = lams;
4364       var alefs = "\u0627\u0622\u0623\u0625\u0671\u0672\u0673\u0675\u0773\u0774";
4365       exports2.alefs = alefs;
4366       var tashkeel = "\u0605\u0640\u0670\u0674\u06DF\u06E7\u06E8";
4367       exports2.tashkeel = tashkeel;
4368       function addToTashkeel(start2, finish) {
4369         for (var i3 = start2; i3 <= finish; i3++) {
4370           exports2.tashkeel = tashkeel += String.fromCharCode(i3);
4371         }
4372       }
4373       addToTashkeel(1552, 1562);
4374       addToTashkeel(1611, 1631);
4375       addToTashkeel(1750, 1756);
4376       addToTashkeel(1760, 1764);
4377       addToTashkeel(1770, 1773);
4378       addToTashkeel(2259, 2273);
4379       addToTashkeel(2275, 2303);
4380       addToTashkeel(65136, 65151);
4381       var lineBreakers = "\u0627\u0629\u0648\u06C0\u06CF\u06FD\u06FE\u076B\u076C\u0771\u0773\u0774\u0778\u0779\u08E2\u08B1\u08B2\u08B9";
4382       exports2.lineBreakers = lineBreakers;
4383       function addToLineBreakers(start2, finish) {
4384         for (var i3 = start2; i3 <= finish; i3++) {
4385           exports2.lineBreakers = lineBreakers += String.fromCharCode(i3);
4386         }
4387       }
4388       addToLineBreakers(1536, 1567);
4389       addToLineBreakers(1569, 1573);
4390       addToLineBreakers(1583, 1586);
4391       addToLineBreakers(1632, 1645);
4392       addToLineBreakers(1649, 1655);
4393       addToLineBreakers(1672, 1689);
4394       addToLineBreakers(1731, 1739);
4395       addToLineBreakers(1746, 1785);
4396       addToLineBreakers(1881, 1883);
4397       addToLineBreakers(2218, 2222);
4398       addToLineBreakers(64336, 65021);
4399       addToLineBreakers(65152, 65276);
4400       addToLineBreakers(69216, 69247);
4401       addToLineBreakers(126064, 126143);
4402       addToLineBreakers(126464, 126719);
4403     }
4404   });
4405
4406   // node_modules/alif-toolkit/lib/GlyphSplitter.js
4407   var require_GlyphSplitter = __commonJS({
4408     "node_modules/alif-toolkit/lib/GlyphSplitter.js"(exports2) {
4409       "use strict";
4410       Object.defineProperty(exports2, "__esModule", { value: true });
4411       exports2.GlyphSplitter = GlyphSplitter;
4412       var isArabic_1 = require_isArabic();
4413       var reference_1 = require_reference();
4414       function GlyphSplitter(word) {
4415         let letters = [];
4416         let lastLetter = "";
4417         word.split("").forEach((letter) => {
4418           if ((0, isArabic_1.isArabic)(letter)) {
4419             if (reference_1.tashkeel.indexOf(letter) > -1) {
4420               letters[letters.length - 1] += letter;
4421             } 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)) {
4422               letters[letters.length - 1] += letter;
4423             } else {
4424               letters.push(letter);
4425             }
4426           } else {
4427             letters.push(letter);
4428           }
4429           if (reference_1.tashkeel.indexOf(letter) === -1) {
4430             lastLetter = letter;
4431           }
4432         });
4433         return letters;
4434       }
4435     }
4436   });
4437
4438   // node_modules/alif-toolkit/lib/BaselineSplitter.js
4439   var require_BaselineSplitter = __commonJS({
4440     "node_modules/alif-toolkit/lib/BaselineSplitter.js"(exports2) {
4441       "use strict";
4442       Object.defineProperty(exports2, "__esModule", { value: true });
4443       exports2.BaselineSplitter = BaselineSplitter;
4444       var isArabic_1 = require_isArabic();
4445       var reference_1 = require_reference();
4446       function BaselineSplitter(word) {
4447         let letters = [];
4448         let lastLetter = "";
4449         word.split("").forEach((letter) => {
4450           if ((0, isArabic_1.isArabic)(letter) && (0, isArabic_1.isArabic)(lastLetter)) {
4451             if (lastLetter.length && reference_1.tashkeel.indexOf(letter) > -1) {
4452               letters[letters.length - 1] += letter;
4453             } else if (reference_1.lineBreakers.indexOf(lastLetter) > -1) {
4454               letters.push(letter);
4455             } else {
4456               letters[letters.length - 1] += letter;
4457             }
4458           } else {
4459             letters.push(letter);
4460           }
4461           if (reference_1.tashkeel.indexOf(letter) === -1) {
4462             lastLetter = letter;
4463           }
4464         });
4465         return letters;
4466       }
4467     }
4468   });
4469
4470   // node_modules/alif-toolkit/lib/Normalization.js
4471   var require_Normalization = __commonJS({
4472     "node_modules/alif-toolkit/lib/Normalization.js"(exports2) {
4473       "use strict";
4474       Object.defineProperty(exports2, "__esModule", { value: true });
4475       exports2.Normal = Normal;
4476       var unicode_arabic_1 = require_unicode_arabic();
4477       var unicode_ligatures_1 = require_unicode_ligatures();
4478       var isArabic_1 = require_isArabic();
4479       var reference_1 = require_reference();
4480       function Normal(word, breakPresentationForm) {
4481         if (typeof breakPresentationForm === "undefined") {
4482           breakPresentationForm = true;
4483         }
4484         let returnable = "";
4485         word.split("").forEach((letter) => {
4486           if (!(0, isArabic_1.isArabic)(letter)) {
4487             returnable += letter;
4488             return;
4489           }
4490           for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
4491             let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
4492             let versions = Object.keys(letterForms);
4493             for (let v3 = 0; v3 < versions.length; v3++) {
4494               let localVersion = letterForms[versions[v3]];
4495               if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
4496                 let embeddedForms = Object.keys(localVersion);
4497                 for (let ef = 0; ef < embeddedForms.length; ef++) {
4498                   let form = localVersion[embeddedForms[ef]];
4499                   if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
4500                     if (form === letter) {
4501                       if (breakPresentationForm && localVersion["normal"] && ["isolated", "initial", "medial", "final"].indexOf(embeddedForms[ef]) > -1) {
4502                         if (typeof localVersion["normal"] === "object") {
4503                           returnable += localVersion["normal"][0];
4504                         } else {
4505                           returnable += localVersion["normal"];
4506                         }
4507                         return;
4508                       }
4509                       returnable += letter;
4510                       return;
4511                     } else if (typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
4512                       returnable += form[0];
4513                       return;
4514                     }
4515                   }
4516                 }
4517               } else if (localVersion === letter) {
4518                 if (breakPresentationForm && letterForms["normal"] && ["isolated", "initial", "medial", "final"].indexOf(versions[v3]) > -1) {
4519                   if (typeof letterForms["normal"] === "object") {
4520                     returnable += letterForms["normal"][0];
4521                   } else {
4522                     returnable += letterForms["normal"];
4523                   }
4524                   return;
4525                 }
4526                 returnable += letter;
4527                 return;
4528               } else if (typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
4529                 returnable += localVersion[0];
4530                 return;
4531               }
4532             }
4533           }
4534           for (let v22 = 0; v22 < reference_1.ligatureList.length; v22++) {
4535             let normalForm = reference_1.ligatureList[v22];
4536             if (normalForm !== "words") {
4537               let ligForms = Object.keys(unicode_ligatures_1.default[normalForm]);
4538               for (let f2 = 0; f2 < ligForms.length; f2++) {
4539                 if (unicode_ligatures_1.default[normalForm][ligForms[f2]] === letter) {
4540                   returnable += normalForm;
4541                   return;
4542                 }
4543               }
4544             }
4545           }
4546           for (let v3 = 0; v3 < reference_1.ligatureWordList.length; v3++) {
4547             let normalForm = reference_1.ligatureWordList[v3];
4548             if (unicode_ligatures_1.default.words[normalForm] === letter) {
4549               returnable += normalForm;
4550               return;
4551             }
4552           }
4553           returnable += letter;
4554         });
4555         return returnable;
4556       }
4557     }
4558   });
4559
4560   // node_modules/alif-toolkit/lib/CharShaper.js
4561   var require_CharShaper = __commonJS({
4562     "node_modules/alif-toolkit/lib/CharShaper.js"(exports2) {
4563       "use strict";
4564       Object.defineProperty(exports2, "__esModule", { value: true });
4565       exports2.CharShaper = CharShaper;
4566       var unicode_arabic_1 = require_unicode_arabic();
4567       var isArabic_1 = require_isArabic();
4568       var reference_1 = require_reference();
4569       function CharShaper(letter, form) {
4570         if (!(0, isArabic_1.isArabic)(letter)) {
4571           throw new Error("Not Arabic");
4572         }
4573         if (letter === "\u0621") {
4574           return "\u0621";
4575         }
4576         for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
4577           let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
4578           let versions = Object.keys(letterForms);
4579           for (let v3 = 0; v3 < versions.length; v3++) {
4580             let localVersion = letterForms[versions[v3]];
4581             if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
4582               if (versions.indexOf(form) > -1) {
4583                 return letterForms[form];
4584               }
4585             } else if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
4586               let embeddedVersions = Object.keys(localVersion);
4587               for (let ev = 0; ev < embeddedVersions.length; ev++) {
4588                 if (localVersion[embeddedVersions[ev]] === letter || typeof localVersion[embeddedVersions[ev]] === "object" && localVersion[embeddedVersions[ev]].indexOf && localVersion[embeddedVersions[ev]].indexOf(letter) > -1) {
4589                   if (embeddedVersions.indexOf(form) > -1) {
4590                     return localVersion[form];
4591                   }
4592                 }
4593               }
4594             }
4595           }
4596         }
4597       }
4598     }
4599   });
4600
4601   // node_modules/alif-toolkit/lib/WordShaper.js
4602   var require_WordShaper = __commonJS({
4603     "node_modules/alif-toolkit/lib/WordShaper.js"(exports2) {
4604       "use strict";
4605       Object.defineProperty(exports2, "__esModule", { value: true });
4606       exports2.WordShaper = WordShaper2;
4607       var isArabic_1 = require_isArabic();
4608       var reference_1 = require_reference();
4609       var CharShaper_1 = require_CharShaper();
4610       var unicode_ligatures_1 = require_unicode_ligatures();
4611       function WordShaper2(word) {
4612         let state = "initial";
4613         let output = "";
4614         for (let w3 = 0; w3 < word.length; w3++) {
4615           let nextLetter = " ";
4616           for (let nxw = w3 + 1; nxw < word.length; nxw++) {
4617             if (!(0, isArabic_1.isArabic)(word[nxw])) {
4618               break;
4619             }
4620             if (reference_1.tashkeel.indexOf(word[nxw]) === -1) {
4621               nextLetter = word[nxw];
4622               break;
4623             }
4624           }
4625           if (!(0, isArabic_1.isArabic)(word[w3]) || (0, isArabic_1.isMath)(word[w3])) {
4626             output += word[w3];
4627             state = "initial";
4628           } else if (reference_1.tashkeel.indexOf(word[w3]) > -1) {
4629             output += word[w3];
4630           } else if (nextLetter === " " || reference_1.lineBreakers.indexOf(word[w3]) > -1) {
4631             output += (0, CharShaper_1.CharShaper)(word[w3], state === "initial" ? "isolated" : "final");
4632             state = "initial";
4633           } else if (reference_1.lams.indexOf(word[w3]) > -1 && reference_1.alefs.indexOf(nextLetter) > -1) {
4634             output += unicode_ligatures_1.default[word[w3] + nextLetter][state === "initial" ? "isolated" : "final"];
4635             while (word[w3] !== nextLetter) {
4636               w3++;
4637             }
4638             state = "initial";
4639           } else {
4640             output += (0, CharShaper_1.CharShaper)(word[w3], state);
4641             state = "medial";
4642           }
4643         }
4644         return output;
4645       }
4646     }
4647   });
4648
4649   // node_modules/alif-toolkit/lib/ParentLetter.js
4650   var require_ParentLetter = __commonJS({
4651     "node_modules/alif-toolkit/lib/ParentLetter.js"(exports2) {
4652       "use strict";
4653       Object.defineProperty(exports2, "__esModule", { value: true });
4654       exports2.ParentLetter = ParentLetter;
4655       exports2.GrandparentLetter = GrandparentLetter;
4656       var unicode_arabic_1 = require_unicode_arabic();
4657       var isArabic_1 = require_isArabic();
4658       var reference_1 = require_reference();
4659       function ParentLetter(letter) {
4660         if (!(0, isArabic_1.isArabic)(letter)) {
4661           throw new Error("Not an Arabic letter");
4662         }
4663         for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
4664           let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
4665           let versions = Object.keys(letterForms);
4666           for (let v3 = 0; v3 < versions.length; v3++) {
4667             let localVersion = letterForms[versions[v3]];
4668             if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
4669               let embeddedForms = Object.keys(localVersion);
4670               for (let ef = 0; ef < embeddedForms.length; ef++) {
4671                 let form = localVersion[embeddedForms[ef]];
4672                 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
4673                   return localVersion;
4674                 }
4675               }
4676             } else if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
4677               return letterForms;
4678             }
4679           }
4680           return null;
4681         }
4682       }
4683       function GrandparentLetter(letter) {
4684         if (!(0, isArabic_1.isArabic)(letter)) {
4685           throw new Error("Not an Arabic letter");
4686         }
4687         for (let w3 = 0; w3 < reference_1.letterList.length; w3++) {
4688           let letterForms = unicode_arabic_1.default[reference_1.letterList[w3]];
4689           let versions = Object.keys(letterForms);
4690           for (let v3 = 0; v3 < versions.length; v3++) {
4691             let localVersion = letterForms[versions[v3]];
4692             if (typeof localVersion === "object" && typeof localVersion.indexOf === "undefined") {
4693               let embeddedForms = Object.keys(localVersion);
4694               for (let ef = 0; ef < embeddedForms.length; ef++) {
4695                 let form = localVersion[embeddedForms[ef]];
4696                 if (form === letter || typeof form === "object" && form.indexOf && form.indexOf(letter) > -1) {
4697                   return letterForms;
4698                 }
4699               }
4700             } else if (localVersion === letter || typeof localVersion === "object" && localVersion.indexOf && localVersion.indexOf(letter) > -1) {
4701               return letterForms;
4702             }
4703           }
4704           return null;
4705         }
4706       }
4707     }
4708   });
4709
4710   // node_modules/alif-toolkit/lib/index.js
4711   var require_lib = __commonJS({
4712     "node_modules/alif-toolkit/lib/index.js"(exports2) {
4713       "use strict";
4714       Object.defineProperty(exports2, "__esModule", { value: true });
4715       exports2.GrandparentLetter = exports2.ParentLetter = exports2.WordShaper = exports2.CharShaper = exports2.Normal = exports2.BaselineSplitter = exports2.GlyphSplitter = exports2.isArabic = void 0;
4716       var isArabic_1 = require_isArabic();
4717       Object.defineProperty(exports2, "isArabic", { enumerable: true, get: function() {
4718         return isArabic_1.isArabic;
4719       } });
4720       var GlyphSplitter_1 = require_GlyphSplitter();
4721       Object.defineProperty(exports2, "GlyphSplitter", { enumerable: true, get: function() {
4722         return GlyphSplitter_1.GlyphSplitter;
4723       } });
4724       var BaselineSplitter_1 = require_BaselineSplitter();
4725       Object.defineProperty(exports2, "BaselineSplitter", { enumerable: true, get: function() {
4726         return BaselineSplitter_1.BaselineSplitter;
4727       } });
4728       var Normalization_1 = require_Normalization();
4729       Object.defineProperty(exports2, "Normal", { enumerable: true, get: function() {
4730         return Normalization_1.Normal;
4731       } });
4732       var CharShaper_1 = require_CharShaper();
4733       Object.defineProperty(exports2, "CharShaper", { enumerable: true, get: function() {
4734         return CharShaper_1.CharShaper;
4735       } });
4736       var WordShaper_1 = require_WordShaper();
4737       Object.defineProperty(exports2, "WordShaper", { enumerable: true, get: function() {
4738         return WordShaper_1.WordShaper;
4739       } });
4740       var ParentLetter_1 = require_ParentLetter();
4741       Object.defineProperty(exports2, "ParentLetter", { enumerable: true, get: function() {
4742         return ParentLetter_1.ParentLetter;
4743       } });
4744       Object.defineProperty(exports2, "GrandparentLetter", { enumerable: true, get: function() {
4745         return ParentLetter_1.GrandparentLetter;
4746       } });
4747     }
4748   });
4749
4750   // node_modules/fast-deep-equal/index.js
4751   var require_fast_deep_equal = __commonJS({
4752     "node_modules/fast-deep-equal/index.js"(exports2, module2) {
4753       "use strict";
4754       module2.exports = function equal(a2, b3) {
4755         if (a2 === b3) return true;
4756         if (a2 && b3 && typeof a2 == "object" && typeof b3 == "object") {
4757           if (a2.constructor !== b3.constructor) return false;
4758           var length2, i3, keys2;
4759           if (Array.isArray(a2)) {
4760             length2 = a2.length;
4761             if (length2 != b3.length) return false;
4762             for (i3 = length2; i3-- !== 0; )
4763               if (!equal(a2[i3], b3[i3])) return false;
4764             return true;
4765           }
4766           if (a2.constructor === RegExp) return a2.source === b3.source && a2.flags === b3.flags;
4767           if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b3.valueOf();
4768           if (a2.toString !== Object.prototype.toString) return a2.toString() === b3.toString();
4769           keys2 = Object.keys(a2);
4770           length2 = keys2.length;
4771           if (length2 !== Object.keys(b3).length) return false;
4772           for (i3 = length2; i3-- !== 0; )
4773             if (!Object.prototype.hasOwnProperty.call(b3, keys2[i3])) return false;
4774           for (i3 = length2; i3-- !== 0; ) {
4775             var key = keys2[i3];
4776             if (!equal(a2[key], b3[key])) return false;
4777           }
4778           return true;
4779         }
4780         return a2 !== a2 && b3 !== b3;
4781       };
4782     }
4783   });
4784
4785   // node_modules/vparse/index.js
4786   var require_vparse = __commonJS({
4787     "node_modules/vparse/index.js"(exports2, module2) {
4788       (function(window2) {
4789         "use strict";
4790         function parseVersion2(v3) {
4791           var m3 = v3.replace(/[^0-9.]/g, "").match(/[0-9]*\.|[0-9]+/g) || [];
4792           v3 = {
4793             major: +m3[0] || 0,
4794             minor: +m3[1] || 0,
4795             patch: +m3[2] || 0,
4796             build: +m3[3] || 0
4797           };
4798           v3.isEmpty = !v3.major && !v3.minor && !v3.patch && !v3.build;
4799           v3.parsed = [v3.major, v3.minor, v3.patch, v3.build];
4800           v3.text = v3.parsed.join(".");
4801           v3.compare = compare2;
4802           return v3;
4803         }
4804         function compare2(v3) {
4805           if (typeof v3 === "string") {
4806             v3 = parseVersion2(v3);
4807           }
4808           for (var i3 = 0; i3 < 4; i3++) {
4809             if (this.parsed[i3] !== v3.parsed[i3]) {
4810               return this.parsed[i3] > v3.parsed[i3] ? 1 : -1;
4811             }
4812           }
4813           return 0;
4814         }
4815         if (typeof module2 === "object" && module2 && typeof module2.exports === "object") {
4816           module2.exports = parseVersion2;
4817         } else {
4818           window2.parseVersion = parseVersion2;
4819         }
4820       })(exports2);
4821     }
4822   });
4823
4824   // node_modules/fast-json-stable-stringify/index.js
4825   var require_fast_json_stable_stringify = __commonJS({
4826     "node_modules/fast-json-stable-stringify/index.js"(exports2, module2) {
4827       "use strict";
4828       module2.exports = function(data, opts) {
4829         if (!opts) opts = {};
4830         if (typeof opts === "function") opts = { cmp: opts };
4831         var cycles = typeof opts.cycles === "boolean" ? opts.cycles : false;
4832         var cmp = opts.cmp && /* @__PURE__ */ (function(f2) {
4833           return function(node) {
4834             return function(a2, b3) {
4835               var aobj = { key: a2, value: node[a2] };
4836               var bobj = { key: b3, value: node[b3] };
4837               return f2(aobj, bobj);
4838             };
4839           };
4840         })(opts.cmp);
4841         var seen = [];
4842         return (function stringify3(node) {
4843           if (node && node.toJSON && typeof node.toJSON === "function") {
4844             node = node.toJSON();
4845           }
4846           if (node === void 0) return;
4847           if (typeof node == "number") return isFinite(node) ? "" + node : "null";
4848           if (typeof node !== "object") return JSON.stringify(node);
4849           var i3, out;
4850           if (Array.isArray(node)) {
4851             out = "[";
4852             for (i3 = 0; i3 < node.length; i3++) {
4853               if (i3) out += ",";
4854               out += stringify3(node[i3]) || "null";
4855             }
4856             return out + "]";
4857           }
4858           if (node === null) return "null";
4859           if (seen.indexOf(node) !== -1) {
4860             if (cycles) return JSON.stringify("__cycle__");
4861             throw new TypeError("Converting circular structure to JSON");
4862           }
4863           var seenIndex = seen.push(node) - 1;
4864           var keys2 = Object.keys(node).sort(cmp && cmp(node));
4865           out = "";
4866           for (i3 = 0; i3 < keys2.length; i3++) {
4867             var key = keys2[i3];
4868             var value = stringify3(node[key]);
4869             if (!value) continue;
4870             if (out) out += ",";
4871             out += JSON.stringify(key) + ":" + value;
4872           }
4873           seen.splice(seenIndex, 1);
4874           return "{" + out + "}";
4875         })(data);
4876       };
4877     }
4878   });
4879
4880   // node_modules/polygon-clipping/dist/polygon-clipping.umd.js
4881   var require_polygon_clipping_umd = __commonJS({
4882     "node_modules/polygon-clipping/dist/polygon-clipping.umd.js"(exports2, module2) {
4883       (function(global2, factory) {
4884         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());
4885       })(exports2, (function() {
4886         "use strict";
4887         function __generator(thisArg, body) {
4888           var _3 = {
4889             label: 0,
4890             sent: function() {
4891               if (t2[0] & 1) throw t2[1];
4892               return t2[1];
4893             },
4894             trys: [],
4895             ops: []
4896           }, f2, y3, t2, g3;
4897           return g3 = {
4898             next: verb(0),
4899             "throw": verb(1),
4900             "return": verb(2)
4901           }, typeof Symbol === "function" && (g3[Symbol.iterator] = function() {
4902             return this;
4903           }), g3;
4904           function verb(n3) {
4905             return function(v3) {
4906               return step([n3, v3]);
4907             };
4908           }
4909           function step(op) {
4910             if (f2) throw new TypeError("Generator is already executing.");
4911             while (_3) try {
4912               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;
4913               if (y3 = 0, t2) op = [op[0] & 2, t2.value];
4914               switch (op[0]) {
4915                 case 0:
4916                 case 1:
4917                   t2 = op;
4918                   break;
4919                 case 4:
4920                   _3.label++;
4921                   return {
4922                     value: op[1],
4923                     done: false
4924                   };
4925                 case 5:
4926                   _3.label++;
4927                   y3 = op[1];
4928                   op = [0];
4929                   continue;
4930                 case 7:
4931                   op = _3.ops.pop();
4932                   _3.trys.pop();
4933                   continue;
4934                 default:
4935                   if (!(t2 = _3.trys, t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
4936                     _3 = 0;
4937                     continue;
4938                   }
4939                   if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
4940                     _3.label = op[1];
4941                     break;
4942                   }
4943                   if (op[0] === 6 && _3.label < t2[1]) {
4944                     _3.label = t2[1];
4945                     t2 = op;
4946                     break;
4947                   }
4948                   if (t2 && _3.label < t2[2]) {
4949                     _3.label = t2[2];
4950                     _3.ops.push(op);
4951                     break;
4952                   }
4953                   if (t2[2]) _3.ops.pop();
4954                   _3.trys.pop();
4955                   continue;
4956               }
4957               op = body.call(thisArg, _3);
4958             } catch (e3) {
4959               op = [6, e3];
4960               y3 = 0;
4961             } finally {
4962               f2 = t2 = 0;
4963             }
4964             if (op[0] & 5) throw op[1];
4965             return {
4966               value: op[0] ? op[1] : void 0,
4967               done: true
4968             };
4969           }
4970         }
4971         var Node = (
4972           /** @class */
4973           /* @__PURE__ */ (function() {
4974             function Node2(key, data) {
4975               this.next = null;
4976               this.key = key;
4977               this.data = data;
4978               this.left = null;
4979               this.right = null;
4980             }
4981             return Node2;
4982           })()
4983         );
4984         function DEFAULT_COMPARE(a2, b3) {
4985           return a2 > b3 ? 1 : a2 < b3 ? -1 : 0;
4986         }
4987         function splay(i3, t2, comparator) {
4988           var N3 = new Node(null, null);
4989           var l2 = N3;
4990           var r2 = N3;
4991           while (true) {
4992             var cmp2 = comparator(i3, t2.key);
4993             if (cmp2 < 0) {
4994               if (t2.left === null) break;
4995               if (comparator(i3, t2.left.key) < 0) {
4996                 var y3 = t2.left;
4997                 t2.left = y3.right;
4998                 y3.right = t2;
4999                 t2 = y3;
5000                 if (t2.left === null) break;
5001               }
5002               r2.left = t2;
5003               r2 = t2;
5004               t2 = t2.left;
5005             } else if (cmp2 > 0) {
5006               if (t2.right === null) break;
5007               if (comparator(i3, t2.right.key) > 0) {
5008                 var y3 = t2.right;
5009                 t2.right = y3.left;
5010                 y3.left = t2;
5011                 t2 = y3;
5012                 if (t2.right === null) break;
5013               }
5014               l2.right = t2;
5015               l2 = t2;
5016               t2 = t2.right;
5017             } else break;
5018           }
5019           l2.right = t2.left;
5020           r2.left = t2.right;
5021           t2.left = N3.right;
5022           t2.right = N3.left;
5023           return t2;
5024         }
5025         function insert(i3, data, t2, comparator) {
5026           var node = new Node(i3, data);
5027           if (t2 === null) {
5028             node.left = node.right = null;
5029             return node;
5030           }
5031           t2 = splay(i3, t2, comparator);
5032           var cmp2 = comparator(i3, t2.key);
5033           if (cmp2 < 0) {
5034             node.left = t2.left;
5035             node.right = t2;
5036             t2.left = null;
5037           } else if (cmp2 >= 0) {
5038             node.right = t2.right;
5039             node.left = t2;
5040             t2.right = null;
5041           }
5042           return node;
5043         }
5044         function split(key, v3, comparator) {
5045           var left = null;
5046           var right = null;
5047           if (v3) {
5048             v3 = splay(key, v3, comparator);
5049             var cmp2 = comparator(v3.key, key);
5050             if (cmp2 === 0) {
5051               left = v3.left;
5052               right = v3.right;
5053             } else if (cmp2 < 0) {
5054               right = v3.right;
5055               v3.right = null;
5056               left = v3;
5057             } else {
5058               left = v3.left;
5059               v3.left = null;
5060               right = v3;
5061             }
5062           }
5063           return {
5064             left,
5065             right
5066           };
5067         }
5068         function merge3(left, right, comparator) {
5069           if (right === null) return left;
5070           if (left === null) return right;
5071           right = splay(left.key, right, comparator);
5072           right.left = left;
5073           return right;
5074         }
5075         function printRow(root3, prefix, isTail, out, printNode) {
5076           if (root3) {
5077             out("" + prefix + (isTail ? "\u2514\u2500\u2500 " : "\u251C\u2500\u2500 ") + printNode(root3) + "\n");
5078             var indent = prefix + (isTail ? "    " : "\u2502   ");
5079             if (root3.left) printRow(root3.left, indent, false, out, printNode);
5080             if (root3.right) printRow(root3.right, indent, true, out, printNode);
5081           }
5082         }
5083         var Tree = (
5084           /** @class */
5085           (function() {
5086             function Tree2(comparator) {
5087               if (comparator === void 0) {
5088                 comparator = DEFAULT_COMPARE;
5089               }
5090               this._root = null;
5091               this._size = 0;
5092               this._comparator = comparator;
5093             }
5094             Tree2.prototype.insert = function(key, data) {
5095               this._size++;
5096               return this._root = insert(key, data, this._root, this._comparator);
5097             };
5098             Tree2.prototype.add = function(key, data) {
5099               var node = new Node(key, data);
5100               if (this._root === null) {
5101                 node.left = node.right = null;
5102                 this._size++;
5103                 this._root = node;
5104               }
5105               var comparator = this._comparator;
5106               var t2 = splay(key, this._root, comparator);
5107               var cmp2 = comparator(key, t2.key);
5108               if (cmp2 === 0) this._root = t2;
5109               else {
5110                 if (cmp2 < 0) {
5111                   node.left = t2.left;
5112                   node.right = t2;
5113                   t2.left = null;
5114                 } else if (cmp2 > 0) {
5115                   node.right = t2.right;
5116                   node.left = t2;
5117                   t2.right = null;
5118                 }
5119                 this._size++;
5120                 this._root = node;
5121               }
5122               return this._root;
5123             };
5124             Tree2.prototype.remove = function(key) {
5125               this._root = this._remove(key, this._root, this._comparator);
5126             };
5127             Tree2.prototype._remove = function(i3, t2, comparator) {
5128               var x3;
5129               if (t2 === null) return null;
5130               t2 = splay(i3, t2, comparator);
5131               var cmp2 = comparator(i3, t2.key);
5132               if (cmp2 === 0) {
5133                 if (t2.left === null) {
5134                   x3 = t2.right;
5135                 } else {
5136                   x3 = splay(i3, t2.left, comparator);
5137                   x3.right = t2.right;
5138                 }
5139                 this._size--;
5140                 return x3;
5141               }
5142               return t2;
5143             };
5144             Tree2.prototype.pop = function() {
5145               var node = this._root;
5146               if (node) {
5147                 while (node.left) node = node.left;
5148                 this._root = splay(node.key, this._root, this._comparator);
5149                 this._root = this._remove(node.key, this._root, this._comparator);
5150                 return {
5151                   key: node.key,
5152                   data: node.data
5153                 };
5154               }
5155               return null;
5156             };
5157             Tree2.prototype.findStatic = function(key) {
5158               var current = this._root;
5159               var compare2 = this._comparator;
5160               while (current) {
5161                 var cmp2 = compare2(key, current.key);
5162                 if (cmp2 === 0) return current;
5163                 else if (cmp2 < 0) current = current.left;
5164                 else current = current.right;
5165               }
5166               return null;
5167             };
5168             Tree2.prototype.find = function(key) {
5169               if (this._root) {
5170                 this._root = splay(key, this._root, this._comparator);
5171                 if (this._comparator(key, this._root.key) !== 0) return null;
5172               }
5173               return this._root;
5174             };
5175             Tree2.prototype.contains = function(key) {
5176               var current = this._root;
5177               var compare2 = this._comparator;
5178               while (current) {
5179                 var cmp2 = compare2(key, current.key);
5180                 if (cmp2 === 0) return true;
5181                 else if (cmp2 < 0) current = current.left;
5182                 else current = current.right;
5183               }
5184               return false;
5185             };
5186             Tree2.prototype.forEach = function(visitor, ctx) {
5187               var current = this._root;
5188               var Q3 = [];
5189               var done = false;
5190               while (!done) {
5191                 if (current !== null) {
5192                   Q3.push(current);
5193                   current = current.left;
5194                 } else {
5195                   if (Q3.length !== 0) {
5196                     current = Q3.pop();
5197                     visitor.call(ctx, current);
5198                     current = current.right;
5199                   } else done = true;
5200                 }
5201               }
5202               return this;
5203             };
5204             Tree2.prototype.range = function(low, high, fn, ctx) {
5205               var Q3 = [];
5206               var compare2 = this._comparator;
5207               var node = this._root;
5208               var cmp2;
5209               while (Q3.length !== 0 || node) {
5210                 if (node) {
5211                   Q3.push(node);
5212                   node = node.left;
5213                 } else {
5214                   node = Q3.pop();
5215                   cmp2 = compare2(node.key, high);
5216                   if (cmp2 > 0) {
5217                     break;
5218                   } else if (compare2(node.key, low) >= 0) {
5219                     if (fn.call(ctx, node)) return this;
5220                   }
5221                   node = node.right;
5222                 }
5223               }
5224               return this;
5225             };
5226             Tree2.prototype.keys = function() {
5227               var keys2 = [];
5228               this.forEach(function(_a5) {
5229                 var key = _a5.key;
5230                 return keys2.push(key);
5231               });
5232               return keys2;
5233             };
5234             Tree2.prototype.values = function() {
5235               var values = [];
5236               this.forEach(function(_a5) {
5237                 var data = _a5.data;
5238                 return values.push(data);
5239               });
5240               return values;
5241             };
5242             Tree2.prototype.min = function() {
5243               if (this._root) return this.minNode(this._root).key;
5244               return null;
5245             };
5246             Tree2.prototype.max = function() {
5247               if (this._root) return this.maxNode(this._root).key;
5248               return null;
5249             };
5250             Tree2.prototype.minNode = function(t2) {
5251               if (t2 === void 0) {
5252                 t2 = this._root;
5253               }
5254               if (t2) while (t2.left) t2 = t2.left;
5255               return t2;
5256             };
5257             Tree2.prototype.maxNode = function(t2) {
5258               if (t2 === void 0) {
5259                 t2 = this._root;
5260               }
5261               if (t2) while (t2.right) t2 = t2.right;
5262               return t2;
5263             };
5264             Tree2.prototype.at = function(index2) {
5265               var current = this._root;
5266               var done = false;
5267               var i3 = 0;
5268               var Q3 = [];
5269               while (!done) {
5270                 if (current) {
5271                   Q3.push(current);
5272                   current = current.left;
5273                 } else {
5274                   if (Q3.length > 0) {
5275                     current = Q3.pop();
5276                     if (i3 === index2) return current;
5277                     i3++;
5278                     current = current.right;
5279                   } else done = true;
5280                 }
5281               }
5282               return null;
5283             };
5284             Tree2.prototype.next = function(d2) {
5285               var root3 = this._root;
5286               var successor = null;
5287               if (d2.right) {
5288                 successor = d2.right;
5289                 while (successor.left) successor = successor.left;
5290                 return successor;
5291               }
5292               var comparator = this._comparator;
5293               while (root3) {
5294                 var cmp2 = comparator(d2.key, root3.key);
5295                 if (cmp2 === 0) break;
5296                 else if (cmp2 < 0) {
5297                   successor = root3;
5298                   root3 = root3.left;
5299                 } else root3 = root3.right;
5300               }
5301               return successor;
5302             };
5303             Tree2.prototype.prev = function(d2) {
5304               var root3 = this._root;
5305               var predecessor = null;
5306               if (d2.left !== null) {
5307                 predecessor = d2.left;
5308                 while (predecessor.right) predecessor = predecessor.right;
5309                 return predecessor;
5310               }
5311               var comparator = this._comparator;
5312               while (root3) {
5313                 var cmp2 = comparator(d2.key, root3.key);
5314                 if (cmp2 === 0) break;
5315                 else if (cmp2 < 0) root3 = root3.left;
5316                 else {
5317                   predecessor = root3;
5318                   root3 = root3.right;
5319                 }
5320               }
5321               return predecessor;
5322             };
5323             Tree2.prototype.clear = function() {
5324               this._root = null;
5325               this._size = 0;
5326               return this;
5327             };
5328             Tree2.prototype.toList = function() {
5329               return toList(this._root);
5330             };
5331             Tree2.prototype.load = function(keys2, values, presort) {
5332               if (values === void 0) {
5333                 values = [];
5334               }
5335               if (presort === void 0) {
5336                 presort = false;
5337               }
5338               var size = keys2.length;
5339               var comparator = this._comparator;
5340               if (presort) sort(keys2, values, 0, size - 1, comparator);
5341               if (this._root === null) {
5342                 this._root = loadRecursive(keys2, values, 0, size);
5343                 this._size = size;
5344               } else {
5345                 var mergedList = mergeLists(this.toList(), createList(keys2, values), comparator);
5346                 size = this._size + size;
5347                 this._root = sortedListToBST({
5348                   head: mergedList
5349                 }, 0, size);
5350               }
5351               return this;
5352             };
5353             Tree2.prototype.isEmpty = function() {
5354               return this._root === null;
5355             };
5356             Object.defineProperty(Tree2.prototype, "size", {
5357               get: function() {
5358                 return this._size;
5359               },
5360               enumerable: true,
5361               configurable: true
5362             });
5363             Object.defineProperty(Tree2.prototype, "root", {
5364               get: function() {
5365                 return this._root;
5366               },
5367               enumerable: true,
5368               configurable: true
5369             });
5370             Tree2.prototype.toString = function(printNode) {
5371               if (printNode === void 0) {
5372                 printNode = function(n3) {
5373                   return String(n3.key);
5374                 };
5375               }
5376               var out = [];
5377               printRow(this._root, "", true, function(v3) {
5378                 return out.push(v3);
5379               }, printNode);
5380               return out.join("");
5381             };
5382             Tree2.prototype.update = function(key, newKey, newData) {
5383               var comparator = this._comparator;
5384               var _a5 = split(key, this._root, comparator), left = _a5.left, right = _a5.right;
5385               if (comparator(key, newKey) < 0) {
5386                 right = insert(newKey, newData, right, comparator);
5387               } else {
5388                 left = insert(newKey, newData, left, comparator);
5389               }
5390               this._root = merge3(left, right, comparator);
5391             };
5392             Tree2.prototype.split = function(key) {
5393               return split(key, this._root, this._comparator);
5394             };
5395             Tree2.prototype[Symbol.iterator] = function() {
5396               var current, Q3, done;
5397               return __generator(this, function(_a5) {
5398                 switch (_a5.label) {
5399                   case 0:
5400                     current = this._root;
5401                     Q3 = [];
5402                     done = false;
5403                     _a5.label = 1;
5404                   case 1:
5405                     if (!!done) return [3, 6];
5406                     if (!(current !== null)) return [3, 2];
5407                     Q3.push(current);
5408                     current = current.left;
5409                     return [3, 5];
5410                   case 2:
5411                     if (!(Q3.length !== 0)) return [3, 4];
5412                     current = Q3.pop();
5413                     return [4, current];
5414                   case 3:
5415                     _a5.sent();
5416                     current = current.right;
5417                     return [3, 5];
5418                   case 4:
5419                     done = true;
5420                     _a5.label = 5;
5421                   case 5:
5422                     return [3, 1];
5423                   case 6:
5424                     return [
5425                       2
5426                       /*return*/
5427                     ];
5428                 }
5429               });
5430             };
5431             return Tree2;
5432           })()
5433         );
5434         function loadRecursive(keys2, values, start2, end) {
5435           var size = end - start2;
5436           if (size > 0) {
5437             var middle = start2 + Math.floor(size / 2);
5438             var key = keys2[middle];
5439             var data = values[middle];
5440             var node = new Node(key, data);
5441             node.left = loadRecursive(keys2, values, start2, middle);
5442             node.right = loadRecursive(keys2, values, middle + 1, end);
5443             return node;
5444           }
5445           return null;
5446         }
5447         function createList(keys2, values) {
5448           var head = new Node(null, null);
5449           var p2 = head;
5450           for (var i3 = 0; i3 < keys2.length; i3++) {
5451             p2 = p2.next = new Node(keys2[i3], values[i3]);
5452           }
5453           p2.next = null;
5454           return head.next;
5455         }
5456         function toList(root3) {
5457           var current = root3;
5458           var Q3 = [];
5459           var done = false;
5460           var head = new Node(null, null);
5461           var p2 = head;
5462           while (!done) {
5463             if (current) {
5464               Q3.push(current);
5465               current = current.left;
5466             } else {
5467               if (Q3.length > 0) {
5468                 current = p2 = p2.next = Q3.pop();
5469                 current = current.right;
5470               } else done = true;
5471             }
5472           }
5473           p2.next = null;
5474           return head.next;
5475         }
5476         function sortedListToBST(list, start2, end) {
5477           var size = end - start2;
5478           if (size > 0) {
5479             var middle = start2 + Math.floor(size / 2);
5480             var left = sortedListToBST(list, start2, middle);
5481             var root3 = list.head;
5482             root3.left = left;
5483             list.head = list.head.next;
5484             root3.right = sortedListToBST(list, middle + 1, end);
5485             return root3;
5486           }
5487           return null;
5488         }
5489         function mergeLists(l1, l2, compare2) {
5490           var head = new Node(null, null);
5491           var p2 = head;
5492           var p1 = l1;
5493           var p22 = l2;
5494           while (p1 !== null && p22 !== null) {
5495             if (compare2(p1.key, p22.key) < 0) {
5496               p2.next = p1;
5497               p1 = p1.next;
5498             } else {
5499               p2.next = p22;
5500               p22 = p22.next;
5501             }
5502             p2 = p2.next;
5503           }
5504           if (p1 !== null) {
5505             p2.next = p1;
5506           } else if (p22 !== null) {
5507             p2.next = p22;
5508           }
5509           return head.next;
5510         }
5511         function sort(keys2, values, left, right, compare2) {
5512           if (left >= right) return;
5513           var pivot = keys2[left + right >> 1];
5514           var i3 = left - 1;
5515           var j3 = right + 1;
5516           while (true) {
5517             do
5518               i3++;
5519             while (compare2(keys2[i3], pivot) < 0);
5520             do
5521               j3--;
5522             while (compare2(keys2[j3], pivot) > 0);
5523             if (i3 >= j3) break;
5524             var tmp = keys2[i3];
5525             keys2[i3] = keys2[j3];
5526             keys2[j3] = tmp;
5527             tmp = values[i3];
5528             values[i3] = values[j3];
5529             values[j3] = tmp;
5530           }
5531           sort(keys2, values, left, j3, compare2);
5532           sort(keys2, values, j3 + 1, right, compare2);
5533         }
5534         const isInBbox2 = (bbox2, point) => {
5535           return bbox2.ll.x <= point.x && point.x <= bbox2.ur.x && bbox2.ll.y <= point.y && point.y <= bbox2.ur.y;
5536         };
5537         const getBboxOverlap2 = (b1, b22) => {
5538           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;
5539           const lowerX = b1.ll.x < b22.ll.x ? b22.ll.x : b1.ll.x;
5540           const upperX = b1.ur.x < b22.ur.x ? b1.ur.x : b22.ur.x;
5541           const lowerY = b1.ll.y < b22.ll.y ? b22.ll.y : b1.ll.y;
5542           const upperY = b1.ur.y < b22.ur.y ? b1.ur.y : b22.ur.y;
5543           return {
5544             ll: {
5545               x: lowerX,
5546               y: lowerY
5547             },
5548             ur: {
5549               x: upperX,
5550               y: upperY
5551             }
5552           };
5553         };
5554         let epsilon$1 = Number.EPSILON;
5555         if (epsilon$1 === void 0) epsilon$1 = Math.pow(2, -52);
5556         const EPSILON_SQ = epsilon$1 * epsilon$1;
5557         const cmp = (a2, b3) => {
5558           if (-epsilon$1 < a2 && a2 < epsilon$1) {
5559             if (-epsilon$1 < b3 && b3 < epsilon$1) {
5560               return 0;
5561             }
5562           }
5563           const ab = a2 - b3;
5564           if (ab * ab < EPSILON_SQ * a2 * b3) {
5565             return 0;
5566           }
5567           return a2 < b3 ? -1 : 1;
5568         };
5569         class PtRounder {
5570           constructor() {
5571             this.reset();
5572           }
5573           reset() {
5574             this.xRounder = new CoordRounder();
5575             this.yRounder = new CoordRounder();
5576           }
5577           round(x3, y3) {
5578             return {
5579               x: this.xRounder.round(x3),
5580               y: this.yRounder.round(y3)
5581             };
5582           }
5583         }
5584         class CoordRounder {
5585           constructor() {
5586             this.tree = new Tree();
5587             this.round(0);
5588           }
5589           // Note: this can rounds input values backwards or forwards.
5590           //       You might ask, why not restrict this to just rounding
5591           //       forwards? Wouldn't that allow left endpoints to always
5592           //       remain left endpoints during splitting (never change to
5593           //       right). No - it wouldn't, because we snap intersections
5594           //       to endpoints (to establish independence from the segment
5595           //       angle for t-intersections).
5596           round(coord2) {
5597             const node = this.tree.add(coord2);
5598             const prevNode = this.tree.prev(node);
5599             if (prevNode !== null && cmp(node.key, prevNode.key) === 0) {
5600               this.tree.remove(coord2);
5601               return prevNode.key;
5602             }
5603             const nextNode = this.tree.next(node);
5604             if (nextNode !== null && cmp(node.key, nextNode.key) === 0) {
5605               this.tree.remove(coord2);
5606               return nextNode.key;
5607             }
5608             return coord2;
5609           }
5610         }
5611         const rounder = new PtRounder();
5612         const epsilon3 = 11102230246251565e-32;
5613         const splitter = 134217729;
5614         const resulterrbound = (3 + 8 * epsilon3) * epsilon3;
5615         function sum(elen, e3, flen, f2, h3) {
5616           let Q3, Qnew, hh, bvirt;
5617           let enow = e3[0];
5618           let fnow = f2[0];
5619           let eindex = 0;
5620           let findex = 0;
5621           if (fnow > enow === fnow > -enow) {
5622             Q3 = enow;
5623             enow = e3[++eindex];
5624           } else {
5625             Q3 = fnow;
5626             fnow = f2[++findex];
5627           }
5628           let hindex = 0;
5629           if (eindex < elen && findex < flen) {
5630             if (fnow > enow === fnow > -enow) {
5631               Qnew = enow + Q3;
5632               hh = Q3 - (Qnew - enow);
5633               enow = e3[++eindex];
5634             } else {
5635               Qnew = fnow + Q3;
5636               hh = Q3 - (Qnew - fnow);
5637               fnow = f2[++findex];
5638             }
5639             Q3 = Qnew;
5640             if (hh !== 0) {
5641               h3[hindex++] = hh;
5642             }
5643             while (eindex < elen && findex < flen) {
5644               if (fnow > enow === fnow > -enow) {
5645                 Qnew = Q3 + enow;
5646                 bvirt = Qnew - Q3;
5647                 hh = Q3 - (Qnew - bvirt) + (enow - bvirt);
5648                 enow = e3[++eindex];
5649               } else {
5650                 Qnew = Q3 + fnow;
5651                 bvirt = Qnew - Q3;
5652                 hh = Q3 - (Qnew - bvirt) + (fnow - bvirt);
5653                 fnow = f2[++findex];
5654               }
5655               Q3 = Qnew;
5656               if (hh !== 0) {
5657                 h3[hindex++] = hh;
5658               }
5659             }
5660           }
5661           while (eindex < elen) {
5662             Qnew = Q3 + enow;
5663             bvirt = Qnew - Q3;
5664             hh = Q3 - (Qnew - bvirt) + (enow - bvirt);
5665             enow = e3[++eindex];
5666             Q3 = Qnew;
5667             if (hh !== 0) {
5668               h3[hindex++] = hh;
5669             }
5670           }
5671           while (findex < flen) {
5672             Qnew = Q3 + fnow;
5673             bvirt = Qnew - Q3;
5674             hh = Q3 - (Qnew - bvirt) + (fnow - bvirt);
5675             fnow = f2[++findex];
5676             Q3 = Qnew;
5677             if (hh !== 0) {
5678               h3[hindex++] = hh;
5679             }
5680           }
5681           if (Q3 !== 0 || hindex === 0) {
5682             h3[hindex++] = Q3;
5683           }
5684           return hindex;
5685         }
5686         function estimate(elen, e3) {
5687           let Q3 = e3[0];
5688           for (let i3 = 1; i3 < elen; i3++) Q3 += e3[i3];
5689           return Q3;
5690         }
5691         function vec(n3) {
5692           return new Float64Array(n3);
5693         }
5694         const ccwerrboundA = (3 + 16 * epsilon3) * epsilon3;
5695         const ccwerrboundB = (2 + 12 * epsilon3) * epsilon3;
5696         const ccwerrboundC = (9 + 64 * epsilon3) * epsilon3 * epsilon3;
5697         const B3 = vec(4);
5698         const C1 = vec(8);
5699         const C22 = vec(12);
5700         const D3 = vec(16);
5701         const u4 = vec(4);
5702         function orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {
5703           let acxtail, acytail, bcxtail, bcytail;
5704           let bvirt, c2, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u32;
5705           const acx = ax - cx;
5706           const bcx = bx - cx;
5707           const acy = ay - cy;
5708           const bcy = by - cy;
5709           s1 = acx * bcy;
5710           c2 = splitter * acx;
5711           ahi = c2 - (c2 - acx);
5712           alo = acx - ahi;
5713           c2 = splitter * bcy;
5714           bhi = c2 - (c2 - bcy);
5715           blo = bcy - bhi;
5716           s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
5717           t1 = acy * bcx;
5718           c2 = splitter * acy;
5719           ahi = c2 - (c2 - acy);
5720           alo = acy - ahi;
5721           c2 = splitter * bcx;
5722           bhi = c2 - (c2 - bcx);
5723           blo = bcx - bhi;
5724           t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
5725           _i = s0 - t0;
5726           bvirt = s0 - _i;
5727           B3[0] = s0 - (_i + bvirt) + (bvirt - t0);
5728           _j = s1 + _i;
5729           bvirt = _j - s1;
5730           _0 = s1 - (_j - bvirt) + (_i - bvirt);
5731           _i = _0 - t1;
5732           bvirt = _0 - _i;
5733           B3[1] = _0 - (_i + bvirt) + (bvirt - t1);
5734           u32 = _j + _i;
5735           bvirt = u32 - _j;
5736           B3[2] = _j - (u32 - bvirt) + (_i - bvirt);
5737           B3[3] = u32;
5738           let det = estimate(4, B3);
5739           let errbound = ccwerrboundB * detsum;
5740           if (det >= errbound || -det >= errbound) {
5741             return det;
5742           }
5743           bvirt = ax - acx;
5744           acxtail = ax - (acx + bvirt) + (bvirt - cx);
5745           bvirt = bx - bcx;
5746           bcxtail = bx - (bcx + bvirt) + (bvirt - cx);
5747           bvirt = ay - acy;
5748           acytail = ay - (acy + bvirt) + (bvirt - cy);
5749           bvirt = by - bcy;
5750           bcytail = by - (bcy + bvirt) + (bvirt - cy);
5751           if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {
5752             return det;
5753           }
5754           errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);
5755           det += acx * bcytail + bcy * acxtail - (acy * bcxtail + bcx * acytail);
5756           if (det >= errbound || -det >= errbound) return det;
5757           s1 = acxtail * bcy;
5758           c2 = splitter * acxtail;
5759           ahi = c2 - (c2 - acxtail);
5760           alo = acxtail - ahi;
5761           c2 = splitter * bcy;
5762           bhi = c2 - (c2 - bcy);
5763           blo = bcy - bhi;
5764           s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
5765           t1 = acytail * bcx;
5766           c2 = splitter * acytail;
5767           ahi = c2 - (c2 - acytail);
5768           alo = acytail - ahi;
5769           c2 = splitter * bcx;
5770           bhi = c2 - (c2 - bcx);
5771           blo = bcx - bhi;
5772           t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
5773           _i = s0 - t0;
5774           bvirt = s0 - _i;
5775           u4[0] = s0 - (_i + bvirt) + (bvirt - t0);
5776           _j = s1 + _i;
5777           bvirt = _j - s1;
5778           _0 = s1 - (_j - bvirt) + (_i - bvirt);
5779           _i = _0 - t1;
5780           bvirt = _0 - _i;
5781           u4[1] = _0 - (_i + bvirt) + (bvirt - t1);
5782           u32 = _j + _i;
5783           bvirt = u32 - _j;
5784           u4[2] = _j - (u32 - bvirt) + (_i - bvirt);
5785           u4[3] = u32;
5786           const C1len = sum(4, B3, 4, u4, C1);
5787           s1 = acx * bcytail;
5788           c2 = splitter * acx;
5789           ahi = c2 - (c2 - acx);
5790           alo = acx - ahi;
5791           c2 = splitter * bcytail;
5792           bhi = c2 - (c2 - bcytail);
5793           blo = bcytail - bhi;
5794           s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
5795           t1 = acy * bcxtail;
5796           c2 = splitter * acy;
5797           ahi = c2 - (c2 - acy);
5798           alo = acy - ahi;
5799           c2 = splitter * bcxtail;
5800           bhi = c2 - (c2 - bcxtail);
5801           blo = bcxtail - bhi;
5802           t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
5803           _i = s0 - t0;
5804           bvirt = s0 - _i;
5805           u4[0] = s0 - (_i + bvirt) + (bvirt - t0);
5806           _j = s1 + _i;
5807           bvirt = _j - s1;
5808           _0 = s1 - (_j - bvirt) + (_i - bvirt);
5809           _i = _0 - t1;
5810           bvirt = _0 - _i;
5811           u4[1] = _0 - (_i + bvirt) + (bvirt - t1);
5812           u32 = _j + _i;
5813           bvirt = u32 - _j;
5814           u4[2] = _j - (u32 - bvirt) + (_i - bvirt);
5815           u4[3] = u32;
5816           const C2len = sum(C1len, C1, 4, u4, C22);
5817           s1 = acxtail * bcytail;
5818           c2 = splitter * acxtail;
5819           ahi = c2 - (c2 - acxtail);
5820           alo = acxtail - ahi;
5821           c2 = splitter * bcytail;
5822           bhi = c2 - (c2 - bcytail);
5823           blo = bcytail - bhi;
5824           s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);
5825           t1 = acytail * bcxtail;
5826           c2 = splitter * acytail;
5827           ahi = c2 - (c2 - acytail);
5828           alo = acytail - ahi;
5829           c2 = splitter * bcxtail;
5830           bhi = c2 - (c2 - bcxtail);
5831           blo = bcxtail - bhi;
5832           t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);
5833           _i = s0 - t0;
5834           bvirt = s0 - _i;
5835           u4[0] = s0 - (_i + bvirt) + (bvirt - t0);
5836           _j = s1 + _i;
5837           bvirt = _j - s1;
5838           _0 = s1 - (_j - bvirt) + (_i - bvirt);
5839           _i = _0 - t1;
5840           bvirt = _0 - _i;
5841           u4[1] = _0 - (_i + bvirt) + (bvirt - t1);
5842           u32 = _j + _i;
5843           bvirt = u32 - _j;
5844           u4[2] = _j - (u32 - bvirt) + (_i - bvirt);
5845           u4[3] = u32;
5846           const Dlen = sum(C2len, C22, 4, u4, D3);
5847           return D3[Dlen - 1];
5848         }
5849         function orient2d(ax, ay, bx, by, cx, cy) {
5850           const detleft = (ay - cy) * (bx - cx);
5851           const detright = (ax - cx) * (by - cy);
5852           const det = detleft - detright;
5853           const detsum = Math.abs(detleft + detright);
5854           if (Math.abs(det) >= ccwerrboundA * detsum) return det;
5855           return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);
5856         }
5857         const crossProduct2 = (a2, b3) => a2.x * b3.y - a2.y * b3.x;
5858         const dotProduct2 = (a2, b3) => a2.x * b3.x + a2.y * b3.y;
5859         const compareVectorAngles = (basePt, endPt1, endPt2) => {
5860           const res = orient2d(basePt.x, basePt.y, endPt1.x, endPt1.y, endPt2.x, endPt2.y);
5861           if (res > 0) return -1;
5862           if (res < 0) return 1;
5863           return 0;
5864         };
5865         const length2 = (v3) => Math.sqrt(dotProduct2(v3, v3));
5866         const sineOfAngle2 = (pShared, pBase, pAngle) => {
5867           const vBase = {
5868             x: pBase.x - pShared.x,
5869             y: pBase.y - pShared.y
5870           };
5871           const vAngle = {
5872             x: pAngle.x - pShared.x,
5873             y: pAngle.y - pShared.y
5874           };
5875           return crossProduct2(vAngle, vBase) / length2(vAngle) / length2(vBase);
5876         };
5877         const cosineOfAngle2 = (pShared, pBase, pAngle) => {
5878           const vBase = {
5879             x: pBase.x - pShared.x,
5880             y: pBase.y - pShared.y
5881           };
5882           const vAngle = {
5883             x: pAngle.x - pShared.x,
5884             y: pAngle.y - pShared.y
5885           };
5886           return dotProduct2(vAngle, vBase) / length2(vAngle) / length2(vBase);
5887         };
5888         const horizontalIntersection2 = (pt2, v3, y3) => {
5889           if (v3.y === 0) return null;
5890           return {
5891             x: pt2.x + v3.x / v3.y * (y3 - pt2.y),
5892             y: y3
5893           };
5894         };
5895         const verticalIntersection2 = (pt2, v3, x3) => {
5896           if (v3.x === 0) return null;
5897           return {
5898             x: x3,
5899             y: pt2.y + v3.y / v3.x * (x3 - pt2.x)
5900           };
5901         };
5902         const intersection$1 = (pt1, v1, pt2, v22) => {
5903           if (v1.x === 0) return verticalIntersection2(pt2, v22, pt1.x);
5904           if (v22.x === 0) return verticalIntersection2(pt1, v1, pt2.x);
5905           if (v1.y === 0) return horizontalIntersection2(pt2, v22, pt1.y);
5906           if (v22.y === 0) return horizontalIntersection2(pt1, v1, pt2.y);
5907           const kross = crossProduct2(v1, v22);
5908           if (kross == 0) return null;
5909           const ve3 = {
5910             x: pt2.x - pt1.x,
5911             y: pt2.y - pt1.y
5912           };
5913           const d1 = crossProduct2(ve3, v1) / kross;
5914           const d2 = crossProduct2(ve3, v22) / kross;
5915           const x12 = pt1.x + d2 * v1.x, x22 = pt2.x + d1 * v22.x;
5916           const y12 = pt1.y + d2 * v1.y, y22 = pt2.y + d1 * v22.y;
5917           const x3 = (x12 + x22) / 2;
5918           const y3 = (y12 + y22) / 2;
5919           return {
5920             x: x3,
5921             y: y3
5922           };
5923         };
5924         class SweepEvent2 {
5925           // for ordering sweep events in the sweep event queue
5926           static compare(a2, b3) {
5927             const ptCmp = SweepEvent2.comparePoints(a2.point, b3.point);
5928             if (ptCmp !== 0) return ptCmp;
5929             if (a2.point !== b3.point) a2.link(b3);
5930             if (a2.isLeft !== b3.isLeft) return a2.isLeft ? 1 : -1;
5931             return Segment2.compare(a2.segment, b3.segment);
5932           }
5933           // for ordering points in sweep line order
5934           static comparePoints(aPt, bPt) {
5935             if (aPt.x < bPt.x) return -1;
5936             if (aPt.x > bPt.x) return 1;
5937             if (aPt.y < bPt.y) return -1;
5938             if (aPt.y > bPt.y) return 1;
5939             return 0;
5940           }
5941           // Warning: 'point' input will be modified and re-used (for performance)
5942           constructor(point, isLeft) {
5943             if (point.events === void 0) point.events = [this];
5944             else point.events.push(this);
5945             this.point = point;
5946             this.isLeft = isLeft;
5947           }
5948           link(other) {
5949             if (other.point === this.point) {
5950               throw new Error("Tried to link already linked events");
5951             }
5952             const otherEvents = other.point.events;
5953             for (let i3 = 0, iMax = otherEvents.length; i3 < iMax; i3++) {
5954               const evt = otherEvents[i3];
5955               this.point.events.push(evt);
5956               evt.point = this.point;
5957             }
5958             this.checkForConsuming();
5959           }
5960           /* Do a pass over our linked events and check to see if any pair
5961            * of segments match, and should be consumed. */
5962           checkForConsuming() {
5963             const numEvents = this.point.events.length;
5964             for (let i3 = 0; i3 < numEvents; i3++) {
5965               const evt1 = this.point.events[i3];
5966               if (evt1.segment.consumedBy !== void 0) continue;
5967               for (let j3 = i3 + 1; j3 < numEvents; j3++) {
5968                 const evt2 = this.point.events[j3];
5969                 if (evt2.consumedBy !== void 0) continue;
5970                 if (evt1.otherSE.point.events !== evt2.otherSE.point.events) continue;
5971                 evt1.segment.consume(evt2.segment);
5972               }
5973             }
5974           }
5975           getAvailableLinkedEvents() {
5976             const events = [];
5977             for (let i3 = 0, iMax = this.point.events.length; i3 < iMax; i3++) {
5978               const evt = this.point.events[i3];
5979               if (evt !== this && !evt.segment.ringOut && evt.segment.isInResult()) {
5980                 events.push(evt);
5981               }
5982             }
5983             return events;
5984           }
5985           /**
5986            * Returns a comparator function for sorting linked events that will
5987            * favor the event that will give us the smallest left-side angle.
5988            * All ring construction starts as low as possible heading to the right,
5989            * so by always turning left as sharp as possible we'll get polygons
5990            * without uncessary loops & holes.
5991            *
5992            * The comparator function has a compute cache such that it avoids
5993            * re-computing already-computed values.
5994            */
5995           getLeftmostComparator(baseEvent) {
5996             const cache = /* @__PURE__ */ new Map();
5997             const fillCache = (linkedEvent) => {
5998               const nextEvent = linkedEvent.otherSE;
5999               cache.set(linkedEvent, {
6000                 sine: sineOfAngle2(this.point, baseEvent.point, nextEvent.point),
6001                 cosine: cosineOfAngle2(this.point, baseEvent.point, nextEvent.point)
6002               });
6003             };
6004             return (a2, b3) => {
6005               if (!cache.has(a2)) fillCache(a2);
6006               if (!cache.has(b3)) fillCache(b3);
6007               const {
6008                 sine: asine,
6009                 cosine: acosine
6010               } = cache.get(a2);
6011               const {
6012                 sine: bsine,
6013                 cosine: bcosine
6014               } = cache.get(b3);
6015               if (asine >= 0 && bsine >= 0) {
6016                 if (acosine < bcosine) return 1;
6017                 if (acosine > bcosine) return -1;
6018                 return 0;
6019               }
6020               if (asine < 0 && bsine < 0) {
6021                 if (acosine < bcosine) return -1;
6022                 if (acosine > bcosine) return 1;
6023                 return 0;
6024               }
6025               if (bsine < asine) return -1;
6026               if (bsine > asine) return 1;
6027               return 0;
6028             };
6029           }
6030         }
6031         let segmentId2 = 0;
6032         class Segment2 {
6033           /* This compare() function is for ordering segments in the sweep
6034            * line tree, and does so according to the following criteria:
6035            *
6036            * Consider the vertical line that lies an infinestimal step to the
6037            * right of the right-more of the two left endpoints of the input
6038            * segments. Imagine slowly moving a point up from negative infinity
6039            * in the increasing y direction. Which of the two segments will that
6040            * point intersect first? That segment comes 'before' the other one.
6041            *
6042            * If neither segment would be intersected by such a line, (if one
6043            * or more of the segments are vertical) then the line to be considered
6044            * is directly on the right-more of the two left inputs.
6045            */
6046           static compare(a2, b3) {
6047             const alx = a2.leftSE.point.x;
6048             const blx = b3.leftSE.point.x;
6049             const arx = a2.rightSE.point.x;
6050             const brx = b3.rightSE.point.x;
6051             if (brx < alx) return 1;
6052             if (arx < blx) return -1;
6053             const aly = a2.leftSE.point.y;
6054             const bly = b3.leftSE.point.y;
6055             const ary = a2.rightSE.point.y;
6056             const bry = b3.rightSE.point.y;
6057             if (alx < blx) {
6058               if (bly < aly && bly < ary) return 1;
6059               if (bly > aly && bly > ary) return -1;
6060               const aCmpBLeft = a2.comparePoint(b3.leftSE.point);
6061               if (aCmpBLeft < 0) return 1;
6062               if (aCmpBLeft > 0) return -1;
6063               const bCmpARight = b3.comparePoint(a2.rightSE.point);
6064               if (bCmpARight !== 0) return bCmpARight;
6065               return -1;
6066             }
6067             if (alx > blx) {
6068               if (aly < bly && aly < bry) return -1;
6069               if (aly > bly && aly > bry) return 1;
6070               const bCmpALeft = b3.comparePoint(a2.leftSE.point);
6071               if (bCmpALeft !== 0) return bCmpALeft;
6072               const aCmpBRight = a2.comparePoint(b3.rightSE.point);
6073               if (aCmpBRight < 0) return 1;
6074               if (aCmpBRight > 0) return -1;
6075               return 1;
6076             }
6077             if (aly < bly) return -1;
6078             if (aly > bly) return 1;
6079             if (arx < brx) {
6080               const bCmpARight = b3.comparePoint(a2.rightSE.point);
6081               if (bCmpARight !== 0) return bCmpARight;
6082             }
6083             if (arx > brx) {
6084               const aCmpBRight = a2.comparePoint(b3.rightSE.point);
6085               if (aCmpBRight < 0) return 1;
6086               if (aCmpBRight > 0) return -1;
6087             }
6088             if (arx !== brx) {
6089               const ay = ary - aly;
6090               const ax = arx - alx;
6091               const by = bry - bly;
6092               const bx = brx - blx;
6093               if (ay > ax && by < bx) return 1;
6094               if (ay < ax && by > bx) return -1;
6095             }
6096             if (arx > brx) return 1;
6097             if (arx < brx) return -1;
6098             if (ary < bry) return -1;
6099             if (ary > bry) return 1;
6100             if (a2.id < b3.id) return -1;
6101             if (a2.id > b3.id) return 1;
6102             return 0;
6103           }
6104           /* Warning: a reference to ringWindings input will be stored,
6105            *  and possibly will be later modified */
6106           constructor(leftSE, rightSE, rings, windings) {
6107             this.id = ++segmentId2;
6108             this.leftSE = leftSE;
6109             leftSE.segment = this;
6110             leftSE.otherSE = rightSE;
6111             this.rightSE = rightSE;
6112             rightSE.segment = this;
6113             rightSE.otherSE = leftSE;
6114             this.rings = rings;
6115             this.windings = windings;
6116           }
6117           static fromRing(pt1, pt2, ring) {
6118             let leftPt, rightPt, winding;
6119             const cmpPts = SweepEvent2.comparePoints(pt1, pt2);
6120             if (cmpPts < 0) {
6121               leftPt = pt1;
6122               rightPt = pt2;
6123               winding = 1;
6124             } else if (cmpPts > 0) {
6125               leftPt = pt2;
6126               rightPt = pt1;
6127               winding = -1;
6128             } else throw new Error("Tried to create degenerate segment at [".concat(pt1.x, ", ").concat(pt1.y, "]"));
6129             const leftSE = new SweepEvent2(leftPt, true);
6130             const rightSE = new SweepEvent2(rightPt, false);
6131             return new Segment2(leftSE, rightSE, [ring], [winding]);
6132           }
6133           /* When a segment is split, the rightSE is replaced with a new sweep event */
6134           replaceRightSE(newRightSE) {
6135             this.rightSE = newRightSE;
6136             this.rightSE.segment = this;
6137             this.rightSE.otherSE = this.leftSE;
6138             this.leftSE.otherSE = this.rightSE;
6139           }
6140           bbox() {
6141             const y12 = this.leftSE.point.y;
6142             const y22 = this.rightSE.point.y;
6143             return {
6144               ll: {
6145                 x: this.leftSE.point.x,
6146                 y: y12 < y22 ? y12 : y22
6147               },
6148               ur: {
6149                 x: this.rightSE.point.x,
6150                 y: y12 > y22 ? y12 : y22
6151               }
6152             };
6153           }
6154           /* A vector from the left point to the right */
6155           vector() {
6156             return {
6157               x: this.rightSE.point.x - this.leftSE.point.x,
6158               y: this.rightSE.point.y - this.leftSE.point.y
6159             };
6160           }
6161           isAnEndpoint(pt2) {
6162             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;
6163           }
6164           /* Compare this segment with a point.
6165            *
6166            * A point P is considered to be colinear to a segment if there
6167            * exists a distance D such that if we travel along the segment
6168            * from one * endpoint towards the other a distance D, we find
6169            * ourselves at point P.
6170            *
6171            * Return value indicates:
6172            *
6173            *   1: point lies above the segment (to the left of vertical)
6174            *   0: point is colinear to segment
6175            *  -1: point lies below the segment (to the right of vertical)
6176            */
6177           comparePoint(point) {
6178             if (this.isAnEndpoint(point)) return 0;
6179             const lPt = this.leftSE.point;
6180             const rPt = this.rightSE.point;
6181             const v3 = this.vector();
6182             if (lPt.x === rPt.x) {
6183               if (point.x === lPt.x) return 0;
6184               return point.x < lPt.x ? 1 : -1;
6185             }
6186             const yDist = (point.y - lPt.y) / v3.y;
6187             const xFromYDist = lPt.x + yDist * v3.x;
6188             if (point.x === xFromYDist) return 0;
6189             const xDist = (point.x - lPt.x) / v3.x;
6190             const yFromXDist = lPt.y + xDist * v3.y;
6191             if (point.y === yFromXDist) return 0;
6192             return point.y < yFromXDist ? -1 : 1;
6193           }
6194           /**
6195            * Given another segment, returns the first non-trivial intersection
6196            * between the two segments (in terms of sweep line ordering), if it exists.
6197            *
6198            * A 'non-trivial' intersection is one that will cause one or both of the
6199            * segments to be split(). As such, 'trivial' vs. 'non-trivial' intersection:
6200            *
6201            *   * endpoint of segA with endpoint of segB --> trivial
6202            *   * endpoint of segA with point along segB --> non-trivial
6203            *   * endpoint of segB with point along segA --> non-trivial
6204            *   * point along segA with point along segB --> non-trivial
6205            *
6206            * If no non-trivial intersection exists, return null
6207            * Else, return null.
6208            */
6209           getIntersection(other) {
6210             const tBbox = this.bbox();
6211             const oBbox = other.bbox();
6212             const bboxOverlap = getBboxOverlap2(tBbox, oBbox);
6213             if (bboxOverlap === null) return null;
6214             const tlp = this.leftSE.point;
6215             const trp = this.rightSE.point;
6216             const olp = other.leftSE.point;
6217             const orp = other.rightSE.point;
6218             const touchesOtherLSE = isInBbox2(tBbox, olp) && this.comparePoint(olp) === 0;
6219             const touchesThisLSE = isInBbox2(oBbox, tlp) && other.comparePoint(tlp) === 0;
6220             const touchesOtherRSE = isInBbox2(tBbox, orp) && this.comparePoint(orp) === 0;
6221             const touchesThisRSE = isInBbox2(oBbox, trp) && other.comparePoint(trp) === 0;
6222             if (touchesThisLSE && touchesOtherLSE) {
6223               if (touchesThisRSE && !touchesOtherRSE) return trp;
6224               if (!touchesThisRSE && touchesOtherRSE) return orp;
6225               return null;
6226             }
6227             if (touchesThisLSE) {
6228               if (touchesOtherRSE) {
6229                 if (tlp.x === orp.x && tlp.y === orp.y) return null;
6230               }
6231               return tlp;
6232             }
6233             if (touchesOtherLSE) {
6234               if (touchesThisRSE) {
6235                 if (trp.x === olp.x && trp.y === olp.y) return null;
6236               }
6237               return olp;
6238             }
6239             if (touchesThisRSE && touchesOtherRSE) return null;
6240             if (touchesThisRSE) return trp;
6241             if (touchesOtherRSE) return orp;
6242             const pt2 = intersection$1(tlp, this.vector(), olp, other.vector());
6243             if (pt2 === null) return null;
6244             if (!isInBbox2(bboxOverlap, pt2)) return null;
6245             return rounder.round(pt2.x, pt2.y);
6246           }
6247           /**
6248            * Split the given segment into multiple segments on the given points.
6249            *  * Each existing segment will retain its leftSE and a new rightSE will be
6250            *    generated for it.
6251            *  * A new segment will be generated which will adopt the original segment's
6252            *    rightSE, and a new leftSE will be generated for it.
6253            *  * If there are more than two points given to split on, new segments
6254            *    in the middle will be generated with new leftSE and rightSE's.
6255            *  * An array of the newly generated SweepEvents will be returned.
6256            *
6257            * Warning: input array of points is modified
6258            */
6259           split(point) {
6260             const newEvents = [];
6261             const alreadyLinked = point.events !== void 0;
6262             const newLeftSE = new SweepEvent2(point, true);
6263             const newRightSE = new SweepEvent2(point, false);
6264             const oldRightSE = this.rightSE;
6265             this.replaceRightSE(newRightSE);
6266             newEvents.push(newRightSE);
6267             newEvents.push(newLeftSE);
6268             const newSeg = new Segment2(newLeftSE, oldRightSE, this.rings.slice(), this.windings.slice());
6269             if (SweepEvent2.comparePoints(newSeg.leftSE.point, newSeg.rightSE.point) > 0) {
6270               newSeg.swapEvents();
6271             }
6272             if (SweepEvent2.comparePoints(this.leftSE.point, this.rightSE.point) > 0) {
6273               this.swapEvents();
6274             }
6275             if (alreadyLinked) {
6276               newLeftSE.checkForConsuming();
6277               newRightSE.checkForConsuming();
6278             }
6279             return newEvents;
6280           }
6281           /* Swap which event is left and right */
6282           swapEvents() {
6283             const tmpEvt = this.rightSE;
6284             this.rightSE = this.leftSE;
6285             this.leftSE = tmpEvt;
6286             this.leftSE.isLeft = true;
6287             this.rightSE.isLeft = false;
6288             for (let i3 = 0, iMax = this.windings.length; i3 < iMax; i3++) {
6289               this.windings[i3] *= -1;
6290             }
6291           }
6292           /* Consume another segment. We take their rings under our wing
6293            * and mark them as consumed. Use for perfectly overlapping segments */
6294           consume(other) {
6295             let consumer = this;
6296             let consumee = other;
6297             while (consumer.consumedBy) consumer = consumer.consumedBy;
6298             while (consumee.consumedBy) consumee = consumee.consumedBy;
6299             const cmp2 = Segment2.compare(consumer, consumee);
6300             if (cmp2 === 0) return;
6301             if (cmp2 > 0) {
6302               const tmp = consumer;
6303               consumer = consumee;
6304               consumee = tmp;
6305             }
6306             if (consumer.prev === consumee) {
6307               const tmp = consumer;
6308               consumer = consumee;
6309               consumee = tmp;
6310             }
6311             for (let i3 = 0, iMax = consumee.rings.length; i3 < iMax; i3++) {
6312               const ring = consumee.rings[i3];
6313               const winding = consumee.windings[i3];
6314               const index2 = consumer.rings.indexOf(ring);
6315               if (index2 === -1) {
6316                 consumer.rings.push(ring);
6317                 consumer.windings.push(winding);
6318               } else consumer.windings[index2] += winding;
6319             }
6320             consumee.rings = null;
6321             consumee.windings = null;
6322             consumee.consumedBy = consumer;
6323             consumee.leftSE.consumedBy = consumer.leftSE;
6324             consumee.rightSE.consumedBy = consumer.rightSE;
6325           }
6326           /* The first segment previous segment chain that is in the result */
6327           prevInResult() {
6328             if (this._prevInResult !== void 0) return this._prevInResult;
6329             if (!this.prev) this._prevInResult = null;
6330             else if (this.prev.isInResult()) this._prevInResult = this.prev;
6331             else this._prevInResult = this.prev.prevInResult();
6332             return this._prevInResult;
6333           }
6334           beforeState() {
6335             if (this._beforeState !== void 0) return this._beforeState;
6336             if (!this.prev) this._beforeState = {
6337               rings: [],
6338               windings: [],
6339               multiPolys: []
6340             };
6341             else {
6342               const seg = this.prev.consumedBy || this.prev;
6343               this._beforeState = seg.afterState();
6344             }
6345             return this._beforeState;
6346           }
6347           afterState() {
6348             if (this._afterState !== void 0) return this._afterState;
6349             const beforeState = this.beforeState();
6350             this._afterState = {
6351               rings: beforeState.rings.slice(0),
6352               windings: beforeState.windings.slice(0),
6353               multiPolys: []
6354             };
6355             const ringsAfter = this._afterState.rings;
6356             const windingsAfter = this._afterState.windings;
6357             const mpsAfter = this._afterState.multiPolys;
6358             for (let i3 = 0, iMax = this.rings.length; i3 < iMax; i3++) {
6359               const ring = this.rings[i3];
6360               const winding = this.windings[i3];
6361               const index2 = ringsAfter.indexOf(ring);
6362               if (index2 === -1) {
6363                 ringsAfter.push(ring);
6364                 windingsAfter.push(winding);
6365               } else windingsAfter[index2] += winding;
6366             }
6367             const polysAfter = [];
6368             const polysExclude = [];
6369             for (let i3 = 0, iMax = ringsAfter.length; i3 < iMax; i3++) {
6370               if (windingsAfter[i3] === 0) continue;
6371               const ring = ringsAfter[i3];
6372               const poly = ring.poly;
6373               if (polysExclude.indexOf(poly) !== -1) continue;
6374               if (ring.isExterior) polysAfter.push(poly);
6375               else {
6376                 if (polysExclude.indexOf(poly) === -1) polysExclude.push(poly);
6377                 const index2 = polysAfter.indexOf(ring.poly);
6378                 if (index2 !== -1) polysAfter.splice(index2, 1);
6379               }
6380             }
6381             for (let i3 = 0, iMax = polysAfter.length; i3 < iMax; i3++) {
6382               const mp = polysAfter[i3].multiPoly;
6383               if (mpsAfter.indexOf(mp) === -1) mpsAfter.push(mp);
6384             }
6385             return this._afterState;
6386           }
6387           /* Is this segment part of the final result? */
6388           isInResult() {
6389             if (this.consumedBy) return false;
6390             if (this._isInResult !== void 0) return this._isInResult;
6391             const mpsBefore = this.beforeState().multiPolys;
6392             const mpsAfter = this.afterState().multiPolys;
6393             switch (operation2.type) {
6394               case "union": {
6395                 const noBefores = mpsBefore.length === 0;
6396                 const noAfters = mpsAfter.length === 0;
6397                 this._isInResult = noBefores !== noAfters;
6398                 break;
6399               }
6400               case "intersection": {
6401                 let least;
6402                 let most;
6403                 if (mpsBefore.length < mpsAfter.length) {
6404                   least = mpsBefore.length;
6405                   most = mpsAfter.length;
6406                 } else {
6407                   least = mpsAfter.length;
6408                   most = mpsBefore.length;
6409                 }
6410                 this._isInResult = most === operation2.numMultiPolys && least < most;
6411                 break;
6412               }
6413               case "xor": {
6414                 const diff = Math.abs(mpsBefore.length - mpsAfter.length);
6415                 this._isInResult = diff % 2 === 1;
6416                 break;
6417               }
6418               case "difference": {
6419                 const isJustSubject = (mps) => mps.length === 1 && mps[0].isSubject;
6420                 this._isInResult = isJustSubject(mpsBefore) !== isJustSubject(mpsAfter);
6421                 break;
6422               }
6423               default:
6424                 throw new Error("Unrecognized operation type found ".concat(operation2.type));
6425             }
6426             return this._isInResult;
6427           }
6428         }
6429         class RingIn2 {
6430           constructor(geomRing, poly, isExterior) {
6431             if (!Array.isArray(geomRing) || geomRing.length === 0) {
6432               throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
6433             }
6434             this.poly = poly;
6435             this.isExterior = isExterior;
6436             this.segments = [];
6437             if (typeof geomRing[0][0] !== "number" || typeof geomRing[0][1] !== "number") {
6438               throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
6439             }
6440             const firstPoint = rounder.round(geomRing[0][0], geomRing[0][1]);
6441             this.bbox = {
6442               ll: {
6443                 x: firstPoint.x,
6444                 y: firstPoint.y
6445               },
6446               ur: {
6447                 x: firstPoint.x,
6448                 y: firstPoint.y
6449               }
6450             };
6451             let prevPoint = firstPoint;
6452             for (let i3 = 1, iMax = geomRing.length; i3 < iMax; i3++) {
6453               if (typeof geomRing[i3][0] !== "number" || typeof geomRing[i3][1] !== "number") {
6454                 throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
6455               }
6456               let point = rounder.round(geomRing[i3][0], geomRing[i3][1]);
6457               if (point.x === prevPoint.x && point.y === prevPoint.y) continue;
6458               this.segments.push(Segment2.fromRing(prevPoint, point, this));
6459               if (point.x < this.bbox.ll.x) this.bbox.ll.x = point.x;
6460               if (point.y < this.bbox.ll.y) this.bbox.ll.y = point.y;
6461               if (point.x > this.bbox.ur.x) this.bbox.ur.x = point.x;
6462               if (point.y > this.bbox.ur.y) this.bbox.ur.y = point.y;
6463               prevPoint = point;
6464             }
6465             if (firstPoint.x !== prevPoint.x || firstPoint.y !== prevPoint.y) {
6466               this.segments.push(Segment2.fromRing(prevPoint, firstPoint, this));
6467             }
6468           }
6469           getSweepEvents() {
6470             const sweepEvents = [];
6471             for (let i3 = 0, iMax = this.segments.length; i3 < iMax; i3++) {
6472               const segment = this.segments[i3];
6473               sweepEvents.push(segment.leftSE);
6474               sweepEvents.push(segment.rightSE);
6475             }
6476             return sweepEvents;
6477           }
6478         }
6479         class PolyIn2 {
6480           constructor(geomPoly, multiPoly) {
6481             if (!Array.isArray(geomPoly)) {
6482               throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
6483             }
6484             this.exteriorRing = new RingIn2(geomPoly[0], this, true);
6485             this.bbox = {
6486               ll: {
6487                 x: this.exteriorRing.bbox.ll.x,
6488                 y: this.exteriorRing.bbox.ll.y
6489               },
6490               ur: {
6491                 x: this.exteriorRing.bbox.ur.x,
6492                 y: this.exteriorRing.bbox.ur.y
6493               }
6494             };
6495             this.interiorRings = [];
6496             for (let i3 = 1, iMax = geomPoly.length; i3 < iMax; i3++) {
6497               const ring = new RingIn2(geomPoly[i3], this, false);
6498               if (ring.bbox.ll.x < this.bbox.ll.x) this.bbox.ll.x = ring.bbox.ll.x;
6499               if (ring.bbox.ll.y < this.bbox.ll.y) this.bbox.ll.y = ring.bbox.ll.y;
6500               if (ring.bbox.ur.x > this.bbox.ur.x) this.bbox.ur.x = ring.bbox.ur.x;
6501               if (ring.bbox.ur.y > this.bbox.ur.y) this.bbox.ur.y = ring.bbox.ur.y;
6502               this.interiorRings.push(ring);
6503             }
6504             this.multiPoly = multiPoly;
6505           }
6506           getSweepEvents() {
6507             const sweepEvents = this.exteriorRing.getSweepEvents();
6508             for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
6509               const ringSweepEvents = this.interiorRings[i3].getSweepEvents();
6510               for (let j3 = 0, jMax = ringSweepEvents.length; j3 < jMax; j3++) {
6511                 sweepEvents.push(ringSweepEvents[j3]);
6512               }
6513             }
6514             return sweepEvents;
6515           }
6516         }
6517         class MultiPolyIn2 {
6518           constructor(geom, isSubject) {
6519             if (!Array.isArray(geom)) {
6520               throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
6521             }
6522             try {
6523               if (typeof geom[0][0][0] === "number") geom = [geom];
6524             } catch (ex) {
6525             }
6526             this.polys = [];
6527             this.bbox = {
6528               ll: {
6529                 x: Number.POSITIVE_INFINITY,
6530                 y: Number.POSITIVE_INFINITY
6531               },
6532               ur: {
6533                 x: Number.NEGATIVE_INFINITY,
6534                 y: Number.NEGATIVE_INFINITY
6535               }
6536             };
6537             for (let i3 = 0, iMax = geom.length; i3 < iMax; i3++) {
6538               const poly = new PolyIn2(geom[i3], this);
6539               if (poly.bbox.ll.x < this.bbox.ll.x) this.bbox.ll.x = poly.bbox.ll.x;
6540               if (poly.bbox.ll.y < this.bbox.ll.y) this.bbox.ll.y = poly.bbox.ll.y;
6541               if (poly.bbox.ur.x > this.bbox.ur.x) this.bbox.ur.x = poly.bbox.ur.x;
6542               if (poly.bbox.ur.y > this.bbox.ur.y) this.bbox.ur.y = poly.bbox.ur.y;
6543               this.polys.push(poly);
6544             }
6545             this.isSubject = isSubject;
6546           }
6547           getSweepEvents() {
6548             const sweepEvents = [];
6549             for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
6550               const polySweepEvents = this.polys[i3].getSweepEvents();
6551               for (let j3 = 0, jMax = polySweepEvents.length; j3 < jMax; j3++) {
6552                 sweepEvents.push(polySweepEvents[j3]);
6553               }
6554             }
6555             return sweepEvents;
6556           }
6557         }
6558         class RingOut2 {
6559           /* Given the segments from the sweep line pass, compute & return a series
6560            * of closed rings from all the segments marked to be part of the result */
6561           static factory(allSegments) {
6562             const ringsOut = [];
6563             for (let i3 = 0, iMax = allSegments.length; i3 < iMax; i3++) {
6564               const segment = allSegments[i3];
6565               if (!segment.isInResult() || segment.ringOut) continue;
6566               let prevEvent = null;
6567               let event = segment.leftSE;
6568               let nextEvent = segment.rightSE;
6569               const events = [event];
6570               const startingPoint = event.point;
6571               const intersectionLEs = [];
6572               while (true) {
6573                 prevEvent = event;
6574                 event = nextEvent;
6575                 events.push(event);
6576                 if (event.point === startingPoint) break;
6577                 while (true) {
6578                   const availableLEs = event.getAvailableLinkedEvents();
6579                   if (availableLEs.length === 0) {
6580                     const firstPt = events[0].point;
6581                     const lastPt = events[events.length - 1].point;
6582                     throw new Error("Unable to complete output ring starting at [".concat(firstPt.x, ",") + " ".concat(firstPt.y, "]. Last matching segment found ends at") + " [".concat(lastPt.x, ", ").concat(lastPt.y, "]."));
6583                   }
6584                   if (availableLEs.length === 1) {
6585                     nextEvent = availableLEs[0].otherSE;
6586                     break;
6587                   }
6588                   let indexLE = null;
6589                   for (let j3 = 0, jMax = intersectionLEs.length; j3 < jMax; j3++) {
6590                     if (intersectionLEs[j3].point === event.point) {
6591                       indexLE = j3;
6592                       break;
6593                     }
6594                   }
6595                   if (indexLE !== null) {
6596                     const intersectionLE = intersectionLEs.splice(indexLE)[0];
6597                     const ringEvents = events.splice(intersectionLE.index);
6598                     ringEvents.unshift(ringEvents[0].otherSE);
6599                     ringsOut.push(new RingOut2(ringEvents.reverse()));
6600                     continue;
6601                   }
6602                   intersectionLEs.push({
6603                     index: events.length,
6604                     point: event.point
6605                   });
6606                   const comparator = event.getLeftmostComparator(prevEvent);
6607                   nextEvent = availableLEs.sort(comparator)[0].otherSE;
6608                   break;
6609                 }
6610               }
6611               ringsOut.push(new RingOut2(events));
6612             }
6613             return ringsOut;
6614           }
6615           constructor(events) {
6616             this.events = events;
6617             for (let i3 = 0, iMax = events.length; i3 < iMax; i3++) {
6618               events[i3].segment.ringOut = this;
6619             }
6620             this.poly = null;
6621           }
6622           getGeom() {
6623             let prevPt = this.events[0].point;
6624             const points = [prevPt];
6625             for (let i3 = 1, iMax = this.events.length - 1; i3 < iMax; i3++) {
6626               const pt3 = this.events[i3].point;
6627               const nextPt2 = this.events[i3 + 1].point;
6628               if (compareVectorAngles(pt3, prevPt, nextPt2) === 0) continue;
6629               points.push(pt3);
6630               prevPt = pt3;
6631             }
6632             if (points.length === 1) return null;
6633             const pt2 = points[0];
6634             const nextPt = points[1];
6635             if (compareVectorAngles(pt2, prevPt, nextPt) === 0) points.shift();
6636             points.push(points[0]);
6637             const step = this.isExteriorRing() ? 1 : -1;
6638             const iStart = this.isExteriorRing() ? 0 : points.length - 1;
6639             const iEnd = this.isExteriorRing() ? points.length : -1;
6640             const orderedPoints = [];
6641             for (let i3 = iStart; i3 != iEnd; i3 += step) orderedPoints.push([points[i3].x, points[i3].y]);
6642             return orderedPoints;
6643           }
6644           isExteriorRing() {
6645             if (this._isExteriorRing === void 0) {
6646               const enclosing = this.enclosingRing();
6647               this._isExteriorRing = enclosing ? !enclosing.isExteriorRing() : true;
6648             }
6649             return this._isExteriorRing;
6650           }
6651           enclosingRing() {
6652             if (this._enclosingRing === void 0) {
6653               this._enclosingRing = this._calcEnclosingRing();
6654             }
6655             return this._enclosingRing;
6656           }
6657           /* Returns the ring that encloses this one, if any */
6658           _calcEnclosingRing() {
6659             let leftMostEvt = this.events[0];
6660             for (let i3 = 1, iMax = this.events.length; i3 < iMax; i3++) {
6661               const evt = this.events[i3];
6662               if (SweepEvent2.compare(leftMostEvt, evt) > 0) leftMostEvt = evt;
6663             }
6664             let prevSeg = leftMostEvt.segment.prevInResult();
6665             let prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
6666             while (true) {
6667               if (!prevSeg) return null;
6668               if (!prevPrevSeg) return prevSeg.ringOut;
6669               if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
6670                 if (prevPrevSeg.ringOut.enclosingRing() !== prevSeg.ringOut) {
6671                   return prevSeg.ringOut;
6672                 } else return prevSeg.ringOut.enclosingRing();
6673               }
6674               prevSeg = prevPrevSeg.prevInResult();
6675               prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
6676             }
6677           }
6678         }
6679         class PolyOut2 {
6680           constructor(exteriorRing) {
6681             this.exteriorRing = exteriorRing;
6682             exteriorRing.poly = this;
6683             this.interiorRings = [];
6684           }
6685           addInterior(ring) {
6686             this.interiorRings.push(ring);
6687             ring.poly = this;
6688           }
6689           getGeom() {
6690             const geom = [this.exteriorRing.getGeom()];
6691             if (geom[0] === null) return null;
6692             for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
6693               const ringGeom = this.interiorRings[i3].getGeom();
6694               if (ringGeom === null) continue;
6695               geom.push(ringGeom);
6696             }
6697             return geom;
6698           }
6699         }
6700         class MultiPolyOut2 {
6701           constructor(rings) {
6702             this.rings = rings;
6703             this.polys = this._composePolys(rings);
6704           }
6705           getGeom() {
6706             const geom = [];
6707             for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
6708               const polyGeom = this.polys[i3].getGeom();
6709               if (polyGeom === null) continue;
6710               geom.push(polyGeom);
6711             }
6712             return geom;
6713           }
6714           _composePolys(rings) {
6715             const polys = [];
6716             for (let i3 = 0, iMax = rings.length; i3 < iMax; i3++) {
6717               const ring = rings[i3];
6718               if (ring.poly) continue;
6719               if (ring.isExteriorRing()) polys.push(new PolyOut2(ring));
6720               else {
6721                 const enclosingRing = ring.enclosingRing();
6722                 if (!enclosingRing.poly) polys.push(new PolyOut2(enclosingRing));
6723                 enclosingRing.poly.addInterior(ring);
6724               }
6725             }
6726             return polys;
6727           }
6728         }
6729         class SweepLine2 {
6730           constructor(queue) {
6731             let comparator = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Segment2.compare;
6732             this.queue = queue;
6733             this.tree = new Tree(comparator);
6734             this.segments = [];
6735           }
6736           process(event) {
6737             const segment = event.segment;
6738             const newEvents = [];
6739             if (event.consumedBy) {
6740               if (event.isLeft) this.queue.remove(event.otherSE);
6741               else this.tree.remove(segment);
6742               return newEvents;
6743             }
6744             const node = event.isLeft ? this.tree.add(segment) : this.tree.find(segment);
6745             if (!node) throw new Error("Unable to find segment #".concat(segment.id, " ") + "[".concat(segment.leftSE.point.x, ", ").concat(segment.leftSE.point.y, "] -> ") + "[".concat(segment.rightSE.point.x, ", ").concat(segment.rightSE.point.y, "] ") + "in SweepLine tree.");
6746             let prevNode = node;
6747             let nextNode = node;
6748             let prevSeg = void 0;
6749             let nextSeg = void 0;
6750             while (prevSeg === void 0) {
6751               prevNode = this.tree.prev(prevNode);
6752               if (prevNode === null) prevSeg = null;
6753               else if (prevNode.key.consumedBy === void 0) prevSeg = prevNode.key;
6754             }
6755             while (nextSeg === void 0) {
6756               nextNode = this.tree.next(nextNode);
6757               if (nextNode === null) nextSeg = null;
6758               else if (nextNode.key.consumedBy === void 0) nextSeg = nextNode.key;
6759             }
6760             if (event.isLeft) {
6761               let prevMySplitter = null;
6762               if (prevSeg) {
6763                 const prevInter = prevSeg.getIntersection(segment);
6764                 if (prevInter !== null) {
6765                   if (!segment.isAnEndpoint(prevInter)) prevMySplitter = prevInter;
6766                   if (!prevSeg.isAnEndpoint(prevInter)) {
6767                     const newEventsFromSplit = this._splitSafely(prevSeg, prevInter);
6768                     for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
6769                       newEvents.push(newEventsFromSplit[i3]);
6770                     }
6771                   }
6772                 }
6773               }
6774               let nextMySplitter = null;
6775               if (nextSeg) {
6776                 const nextInter = nextSeg.getIntersection(segment);
6777                 if (nextInter !== null) {
6778                   if (!segment.isAnEndpoint(nextInter)) nextMySplitter = nextInter;
6779                   if (!nextSeg.isAnEndpoint(nextInter)) {
6780                     const newEventsFromSplit = this._splitSafely(nextSeg, nextInter);
6781                     for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
6782                       newEvents.push(newEventsFromSplit[i3]);
6783                     }
6784                   }
6785                 }
6786               }
6787               if (prevMySplitter !== null || nextMySplitter !== null) {
6788                 let mySplitter = null;
6789                 if (prevMySplitter === null) mySplitter = nextMySplitter;
6790                 else if (nextMySplitter === null) mySplitter = prevMySplitter;
6791                 else {
6792                   const cmpSplitters = SweepEvent2.comparePoints(prevMySplitter, nextMySplitter);
6793                   mySplitter = cmpSplitters <= 0 ? prevMySplitter : nextMySplitter;
6794                 }
6795                 this.queue.remove(segment.rightSE);
6796                 newEvents.push(segment.rightSE);
6797                 const newEventsFromSplit = segment.split(mySplitter);
6798                 for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
6799                   newEvents.push(newEventsFromSplit[i3]);
6800                 }
6801               }
6802               if (newEvents.length > 0) {
6803                 this.tree.remove(segment);
6804                 newEvents.push(event);
6805               } else {
6806                 this.segments.push(segment);
6807                 segment.prev = prevSeg;
6808               }
6809             } else {
6810               if (prevSeg && nextSeg) {
6811                 const inter = prevSeg.getIntersection(nextSeg);
6812                 if (inter !== null) {
6813                   if (!prevSeg.isAnEndpoint(inter)) {
6814                     const newEventsFromSplit = this._splitSafely(prevSeg, inter);
6815                     for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
6816                       newEvents.push(newEventsFromSplit[i3]);
6817                     }
6818                   }
6819                   if (!nextSeg.isAnEndpoint(inter)) {
6820                     const newEventsFromSplit = this._splitSafely(nextSeg, inter);
6821                     for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
6822                       newEvents.push(newEventsFromSplit[i3]);
6823                     }
6824                   }
6825                 }
6826               }
6827               this.tree.remove(segment);
6828             }
6829             return newEvents;
6830           }
6831           /* Safely split a segment that is currently in the datastructures
6832            * IE - a segment other than the one that is currently being processed. */
6833           _splitSafely(seg, pt2) {
6834             this.tree.remove(seg);
6835             const rightSE = seg.rightSE;
6836             this.queue.remove(rightSE);
6837             const newEvents = seg.split(pt2);
6838             newEvents.push(rightSE);
6839             if (seg.consumedBy === void 0) this.tree.add(seg);
6840             return newEvents;
6841           }
6842         }
6843         const POLYGON_CLIPPING_MAX_QUEUE_SIZE = typeof process !== "undefined" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6;
6844         const POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS = typeof process !== "undefined" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
6845         class Operation2 {
6846           run(type2, geom, moreGeoms) {
6847             operation2.type = type2;
6848             rounder.reset();
6849             const multipolys = [new MultiPolyIn2(geom, true)];
6850             for (let i3 = 0, iMax = moreGeoms.length; i3 < iMax; i3++) {
6851               multipolys.push(new MultiPolyIn2(moreGeoms[i3], false));
6852             }
6853             operation2.numMultiPolys = multipolys.length;
6854             if (operation2.type === "difference") {
6855               const subject = multipolys[0];
6856               let i3 = 1;
6857               while (i3 < multipolys.length) {
6858                 if (getBboxOverlap2(multipolys[i3].bbox, subject.bbox) !== null) i3++;
6859                 else multipolys.splice(i3, 1);
6860               }
6861             }
6862             if (operation2.type === "intersection") {
6863               for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
6864                 const mpA = multipolys[i3];
6865                 for (let j3 = i3 + 1, jMax = multipolys.length; j3 < jMax; j3++) {
6866                   if (getBboxOverlap2(mpA.bbox, multipolys[j3].bbox) === null) return [];
6867                 }
6868               }
6869             }
6870             const queue = new Tree(SweepEvent2.compare);
6871             for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
6872               const sweepEvents = multipolys[i3].getSweepEvents();
6873               for (let j3 = 0, jMax = sweepEvents.length; j3 < jMax; j3++) {
6874                 queue.insert(sweepEvents[j3]);
6875                 if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
6876                   throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
6877                 }
6878               }
6879             }
6880             const sweepLine = new SweepLine2(queue);
6881             let prevQueueSize = queue.size;
6882             let node = queue.pop();
6883             while (node) {
6884               const evt = node.key;
6885               if (queue.size === prevQueueSize) {
6886                 const seg = evt.segment;
6887                 throw new Error("Unable to pop() ".concat(evt.isLeft ? "left" : "right", " SweepEvent ") + "[".concat(evt.point.x, ", ").concat(evt.point.y, "] from segment #").concat(seg.id, " ") + "[".concat(seg.leftSE.point.x, ", ").concat(seg.leftSE.point.y, "] -> ") + "[".concat(seg.rightSE.point.x, ", ").concat(seg.rightSE.point.y, "] from queue."));
6888               }
6889               if (queue.size > POLYGON_CLIPPING_MAX_QUEUE_SIZE) {
6890                 throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
6891               }
6892               if (sweepLine.segments.length > POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS) {
6893                 throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
6894               }
6895               const newEvents = sweepLine.process(evt);
6896               for (let i3 = 0, iMax = newEvents.length; i3 < iMax; i3++) {
6897                 const evt2 = newEvents[i3];
6898                 if (evt2.consumedBy === void 0) queue.insert(evt2);
6899               }
6900               prevQueueSize = queue.size;
6901               node = queue.pop();
6902             }
6903             rounder.reset();
6904             const ringsOut = RingOut2.factory(sweepLine.segments);
6905             const result = new MultiPolyOut2(ringsOut);
6906             return result.getGeom();
6907           }
6908         }
6909         const operation2 = new Operation2();
6910         const union2 = function(geom) {
6911           for (var _len = arguments.length, moreGeoms = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6912             moreGeoms[_key - 1] = arguments[_key];
6913           }
6914           return operation2.run("union", geom, moreGeoms);
6915         };
6916         const intersection2 = function(geom) {
6917           for (var _len2 = arguments.length, moreGeoms = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
6918             moreGeoms[_key2 - 1] = arguments[_key2];
6919           }
6920           return operation2.run("intersection", geom, moreGeoms);
6921         };
6922         const xor = function(geom) {
6923           for (var _len3 = arguments.length, moreGeoms = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
6924             moreGeoms[_key3 - 1] = arguments[_key3];
6925           }
6926           return operation2.run("xor", geom, moreGeoms);
6927         };
6928         const difference2 = function(subjectGeom) {
6929           for (var _len4 = arguments.length, clippingGeoms = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
6930             clippingGeoms[_key4 - 1] = arguments[_key4];
6931           }
6932           return operation2.run("difference", subjectGeom, clippingGeoms);
6933         };
6934         var index = {
6935           union: union2,
6936           intersection: intersection2,
6937           xor,
6938           difference: difference2
6939         };
6940         return index;
6941       }));
6942     }
6943   });
6944
6945   // node_modules/@mapbox/sexagesimal/index.js
6946   var require_sexagesimal = __commonJS({
6947     "node_modules/@mapbox/sexagesimal/index.js"(exports2, module2) {
6948       module2.exports = element;
6949       module2.exports.pair = pair3;
6950       module2.exports.format = format2;
6951       module2.exports.formatPair = formatPair;
6952       module2.exports.coordToDMS = coordToDMS;
6953       function element(input, dims) {
6954         var result = search(input, dims);
6955         return result === null ? null : result.val;
6956       }
6957       function formatPair(input) {
6958         return format2(input.lat, "lat") + " " + format2(input.lon, "lon");
6959       }
6960       function format2(input, dim) {
6961         var dms = coordToDMS(input, dim);
6962         return dms.whole + "\xB0 " + (dms.minutes ? dms.minutes + "' " : "") + (dms.seconds ? dms.seconds + '" ' : "") + dms.dir;
6963       }
6964       function coordToDMS(input, dim) {
6965         var dirs = { lat: ["N", "S"], lon: ["E", "W"] }[dim] || "";
6966         var dir = dirs[input >= 0 ? 0 : 1];
6967         var abs3 = Math.abs(input);
6968         var whole = Math.floor(abs3);
6969         var fraction = abs3 - whole;
6970         var fractionMinutes = fraction * 60;
6971         var minutes = Math.floor(fractionMinutes);
6972         var seconds = Math.floor((fractionMinutes - minutes) * 60);
6973         return {
6974           whole,
6975           minutes,
6976           seconds,
6977           dir
6978         };
6979       }
6980       function search(input, dims) {
6981         if (!dims) dims = "NSEW";
6982         if (typeof input !== "string") return null;
6983         input = input.toUpperCase();
6984         var regex = /^[\s\,]*([NSEW])?\s*([\-|\—|\―]?[0-9.]+)[°º˚]?\s*(?:([0-9.]+)['’′‘]\s*)?(?:([0-9.]+)(?:''|"|”|″)\s*)?([NSEW])?/;
6985         var m3 = input.match(regex);
6986         if (!m3) return null;
6987         var matched = m3[0];
6988         var dim;
6989         if (m3[1] && m3[5]) {
6990           dim = m3[1];
6991           matched = matched.slice(0, -1);
6992         } else {
6993           dim = m3[1] || m3[5];
6994         }
6995         if (dim && dims.indexOf(dim) === -1) return null;
6996         var deg = m3[2] ? parseFloat(m3[2]) : 0;
6997         var min3 = m3[3] ? parseFloat(m3[3]) / 60 : 0;
6998         var sec = m3[4] ? parseFloat(m3[4]) / 3600 : 0;
6999         var sign2 = deg < 0 ? -1 : 1;
7000         if (dim === "S" || dim === "W") sign2 *= -1;
7001         return {
7002           val: (Math.abs(deg) + min3 + sec) * sign2,
7003           dim,
7004           matched,
7005           remain: input.slice(matched.length)
7006         };
7007       }
7008       function pair3(input, dims) {
7009         input = input.trim();
7010         var one2 = search(input, dims);
7011         if (!one2) return null;
7012         input = one2.remain.trim();
7013         var two = search(input, dims);
7014         if (!two || two.remain) return null;
7015         if (one2.dim) {
7016           return swapdim(one2.val, two.val, one2.dim);
7017         } else {
7018           return [one2.val, two.val];
7019         }
7020       }
7021       function swapdim(a2, b3, dim) {
7022         if (dim === "N" || dim === "S") return [a2, b3];
7023         if (dim === "W" || dim === "E") return [b3, a2];
7024       }
7025     }
7026   });
7027
7028   // node_modules/whatwg-fetch/fetch.js
7029   var g = typeof globalThis !== "undefined" && globalThis || typeof self !== "undefined" && self || // eslint-disable-next-line no-undef
7030   typeof global !== "undefined" && global || {};
7031   var support = {
7032     searchParams: "URLSearchParams" in g,
7033     iterable: "Symbol" in g && "iterator" in Symbol,
7034     blob: "FileReader" in g && "Blob" in g && (function() {
7035       try {
7036         new Blob();
7037         return true;
7038       } catch (e3) {
7039         return false;
7040       }
7041     })(),
7042     formData: "FormData" in g,
7043     arrayBuffer: "ArrayBuffer" in g
7044   };
7045   function isDataView(obj) {
7046     return obj && DataView.prototype.isPrototypeOf(obj);
7047   }
7048   if (support.arrayBuffer) {
7049     viewClasses = [
7050       "[object Int8Array]",
7051       "[object Uint8Array]",
7052       "[object Uint8ClampedArray]",
7053       "[object Int16Array]",
7054       "[object Uint16Array]",
7055       "[object Int32Array]",
7056       "[object Uint32Array]",
7057       "[object Float32Array]",
7058       "[object Float64Array]"
7059     ];
7060     isArrayBufferView = ArrayBuffer.isView || function(obj) {
7061       return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
7062     };
7063   }
7064   var viewClasses;
7065   var isArrayBufferView;
7066   function normalizeName(name) {
7067     if (typeof name !== "string") {
7068       name = String(name);
7069     }
7070     if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === "") {
7071       throw new TypeError('Invalid character in header field name: "' + name + '"');
7072     }
7073     return name.toLowerCase();
7074   }
7075   function normalizeValue(value) {
7076     if (typeof value !== "string") {
7077       value = String(value);
7078     }
7079     return value;
7080   }
7081   function iteratorFor(items) {
7082     var iterator = {
7083       next: function() {
7084         var value = items.shift();
7085         return { done: value === void 0, value };
7086       }
7087     };
7088     if (support.iterable) {
7089       iterator[Symbol.iterator] = function() {
7090         return iterator;
7091       };
7092     }
7093     return iterator;
7094   }
7095   function Headers(headers) {
7096     this.map = {};
7097     if (headers instanceof Headers) {
7098       headers.forEach(function(value, name) {
7099         this.append(name, value);
7100       }, this);
7101     } else if (Array.isArray(headers)) {
7102       headers.forEach(function(header) {
7103         if (header.length != 2) {
7104           throw new TypeError("Headers constructor: expected name/value pair to be length 2, found" + header.length);
7105         }
7106         this.append(header[0], header[1]);
7107       }, this);
7108     } else if (headers) {
7109       Object.getOwnPropertyNames(headers).forEach(function(name) {
7110         this.append(name, headers[name]);
7111       }, this);
7112     }
7113   }
7114   Headers.prototype.append = function(name, value) {
7115     name = normalizeName(name);
7116     value = normalizeValue(value);
7117     var oldValue = this.map[name];
7118     this.map[name] = oldValue ? oldValue + ", " + value : value;
7119   };
7120   Headers.prototype["delete"] = function(name) {
7121     delete this.map[normalizeName(name)];
7122   };
7123   Headers.prototype.get = function(name) {
7124     name = normalizeName(name);
7125     return this.has(name) ? this.map[name] : null;
7126   };
7127   Headers.prototype.has = function(name) {
7128     return this.map.hasOwnProperty(normalizeName(name));
7129   };
7130   Headers.prototype.set = function(name, value) {
7131     this.map[normalizeName(name)] = normalizeValue(value);
7132   };
7133   Headers.prototype.forEach = function(callback, thisArg) {
7134     for (var name in this.map) {
7135       if (this.map.hasOwnProperty(name)) {
7136         callback.call(thisArg, this.map[name], name, this);
7137       }
7138     }
7139   };
7140   Headers.prototype.keys = function() {
7141     var items = [];
7142     this.forEach(function(value, name) {
7143       items.push(name);
7144     });
7145     return iteratorFor(items);
7146   };
7147   Headers.prototype.values = function() {
7148     var items = [];
7149     this.forEach(function(value) {
7150       items.push(value);
7151     });
7152     return iteratorFor(items);
7153   };
7154   Headers.prototype.entries = function() {
7155     var items = [];
7156     this.forEach(function(value, name) {
7157       items.push([name, value]);
7158     });
7159     return iteratorFor(items);
7160   };
7161   if (support.iterable) {
7162     Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
7163   }
7164   function consumed(body) {
7165     if (body._noBody) return;
7166     if (body.bodyUsed) {
7167       return Promise.reject(new TypeError("Already read"));
7168     }
7169     body.bodyUsed = true;
7170   }
7171   function fileReaderReady(reader) {
7172     return new Promise(function(resolve, reject) {
7173       reader.onload = function() {
7174         resolve(reader.result);
7175       };
7176       reader.onerror = function() {
7177         reject(reader.error);
7178       };
7179     });
7180   }
7181   function readBlobAsArrayBuffer(blob) {
7182     var reader = new FileReader();
7183     var promise = fileReaderReady(reader);
7184     reader.readAsArrayBuffer(blob);
7185     return promise;
7186   }
7187   function readBlobAsText(blob) {
7188     var reader = new FileReader();
7189     var promise = fileReaderReady(reader);
7190     var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
7191     var encoding = match ? match[1] : "utf-8";
7192     reader.readAsText(blob, encoding);
7193     return promise;
7194   }
7195   function readArrayBufferAsText(buf) {
7196     var view = new Uint8Array(buf);
7197     var chars = new Array(view.length);
7198     for (var i3 = 0; i3 < view.length; i3++) {
7199       chars[i3] = String.fromCharCode(view[i3]);
7200     }
7201     return chars.join("");
7202   }
7203   function bufferClone(buf) {
7204     if (buf.slice) {
7205       return buf.slice(0);
7206     } else {
7207       var view = new Uint8Array(buf.byteLength);
7208       view.set(new Uint8Array(buf));
7209       return view.buffer;
7210     }
7211   }
7212   function Body() {
7213     this.bodyUsed = false;
7214     this._initBody = function(body) {
7215       this.bodyUsed = this.bodyUsed;
7216       this._bodyInit = body;
7217       if (!body) {
7218         this._noBody = true;
7219         this._bodyText = "";
7220       } else if (typeof body === "string") {
7221         this._bodyText = body;
7222       } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
7223         this._bodyBlob = body;
7224       } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
7225         this._bodyFormData = body;
7226       } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
7227         this._bodyText = body.toString();
7228       } else if (support.arrayBuffer && support.blob && isDataView(body)) {
7229         this._bodyArrayBuffer = bufferClone(body.buffer);
7230         this._bodyInit = new Blob([this._bodyArrayBuffer]);
7231       } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
7232         this._bodyArrayBuffer = bufferClone(body);
7233       } else {
7234         this._bodyText = body = Object.prototype.toString.call(body);
7235       }
7236       if (!this.headers.get("content-type")) {
7237         if (typeof body === "string") {
7238           this.headers.set("content-type", "text/plain;charset=UTF-8");
7239         } else if (this._bodyBlob && this._bodyBlob.type) {
7240           this.headers.set("content-type", this._bodyBlob.type);
7241         } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
7242           this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8");
7243         }
7244       }
7245     };
7246     if (support.blob) {
7247       this.blob = function() {
7248         var rejected = consumed(this);
7249         if (rejected) {
7250           return rejected;
7251         }
7252         if (this._bodyBlob) {
7253           return Promise.resolve(this._bodyBlob);
7254         } else if (this._bodyArrayBuffer) {
7255           return Promise.resolve(new Blob([this._bodyArrayBuffer]));
7256         } else if (this._bodyFormData) {
7257           throw new Error("could not read FormData body as blob");
7258         } else {
7259           return Promise.resolve(new Blob([this._bodyText]));
7260         }
7261       };
7262     }
7263     this.arrayBuffer = function() {
7264       if (this._bodyArrayBuffer) {
7265         var isConsumed = consumed(this);
7266         if (isConsumed) {
7267           return isConsumed;
7268         } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
7269           return Promise.resolve(
7270             this._bodyArrayBuffer.buffer.slice(
7271               this._bodyArrayBuffer.byteOffset,
7272               this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
7273             )
7274           );
7275         } else {
7276           return Promise.resolve(this._bodyArrayBuffer);
7277         }
7278       } else if (support.blob) {
7279         return this.blob().then(readBlobAsArrayBuffer);
7280       } else {
7281         throw new Error("could not read as ArrayBuffer");
7282       }
7283     };
7284     this.text = function() {
7285       var rejected = consumed(this);
7286       if (rejected) {
7287         return rejected;
7288       }
7289       if (this._bodyBlob) {
7290         return readBlobAsText(this._bodyBlob);
7291       } else if (this._bodyArrayBuffer) {
7292         return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
7293       } else if (this._bodyFormData) {
7294         throw new Error("could not read FormData body as text");
7295       } else {
7296         return Promise.resolve(this._bodyText);
7297       }
7298     };
7299     if (support.formData) {
7300       this.formData = function() {
7301         return this.text().then(decode);
7302       };
7303     }
7304     this.json = function() {
7305       return this.text().then(JSON.parse);
7306     };
7307     return this;
7308   }
7309   var methods = ["CONNECT", "DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"];
7310   function normalizeMethod(method) {
7311     var upcased = method.toUpperCase();
7312     return methods.indexOf(upcased) > -1 ? upcased : method;
7313   }
7314   function Request(input, options) {
7315     if (!(this instanceof Request)) {
7316       throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
7317     }
7318     options = options || {};
7319     var body = options.body;
7320     if (input instanceof Request) {
7321       if (input.bodyUsed) {
7322         throw new TypeError("Already read");
7323       }
7324       this.url = input.url;
7325       this.credentials = input.credentials;
7326       if (!options.headers) {
7327         this.headers = new Headers(input.headers);
7328       }
7329       this.method = input.method;
7330       this.mode = input.mode;
7331       this.signal = input.signal;
7332       if (!body && input._bodyInit != null) {
7333         body = input._bodyInit;
7334         input.bodyUsed = true;
7335       }
7336     } else {
7337       this.url = String(input);
7338     }
7339     this.credentials = options.credentials || this.credentials || "same-origin";
7340     if (options.headers || !this.headers) {
7341       this.headers = new Headers(options.headers);
7342     }
7343     this.method = normalizeMethod(options.method || this.method || "GET");
7344     this.mode = options.mode || this.mode || null;
7345     this.signal = options.signal || this.signal || (function() {
7346       if ("AbortController" in g) {
7347         var ctrl = new AbortController();
7348         return ctrl.signal;
7349       }
7350     })();
7351     this.referrer = null;
7352     if ((this.method === "GET" || this.method === "HEAD") && body) {
7353       throw new TypeError("Body not allowed for GET or HEAD requests");
7354     }
7355     this._initBody(body);
7356     if (this.method === "GET" || this.method === "HEAD") {
7357       if (options.cache === "no-store" || options.cache === "no-cache") {
7358         var reParamSearch = /([?&])_=[^&]*/;
7359         if (reParamSearch.test(this.url)) {
7360           this.url = this.url.replace(reParamSearch, "$1_=" + (/* @__PURE__ */ new Date()).getTime());
7361         } else {
7362           var reQueryString = /\?/;
7363           this.url += (reQueryString.test(this.url) ? "&" : "?") + "_=" + (/* @__PURE__ */ new Date()).getTime();
7364         }
7365       }
7366     }
7367   }
7368   Request.prototype.clone = function() {
7369     return new Request(this, { body: this._bodyInit });
7370   };
7371   function decode(body) {
7372     var form = new FormData();
7373     body.trim().split("&").forEach(function(bytes) {
7374       if (bytes) {
7375         var split = bytes.split("=");
7376         var name = split.shift().replace(/\+/g, " ");
7377         var value = split.join("=").replace(/\+/g, " ");
7378         form.append(decodeURIComponent(name), decodeURIComponent(value));
7379       }
7380     });
7381     return form;
7382   }
7383   function parseHeaders(rawHeaders) {
7384     var headers = new Headers();
7385     var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, " ");
7386     preProcessedHeaders.split("\r").map(function(header) {
7387       return header.indexOf("\n") === 0 ? header.substr(1, header.length) : header;
7388     }).forEach(function(line) {
7389       var parts = line.split(":");
7390       var key = parts.shift().trim();
7391       if (key) {
7392         var value = parts.join(":").trim();
7393         try {
7394           headers.append(key, value);
7395         } catch (error) {
7396           console.warn("Response " + error.message);
7397         }
7398       }
7399     });
7400     return headers;
7401   }
7402   Body.call(Request.prototype);
7403   function Response2(bodyInit, options) {
7404     if (!(this instanceof Response2)) {
7405       throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');
7406     }
7407     if (!options) {
7408       options = {};
7409     }
7410     this.type = "default";
7411     this.status = options.status === void 0 ? 200 : options.status;
7412     if (this.status < 200 || this.status > 599) {
7413       throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");
7414     }
7415     this.ok = this.status >= 200 && this.status < 300;
7416     this.statusText = options.statusText === void 0 ? "" : "" + options.statusText;
7417     this.headers = new Headers(options.headers);
7418     this.url = options.url || "";
7419     this._initBody(bodyInit);
7420   }
7421   Body.call(Response2.prototype);
7422   Response2.prototype.clone = function() {
7423     return new Response2(this._bodyInit, {
7424       status: this.status,
7425       statusText: this.statusText,
7426       headers: new Headers(this.headers),
7427       url: this.url
7428     });
7429   };
7430   Response2.error = function() {
7431     var response = new Response2(null, { status: 200, statusText: "" });
7432     response.ok = false;
7433     response.status = 0;
7434     response.type = "error";
7435     return response;
7436   };
7437   var redirectStatuses = [301, 302, 303, 307, 308];
7438   Response2.redirect = function(url, status) {
7439     if (redirectStatuses.indexOf(status) === -1) {
7440       throw new RangeError("Invalid status code");
7441     }
7442     return new Response2(null, { status, headers: { location: url } });
7443   };
7444   var DOMException2 = g.DOMException;
7445   try {
7446     new DOMException2();
7447   } catch (err) {
7448     DOMException2 = function(message, name) {
7449       this.message = message;
7450       this.name = name;
7451       var error = Error(message);
7452       this.stack = error.stack;
7453     };
7454     DOMException2.prototype = Object.create(Error.prototype);
7455     DOMException2.prototype.constructor = DOMException2;
7456   }
7457   function fetch2(input, init2) {
7458     return new Promise(function(resolve, reject) {
7459       var request3 = new Request(input, init2);
7460       if (request3.signal && request3.signal.aborted) {
7461         return reject(new DOMException2("Aborted", "AbortError"));
7462       }
7463       var xhr = new XMLHttpRequest();
7464       function abortXhr() {
7465         xhr.abort();
7466       }
7467       xhr.onload = function() {
7468         var options = {
7469           statusText: xhr.statusText,
7470           headers: parseHeaders(xhr.getAllResponseHeaders() || "")
7471         };
7472         if (request3.url.indexOf("file://") === 0 && (xhr.status < 200 || xhr.status > 599)) {
7473           options.status = 200;
7474         } else {
7475           options.status = xhr.status;
7476         }
7477         options.url = "responseURL" in xhr ? xhr.responseURL : options.headers.get("X-Request-URL");
7478         var body = "response" in xhr ? xhr.response : xhr.responseText;
7479         setTimeout(function() {
7480           resolve(new Response2(body, options));
7481         }, 0);
7482       };
7483       xhr.onerror = function() {
7484         setTimeout(function() {
7485           reject(new TypeError("Network request failed"));
7486         }, 0);
7487       };
7488       xhr.ontimeout = function() {
7489         setTimeout(function() {
7490           reject(new TypeError("Network request timed out"));
7491         }, 0);
7492       };
7493       xhr.onabort = function() {
7494         setTimeout(function() {
7495           reject(new DOMException2("Aborted", "AbortError"));
7496         }, 0);
7497       };
7498       function fixUrl(url) {
7499         try {
7500           return url === "" && g.location.href ? g.location.href : url;
7501         } catch (e3) {
7502           return url;
7503         }
7504       }
7505       xhr.open(request3.method, fixUrl(request3.url), true);
7506       if (request3.credentials === "include") {
7507         xhr.withCredentials = true;
7508       } else if (request3.credentials === "omit") {
7509         xhr.withCredentials = false;
7510       }
7511       if ("responseType" in xhr) {
7512         if (support.blob) {
7513           xhr.responseType = "blob";
7514         } else if (support.arrayBuffer) {
7515           xhr.responseType = "arraybuffer";
7516         }
7517       }
7518       if (init2 && typeof init2.headers === "object" && !(init2.headers instanceof Headers || g.Headers && init2.headers instanceof g.Headers)) {
7519         var names = [];
7520         Object.getOwnPropertyNames(init2.headers).forEach(function(name) {
7521           names.push(normalizeName(name));
7522           xhr.setRequestHeader(name, normalizeValue(init2.headers[name]));
7523         });
7524         request3.headers.forEach(function(value, name) {
7525           if (names.indexOf(name) === -1) {
7526             xhr.setRequestHeader(name, value);
7527           }
7528         });
7529       } else {
7530         request3.headers.forEach(function(value, name) {
7531           xhr.setRequestHeader(name, value);
7532         });
7533       }
7534       if (request3.signal) {
7535         request3.signal.addEventListener("abort", abortXhr);
7536         xhr.onreadystatechange = function() {
7537           if (xhr.readyState === 4) {
7538             request3.signal.removeEventListener("abort", abortXhr);
7539           }
7540         };
7541       }
7542       xhr.send(typeof request3._bodyInit === "undefined" ? null : request3._bodyInit);
7543     });
7544   }
7545   fetch2.polyfill = true;
7546   if (!g.fetch) {
7547     g.fetch = fetch2;
7548     g.Headers = Headers;
7549     g.Request = Request;
7550     g.Response = Response2;
7551   }
7552
7553   // node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js
7554   (function(factory) {
7555     typeof define === "function" && define.amd ? define(factory) : factory();
7556   })((function() {
7557     "use strict";
7558     function _arrayLikeToArray(r2, a2) {
7559       (null == a2 || a2 > r2.length) && (a2 = r2.length);
7560       for (var e3 = 0, n3 = Array(a2); e3 < a2; e3++) n3[e3] = r2[e3];
7561       return n3;
7562     }
7563     function _assertThisInitialized(e3) {
7564       if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
7565       return e3;
7566     }
7567     function _callSuper(t2, o2, e3) {
7568       return o2 = _getPrototypeOf(o2), _possibleConstructorReturn(t2, _isNativeReflectConstruct() ? Reflect.construct(o2, e3 || [], _getPrototypeOf(t2).constructor) : o2.apply(t2, e3));
7569     }
7570     function _classCallCheck(a2, n3) {
7571       if (!(a2 instanceof n3)) throw new TypeError("Cannot call a class as a function");
7572     }
7573     function _defineProperties(e3, r2) {
7574       for (var t2 = 0; t2 < r2.length; t2++) {
7575         var o2 = r2[t2];
7576         o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e3, _toPropertyKey(o2.key), o2);
7577       }
7578     }
7579     function _createClass(e3, r2, t2) {
7580       return r2 && _defineProperties(e3.prototype, r2), t2 && _defineProperties(e3, t2), Object.defineProperty(e3, "prototype", {
7581         writable: false
7582       }), e3;
7583     }
7584     function _createForOfIteratorHelper(r2, e3) {
7585       var t2 = "undefined" != typeof Symbol && r2[Symbol.iterator] || r2["@@iterator"];
7586       if (!t2) {
7587         if (Array.isArray(r2) || (t2 = _unsupportedIterableToArray(r2)) || e3 && r2 && "number" == typeof r2.length) {
7588           t2 && (r2 = t2);
7589           var n3 = 0, F3 = function() {
7590           };
7591           return {
7592             s: F3,
7593             n: function() {
7594               return n3 >= r2.length ? {
7595                 done: true
7596               } : {
7597                 done: false,
7598                 value: r2[n3++]
7599               };
7600             },
7601             e: function(r3) {
7602               throw r3;
7603             },
7604             f: F3
7605           };
7606         }
7607         throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7608       }
7609       var o2, a2 = true, u4 = false;
7610       return {
7611         s: function() {
7612           t2 = t2.call(r2);
7613         },
7614         n: function() {
7615           var r3 = t2.next();
7616           return a2 = r3.done, r3;
7617         },
7618         e: function(r3) {
7619           u4 = true, o2 = r3;
7620         },
7621         f: function() {
7622           try {
7623             a2 || null == t2.return || t2.return();
7624           } finally {
7625             if (u4) throw o2;
7626           }
7627         }
7628       };
7629     }
7630     function _get() {
7631       return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e3, t2, r2) {
7632         var p2 = _superPropBase(e3, t2);
7633         if (p2) {
7634           var n3 = Object.getOwnPropertyDescriptor(p2, t2);
7635           return n3.get ? n3.get.call(arguments.length < 3 ? e3 : r2) : n3.value;
7636         }
7637       }, _get.apply(null, arguments);
7638     }
7639     function _getPrototypeOf(t2) {
7640       return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
7641         return t3.__proto__ || Object.getPrototypeOf(t3);
7642       }, _getPrototypeOf(t2);
7643     }
7644     function _inherits(t2, e3) {
7645       if ("function" != typeof e3 && null !== e3) throw new TypeError("Super expression must either be null or a function");
7646       t2.prototype = Object.create(e3 && e3.prototype, {
7647         constructor: {
7648           value: t2,
7649           writable: true,
7650           configurable: true
7651         }
7652       }), Object.defineProperty(t2, "prototype", {
7653         writable: false
7654       }), e3 && _setPrototypeOf(t2, e3);
7655     }
7656     function _isNativeReflectConstruct() {
7657       try {
7658         var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
7659         }));
7660       } catch (t3) {
7661       }
7662       return (_isNativeReflectConstruct = function() {
7663         return !!t2;
7664       })();
7665     }
7666     function _possibleConstructorReturn(t2, e3) {
7667       if (e3 && ("object" == typeof e3 || "function" == typeof e3)) return e3;
7668       if (void 0 !== e3) throw new TypeError("Derived constructors may only return object or undefined");
7669       return _assertThisInitialized(t2);
7670     }
7671     function _setPrototypeOf(t2, e3) {
7672       return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e4) {
7673         return t3.__proto__ = e4, t3;
7674       }, _setPrototypeOf(t2, e3);
7675     }
7676     function _superPropBase(t2, o2) {
7677       for (; !{}.hasOwnProperty.call(t2, o2) && null !== (t2 = _getPrototypeOf(t2)); ) ;
7678       return t2;
7679     }
7680     function _superPropGet(t2, o2, e3, r2) {
7681       var p2 = _get(_getPrototypeOf(1 & r2 ? t2.prototype : t2), o2, e3);
7682       return 2 & r2 && "function" == typeof p2 ? function(t3) {
7683         return p2.apply(e3, t3);
7684       } : p2;
7685     }
7686     function _toPrimitive(t2, r2) {
7687       if ("object" != typeof t2 || !t2) return t2;
7688       var e3 = t2[Symbol.toPrimitive];
7689       if (void 0 !== e3) {
7690         var i3 = e3.call(t2, r2 || "default");
7691         if ("object" != typeof i3) return i3;
7692         throw new TypeError("@@toPrimitive must return a primitive value.");
7693       }
7694       return ("string" === r2 ? String : Number)(t2);
7695     }
7696     function _toPropertyKey(t2) {
7697       var i3 = _toPrimitive(t2, "string");
7698       return "symbol" == typeof i3 ? i3 : i3 + "";
7699     }
7700     function _unsupportedIterableToArray(r2, a2) {
7701       if (r2) {
7702         if ("string" == typeof r2) return _arrayLikeToArray(r2, a2);
7703         var t2 = {}.toString.call(r2).slice(8, -1);
7704         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;
7705       }
7706     }
7707     (function(self2) {
7708       return {
7709         NativeAbortSignal: self2.AbortSignal,
7710         NativeAbortController: self2.AbortController
7711       };
7712     })(typeof self !== "undefined" ? self : global);
7713     function createAbortEvent(reason) {
7714       var event;
7715       try {
7716         event = new Event("abort");
7717       } catch (e3) {
7718         if (typeof document !== "undefined") {
7719           if (!document.createEvent) {
7720             event = document.createEventObject();
7721             event.type = "abort";
7722           } else {
7723             event = document.createEvent("Event");
7724             event.initEvent("abort", false, false);
7725           }
7726         } else {
7727           event = {
7728             type: "abort",
7729             bubbles: false,
7730             cancelable: false
7731           };
7732         }
7733       }
7734       event.reason = reason;
7735       return event;
7736     }
7737     function normalizeAbortReason(reason) {
7738       if (reason === void 0) {
7739         if (typeof document === "undefined") {
7740           reason = new Error("This operation was aborted");
7741           reason.name = "AbortError";
7742         } else {
7743           try {
7744             reason = new DOMException("signal is aborted without reason");
7745             Object.defineProperty(reason, "name", {
7746               value: "AbortError"
7747             });
7748           } catch (err) {
7749             reason = new Error("This operation was aborted");
7750             reason.name = "AbortError";
7751           }
7752         }
7753       }
7754       return reason;
7755     }
7756     var Emitter = /* @__PURE__ */ (function() {
7757       function Emitter2() {
7758         _classCallCheck(this, Emitter2);
7759         Object.defineProperty(this, "listeners", {
7760           value: {},
7761           writable: true,
7762           configurable: true
7763         });
7764       }
7765       return _createClass(Emitter2, [{
7766         key: "addEventListener",
7767         value: function addEventListener(type2, callback, options) {
7768           if (!(type2 in this.listeners)) {
7769             this.listeners[type2] = [];
7770           }
7771           this.listeners[type2].push({
7772             callback,
7773             options
7774           });
7775         }
7776       }, {
7777         key: "removeEventListener",
7778         value: function removeEventListener(type2, callback) {
7779           if (!(type2 in this.listeners)) {
7780             return;
7781           }
7782           var stack = this.listeners[type2];
7783           for (var i3 = 0, l2 = stack.length; i3 < l2; i3++) {
7784             if (stack[i3].callback === callback) {
7785               stack.splice(i3, 1);
7786               return;
7787             }
7788           }
7789         }
7790       }, {
7791         key: "dispatchEvent",
7792         value: function dispatchEvent2(event) {
7793           var _this = this;
7794           if (!(event.type in this.listeners)) {
7795             return;
7796           }
7797           var stack = this.listeners[event.type];
7798           var stackToCall = stack.slice();
7799           var _loop = function _loop2() {
7800             var listener = stackToCall[i3];
7801             try {
7802               listener.callback.call(_this, event);
7803             } catch (e3) {
7804               Promise.resolve().then(function() {
7805                 throw e3;
7806               });
7807             }
7808             if (listener.options && listener.options.once) {
7809               _this.removeEventListener(event.type, listener.callback);
7810             }
7811           };
7812           for (var i3 = 0, l2 = stackToCall.length; i3 < l2; i3++) {
7813             _loop();
7814           }
7815           return !event.defaultPrevented;
7816         }
7817       }]);
7818     })();
7819     var AbortSignal = /* @__PURE__ */ (function(_Emitter) {
7820       function AbortSignal2() {
7821         var _this2;
7822         _classCallCheck(this, AbortSignal2);
7823         _this2 = _callSuper(this, AbortSignal2);
7824         if (!_this2.listeners) {
7825           Emitter.call(_this2);
7826         }
7827         Object.defineProperty(_this2, "aborted", {
7828           value: false,
7829           writable: true,
7830           configurable: true
7831         });
7832         Object.defineProperty(_this2, "onabort", {
7833           value: null,
7834           writable: true,
7835           configurable: true
7836         });
7837         Object.defineProperty(_this2, "reason", {
7838           value: void 0,
7839           writable: true,
7840           configurable: true
7841         });
7842         return _this2;
7843       }
7844       _inherits(AbortSignal2, _Emitter);
7845       return _createClass(AbortSignal2, [{
7846         key: "toString",
7847         value: function toString2() {
7848           return "[object AbortSignal]";
7849         }
7850       }, {
7851         key: "dispatchEvent",
7852         value: function dispatchEvent2(event) {
7853           if (event.type === "abort") {
7854             this.aborted = true;
7855             if (typeof this.onabort === "function") {
7856               this.onabort.call(this, event);
7857             }
7858           }
7859           _superPropGet(AbortSignal2, "dispatchEvent", this, 3)([event]);
7860         }
7861         /**
7862          * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/AbortSignal/throwIfAborted}
7863          */
7864       }, {
7865         key: "throwIfAborted",
7866         value: function throwIfAborted() {
7867           var aborted = this.aborted, _this$reason = this.reason, reason = _this$reason === void 0 ? "Aborted" : _this$reason;
7868           if (!aborted) return;
7869           throw reason;
7870         }
7871         /**
7872          * @see {@link https://developer.mozilla.org/zh-CN/docs/Web/API/AbortSignal/timeout_static}
7873          * @param {number} time The "active" time in milliseconds before the returned {@link AbortSignal} will abort.
7874          *                      The value must be within range of 0 and {@link Number.MAX_SAFE_INTEGER}.
7875          * @returns {AbortSignal} The signal will abort with its {@link AbortSignal.reason} property set to a `TimeoutError` {@link DOMException} on timeout,
7876          *                        or an `AbortError` {@link DOMException} if the operation was user-triggered.
7877          */
7878       }], [{
7879         key: "timeout",
7880         value: function timeout2(time) {
7881           var controller = new AbortController2();
7882           setTimeout(function() {
7883             return controller.abort(new DOMException("This signal is timeout in ".concat(time, "ms"), "TimeoutError"));
7884           }, time);
7885           return controller.signal;
7886         }
7887         /**
7888          * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static}
7889          * @param {Iterable<AbortSignal>} iterable An {@link Iterable} (such as an {@link Array}) of abort signals.
7890          * @returns {AbortSignal} - **Already aborted**, if any of the abort signals given is already aborted.
7891          *                          The returned {@link AbortSignal}'s reason will be already set to the `reason` of the first abort signal that was already aborted.
7892          *                        - **Asynchronously aborted**, when any abort signal in `iterable` aborts.
7893          *                          The `reason` will be set to the reason of the first abort signal that is aborted.
7894          */
7895       }, {
7896         key: "any",
7897         value: function any(iterable) {
7898           var controller = new AbortController2();
7899           function abort() {
7900             controller.abort(this.reason);
7901             clean2();
7902           }
7903           function clean2() {
7904             var _iterator = _createForOfIteratorHelper(iterable), _step;
7905             try {
7906               for (_iterator.s(); !(_step = _iterator.n()).done; ) {
7907                 var signal2 = _step.value;
7908                 signal2.removeEventListener("abort", abort);
7909               }
7910             } catch (err) {
7911               _iterator.e(err);
7912             } finally {
7913               _iterator.f();
7914             }
7915           }
7916           var _iterator2 = _createForOfIteratorHelper(iterable), _step2;
7917           try {
7918             for (_iterator2.s(); !(_step2 = _iterator2.n()).done; ) {
7919               var signal = _step2.value;
7920               if (signal.aborted) {
7921                 controller.abort(signal.reason);
7922                 break;
7923               } else signal.addEventListener("abort", abort);
7924             }
7925           } catch (err) {
7926             _iterator2.e(err);
7927           } finally {
7928             _iterator2.f();
7929           }
7930           return controller.signal;
7931         }
7932       }]);
7933     })(Emitter);
7934     var AbortController2 = /* @__PURE__ */ (function() {
7935       function AbortController3() {
7936         _classCallCheck(this, AbortController3);
7937         Object.defineProperty(this, "signal", {
7938           value: new AbortSignal(),
7939           writable: true,
7940           configurable: true
7941         });
7942       }
7943       return _createClass(AbortController3, [{
7944         key: "abort",
7945         value: function abort(reason) {
7946           var signalReason = normalizeAbortReason(reason);
7947           var event = createAbortEvent(signalReason);
7948           this.signal.reason = signalReason;
7949           this.signal.dispatchEvent(event);
7950         }
7951       }, {
7952         key: "toString",
7953         value: function toString2() {
7954           return "[object AbortController]";
7955         }
7956       }]);
7957     })();
7958     if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
7959       AbortController2.prototype[Symbol.toStringTag] = "AbortController";
7960       AbortSignal.prototype[Symbol.toStringTag] = "AbortSignal";
7961     }
7962     function polyfillNeeded(self2) {
7963       if (self2.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {
7964         console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill");
7965         return true;
7966       }
7967       return typeof self2.Request === "function" && !self2.Request.prototype.hasOwnProperty("signal") || !self2.AbortController;
7968     }
7969     function abortableFetchDecorator(patchTargets) {
7970       if ("function" === typeof patchTargets) {
7971         patchTargets = {
7972           fetch: patchTargets
7973         };
7974       }
7975       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;
7976       if (!polyfillNeeded({
7977         fetch: fetch3,
7978         Request: NativeRequest,
7979         AbortController: NativeAbortController,
7980         __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL
7981       })) {
7982         return {
7983           fetch: fetch3,
7984           Request: Request2
7985         };
7986       }
7987       var Request2 = NativeRequest;
7988       if (Request2 && !Request2.prototype.hasOwnProperty("signal") || __FORCE_INSTALL_ABORTCONTROLLER_POLYFILL) {
7989         Request2 = function Request3(input, init2) {
7990           var signal;
7991           if (init2 && init2.signal) {
7992             signal = init2.signal;
7993             delete init2.signal;
7994           }
7995           var request3 = new NativeRequest(input, init2);
7996           if (signal) {
7997             Object.defineProperty(request3, "signal", {
7998               writable: false,
7999               enumerable: false,
8000               configurable: true,
8001               value: signal
8002             });
8003           }
8004           return request3;
8005         };
8006         Request2.prototype = NativeRequest.prototype;
8007       }
8008       var realFetch = fetch3;
8009       var abortableFetch = function abortableFetch2(input, init2) {
8010         var signal = Request2 && Request2.prototype.isPrototypeOf(input) ? input.signal : init2 ? init2.signal : void 0;
8011         if (signal) {
8012           var abortError;
8013           try {
8014             abortError = new DOMException("Aborted", "AbortError");
8015           } catch (err) {
8016             abortError = new Error("Aborted");
8017             abortError.name = "AbortError";
8018           }
8019           if (signal.aborted) {
8020             return Promise.reject(abortError);
8021           }
8022           var cancellation = new Promise(function(_3, reject) {
8023             signal.addEventListener("abort", function() {
8024               return reject(abortError);
8025             }, {
8026               once: true
8027             });
8028           });
8029           if (init2 && init2.signal) {
8030             delete init2.signal;
8031           }
8032           return Promise.race([cancellation, realFetch(input, init2)]);
8033         }
8034         return realFetch(input, init2);
8035       };
8036       return {
8037         fetch: abortableFetch,
8038         Request: Request2
8039       };
8040     }
8041     (function(self2) {
8042       if (!polyfillNeeded(self2)) {
8043         return;
8044       }
8045       if (!self2.fetch) {
8046         console.warn("fetch() is not available, cannot install abortcontroller-polyfill");
8047         return;
8048       }
8049       var _abortableFetch = abortableFetchDecorator(self2), fetch3 = _abortableFetch.fetch, Request2 = _abortableFetch.Request;
8050       self2.fetch = fetch3;
8051       self2.Request = Request2;
8052       Object.defineProperty(self2, "AbortController", {
8053         writable: true,
8054         enumerable: false,
8055         configurable: true,
8056         value: AbortController2
8057       });
8058       Object.defineProperty(self2, "AbortSignal", {
8059         writable: true,
8060         enumerable: false,
8061         configurable: true,
8062         value: AbortSignal
8063       });
8064     })(typeof self !== "undefined" ? self : global);
8065   }));
8066
8067   // modules/index.js
8068   var index_exports = {};
8069   __export(index_exports, {
8070     LANGUAGE_SUFFIX_REGEX: () => LANGUAGE_SUFFIX_REGEX,
8071     LocationManager: () => LocationManager,
8072     QAItem: () => QAItem,
8073     actionAddEntity: () => actionAddEntity,
8074     actionAddMember: () => actionAddMember,
8075     actionAddMidpoint: () => actionAddMidpoint,
8076     actionAddVertex: () => actionAddVertex,
8077     actionChangeMember: () => actionChangeMember,
8078     actionChangePreset: () => actionChangePreset,
8079     actionChangeTags: () => actionChangeTags,
8080     actionCircularize: () => actionCircularize,
8081     actionConnect: () => actionConnect,
8082     actionCopyEntities: () => actionCopyEntities,
8083     actionDeleteMember: () => actionDeleteMember,
8084     actionDeleteMultiple: () => actionDeleteMultiple,
8085     actionDeleteNode: () => actionDeleteNode,
8086     actionDeleteRelation: () => actionDeleteRelation,
8087     actionDeleteWay: () => actionDeleteWay,
8088     actionDiscardTags: () => actionDiscardTags,
8089     actionDisconnect: () => actionDisconnect,
8090     actionExtract: () => actionExtract,
8091     actionJoin: () => actionJoin,
8092     actionMerge: () => actionMerge,
8093     actionMergeNodes: () => actionMergeNodes,
8094     actionMergePolygon: () => actionMergePolygon,
8095     actionMergeRemoteChanges: () => actionMergeRemoteChanges,
8096     actionMove: () => actionMove,
8097     actionMoveMember: () => actionMoveMember,
8098     actionMoveNode: () => actionMoveNode,
8099     actionNoop: () => actionNoop,
8100     actionOrthogonalize: () => actionOrthogonalize,
8101     actionReflect: () => actionReflect,
8102     actionRestrictTurn: () => actionRestrictTurn,
8103     actionReverse: () => actionReverse,
8104     actionRevert: () => actionRevert,
8105     actionRotate: () => actionRotate,
8106     actionScale: () => actionScale,
8107     actionSplit: () => actionSplit,
8108     actionStraightenNodes: () => actionStraightenNodes,
8109     actionStraightenWay: () => actionStraightenWay,
8110     actionUnrestrictTurn: () => actionUnrestrictTurn,
8111     actionUpgradeTags: () => actionUpgradeTags,
8112     behaviorAddWay: () => behaviorAddWay,
8113     behaviorBreathe: () => behaviorBreathe,
8114     behaviorDrag: () => behaviorDrag,
8115     behaviorDraw: () => behaviorDraw,
8116     behaviorDrawWay: () => behaviorDrawWay,
8117     behaviorEdit: () => behaviorEdit,
8118     behaviorHash: () => behaviorHash,
8119     behaviorHover: () => behaviorHover,
8120     behaviorLasso: () => behaviorLasso,
8121     behaviorOperation: () => behaviorOperation,
8122     behaviorPaste: () => behaviorPaste,
8123     behaviorSelect: () => behaviorSelect,
8124     coreContext: () => coreContext,
8125     coreDifference: () => coreDifference,
8126     coreFileFetcher: () => coreFileFetcher,
8127     coreGraph: () => coreGraph,
8128     coreHistory: () => coreHistory,
8129     coreLocalizer: () => coreLocalizer,
8130     coreTree: () => coreTree,
8131     coreUploader: () => coreUploader,
8132     coreValidator: () => coreValidator,
8133     d3: () => d3,
8134     debug: () => debug,
8135     dmsCoordinatePair: () => dmsCoordinatePair,
8136     dmsMatcher: () => dmsMatcher,
8137     fileFetcher: () => _mainFileFetcher,
8138     geoAngle: () => geoAngle,
8139     geoChooseEdge: () => geoChooseEdge,
8140     geoEdgeEqual: () => geoEdgeEqual,
8141     geoExtent: () => geoExtent,
8142     geoGetSmallestSurroundingRectangle: () => geoGetSmallestSurroundingRectangle,
8143     geoHasLineIntersections: () => geoHasLineIntersections,
8144     geoHasSelfIntersections: () => geoHasSelfIntersections,
8145     geoLatToMeters: () => geoLatToMeters,
8146     geoLineIntersection: () => geoLineIntersection,
8147     geoLonToMeters: () => geoLonToMeters,
8148     geoMetersToLat: () => geoMetersToLat,
8149     geoMetersToLon: () => geoMetersToLon,
8150     geoMetersToOffset: () => geoMetersToOffset,
8151     geoOffsetToMeters: () => geoOffsetToMeters,
8152     geoOrthoCalcScore: () => geoOrthoCalcScore,
8153     geoOrthoCanOrthogonalize: () => geoOrthoCanOrthogonalize,
8154     geoOrthoMaxOffsetAngle: () => geoOrthoMaxOffsetAngle,
8155     geoOrthoNormalizedDotProduct: () => geoOrthoNormalizedDotProduct,
8156     geoPathHasIntersections: () => geoPathHasIntersections,
8157     geoPathIntersections: () => geoPathIntersections,
8158     geoPathLength: () => geoPathLength,
8159     geoPointInPolygon: () => geoPointInPolygon,
8160     geoPolygonContainsPolygon: () => geoPolygonContainsPolygon,
8161     geoPolygonIntersectsPolygon: () => geoPolygonIntersectsPolygon,
8162     geoRawMercator: () => geoRawMercator,
8163     geoRotate: () => geoRotate,
8164     geoScaleToZoom: () => geoScaleToZoom,
8165     geoSphericalClosestNode: () => geoSphericalClosestNode,
8166     geoSphericalDistance: () => geoSphericalDistance,
8167     geoVecAdd: () => geoVecAdd,
8168     geoVecAngle: () => geoVecAngle,
8169     geoVecCross: () => geoVecCross,
8170     geoVecDot: () => geoVecDot,
8171     geoVecEqual: () => geoVecEqual,
8172     geoVecFloor: () => geoVecFloor,
8173     geoVecInterp: () => geoVecInterp,
8174     geoVecLength: () => geoVecLength,
8175     geoVecLengthSquare: () => geoVecLengthSquare,
8176     geoVecNormalize: () => geoVecNormalize,
8177     geoVecNormalizedDot: () => geoVecNormalizedDot,
8178     geoVecProject: () => geoVecProject,
8179     geoVecScale: () => geoVecScale,
8180     geoVecSubtract: () => geoVecSubtract,
8181     geoViewportEdge: () => geoViewportEdge,
8182     geoZoomToScale: () => geoZoomToScale,
8183     likelyRawNumberFormat: () => likelyRawNumberFormat,
8184     localizer: () => _mainLocalizer,
8185     locationManager: () => _sharedLocationManager,
8186     modeAddArea: () => modeAddArea,
8187     modeAddLine: () => modeAddLine,
8188     modeAddNote: () => modeAddNote,
8189     modeAddPoint: () => modeAddPoint,
8190     modeBrowse: () => modeBrowse,
8191     modeDragNode: () => modeDragNode,
8192     modeDragNote: () => modeDragNote,
8193     modeDrawArea: () => modeDrawArea,
8194     modeDrawLine: () => modeDrawLine,
8195     modeMove: () => modeMove,
8196     modeRotate: () => modeRotate,
8197     modeSave: () => modeSave,
8198     modeSelect: () => modeSelect,
8199     modeSelectData: () => modeSelectData,
8200     modeSelectError: () => modeSelectError,
8201     modeSelectNote: () => modeSelectNote,
8202     operationCircularize: () => operationCircularize,
8203     operationContinue: () => operationContinue,
8204     operationCopy: () => operationCopy,
8205     operationDelete: () => operationDelete,
8206     operationDisconnect: () => operationDisconnect,
8207     operationDowngrade: () => operationDowngrade,
8208     operationExtract: () => operationExtract,
8209     operationMerge: () => operationMerge,
8210     operationMove: () => operationMove,
8211     operationOrthogonalize: () => operationOrthogonalize,
8212     operationPaste: () => operationPaste,
8213     operationReflectLong: () => operationReflectLong,
8214     operationReflectShort: () => operationReflectShort,
8215     operationReverse: () => operationReverse,
8216     operationRotate: () => operationRotate,
8217     operationSplit: () => operationSplit,
8218     operationStraighten: () => operationStraighten,
8219     osmAreaKeys: () => osmAreaKeys,
8220     osmChangeset: () => osmChangeset,
8221     osmEntity: () => osmEntity,
8222     osmFlowingWaterwayTagValues: () => osmFlowingWaterwayTagValues,
8223     osmInferRestriction: () => osmInferRestriction,
8224     osmIntersection: () => osmIntersection,
8225     osmIsInterestingTag: () => osmIsInterestingTag,
8226     osmJoinWays: () => osmJoinWays,
8227     osmLanes: () => osmLanes,
8228     osmLifecyclePrefixes: () => osmLifecyclePrefixes,
8229     osmNode: () => osmNode,
8230     osmNodeGeometriesForTags: () => osmNodeGeometriesForTags,
8231     osmNote: () => osmNote,
8232     osmPavedTags: () => osmPavedTags,
8233     osmPointTags: () => osmPointTags,
8234     osmRailwayTrackTagValues: () => osmRailwayTrackTagValues,
8235     osmRelation: () => osmRelation,
8236     osmRemoveLifecyclePrefix: () => osmRemoveLifecyclePrefix,
8237     osmRoutableHighwayTagValues: () => osmRoutableHighwayTagValues,
8238     osmSetAreaKeys: () => osmSetAreaKeys,
8239     osmSetPointTags: () => osmSetPointTags,
8240     osmSetVertexTags: () => osmSetVertexTags,
8241     osmTagSuggestingArea: () => osmTagSuggestingArea,
8242     osmTurn: () => osmTurn,
8243     osmVertexTags: () => osmVertexTags,
8244     osmWay: () => osmWay,
8245     prefs: () => corePreferences,
8246     presetCategory: () => presetCategory,
8247     presetCollection: () => presetCollection,
8248     presetField: () => presetField,
8249     presetIndex: () => presetIndex,
8250     presetManager: () => _mainPresetIndex,
8251     presetPreset: () => presetPreset,
8252     rendererBackground: () => rendererBackground,
8253     rendererBackgroundSource: () => rendererBackgroundSource,
8254     rendererFeatures: () => rendererFeatures,
8255     rendererMap: () => rendererMap,
8256     rendererPhotos: () => rendererPhotos,
8257     rendererTileLayer: () => rendererTileLayer,
8258     serviceKartaview: () => kartaview_default,
8259     serviceKeepRight: () => keepRight_default,
8260     serviceMapRules: () => maprules_default,
8261     serviceMapilio: () => mapilio_default,
8262     serviceMapillary: () => mapillary_default,
8263     serviceNominatim: () => nominatim_default,
8264     serviceNsi: () => nsi_default,
8265     serviceOsm: () => osm_default,
8266     serviceOsmWikibase: () => osm_wikibase_default,
8267     serviceOsmose: () => osmose_default,
8268     servicePanoramax: () => panoramax_default,
8269     serviceStreetside: () => streetside_default,
8270     serviceTaginfo: () => taginfo_default,
8271     serviceVectorTile: () => vector_tile_default,
8272     serviceVegbilder: () => vegbilder_default,
8273     serviceWikidata: () => wikidata_default,
8274     serviceWikipedia: () => wikipedia_default,
8275     services: () => services,
8276     setDebug: () => setDebug,
8277     svgAreas: () => svgAreas,
8278     svgData: () => svgData,
8279     svgDebug: () => svgDebug,
8280     svgDefs: () => svgDefs,
8281     svgGeolocate: () => svgGeolocate,
8282     svgIcon: () => svgIcon,
8283     svgKartaviewImages: () => svgKartaviewImages,
8284     svgKeepRight: () => svgKeepRight,
8285     svgLabels: () => svgLabels,
8286     svgLayers: () => svgLayers,
8287     svgLines: () => svgLines,
8288     svgMapilioImages: () => svgMapilioImages,
8289     svgMapillaryImages: () => svgMapillaryImages,
8290     svgMapillarySigns: () => svgMapillarySigns,
8291     svgMarkerSegments: () => svgMarkerSegments,
8292     svgMidpoints: () => svgMidpoints,
8293     svgNotes: () => svgNotes,
8294     svgOsm: () => svgOsm,
8295     svgPanoramaxImages: () => svgPanoramaxImages,
8296     svgPassiveVertex: () => svgPassiveVertex,
8297     svgPath: () => svgPath,
8298     svgPointTransform: () => svgPointTransform,
8299     svgPoints: () => svgPoints,
8300     svgRelationMemberTags: () => svgRelationMemberTags,
8301     svgSegmentWay: () => svgSegmentWay,
8302     svgStreetside: () => svgStreetside,
8303     svgTagClasses: () => svgTagClasses,
8304     svgTagPattern: () => svgTagPattern,
8305     svgTouch: () => svgTouch,
8306     svgTurns: () => svgTurns,
8307     svgVegbilder: () => svgVegbilder,
8308     svgVertices: () => svgVertices,
8309     t: () => _t,
8310     uiAccount: () => uiAccount,
8311     uiAttribution: () => uiAttribution,
8312     uiChangesetEditor: () => uiChangesetEditor,
8313     uiCmd: () => uiCmd,
8314     uiCombobox: () => uiCombobox,
8315     uiCommit: () => uiCommit,
8316     uiCommitWarnings: () => uiCommitWarnings,
8317     uiConfirm: () => uiConfirm,
8318     uiConflicts: () => uiConflicts,
8319     uiContributors: () => uiContributors,
8320     uiCurtain: () => uiCurtain,
8321     uiDataEditor: () => uiDataEditor,
8322     uiDataHeader: () => uiDataHeader,
8323     uiDisclosure: () => uiDisclosure,
8324     uiEditMenu: () => uiEditMenu,
8325     uiEntityEditor: () => uiEntityEditor,
8326     uiFeatureInfo: () => uiFeatureInfo,
8327     uiFeatureList: () => uiFeatureList,
8328     uiField: () => uiField,
8329     uiFieldAccess: () => uiFieldAccess,
8330     uiFieldAddress: () => uiFieldAddress,
8331     uiFieldCheck: () => uiFieldCheck,
8332     uiFieldColour: () => uiFieldText,
8333     uiFieldCombo: () => uiFieldCombo,
8334     uiFieldDefaultCheck: () => uiFieldCheck,
8335     uiFieldDirectionalCombo: () => uiFieldDirectionalCombo,
8336     uiFieldEmail: () => uiFieldText,
8337     uiFieldHelp: () => uiFieldHelp,
8338     uiFieldIdentifier: () => uiFieldText,
8339     uiFieldLanes: () => uiFieldLanes,
8340     uiFieldLocalized: () => uiFieldLocalized,
8341     uiFieldManyCombo: () => uiFieldCombo,
8342     uiFieldMultiCombo: () => uiFieldCombo,
8343     uiFieldNetworkCombo: () => uiFieldCombo,
8344     uiFieldNumber: () => uiFieldText,
8345     uiFieldOnewayCheck: () => uiFieldCheck,
8346     uiFieldRadio: () => uiFieldRadio,
8347     uiFieldRestrictions: () => uiFieldRestrictions,
8348     uiFieldRoadheight: () => uiFieldRoadheight,
8349     uiFieldRoadspeed: () => uiFieldRoadspeed,
8350     uiFieldSchedule: () => uiFieldText,
8351     uiFieldSemiCombo: () => uiFieldCombo,
8352     uiFieldStructureRadio: () => uiFieldRadio,
8353     uiFieldTel: () => uiFieldText,
8354     uiFieldText: () => uiFieldText,
8355     uiFieldTextarea: () => uiFieldTextarea,
8356     uiFieldTypeCombo: () => uiFieldCombo,
8357     uiFieldUrl: () => uiFieldText,
8358     uiFieldWikidata: () => uiFieldWikidata,
8359     uiFieldWikipedia: () => uiFieldWikipedia,
8360     uiFields: () => uiFields,
8361     uiFlash: () => uiFlash,
8362     uiFormFields: () => uiFormFields,
8363     uiFullScreen: () => uiFullScreen,
8364     uiGeolocate: () => uiGeolocate,
8365     uiInfo: () => uiInfo,
8366     uiInfoPanels: () => uiInfoPanels,
8367     uiInit: () => uiInit,
8368     uiInspector: () => uiInspector,
8369     uiIntro: () => uiIntro,
8370     uiIssuesInfo: () => uiIssuesInfo,
8371     uiKeepRightDetails: () => uiKeepRightDetails,
8372     uiKeepRightEditor: () => uiKeepRightEditor,
8373     uiKeepRightHeader: () => uiKeepRightHeader,
8374     uiLasso: () => uiLasso,
8375     uiLengthIndicator: () => uiLengthIndicator,
8376     uiLoading: () => uiLoading,
8377     uiMapInMap: () => uiMapInMap,
8378     uiModal: () => uiModal,
8379     uiNoteComments: () => uiNoteComments,
8380     uiNoteEditor: () => uiNoteEditor,
8381     uiNoteHeader: () => uiNoteHeader,
8382     uiNoteReport: () => uiNoteReport,
8383     uiNotice: () => uiNotice,
8384     uiPaneBackground: () => uiPaneBackground,
8385     uiPaneHelp: () => uiPaneHelp,
8386     uiPaneIssues: () => uiPaneIssues,
8387     uiPaneMapData: () => uiPaneMapData,
8388     uiPanePreferences: () => uiPanePreferences,
8389     uiPanelBackground: () => uiPanelBackground,
8390     uiPanelHistory: () => uiPanelHistory,
8391     uiPanelLocation: () => uiPanelLocation,
8392     uiPanelMeasurement: () => uiPanelMeasurement,
8393     uiPopover: () => uiPopover,
8394     uiPresetIcon: () => uiPresetIcon,
8395     uiPresetList: () => uiPresetList,
8396     uiRestore: () => uiRestore,
8397     uiScale: () => uiScale,
8398     uiSectionBackgroundDisplayOptions: () => uiSectionBackgroundDisplayOptions,
8399     uiSectionBackgroundList: () => uiSectionBackgroundList,
8400     uiSectionBackgroundOffset: () => uiSectionBackgroundOffset,
8401     uiSectionChanges: () => uiSectionChanges,
8402     uiSectionDataLayers: () => uiSectionDataLayers,
8403     uiSectionEntityIssues: () => uiSectionEntityIssues,
8404     uiSectionFeatureType: () => uiSectionFeatureType,
8405     uiSectionMapFeatures: () => uiSectionMapFeatures,
8406     uiSectionMapStyleOptions: () => uiSectionMapStyleOptions,
8407     uiSectionOverlayList: () => uiSectionOverlayList,
8408     uiSectionPhotoOverlays: () => uiSectionPhotoOverlays,
8409     uiSectionPresetFields: () => uiSectionPresetFields,
8410     uiSectionPrivacy: () => uiSectionPrivacy,
8411     uiSectionRawMemberEditor: () => uiSectionRawMemberEditor,
8412     uiSectionRawMembershipEditor: () => uiSectionRawMembershipEditor,
8413     uiSectionRawTagEditor: () => uiSectionRawTagEditor,
8414     uiSectionSelectionList: () => uiSectionSelectionList,
8415     uiSectionValidationIssues: () => uiSectionValidationIssues,
8416     uiSectionValidationOptions: () => uiSectionValidationOptions,
8417     uiSectionValidationRules: () => uiSectionValidationRules,
8418     uiSectionValidationStatus: () => uiSectionValidationStatus,
8419     uiSettingsCustomBackground: () => uiSettingsCustomBackground,
8420     uiSettingsCustomData: () => uiSettingsCustomData,
8421     uiSidebar: () => uiSidebar,
8422     uiSourceSwitch: () => uiSourceSwitch,
8423     uiSpinner: () => uiSpinner,
8424     uiSplash: () => uiSplash,
8425     uiStatus: () => uiStatus,
8426     uiSuccess: () => uiSuccess,
8427     uiTagReference: () => uiTagReference,
8428     uiToggle: () => uiToggle,
8429     uiTooltip: () => uiTooltip,
8430     uiVersion: () => uiVersion,
8431     uiViewOnKeepRight: () => uiViewOnKeepRight,
8432     uiViewOnOSM: () => uiViewOnOSM,
8433     uiZoom: () => uiZoom,
8434     utilAesDecrypt: () => utilAesDecrypt,
8435     utilAesEncrypt: () => utilAesEncrypt,
8436     utilArrayChunk: () => utilArrayChunk,
8437     utilArrayDifference: () => utilArrayDifference,
8438     utilArrayFlatten: () => utilArrayFlatten,
8439     utilArrayGroupBy: () => utilArrayGroupBy,
8440     utilArrayIdentical: () => utilArrayIdentical,
8441     utilArrayIntersection: () => utilArrayIntersection,
8442     utilArrayUnion: () => utilArrayUnion,
8443     utilArrayUniq: () => utilArrayUniq,
8444     utilArrayUniqBy: () => utilArrayUniqBy,
8445     utilAsyncMap: () => utilAsyncMap,
8446     utilCheckTagDictionary: () => utilCheckTagDictionary,
8447     utilCleanOsmString: () => utilCleanOsmString,
8448     utilCleanTags: () => utilCleanTags,
8449     utilCombinedTags: () => utilCombinedTags,
8450     utilCompareIDs: () => utilCompareIDs,
8451     utilDeepMemberSelector: () => utilDeepMemberSelector,
8452     utilDetect: () => utilDetect,
8453     utilDisplayName: () => utilDisplayName,
8454     utilDisplayNameForPath: () => utilDisplayNameForPath,
8455     utilDisplayType: () => utilDisplayType,
8456     utilEditDistance: () => utilEditDistance,
8457     utilEntityAndDeepMemberIDs: () => utilEntityAndDeepMemberIDs,
8458     utilEntityOrDeepMemberSelector: () => utilEntityOrDeepMemberSelector,
8459     utilEntityOrMemberSelector: () => utilEntityOrMemberSelector,
8460     utilEntityRoot: () => utilEntityRoot,
8461     utilEntitySelector: () => utilEntitySelector,
8462     utilFastMouse: () => utilFastMouse,
8463     utilFunctor: () => utilFunctor,
8464     utilGetAllNodes: () => utilGetAllNodes,
8465     utilGetSetValue: () => utilGetSetValue,
8466     utilHashcode: () => utilHashcode,
8467     utilHighlightEntities: () => utilHighlightEntities,
8468     utilKeybinding: () => utilKeybinding,
8469     utilNoAuto: () => utilNoAuto,
8470     utilObjectOmit: () => utilObjectOmit,
8471     utilOldestID: () => utilOldestID,
8472     utilPrefixCSSProperty: () => utilPrefixCSSProperty,
8473     utilPrefixDOMProperty: () => utilPrefixDOMProperty,
8474     utilQsString: () => utilQsString,
8475     utilRebind: () => utilRebind,
8476     utilSafeClassName: () => utilSafeClassName,
8477     utilSessionMutex: () => utilSessionMutex,
8478     utilSetTransform: () => utilSetTransform,
8479     utilStringQs: () => utilStringQs,
8480     utilTagDiff: () => utilTagDiff,
8481     utilTagText: () => utilTagText,
8482     utilTiler: () => utilTiler,
8483     utilTotalExtent: () => utilTotalExtent,
8484     utilTriggerEvent: () => utilTriggerEvent,
8485     utilUnicodeCharsCount: () => utilUnicodeCharsCount,
8486     utilUnicodeCharsTruncated: () => utilUnicodeCharsTruncated,
8487     utilUniqueDomId: () => utilUniqueDomId,
8488     utilWrap: () => utilWrap,
8489     validationAlmostJunction: () => validationAlmostJunction,
8490     validationCloseNodes: () => validationCloseNodes,
8491     validationCrossingWays: () => validationCrossingWays,
8492     validationDisconnectedWay: () => validationDisconnectedWay,
8493     validationFormatting: () => validationFormatting,
8494     validationHelpRequest: () => validationHelpRequest,
8495     validationImpossibleOneway: () => validationImpossibleOneway,
8496     validationIncompatibleSource: () => validationIncompatibleSource,
8497     validationMaprules: () => validationMaprules,
8498     validationMismatchedGeometry: () => validationMismatchedGeometry,
8499     validationMissingRole: () => validationMissingRole,
8500     validationMissingTag: () => validationMissingTag,
8501     validationMutuallyExclusiveTags: () => validationMutuallyExclusiveTags,
8502     validationOsmApiLimits: () => validationOsmApiLimits,
8503     validationOutdatedTags: () => validationOutdatedTags,
8504     validationPrivateData: () => validationPrivateData,
8505     validationSuspiciousName: () => validationSuspiciousName,
8506     validationUnsquareWay: () => validationUnsquareWay
8507   });
8508
8509   // modules/actions/add_entity.js
8510   function actionAddEntity(way) {
8511     return function(graph) {
8512       return graph.replace(way);
8513     };
8514   }
8515
8516   // node_modules/d3-dispatch/src/dispatch.js
8517   var noop = { value: () => {
8518   } };
8519   function dispatch() {
8520     for (var i3 = 0, n3 = arguments.length, _3 = {}, t2; i3 < n3; ++i3) {
8521       if (!(t2 = arguments[i3] + "") || t2 in _3 || /[\s.]/.test(t2)) throw new Error("illegal type: " + t2);
8522       _3[t2] = [];
8523     }
8524     return new Dispatch(_3);
8525   }
8526   function Dispatch(_3) {
8527     this._ = _3;
8528   }
8529   function parseTypenames(typenames, types) {
8530     return typenames.trim().split(/^|\s+/).map(function(t2) {
8531       var name = "", i3 = t2.indexOf(".");
8532       if (i3 >= 0) name = t2.slice(i3 + 1), t2 = t2.slice(0, i3);
8533       if (t2 && !types.hasOwnProperty(t2)) throw new Error("unknown type: " + t2);
8534       return { type: t2, name };
8535     });
8536   }
8537   Dispatch.prototype = dispatch.prototype = {
8538     constructor: Dispatch,
8539     on: function(typename, callback) {
8540       var _3 = this._, T3 = parseTypenames(typename + "", _3), t2, i3 = -1, n3 = T3.length;
8541       if (arguments.length < 2) {
8542         while (++i3 < n3) if ((t2 = (typename = T3[i3]).type) && (t2 = get(_3[t2], typename.name))) return t2;
8543         return;
8544       }
8545       if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
8546       while (++i3 < n3) {
8547         if (t2 = (typename = T3[i3]).type) _3[t2] = set(_3[t2], typename.name, callback);
8548         else if (callback == null) for (t2 in _3) _3[t2] = set(_3[t2], typename.name, null);
8549       }
8550       return this;
8551     },
8552     copy: function() {
8553       var copy2 = {}, _3 = this._;
8554       for (var t2 in _3) copy2[t2] = _3[t2].slice();
8555       return new Dispatch(copy2);
8556     },
8557     call: function(type2, that) {
8558       if ((n3 = arguments.length - 2) > 0) for (var args = new Array(n3), i3 = 0, n3, t2; i3 < n3; ++i3) args[i3] = arguments[i3 + 2];
8559       if (!this._.hasOwnProperty(type2)) throw new Error("unknown type: " + type2);
8560       for (t2 = this._[type2], i3 = 0, n3 = t2.length; i3 < n3; ++i3) t2[i3].value.apply(that, args);
8561     },
8562     apply: function(type2, that, args) {
8563       if (!this._.hasOwnProperty(type2)) throw new Error("unknown type: " + type2);
8564       for (var t2 = this._[type2], i3 = 0, n3 = t2.length; i3 < n3; ++i3) t2[i3].value.apply(that, args);
8565     }
8566   };
8567   function get(type2, name) {
8568     for (var i3 = 0, n3 = type2.length, c2; i3 < n3; ++i3) {
8569       if ((c2 = type2[i3]).name === name) {
8570         return c2.value;
8571       }
8572     }
8573   }
8574   function set(type2, name, callback) {
8575     for (var i3 = 0, n3 = type2.length; i3 < n3; ++i3) {
8576       if (type2[i3].name === name) {
8577         type2[i3] = noop, type2 = type2.slice(0, i3).concat(type2.slice(i3 + 1));
8578         break;
8579       }
8580     }
8581     if (callback != null) type2.push({ name, value: callback });
8582     return type2;
8583   }
8584   var dispatch_default = dispatch;
8585
8586   // node_modules/idb-keyval/dist/index.js
8587   function promisifyRequest(request3) {
8588     return new Promise((resolve, reject) => {
8589       request3.oncomplete = request3.onsuccess = () => resolve(request3.result);
8590       request3.onabort = request3.onerror = () => reject(request3.error);
8591     });
8592   }
8593   function createStore(dbName, storeName) {
8594     let dbp;
8595     const getDB = () => {
8596       if (dbp)
8597         return dbp;
8598       const request3 = indexedDB.open(dbName);
8599       request3.onupgradeneeded = () => request3.result.createObjectStore(storeName);
8600       dbp = promisifyRequest(request3);
8601       dbp.then((db) => {
8602         db.onclose = () => dbp = void 0;
8603       }, () => {
8604       });
8605       return dbp;
8606     };
8607     return (txMode, callback) => getDB().then((db) => callback(db.transaction(storeName, txMode).objectStore(storeName)));
8608   }
8609   var defaultGetStoreFunc;
8610   function defaultGetStore() {
8611     if (!defaultGetStoreFunc) {
8612       defaultGetStoreFunc = createStore("keyval-store", "keyval");
8613     }
8614     return defaultGetStoreFunc;
8615   }
8616   function get2(key, customStore = defaultGetStore()) {
8617     return customStore("readonly", (store) => promisifyRequest(store.get(key)));
8618   }
8619   function set2(key, value, customStore = defaultGetStore()) {
8620     return customStore("readwrite", (store) => {
8621       store.put(value, key);
8622       return promisifyRequest(store.transaction);
8623     });
8624   }
8625   function del(key, customStore = defaultGetStore()) {
8626     return customStore("readwrite", (store) => {
8627       store.delete(key);
8628       return promisifyRequest(store.transaction);
8629     });
8630   }
8631
8632   // modules/core/preferences.js
8633   var _storage;
8634   try {
8635     _storage = localStorage;
8636   } catch (e3) {
8637   }
8638   _storage = _storage || /* @__PURE__ */ (() => {
8639     let s2 = {};
8640     return {
8641       getItem: (k3) => s2[k3],
8642       setItem: (k3, v3) => s2[k3] = v3,
8643       removeItem: (k3) => delete s2[k3]
8644     };
8645   })();
8646   var _listeners = {};
8647   function corePreferences(k3, v3) {
8648     try {
8649       if (v3 === void 0) return _storage.getItem(k3);
8650       else if (v3 === null) _storage.removeItem(k3);
8651       else _storage.setItem(k3, v3);
8652       if (_listeners[k3]) {
8653         _listeners[k3].forEach((handler) => handler(v3));
8654       }
8655       return true;
8656     } catch (e3) {
8657       if (typeof console !== "undefined") {
8658         console.error("localStorage quota exceeded");
8659       }
8660       return false;
8661     }
8662   }
8663   corePreferences.onChange = function(k3, handler) {
8664     _listeners[k3] = _listeners[k3] || [];
8665     _listeners[k3].push(handler);
8666   };
8667   var asyncPrefs = {
8668     get: get2,
8669     set: set2,
8670     del
8671   };
8672
8673   // config/id.js
8674   var presetsCdnUrl = "https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@{presets_version}/";
8675   var ociCdnUrl = "https://cdn.jsdelivr.net/npm/osm-community-index@{version}/";
8676   var wmfSitematrixCdnUrl = "https://cdn.jsdelivr.net/npm/wmf-sitematrix@{version}/";
8677   var nsiCdnUrl = "https://cdn.jsdelivr.net/npm/name-suggestion-index@{version}/";
8678   var defaultOsmApiConnections = {
8679     live: {
8680       url: "https://www.openstreetmap.org",
8681       apiUrl: "https://api.openstreetmap.org",
8682       client_id: "0tmNTmd0Jo1dQp4AUmMBLtGiD9YpMuXzHefitcuVStc"
8683     },
8684     dev: {
8685       url: "https://api06.dev.openstreetmap.org",
8686       client_id: "Ee1wWJ6UlpERbF6BfTNOpwn0R8k_06mvMXdDUkeHMgw"
8687     }
8688   };
8689   var osmApiConnections = [];
8690   if (false) {
8691     osmApiConnections.push({
8692       url: null,
8693       apiUrl: null,
8694       client_id: null
8695     });
8696   } else if (false) {
8697     osmApiConnections.push(defaultOsmApiConnections[null]);
8698   } else {
8699     osmApiConnections.push(defaultOsmApiConnections.live);
8700     osmApiConnections.push(defaultOsmApiConnections.dev);
8701   }
8702   var taginfoApiUrl = "https://taginfo.openstreetmap.org/api/4/";
8703   var nominatimApiUrl = "https://nominatim.openstreetmap.org/";
8704   var showDonationMessage = true;
8705
8706   // package.json
8707   var package_default = {
8708     name: "iD",
8709     version: "2.37.2",
8710     description: "A friendly editor for OpenStreetMap",
8711     main: "dist/iD.min.js",
8712     repository: "github:openstreetmap/iD",
8713     homepage: "https://github.com/openstreetmap/iD",
8714     bugs: "https://github.com/openstreetmap/iD/issues",
8715     keywords: [
8716       "editor",
8717       "openstreetmap"
8718     ],
8719     license: "ISC",
8720     type: "module",
8721     scripts: {
8722       all: "run-s clean build dist",
8723       build: "run-s build:css build:data build:js",
8724       "build:css": "node scripts/build_css.js",
8725       "build:data": "shx mkdir -p dist/data && node scripts/build_data.js",
8726       "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",
8727       "build:js": "node config/esbuild.config.js",
8728       "build:js:watch": "node config/esbuild.config.js --watch",
8729       clean: "shx rm -f dist/esbuild.json dist/*.js dist/*.map dist/*.css dist/img/*.svg",
8730       dist: "run-p dist:**",
8731       "dist:mapillary": "shx mkdir -p dist/mapillary-js && shx cp -R node_modules/mapillary-js/dist/* dist/mapillary-js/",
8732       "dist:pannellum": "shx mkdir -p dist/pannellum && shx cp -R node_modules/pannellum/build/* dist/pannellum/",
8733       "dist:min": "node config/esbuild.config.min.js",
8734       "dist:svg:iD": 'svg-sprite --symbol --symbol-dest . --shape-id-generator "iD-%s" --symbol-sprite dist/img/iD-sprite.svg "svg/iD-sprite/**/*.svg"',
8735       "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',
8736       "dist:svg:fa": "svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/fa-sprite.svg svg/fontawesome/*.svg",
8737       "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',
8738       "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",
8739       "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",
8740       "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',
8741       "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',
8742       imagery: "node scripts/update_imagery.js",
8743       lint: "eslint config scripts test/spec modules",
8744       "lint:fix": "eslint scripts test/spec modules --fix",
8745       start: "run-s start:watch",
8746       "start:single-build": "run-p build:js start:server",
8747       "start:watch": "run-p build:js:watch start:server",
8748       "start:server": "node scripts/server.js",
8749       test: "npm-run-all -s lint build test:*",
8750       "test:typecheck": "tsc",
8751       "test:spec": "vitest --no-isolate",
8752       translations: "node scripts/update_locales.js"
8753     },
8754     dependencies: {
8755       "@mapbox/geojson-area": "^0.2.2",
8756       "@mapbox/sexagesimal": "1.2.0",
8757       "@mapbox/vector-tile": "^2.0.4",
8758       "@rapideditor/country-coder": "~5.5.1",
8759       "@rapideditor/location-conflation": "~1.7.0",
8760       "@tmcw/togeojson": "^7.1.2",
8761       "@turf/bbox": "^7.2.0",
8762       "@turf/bbox-clip": "^7.2.0",
8763       "abortcontroller-polyfill": "^1.7.8",
8764       "aes-js": "^3.1.2",
8765       "alif-toolkit": "^1.3.0",
8766       "core-js-bundle": "^3.46.0",
8767       diacritics: "1.3.0",
8768       exifr: "^7.1.3",
8769       "fast-deep-equal": "~3.1.1",
8770       "fast-json-stable-stringify": "2.1.0",
8771       "idb-keyval": "^6.2.2",
8772       "lodash-es": "~4.17.15",
8773       marked: "~16.4.1",
8774       "node-diff3": "~3.2.0",
8775       "osm-auth": "^3.1.0",
8776       pannellum: "2.5.6",
8777       pbf: "^4.0.1",
8778       "polygon-clipping": "~0.15.7",
8779       rbush: "4.0.1",
8780       vitest: "^3.2.4",
8781       "whatwg-fetch": "^3.6.20",
8782       "which-polygon": "2.2.1"
8783     },
8784     devDependencies: {
8785       "@actions/github-script": "github:actions/github-script",
8786       "@fortawesome/fontawesome-svg-core": "^7.1.0",
8787       "@fortawesome/free-brands-svg-icons": "^7.1.0",
8788       "@fortawesome/free-regular-svg-icons": "^7.1.0",
8789       "@fortawesome/free-solid-svg-icons": "^7.1.0",
8790       "@mapbox/maki": "^8.2.0",
8791       "@openstreetmap/id-tagging-schema": "^6.13.1",
8792       "@rapideditor/mapillary_sprite_source": "^1.8.0",
8793       "@rapideditor/temaki": "^5.11.0",
8794       "@transifex/api": "^7.1.4",
8795       "@types/chai": "^5.2.3",
8796       "@types/d3": "^7.4.3",
8797       "@types/geojson": "^7946.0.16",
8798       "@types/happen": "^0.3.0",
8799       "@types/lodash-es": "^4.17.12",
8800       "@types/node": "^24.9.1",
8801       "@types/sinon": "^17.0.4",
8802       "@types/sinon-chai": "^4.0.0",
8803       autoprefixer: "^10.4.21",
8804       browserslist: "^4.27.0",
8805       "browserslist-to-esbuild": "^2.1.1",
8806       "cldr-core": "^47.0.0",
8807       "cldr-localenames-full": "^47.0.0",
8808       "concat-files": "^0.1.1",
8809       d3: "~7.9.0",
8810       dotenv: "^17.2.3",
8811       "editor-layer-index": "github:osmlab/editor-layer-index#gh-pages",
8812       esbuild: "^0.25.11",
8813       "esbuild-visualizer": "^0.7.0",
8814       eslint: "^9.38.0",
8815       "fake-indexeddb": "^6.2.4",
8816       "fetch-mock": "^11.1.1",
8817       gaze: "^1.1.3",
8818       happen: "^0.3.2",
8819       "js-yaml": "^4.0.0",
8820       jsdom: "^26.1.0",
8821       "json-stringify-pretty-compact": "^3.0.0",
8822       "mapillary-js": "4.1.2",
8823       "name-suggestion-index": "~6.0",
8824       "netlify-cli": "^23.9.5",
8825       nise: "^6.1.1",
8826       "npm-run-all": "^4.0.0",
8827       "osm-community-index": "5.9.3",
8828       postcss: "^8.5.6",
8829       "postcss-prefix-selector": "^2.1.1",
8830       "serve-handler": "^6.1.6",
8831       shelljs: "^0.10.0",
8832       shx: "^0.4.0",
8833       sinon: "^21.0.0",
8834       "sinon-chai": "^4.0.1",
8835       smash: "0.0",
8836       "svg-sprite": "2.0.4",
8837       typescript: "^5.9.3",
8838       "typescript-eslint": "^8.46.2",
8839       vparse: "~1.1.0"
8840     },
8841     engines: {
8842       node: ">=22"
8843     },
8844     browserslist: [
8845       "> 0.3%, last 6 major versions, not dead, Firefox ESR, maintained node versions"
8846     ]
8847   };
8848
8849   // modules/core/file_fetcher.js
8850   var _mainFileFetcher = coreFileFetcher();
8851   function coreFileFetcher() {
8852     const ociVersion = "5.10.0";
8853     const presetsVersion = package_default.devDependencies["@openstreetmap/id-tagging-schema"];
8854     let _this = {};
8855     let _inflight4 = {};
8856     let _fileMap = {
8857       "address_formats": "data/address_formats.min.json",
8858       "imagery": "data/imagery.min.json",
8859       "intro_graph": "data/intro_graph.min.json",
8860       "keepRight": "data/keepRight.min.json",
8861       "languages": "data/languages.min.json",
8862       "locales": "locales/index.min.json",
8863       "phone_formats": "data/phone_formats.min.json",
8864       "qa_data": "data/qa_data.min.json",
8865       "shortcuts": "data/shortcuts.min.json",
8866       "territory_languages": "data/territory_languages.min.json",
8867       "oci_defaults": ociCdnUrl.replace("{version}", ociVersion) + "dist/json/defaults.min.json",
8868       "oci_features": ociCdnUrl.replace("{version}", ociVersion) + "dist/json/featureCollection.min.json",
8869       "oci_resources": ociCdnUrl.replace("{version}", ociVersion) + "dist/json/resources.min.json",
8870       "presets_package": presetsCdnUrl.replace("{presets_version}", presetsVersion) + "package.json",
8871       "deprecated": presetsCdnUrl + "dist/deprecated.min.json",
8872       "discarded": presetsCdnUrl + "dist/discarded.min.json",
8873       "preset_categories": presetsCdnUrl + "dist/preset_categories.min.json",
8874       "preset_defaults": presetsCdnUrl + "dist/preset_defaults.min.json",
8875       "preset_fields": presetsCdnUrl + "dist/fields.min.json",
8876       "preset_presets": presetsCdnUrl + "dist/presets.min.json",
8877       "wmf_sitematrix": wmfSitematrixCdnUrl.replace("{version}", "0.2") + "data/wikipedia.min.json"
8878     };
8879     let _cachedData = {};
8880     _this.cache = () => _cachedData;
8881     _this.get = (which) => {
8882       if (_cachedData[which]) {
8883         return Promise.resolve(_cachedData[which]);
8884       }
8885       const file = _fileMap[which];
8886       const url = file && _this.asset(file);
8887       if (!url) {
8888         return Promise.reject('Unknown data file for "'.concat(which, '"'));
8889       }
8890       if (url.includes("{presets_version}")) {
8891         return _this.get("presets_package").then((result) => {
8892           const presetsVersion2 = result.version;
8893           return getUrl(url.replace("{presets_version}", presetsVersion2), which);
8894         });
8895       } else {
8896         return getUrl(url, which);
8897       }
8898     };
8899     function getUrl(url, which) {
8900       let prom = _inflight4[url];
8901       if (!prom) {
8902         _inflight4[url] = prom = (window.VITEST ? import("../".concat(url)) : fetch(url)).then((response) => {
8903           if (window.VITEST) return response.default;
8904           if (!response.ok || !response.json) {
8905             throw new Error(response.status + " " + response.statusText);
8906           }
8907           if (response.status === 204 || response.status === 205) return;
8908           return response.json();
8909         }).then((result) => {
8910           delete _inflight4[url];
8911           if (!result) {
8912             throw new Error('No data loaded for "'.concat(which, '"'));
8913           }
8914           _cachedData[which] = result;
8915           return result;
8916         }).catch((err) => {
8917           delete _inflight4[url];
8918           throw err;
8919         });
8920       }
8921       return prom;
8922     }
8923     _this.fileMap = function(val) {
8924       if (!arguments.length) return _fileMap;
8925       _fileMap = val;
8926       return _this;
8927     };
8928     let _assetPath = "";
8929     _this.assetPath = function(val) {
8930       if (!arguments.length) return _assetPath;
8931       _assetPath = val;
8932       return _this;
8933     };
8934     let _assetMap = {};
8935     _this.assetMap = function(val) {
8936       if (!arguments.length) return _assetMap;
8937       _assetMap = val;
8938       return _this;
8939     };
8940     _this.asset = (val) => {
8941       if (/^http(s)?:\/\//i.test(val)) return val;
8942       const filename = _assetPath + val;
8943       return _assetMap[filename] || filename;
8944     };
8945     return _this;
8946   }
8947
8948   // node_modules/@rapideditor/location-conflation/node_modules/@rapideditor/country-coder/dist/country-coder.mjs
8949   var import_which_polygon = __toESM(require_which_polygon(), 1);
8950   var borders_default = {
8951     type: "FeatureCollection",
8952     features: [
8953       { 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]]]] } },
8954       { 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]]]] } },
8955       { 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]]]] } },
8956       { 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]]]] } },
8957       { 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]]]] } },
8958       { 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]]]] } },
8959       { 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]]]] } },
8960       { 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]]]] } },
8961       { 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]]]] } },
8962       { 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]]]] } },
8963       { 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]]]] } },
8964       { 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]]]] } },
8965       { 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]]]] } },
8966       { 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]]]] } },
8967       { 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]]]] } },
8968       { 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]]]] } },
8969       { 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]]]] } },
8970       { 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]]]] } },
8971       { 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]]]] } },
8972       { type: "Feature", properties: { wikidata: "Q12837", nameEn: "Iberia", level: "sharedLandform" }, geometry: null },
8973       { 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]]]] } },
8974       { 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]]]] } },
8975       { type: "Feature", properties: { wikidata: "Q22890", nameEn: "Ireland", level: "sharedLandform" }, geometry: null },
8976       { type: "Feature", properties: { wikidata: "Q23666", nameEn: "Great Britain", country: "GB", level: "sharedLandform" }, geometry: null },
8977       { 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]]]] } },
8978       { 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]]]] } },
8979       { 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]]]] } },
8980       { 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]]]] } },
8981       { 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]]]] } },
8982       { 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]]]] } },
8983       { 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]]]] } },
8984       { 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]]]] } },
8985       { 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]]]] } },
8986       { 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]]]] } },
8987       { 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]]]] } },
8988       { 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]]]] } },
8989       { type: "Feature", properties: { wikidata: "Q35657", nameEn: "US States", country: "US", level: "subcountryGroup" }, geometry: null },
8990       { type: "Feature", properties: { wikidata: "Q36117", nameEn: "Borneo", level: "sharedLandform" }, geometry: null },
8991       { 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]]]] } },
8992       { type: "Feature", properties: { wikidata: "Q37362", nameEn: "Akrotiri and Dhekelia", aliases: ["SBA"], country: "GB" }, geometry: null },
8993       { 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]]]] } },
8994       { 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]]]] } },
8995       { 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]]]] } },
8996       { 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]]]] } },
8997       { 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]]]] } },
8998       { 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]]]] } },
8999       { type: "Feature", properties: { wikidata: "Q46395", nameEn: "British Overseas Territories", aliases: ["BOTS", "UKOTS"], country: "GB", level: "subcountryGroup" }, geometry: null },
9000       { 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]]]] } },
9001       { 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]]]] } },
9002       { 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]]]] } },
9003       { 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]]]] } },
9004       { type: "Feature", properties: { wikidata: "Q105472", nameEn: "Macaronesia", level: "sharedLandform" }, geometry: null },
9005       { 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]]]] } },
9006       { 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]]]] } },
9007       { 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]]]] } },
9008       { 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]]]] } },
9009       { 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]]]] } },
9010       { 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]]]] } },
9011       { 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]]]] } },
9012       { 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]]]] } },
9013       { 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]]]] } },
9014       { 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]]]] } },
9015       { type: "Feature", properties: { wikidata: "Q153732", nameEn: "Mariana Islands", level: "sharedLandform" }, geometry: null },
9016       { 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]]]] } },
9017       { 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]]]] } },
9018       { type: "Feature", properties: { wikidata: "Q185086", nameEn: "Crown Dependencies", country: "GB", level: "subcountryGroup" }, geometry: null },
9019       { 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]]]] } },
9020       { type: "Feature", properties: { wikidata: "Q191011", nameEn: "Plazas de soberan\xEDa", country: "ES" }, geometry: null },
9021       { 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]]]] } },
9022       { 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]]]] } },
9023       { 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]]]] } },
9024       { 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]]]] } },
9025       { 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]]]] } },
9026       { type: "Feature", properties: { wikidata: "Q644636", nameEn: "Cyprus", level: "sharedLandform" }, geometry: null },
9027       { type: "Feature", properties: { wikidata: "Q851132", nameEn: "New Zealand Outlying Islands", country: "NZ", level: "subcountryGroup" }, geometry: null },
9028       { 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]]]] } },
9029       { 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]]]] } },
9030       { 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]]]] } },
9031       { 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]]]] } },
9032       { type: "Feature", properties: { wikidata: "Q1352230", nameEn: "US Territories", country: "US", level: "subcountryGroup" }, geometry: null },
9033       { type: "Feature", properties: { wikidata: "Q1451600", nameEn: "Overseas Countries and Territories of the EU", aliases: ["OCT"], level: "subunion" }, geometry: null },
9034       { 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]]]] } },
9035       { 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]]]] } },
9036       { 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]]]] } },
9037       { 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]]]] } },
9038       { 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]]]] } },
9039       { 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]]]] } },
9040       { 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]]]] } },
9041       { 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]]]] } },
9042       { type: "Feature", properties: { wikidata: "Q2914565", nameEn: "Autonomous Regions of Portugal", country: "PT", level: "subcountryGroup" }, geometry: null },
9043       { 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]]]] } },
9044       { 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]]]] } },
9045       { type: "Feature", properties: { wikidata: "Q3320166", nameEn: "Outermost Regions of the EU", aliases: ["OMR"], level: "subunion" }, geometry: null },
9046       { type: "Feature", properties: { wikidata: "Q3336843", nameEn: "Countries of the United Kingdom", aliases: ["GB-UKM"], country: "GB", level: "subcountryGroup" }, geometry: null },
9047       { 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]]]] } },
9048       { 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]]]] } },
9049       { 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]]]] } },
9050       { 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]]]] } },
9051       { 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]]]] } },
9052       { 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]]]] } },
9053       { type: "Feature", properties: { m49: "001", wikidata: "Q2", nameEn: "World", aliases: ["Earth", "Planet"], level: "world" }, geometry: null },
9054       { type: "Feature", properties: { m49: "002", wikidata: "Q15", nameEn: "Africa", level: "region" }, geometry: null },
9055       { type: "Feature", properties: { m49: "003", wikidata: "Q49", nameEn: "North America", level: "subregion" }, geometry: null },
9056       { type: "Feature", properties: { m49: "005", wikidata: "Q18", nameEn: "South America", level: "intermediateRegion" }, geometry: null },
9057       { type: "Feature", properties: { m49: "009", wikidata: "Q538", nameEn: "Oceania", level: "region" }, geometry: null },
9058       { type: "Feature", properties: { m49: "011", wikidata: "Q4412", nameEn: "Western Africa", level: "intermediateRegion" }, geometry: null },
9059       { type: "Feature", properties: { m49: "013", wikidata: "Q27611", nameEn: "Central America", level: "intermediateRegion" }, geometry: null },
9060       { type: "Feature", properties: { m49: "014", wikidata: "Q27407", nameEn: "Eastern Africa", level: "intermediateRegion" }, geometry: null },
9061       { type: "Feature", properties: { m49: "015", wikidata: "Q27381", nameEn: "Northern Africa", level: "subregion" }, geometry: null },
9062       { type: "Feature", properties: { m49: "017", wikidata: "Q27433", nameEn: "Middle Africa", level: "intermediateRegion" }, geometry: null },
9063       { type: "Feature", properties: { m49: "018", wikidata: "Q27394", nameEn: "Southern Africa", level: "intermediateRegion" }, geometry: null },
9064       { type: "Feature", properties: { m49: "019", wikidata: "Q828", nameEn: "Americas", level: "region" }, geometry: null },
9065       { type: "Feature", properties: { m49: "021", wikidata: "Q2017699", nameEn: "Northern America", level: "subregion" }, geometry: null },
9066       { type: "Feature", properties: { m49: "029", wikidata: "Q664609", nameEn: "Caribbean", level: "intermediateRegion" }, geometry: null },
9067       { type: "Feature", properties: { m49: "030", wikidata: "Q27231", nameEn: "Eastern Asia", level: "subregion" }, geometry: null },
9068       { type: "Feature", properties: { m49: "034", wikidata: "Q771405", nameEn: "Southern Asia", level: "subregion" }, geometry: null },
9069       { type: "Feature", properties: { m49: "035", wikidata: "Q11708", nameEn: "South-eastern Asia", level: "subregion" }, geometry: null },
9070       { type: "Feature", properties: { m49: "039", wikidata: "Q27449", nameEn: "Southern Europe", level: "subregion" }, geometry: null },
9071       { type: "Feature", properties: { m49: "053", wikidata: "Q45256", nameEn: "Australia and New Zealand", aliases: ["Australasia"], level: "subregion" }, geometry: null },
9072       { type: "Feature", properties: { m49: "054", wikidata: "Q37394", nameEn: "Melanesia", level: "subregion" }, geometry: null },
9073       { type: "Feature", properties: { m49: "057", wikidata: "Q3359409", nameEn: "Micronesia", level: "subregion" }, geometry: null },
9074       { type: "Feature", properties: { m49: "061", wikidata: "Q35942", nameEn: "Polynesia", level: "subregion" }, geometry: null },
9075       { type: "Feature", properties: { m49: "142", wikidata: "Q48", nameEn: "Asia", level: "region" }, geometry: null },
9076       { type: "Feature", properties: { m49: "143", wikidata: "Q27275", nameEn: "Central Asia", level: "subregion" }, geometry: null },
9077       { type: "Feature", properties: { m49: "145", wikidata: "Q27293", nameEn: "Western Asia", level: "subregion" }, geometry: null },
9078       { type: "Feature", properties: { m49: "150", wikidata: "Q46", nameEn: "Europe", level: "region" }, geometry: null },
9079       { type: "Feature", properties: { m49: "151", wikidata: "Q27468", nameEn: "Eastern Europe", level: "subregion" }, geometry: null },
9080       { type: "Feature", properties: { m49: "154", wikidata: "Q27479", nameEn: "Northern Europe", level: "subregion" }, geometry: null },
9081       { type: "Feature", properties: { m49: "155", wikidata: "Q27496", nameEn: "Western Europe", level: "subregion" }, geometry: null },
9082       { type: "Feature", properties: { m49: "202", wikidata: "Q132959", nameEn: "Sub-Saharan Africa", level: "subregion" }, geometry: null },
9083       { type: "Feature", properties: { m49: "419", wikidata: "Q72829598", nameEn: "Latin America and the Caribbean", level: "subregion" }, geometry: null },
9084       { type: "Feature", properties: { m49: "830", wikidata: "Q42314", nameEn: "Channel Islands", level: "intermediateRegion" }, geometry: null },
9085       { 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]]]] } },
9086       { 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]]]] } },
9087       { 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]]]] } },
9088       { 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]]]] } },
9089       { 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]]]] } },
9090       { 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]]]] } },
9091       { 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]]]] } },
9092       { 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]]]] } },
9093       { 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]]]] } },
9094       { 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]]]] } },
9095       { 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]]]] } },
9096       { 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]]]] } },
9097       { 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]]]] } },
9098       { type: "Feature", properties: { iso1A2: "AU", iso1A3: "AUS", iso1N3: "036", wikidata: "Q408", nameEn: "Australia" }, geometry: null },
9099       { 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]]]] } },
9100       { 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]]]] } },
9101       { 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]]]] } },
9102       { 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]]]] } },
9103       { 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]]]] } },
9104       { 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]]]] } },
9105       { 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]]]] } },
9106       { 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]]]] } },
9107       { 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]]]] } },
9108       { 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]]]] } },
9109       { 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]]]] } },
9110       { 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]]]] } },
9111       { 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]]]] } },
9112       { 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]]]] } },
9113       { 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]]]] } },
9114       { 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]]]] } },
9115       { type: "Feature", properties: { iso1A2: "BQ", iso1A3: "BES", iso1N3: "535", wikidata: "Q27561", nameEn: "Caribbean Netherlands", country: "NL" }, geometry: null },
9116       { 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]]]] } },
9117       { 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]]]] } },
9118       { 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]]]] } },
9119       { 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]]]] } },
9120       { 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]]]] } },
9121       { 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]]]] } },
9122       { 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]]]] } },
9123       { 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]]]] } },
9124       { 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]]]] } },
9125       { 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]]]] } },
9126       { 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]]]] } },
9127       { 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]]]] } },
9128       { 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]]]] } },
9129       { 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]]]] } },
9130       { 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]]]] } },
9131       { 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]]]] } },
9132       { 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]]]] } },
9133       { type: "Feature", properties: { iso1A2: "CN", iso1A3: "CHN", iso1N3: "156", wikidata: "Q148", nameEn: "People's Republic of China" }, geometry: null },
9134       { 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]]]] } },
9135       { 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]]]] } },
9136       { 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]]]] } },
9137       { 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]]]] } },
9138       { 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]]]] } },
9139       { 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]]]] } },
9140       { 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]]]] } },
9141       { 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]]]] } },
9142       { 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]]]] } },
9143       { 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]]]] } },
9144       { 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]]]] } },
9145       { 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]]]] } },
9146       { 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]]]] } },
9147       { type: "Feature", properties: { iso1A2: "DK", iso1A3: "DNK", iso1N3: "208", wikidata: "Q756617", nameEn: "Kingdom of Denmark" }, geometry: null },
9148       { 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]]]] } },
9149       { 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]]]] } },
9150       { 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]]]] } },
9151       { type: "Feature", properties: { iso1A2: "EA", wikidata: "Q28868874", nameEn: "Ceuta, Melilla", country: "ES", level: "territory", isoStatus: "excRes" }, geometry: null },
9152       { type: "Feature", properties: { iso1A2: "EC", iso1A3: "ECU", iso1N3: "218", wikidata: "Q736", nameEn: "Ecuador" }, geometry: null },
9153       { 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]]]] } },
9154       { 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]]]] } },
9155       { 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]]]] } },
9156       { 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]]]] } },
9157       { type: "Feature", properties: { iso1A2: "ES", iso1A3: "ESP", iso1N3: "724", wikidata: "Q29", nameEn: "Spain" }, geometry: null },
9158       { 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]]]] } },
9159       { type: "Feature", properties: { iso1A2: "EU", iso1A3: "EUE", wikidata: "Q458", nameEn: "European Union", level: "union", isoStatus: "excRes" }, geometry: null },
9160       { type: "Feature", properties: { iso1A2: "FI", iso1A3: "FIN", iso1N3: "246", wikidata: "Q33", nameEn: "Finland", aliases: ["SF"] }, geometry: null },
9161       { 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]]]] } },
9162       { 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]]]] } },
9163       { 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]]]] } },
9164       { 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]]]] } },
9165       { type: "Feature", properties: { iso1A2: "FR", iso1A3: "FRA", iso1N3: "250", wikidata: "Q142", nameEn: "France" }, geometry: null },
9166       { 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]]]] } },
9167       { 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]]]] } },
9168       { type: "Feature", properties: { iso1A2: "GB", iso1A3: "GBR", iso1N3: "826", wikidata: "Q145", ccTLD: ".uk", nameEn: "United Kingdom", aliases: ["UK"] }, geometry: null },
9169       { 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]]]] } },
9170       { 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]]]] } },
9171       { 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]]]] } },
9172       { type: "Feature", properties: { iso1A2: "GG", iso1A3: "GGY", iso1N3: "831", wikidata: "Q25230", nameEn: "Bailiwick of Guernsey", country: "GB" }, geometry: null },
9173       { 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]]]] } },
9174       { 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]]]] } },
9175       { 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]]]] } },
9176       { 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]]]] } },
9177       { 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]]]] } },
9178       { 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]]]] } },
9179       { 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]]]] } },
9180       { 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]]]] } },
9181       { 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]]]] } },
9182       { 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]]]] } },
9183       { 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]]]] } },
9184       { 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]]]] } },
9185       { 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]]]] } },
9186       { 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]]]] } },
9187       { 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]]]] } },
9188       { 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]]]] } },
9189       { 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]]]] } },
9190       { 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]]]] } },
9191       { 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]]]] } },
9192       { 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]]]] } },
9193       { type: "Feature", properties: { iso1A2: "ID", iso1A3: "IDN", iso1N3: "360", wikidata: "Q252", nameEn: "Indonesia", aliases: ["RI"] }, geometry: null },
9194       { 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]]]] } },
9195       { 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]]]] } },
9196       { 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]]]] } },
9197       { type: "Feature", properties: { iso1A2: "IN", iso1A3: "IND", iso1N3: "356", wikidata: "Q668", nameEn: "India" }, geometry: null },
9198       { type: "Feature", properties: { iso1A2: "IO", iso1A3: "IOT", iso1N3: "086", wikidata: "Q43448", nameEn: "British Indian Ocean Territory", country: "GB" }, geometry: null },
9199       { 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]]]] } },
9200       { 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]]]] } },
9201       { 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]]]] } },
9202       { 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]]]] } },
9203       { 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]]]] } },
9204       { 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]]]] } },
9205       { 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]]]] } },
9206       { 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]]]] } },
9207       { 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]]]] } },
9208       { 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]]]] } },
9209       { 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]]]] } },
9210       { 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]]]] } },
9211       { 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]]]] } },
9212       { 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]]]] } },
9213       { 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]]]] } },
9214       { 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]]]] } },
9215       { 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]]]] } },
9216       { 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]]]] } },
9217       { 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]]]] } },
9218       { 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]]]] } },
9219       { 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]]]] } },
9220       { 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]]]] } },
9221       { 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]]]] } },
9222       { 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]]]] } },
9223       { 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]]]] } },
9224       { 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]]]] } },
9225       { 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]]]] } },
9226       { 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]]]] } },
9227       { 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]]]] } },
9228       { 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]]]] } },
9229       { 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]]]] } },
9230       { 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]]]] } },
9231       { 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]]]] } },
9232       { 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]]]] } },
9233       { 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]]]] } },
9234       { 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]]]] } },
9235       { 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]]]] } },
9236       { 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]]]] } },
9237       { 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]]]] } },
9238       { 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]]]] } },
9239       { 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]]]] } },
9240       { 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]]]] } },
9241       { 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]]]] } },
9242       { 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]]]] } },
9243       { 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]]]] } },
9244       { 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]]]] } },
9245       { 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]]]] } },
9246       { 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]]]] } },
9247       { 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]]]] } },
9248       { 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]]]] } },
9249       { 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]]]] } },
9250       { type: "Feature", properties: { iso1A2: "MY", iso1A3: "MYS", iso1N3: "458", wikidata: "Q833", nameEn: "Malaysia" }, geometry: null },
9251       { 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]]]] } },
9252       { 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]]]] } },
9253       { 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]]]] } },
9254       { 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]]]] } },
9255       { 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]]]] } },
9256       { 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]]]] } },
9257       { 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]]]] } },
9258       { type: "Feature", properties: { iso1A2: "NL", iso1A3: "NLD", iso1N3: "528", wikidata: "Q29999", nameEn: "Kingdom of the Netherlands" }, geometry: null },
9259       { type: "Feature", properties: { iso1A2: "NO", iso1A3: "NOR", iso1N3: "578", wikidata: "Q20", nameEn: "Norway" }, geometry: null },
9260       { 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]]]] } },
9261       { 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]]]] } },
9262       { 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]]]] } },
9263       { type: "Feature", properties: { iso1A2: "NZ", iso1A3: "NZL", iso1N3: "554", wikidata: "Q664", nameEn: "New Zealand" }, geometry: null },
9264       { 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]]]] } },
9265       { 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]]]] } },
9266       { 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]]]] } },
9267       { 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]]]] } },
9268       { 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]]]] } },
9269       { 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]]]] } },
9270       { 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]]]] } },
9271       { 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]]]] } },
9272       { 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]]]] } },
9273       { 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]]]] } },
9274       { 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]]]] } },
9275       { type: "Feature", properties: { iso1A2: "PS", iso1A3: "PSE", iso1N3: "275", wikidata: "Q219060", nameEn: "Palestine" }, geometry: null },
9276       { type: "Feature", properties: { iso1A2: "PT", iso1A3: "PRT", iso1N3: "620", wikidata: "Q45", nameEn: "Portugal" }, geometry: null },
9277       { 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]]]] } },
9278       { 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]]]] } },
9279       { 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]]]] } },
9280       { 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]]]] } },
9281       { 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]]]] } },
9282       { 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]]]] } },
9283       { type: "Feature", properties: { iso1A2: "RU", iso1A3: "RUS", iso1N3: "643", wikidata: "Q159", nameEn: "Russia" }, geometry: null },
9284       { 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]]]] } },
9285       { 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]]]] } },
9286       { 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]]]] } },
9287       { 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]]]] } },
9288       { 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]]]] } },
9289       { 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]]]] } },
9290       { 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]]]] } },
9291       { type: "Feature", properties: { iso1A2: "SH", iso1A3: "SHN", iso1N3: "654", wikidata: "Q192184", nameEn: "Saint Helena, Ascension and Tristan da Cunha", country: "GB" }, geometry: null },
9292       { 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]]]] } },
9293       { type: "Feature", properties: { iso1A2: "SJ", iso1A3: "SJM", iso1N3: "744", wikidata: "Q842829", nameEn: "Svalbard and Jan Mayen", country: "NO" }, geometry: null },
9294       { 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]]]] } },
9295       { 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]]]] } },
9296       { 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]]]] } },
9297       { 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]]]] } },
9298       { 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]]]] } },
9299       { 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]]]] } },
9300       { 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]]]] } },
9301       { 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]]]] } },
9302       { 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]]]] } },
9303       { 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]]]] } },
9304       { 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]]]] } },
9305       { 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]]]] } },
9306       { 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]]]] } },
9307       { 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]]]] } },
9308       { 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]]]] } },
9309       { type: "Feature", properties: { iso1A2: "TF", iso1A3: "ATF", iso1N3: "260", wikidata: "Q129003", nameEn: "French Southern Territories", country: "FR", groups: ["EU", "UN"] }, geometry: null },
9310       { 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]]]] } },
9311       { 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]]]] } },
9312       { 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]]]] } },
9313       { 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]]]] } },
9314       { 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]]]] } },
9315       { 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]]]] } },
9316       { 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]]]] } },
9317       { 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]]]] } },
9318       { 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]]]] } },
9319       { 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]]]] } },
9320       { 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]]]] } },
9321       { 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]]]] } },
9322       { 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]]]] } },
9323       { 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]]]] } },
9324       { 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]]]] } },
9325       { type: "Feature", properties: { iso1A2: "UM", iso1A3: "UMI", iso1N3: "581", wikidata: "Q16645", nameEn: "United States Minor Outlying Islands", country: "US" }, geometry: null },
9326       { type: "Feature", properties: { iso1A2: "UN", wikidata: "Q1065", nameEn: "United Nations", level: "unitedNations", isoStatus: "excRes" }, geometry: null },
9327       { type: "Feature", properties: { iso1A2: "US", iso1A3: "USA", iso1N3: "840", wikidata: "Q30", nameEn: "United States of America" }, geometry: null },
9328       { 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]]]] } },
9329       { 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]]]] } },
9330       { 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]]]] } },
9331       { 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]]]] } },
9332       { 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]]]] } },
9333       { 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]]]] } },
9334       { 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]]]] } },
9335       { 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]]]] } },
9336       { 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]]]] } },
9337       { 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]]]] } },
9338       { 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]]]] } },
9339       { 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]]]] } },
9340       { 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]]]] } },
9341       { 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]]]] } },
9342       { 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]]]] } },
9343       { 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]]]] } },
9344       { 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]]]] } }
9345     ]
9346   };
9347   var borders = borders_default;
9348   var _whichPolygon = {};
9349   var _featuresByCode = {};
9350   var idFilterRegex = /(?=(?!^(and|the|of|el|la|de)$))(\b(and|the|of|el|la|de)\b)|[-_ .,'()&[\]/]/gi;
9351   function canonicalID(id2) {
9352     const s2 = id2 || "";
9353     if (s2.charAt(0) === ".") {
9354       return s2.toUpperCase();
9355     } else {
9356       return s2.replace(idFilterRegex, "").toUpperCase();
9357     }
9358   }
9359   var levels = [
9360     "subterritory",
9361     "territory",
9362     "subcountryGroup",
9363     "country",
9364     "sharedLandform",
9365     "intermediateRegion",
9366     "subregion",
9367     "region",
9368     "subunion",
9369     "union",
9370     "unitedNations",
9371     "world"
9372   ];
9373   loadDerivedDataAndCaches(borders);
9374   function loadDerivedDataAndCaches(borders22) {
9375     const identifierProps = ["iso1A2", "iso1A3", "m49", "wikidata", "emojiFlag", "ccTLD", "nameEn"];
9376     let geometryFeatures = [];
9377     for (const feature4 of borders22.features) {
9378       const props = feature4.properties;
9379       props.id = props.iso1A2 || props.m49 || props.wikidata;
9380       loadM49(feature4);
9381       loadTLD(feature4);
9382       loadIsoStatus(feature4);
9383       loadLevel(feature4);
9384       loadGroups(feature4);
9385       loadFlag(feature4);
9386       cacheFeatureByIDs(feature4);
9387       if (feature4.geometry) {
9388         geometryFeatures.push(feature4);
9389       }
9390     }
9391     for (const feature4 of borders22.features) {
9392       feature4.properties.groups = feature4.properties.groups.map((groupID) => {
9393         return _featuresByCode[groupID].properties.id;
9394       });
9395       loadMembersForGroupsOf(feature4);
9396     }
9397     for (const feature4 of borders22.features) {
9398       loadRoadSpeedUnit(feature4);
9399       loadRoadHeightUnit(feature4);
9400       loadDriveSide(feature4);
9401       loadCallingCodes(feature4);
9402       loadGroupGroups(feature4);
9403     }
9404     for (const feature4 of borders22.features) {
9405       feature4.properties.groups.sort((groupID1, groupID2) => {
9406         return levels.indexOf(_featuresByCode[groupID1].properties.level) - levels.indexOf(_featuresByCode[groupID2].properties.level);
9407       });
9408       if (feature4.properties.members) {
9409         feature4.properties.members.sort((id1, id2) => {
9410           const diff = levels.indexOf(_featuresByCode[id1].properties.level) - levels.indexOf(_featuresByCode[id2].properties.level);
9411           if (diff === 0) {
9412             return borders22.features.indexOf(_featuresByCode[id1]) - borders22.features.indexOf(_featuresByCode[id2]);
9413           }
9414           return diff;
9415         });
9416       }
9417     }
9418     const geometryOnlyCollection = {
9419       type: "FeatureCollection",
9420       features: geometryFeatures
9421     };
9422     _whichPolygon = (0, import_which_polygon.default)(geometryOnlyCollection);
9423     function loadGroups(feature4) {
9424       const props = feature4.properties;
9425       if (!props.groups) {
9426         props.groups = [];
9427       }
9428       if (feature4.geometry && props.country) {
9429         props.groups.push(props.country);
9430       }
9431       if (props.m49 !== "001") {
9432         props.groups.push("001");
9433       }
9434     }
9435     function loadM49(feature4) {
9436       const props = feature4.properties;
9437       if (!props.m49 && props.iso1N3) {
9438         props.m49 = props.iso1N3;
9439       }
9440     }
9441     function loadTLD(feature4) {
9442       const props = feature4.properties;
9443       if (props.level === "unitedNations")
9444         return;
9445       if (props.ccTLD === null)
9446         return;
9447       if (!props.ccTLD && props.iso1A2) {
9448         props.ccTLD = "." + props.iso1A2.toLowerCase();
9449       }
9450     }
9451     function loadIsoStatus(feature4) {
9452       const props = feature4.properties;
9453       if (!props.isoStatus && props.iso1A2) {
9454         props.isoStatus = "official";
9455       }
9456     }
9457     function loadLevel(feature4) {
9458       const props = feature4.properties;
9459       if (props.level)
9460         return;
9461       if (!props.country) {
9462         props.level = "country";
9463       } else if (!props.iso1A2 || props.isoStatus === "official") {
9464         props.level = "territory";
9465       } else {
9466         props.level = "subterritory";
9467       }
9468     }
9469     function loadGroupGroups(feature4) {
9470       const props = feature4.properties;
9471       if (feature4.geometry || !props.members)
9472         return;
9473       const featureLevelIndex = levels.indexOf(props.level);
9474       let sharedGroups = [];
9475       props.members.forEach((memberID, index) => {
9476         const member = _featuresByCode[memberID];
9477         const memberGroups = member.properties.groups.filter((groupID) => {
9478           return groupID !== feature4.properties.id && featureLevelIndex < levels.indexOf(_featuresByCode[groupID].properties.level);
9479         });
9480         if (index === 0) {
9481           sharedGroups = memberGroups;
9482         } else {
9483           sharedGroups = sharedGroups.filter((groupID) => memberGroups.indexOf(groupID) !== -1);
9484         }
9485       });
9486       props.groups = props.groups.concat(sharedGroups.filter((groupID) => props.groups.indexOf(groupID) === -1));
9487       for (const groupID of sharedGroups) {
9488         const groupFeature = _featuresByCode[groupID];
9489         if (groupFeature.properties.members.indexOf(props.id) === -1) {
9490           groupFeature.properties.members.push(props.id);
9491         }
9492       }
9493     }
9494     function loadRoadSpeedUnit(feature4) {
9495       const props = feature4.properties;
9496       if (feature4.geometry) {
9497         if (!props.roadSpeedUnit)
9498           props.roadSpeedUnit = "km/h";
9499       } else if (props.members) {
9500         const vals = Array.from(new Set(props.members.map((id2) => {
9501           const member = _featuresByCode[id2];
9502           if (member.geometry)
9503             return member.properties.roadSpeedUnit || "km/h";
9504         }).filter(Boolean)));
9505         if (vals.length === 1)
9506           props.roadSpeedUnit = vals[0];
9507       }
9508     }
9509     function loadRoadHeightUnit(feature4) {
9510       const props = feature4.properties;
9511       if (feature4.geometry) {
9512         if (!props.roadHeightUnit)
9513           props.roadHeightUnit = "m";
9514       } else if (props.members) {
9515         const vals = Array.from(new Set(props.members.map((id2) => {
9516           const member = _featuresByCode[id2];
9517           if (member.geometry)
9518             return member.properties.roadHeightUnit || "m";
9519         }).filter(Boolean)));
9520         if (vals.length === 1)
9521           props.roadHeightUnit = vals[0];
9522       }
9523     }
9524     function loadDriveSide(feature4) {
9525       const props = feature4.properties;
9526       if (feature4.geometry) {
9527         if (!props.driveSide)
9528           props.driveSide = "right";
9529       } else if (props.members) {
9530         const vals = Array.from(new Set(props.members.map((id2) => {
9531           const member = _featuresByCode[id2];
9532           if (member.geometry)
9533             return member.properties.driveSide || "right";
9534         }).filter(Boolean)));
9535         if (vals.length === 1)
9536           props.driveSide = vals[0];
9537       }
9538     }
9539     function loadCallingCodes(feature4) {
9540       const props = feature4.properties;
9541       if (!feature4.geometry && props.members) {
9542         props.callingCodes = Array.from(new Set(props.members.reduce((array2, id2) => {
9543           const member = _featuresByCode[id2];
9544           if (member.geometry && member.properties.callingCodes) {
9545             return array2.concat(member.properties.callingCodes);
9546           }
9547           return array2;
9548         }, [])));
9549       }
9550     }
9551     function loadFlag(feature4) {
9552       let flag = "";
9553       const country = feature4.properties.iso1A2;
9554       if (country && country !== "FX") {
9555         flag = _toEmojiCountryFlag(country);
9556       }
9557       const regionStrings = {
9558         Q21: "gbeng",
9559         Q22: "gbsct",
9560         Q25: "gbwls"
9561       };
9562       const region = regionStrings[feature4.properties.wikidata];
9563       if (region) {
9564         flag = _toEmojiRegionFlag(region);
9565       }
9566       if (flag) {
9567         feature4.properties.emojiFlag = flag;
9568       }
9569       function _toEmojiCountryFlag(s2) {
9570         return s2.replace(/./g, (c2) => String.fromCodePoint(c2.charCodeAt(0) + 127397));
9571       }
9572       function _toEmojiRegionFlag(s2) {
9573         const codepoints = [127988];
9574         for (const c2 of [...s2]) {
9575           codepoints.push(c2.codePointAt(0) + 917504);
9576         }
9577         codepoints.push(917631);
9578         return String.fromCodePoint.apply(null, codepoints);
9579       }
9580     }
9581     function loadMembersForGroupsOf(feature4) {
9582       for (const groupID of feature4.properties.groups) {
9583         const groupFeature = _featuresByCode[groupID];
9584         if (!groupFeature.properties.members) {
9585           groupFeature.properties.members = [];
9586         }
9587         groupFeature.properties.members.push(feature4.properties.id);
9588       }
9589     }
9590     function cacheFeatureByIDs(feature4) {
9591       let ids = [];
9592       for (const prop of identifierProps) {
9593         const id2 = feature4.properties[prop];
9594         if (id2) {
9595           ids.push(id2);
9596         }
9597       }
9598       for (const alias of feature4.properties.aliases || []) {
9599         ids.push(alias);
9600       }
9601       for (const id2 of ids) {
9602         const cid = canonicalID(id2);
9603         _featuresByCode[cid] = feature4;
9604       }
9605     }
9606   }
9607   function locArray(loc) {
9608     if (Array.isArray(loc)) {
9609       return loc;
9610     } else if (loc.coordinates) {
9611       return loc.coordinates;
9612     }
9613     return loc.geometry.coordinates;
9614   }
9615   function smallestFeature(loc) {
9616     const query = locArray(loc);
9617     const featureProperties = _whichPolygon(query);
9618     if (!featureProperties)
9619       return null;
9620     return _featuresByCode[featureProperties.id];
9621   }
9622   function countryFeature(loc) {
9623     const feature4 = smallestFeature(loc);
9624     if (!feature4)
9625       return null;
9626     const countryCode = feature4.properties.country || feature4.properties.iso1A2;
9627     return _featuresByCode[countryCode] || null;
9628   }
9629   var defaultOpts = {
9630     level: void 0,
9631     maxLevel: void 0,
9632     withProp: void 0
9633   };
9634   function featureForLoc(loc, opts) {
9635     const targetLevel = opts.level || "country";
9636     const maxLevel = opts.maxLevel || "world";
9637     const withProp = opts.withProp;
9638     const targetLevelIndex = levels.indexOf(targetLevel);
9639     if (targetLevelIndex === -1)
9640       return null;
9641     const maxLevelIndex = levels.indexOf(maxLevel);
9642     if (maxLevelIndex === -1)
9643       return null;
9644     if (maxLevelIndex < targetLevelIndex)
9645       return null;
9646     if (targetLevel === "country") {
9647       const fastFeature = countryFeature(loc);
9648       if (fastFeature) {
9649         if (!withProp || fastFeature.properties[withProp]) {
9650           return fastFeature;
9651         }
9652       }
9653     }
9654     const features = featuresContaining(loc);
9655     const match = features.find((feature4) => {
9656       let levelIndex = levels.indexOf(feature4.properties.level);
9657       if (feature4.properties.level === targetLevel || levelIndex > targetLevelIndex && levelIndex <= maxLevelIndex) {
9658         if (!withProp || feature4.properties[withProp]) {
9659           return feature4;
9660         }
9661       }
9662       return false;
9663     });
9664     return match || null;
9665   }
9666   function featureForID(id2) {
9667     let stringID;
9668     if (typeof id2 === "number") {
9669       stringID = id2.toString();
9670       if (stringID.length === 1) {
9671         stringID = "00" + stringID;
9672       } else if (stringID.length === 2) {
9673         stringID = "0" + stringID;
9674       }
9675     } else {
9676       stringID = canonicalID(id2);
9677     }
9678     return _featuresByCode[stringID] || null;
9679   }
9680   function smallestFeaturesForBbox(bbox2) {
9681     return _whichPolygon.bbox(bbox2).map((props) => _featuresByCode[props.id]);
9682   }
9683   function smallestOrMatchingFeature(query) {
9684     if (typeof query === "object") {
9685       return smallestFeature(query);
9686     }
9687     return featureForID(query);
9688   }
9689   function feature(query, opts = defaultOpts) {
9690     if (typeof query === "object") {
9691       return featureForLoc(query, opts);
9692     }
9693     return featureForID(query);
9694   }
9695   function featuresContaining(query, strict) {
9696     let matchingFeatures;
9697     if (Array.isArray(query) && query.length === 4) {
9698       matchingFeatures = smallestFeaturesForBbox(query);
9699     } else {
9700       const smallestOrMatching = smallestOrMatchingFeature(query);
9701       matchingFeatures = smallestOrMatching ? [smallestOrMatching] : [];
9702     }
9703     if (!matchingFeatures.length)
9704       return [];
9705     let returnFeatures;
9706     if (!strict || typeof query === "object") {
9707       returnFeatures = matchingFeatures.slice();
9708     } else {
9709       returnFeatures = [];
9710     }
9711     for (const feature22 of matchingFeatures) {
9712       const properties = feature22.properties;
9713       for (const groupID of properties.groups) {
9714         const groupFeature = _featuresByCode[groupID];
9715         if (returnFeatures.indexOf(groupFeature) === -1) {
9716           returnFeatures.push(groupFeature);
9717         }
9718       }
9719     }
9720     return returnFeatures;
9721   }
9722   function featuresIn(id2, strict) {
9723     const feature22 = featureForID(id2);
9724     if (!feature22)
9725       return [];
9726     let features = [];
9727     if (!strict) {
9728       features.push(feature22);
9729     }
9730     const properties = feature22.properties;
9731     for (const memberID of properties.members || []) {
9732       features.push(_featuresByCode[memberID]);
9733     }
9734     return features;
9735   }
9736   function aggregateFeature(id2) {
9737     var _a5;
9738     const features = featuresIn(id2, false);
9739     if (features.length === 0)
9740       return null;
9741     let aggregateCoordinates = [];
9742     for (const feature22 of features) {
9743       if (((_a5 = feature22.geometry) == null ? void 0 : _a5.type) === "MultiPolygon" && feature22.geometry.coordinates) {
9744         aggregateCoordinates = aggregateCoordinates.concat(feature22.geometry.coordinates);
9745       }
9746     }
9747     return {
9748       type: "Feature",
9749       properties: features[0].properties,
9750       geometry: {
9751         type: "MultiPolygon",
9752         coordinates: aggregateCoordinates
9753       }
9754     };
9755   }
9756
9757   // node_modules/bignumber.js/bignumber.mjs
9758   var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
9759   var mathceil = Math.ceil;
9760   var mathfloor = Math.floor;
9761   var bignumberError = "[BigNumber Error] ";
9762   var tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ";
9763   var BASE = 1e14;
9764   var LOG_BASE = 14;
9765   var MAX_SAFE_INTEGER = 9007199254740991;
9766   var POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13];
9767   var SQRT_BASE = 1e7;
9768   var MAX = 1e9;
9769   function clone(configObject) {
9770     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 = {
9771       prefix: "",
9772       groupSize: 3,
9773       secondaryGroupSize: 0,
9774       groupSeparator: ",",
9775       decimalSeparator: ".",
9776       fractionGroupSize: 0,
9777       fractionGroupSeparator: "\xA0",
9778       // non-breaking space
9779       suffix: ""
9780     }, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
9781     function BigNumber2(v3, b3) {
9782       var alphabet, c2, caseChanged, e3, i3, isNum, len, str, x3 = this;
9783       if (!(x3 instanceof BigNumber2)) return new BigNumber2(v3, b3);
9784       if (b3 == null) {
9785         if (v3 && v3._isBigNumber === true) {
9786           x3.s = v3.s;
9787           if (!v3.c || v3.e > MAX_EXP) {
9788             x3.c = x3.e = null;
9789           } else if (v3.e < MIN_EXP) {
9790             x3.c = [x3.e = 0];
9791           } else {
9792             x3.e = v3.e;
9793             x3.c = v3.c.slice();
9794           }
9795           return;
9796         }
9797         if ((isNum = typeof v3 == "number") && v3 * 0 == 0) {
9798           x3.s = 1 / v3 < 0 ? (v3 = -v3, -1) : 1;
9799           if (v3 === ~~v3) {
9800             for (e3 = 0, i3 = v3; i3 >= 10; i3 /= 10, e3++) ;
9801             if (e3 > MAX_EXP) {
9802               x3.c = x3.e = null;
9803             } else {
9804               x3.e = e3;
9805               x3.c = [v3];
9806             }
9807             return;
9808           }
9809           str = String(v3);
9810         } else {
9811           if (!isNumeric.test(str = String(v3))) return parseNumeric2(x3, str, isNum);
9812           x3.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
9813         }
9814         if ((e3 = str.indexOf(".")) > -1) str = str.replace(".", "");
9815         if ((i3 = str.search(/e/i)) > 0) {
9816           if (e3 < 0) e3 = i3;
9817           e3 += +str.slice(i3 + 1);
9818           str = str.substring(0, i3);
9819         } else if (e3 < 0) {
9820           e3 = str.length;
9821         }
9822       } else {
9823         intCheck(b3, 2, ALPHABET.length, "Base");
9824         if (b3 == 10 && alphabetHasNormalDecimalDigits) {
9825           x3 = new BigNumber2(v3);
9826           return round(x3, DECIMAL_PLACES + x3.e + 1, ROUNDING_MODE);
9827         }
9828         str = String(v3);
9829         if (isNum = typeof v3 == "number") {
9830           if (v3 * 0 != 0) return parseNumeric2(x3, str, isNum, b3);
9831           x3.s = 1 / v3 < 0 ? (str = str.slice(1), -1) : 1;
9832           if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
9833             throw Error(tooManyDigits + v3);
9834           }
9835         } else {
9836           x3.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
9837         }
9838         alphabet = ALPHABET.slice(0, b3);
9839         e3 = i3 = 0;
9840         for (len = str.length; i3 < len; i3++) {
9841           if (alphabet.indexOf(c2 = str.charAt(i3)) < 0) {
9842             if (c2 == ".") {
9843               if (i3 > e3) {
9844                 e3 = len;
9845                 continue;
9846               }
9847             } else if (!caseChanged) {
9848               if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
9849                 caseChanged = true;
9850                 i3 = -1;
9851                 e3 = 0;
9852                 continue;
9853               }
9854             }
9855             return parseNumeric2(x3, String(v3), isNum, b3);
9856           }
9857         }
9858         isNum = false;
9859         str = convertBase(str, b3, 10, x3.s);
9860         if ((e3 = str.indexOf(".")) > -1) str = str.replace(".", "");
9861         else e3 = str.length;
9862       }
9863       for (i3 = 0; str.charCodeAt(i3) === 48; i3++) ;
9864       for (len = str.length; str.charCodeAt(--len) === 48; ) ;
9865       if (str = str.slice(i3, ++len)) {
9866         len -= i3;
9867         if (isNum && BigNumber2.DEBUG && len > 15 && (v3 > MAX_SAFE_INTEGER || v3 !== mathfloor(v3))) {
9868           throw Error(tooManyDigits + x3.s * v3);
9869         }
9870         if ((e3 = e3 - i3 - 1) > MAX_EXP) {
9871           x3.c = x3.e = null;
9872         } else if (e3 < MIN_EXP) {
9873           x3.c = [x3.e = 0];
9874         } else {
9875           x3.e = e3;
9876           x3.c = [];
9877           i3 = (e3 + 1) % LOG_BASE;
9878           if (e3 < 0) i3 += LOG_BASE;
9879           if (i3 < len) {
9880             if (i3) x3.c.push(+str.slice(0, i3));
9881             for (len -= LOG_BASE; i3 < len; ) {
9882               x3.c.push(+str.slice(i3, i3 += LOG_BASE));
9883             }
9884             i3 = LOG_BASE - (str = str.slice(i3)).length;
9885           } else {
9886             i3 -= len;
9887           }
9888           for (; i3--; str += "0") ;
9889           x3.c.push(+str);
9890         }
9891       } else {
9892         x3.c = [x3.e = 0];
9893       }
9894     }
9895     BigNumber2.clone = clone;
9896     BigNumber2.ROUND_UP = 0;
9897     BigNumber2.ROUND_DOWN = 1;
9898     BigNumber2.ROUND_CEIL = 2;
9899     BigNumber2.ROUND_FLOOR = 3;
9900     BigNumber2.ROUND_HALF_UP = 4;
9901     BigNumber2.ROUND_HALF_DOWN = 5;
9902     BigNumber2.ROUND_HALF_EVEN = 6;
9903     BigNumber2.ROUND_HALF_CEIL = 7;
9904     BigNumber2.ROUND_HALF_FLOOR = 8;
9905     BigNumber2.EUCLID = 9;
9906     BigNumber2.config = BigNumber2.set = function(obj) {
9907       var p2, v3;
9908       if (obj != null) {
9909         if (typeof obj == "object") {
9910           if (obj.hasOwnProperty(p2 = "DECIMAL_PLACES")) {
9911             v3 = obj[p2];
9912             intCheck(v3, 0, MAX, p2);
9913             DECIMAL_PLACES = v3;
9914           }
9915           if (obj.hasOwnProperty(p2 = "ROUNDING_MODE")) {
9916             v3 = obj[p2];
9917             intCheck(v3, 0, 8, p2);
9918             ROUNDING_MODE = v3;
9919           }
9920           if (obj.hasOwnProperty(p2 = "EXPONENTIAL_AT")) {
9921             v3 = obj[p2];
9922             if (v3 && v3.pop) {
9923               intCheck(v3[0], -MAX, 0, p2);
9924               intCheck(v3[1], 0, MAX, p2);
9925               TO_EXP_NEG = v3[0];
9926               TO_EXP_POS = v3[1];
9927             } else {
9928               intCheck(v3, -MAX, MAX, p2);
9929               TO_EXP_NEG = -(TO_EXP_POS = v3 < 0 ? -v3 : v3);
9930             }
9931           }
9932           if (obj.hasOwnProperty(p2 = "RANGE")) {
9933             v3 = obj[p2];
9934             if (v3 && v3.pop) {
9935               intCheck(v3[0], -MAX, -1, p2);
9936               intCheck(v3[1], 1, MAX, p2);
9937               MIN_EXP = v3[0];
9938               MAX_EXP = v3[1];
9939             } else {
9940               intCheck(v3, -MAX, MAX, p2);
9941               if (v3) {
9942                 MIN_EXP = -(MAX_EXP = v3 < 0 ? -v3 : v3);
9943               } else {
9944                 throw Error(bignumberError + p2 + " cannot be zero: " + v3);
9945               }
9946             }
9947           }
9948           if (obj.hasOwnProperty(p2 = "CRYPTO")) {
9949             v3 = obj[p2];
9950             if (v3 === !!v3) {
9951               if (v3) {
9952                 if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
9953                   CRYPTO = v3;
9954                 } else {
9955                   CRYPTO = !v3;
9956                   throw Error(bignumberError + "crypto unavailable");
9957                 }
9958               } else {
9959                 CRYPTO = v3;
9960               }
9961             } else {
9962               throw Error(bignumberError + p2 + " not true or false: " + v3);
9963             }
9964           }
9965           if (obj.hasOwnProperty(p2 = "MODULO_MODE")) {
9966             v3 = obj[p2];
9967             intCheck(v3, 0, 9, p2);
9968             MODULO_MODE = v3;
9969           }
9970           if (obj.hasOwnProperty(p2 = "POW_PRECISION")) {
9971             v3 = obj[p2];
9972             intCheck(v3, 0, MAX, p2);
9973             POW_PRECISION = v3;
9974           }
9975           if (obj.hasOwnProperty(p2 = "FORMAT")) {
9976             v3 = obj[p2];
9977             if (typeof v3 == "object") FORMAT = v3;
9978             else throw Error(bignumberError + p2 + " not an object: " + v3);
9979           }
9980           if (obj.hasOwnProperty(p2 = "ALPHABET")) {
9981             v3 = obj[p2];
9982             if (typeof v3 == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v3)) {
9983               alphabetHasNormalDecimalDigits = v3.slice(0, 10) == "0123456789";
9984               ALPHABET = v3;
9985             } else {
9986               throw Error(bignumberError + p2 + " invalid: " + v3);
9987             }
9988           }
9989         } else {
9990           throw Error(bignumberError + "Object expected: " + obj);
9991         }
9992       }
9993       return {
9994         DECIMAL_PLACES,
9995         ROUNDING_MODE,
9996         EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
9997         RANGE: [MIN_EXP, MAX_EXP],
9998         CRYPTO,
9999         MODULO_MODE,
10000         POW_PRECISION,
10001         FORMAT,
10002         ALPHABET
10003       };
10004     };
10005     BigNumber2.isBigNumber = function(v3) {
10006       if (!v3 || v3._isBigNumber !== true) return false;
10007       if (!BigNumber2.DEBUG) return true;
10008       var i3, n3, c2 = v3.c, e3 = v3.e, s2 = v3.s;
10009       out: if ({}.toString.call(c2) == "[object Array]") {
10010         if ((s2 === 1 || s2 === -1) && e3 >= -MAX && e3 <= MAX && e3 === mathfloor(e3)) {
10011           if (c2[0] === 0) {
10012             if (e3 === 0 && c2.length === 1) return true;
10013             break out;
10014           }
10015           i3 = (e3 + 1) % LOG_BASE;
10016           if (i3 < 1) i3 += LOG_BASE;
10017           if (String(c2[0]).length == i3) {
10018             for (i3 = 0; i3 < c2.length; i3++) {
10019               n3 = c2[i3];
10020               if (n3 < 0 || n3 >= BASE || n3 !== mathfloor(n3)) break out;
10021             }
10022             if (n3 !== 0) return true;
10023           }
10024         }
10025       } else if (c2 === null && e3 === null && (s2 === null || s2 === 1 || s2 === -1)) {
10026         return true;
10027       }
10028       throw Error(bignumberError + "Invalid BigNumber: " + v3);
10029     };
10030     BigNumber2.maximum = BigNumber2.max = function() {
10031       return maxOrMin(arguments, -1);
10032     };
10033     BigNumber2.minimum = BigNumber2.min = function() {
10034       return maxOrMin(arguments, 1);
10035     };
10036     BigNumber2.random = (function() {
10037       var pow2_53 = 9007199254740992;
10038       var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
10039         return mathfloor(Math.random() * pow2_53);
10040       } : function() {
10041         return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
10042       };
10043       return function(dp) {
10044         var a2, b3, e3, k3, v3, i3 = 0, c2 = [], rand = new BigNumber2(ONE);
10045         if (dp == null) dp = DECIMAL_PLACES;
10046         else intCheck(dp, 0, MAX);
10047         k3 = mathceil(dp / LOG_BASE);
10048         if (CRYPTO) {
10049           if (crypto.getRandomValues) {
10050             a2 = crypto.getRandomValues(new Uint32Array(k3 *= 2));
10051             for (; i3 < k3; ) {
10052               v3 = a2[i3] * 131072 + (a2[i3 + 1] >>> 11);
10053               if (v3 >= 9e15) {
10054                 b3 = crypto.getRandomValues(new Uint32Array(2));
10055                 a2[i3] = b3[0];
10056                 a2[i3 + 1] = b3[1];
10057               } else {
10058                 c2.push(v3 % 1e14);
10059                 i3 += 2;
10060               }
10061             }
10062             i3 = k3 / 2;
10063           } else if (crypto.randomBytes) {
10064             a2 = crypto.randomBytes(k3 *= 7);
10065             for (; i3 < k3; ) {
10066               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];
10067               if (v3 >= 9e15) {
10068                 crypto.randomBytes(7).copy(a2, i3);
10069               } else {
10070                 c2.push(v3 % 1e14);
10071                 i3 += 7;
10072               }
10073             }
10074             i3 = k3 / 7;
10075           } else {
10076             CRYPTO = false;
10077             throw Error(bignumberError + "crypto unavailable");
10078           }
10079         }
10080         if (!CRYPTO) {
10081           for (; i3 < k3; ) {
10082             v3 = random53bitInt();
10083             if (v3 < 9e15) c2[i3++] = v3 % 1e14;
10084           }
10085         }
10086         k3 = c2[--i3];
10087         dp %= LOG_BASE;
10088         if (k3 && dp) {
10089           v3 = POWS_TEN[LOG_BASE - dp];
10090           c2[i3] = mathfloor(k3 / v3) * v3;
10091         }
10092         for (; c2[i3] === 0; c2.pop(), i3--) ;
10093         if (i3 < 0) {
10094           c2 = [e3 = 0];
10095         } else {
10096           for (e3 = -1; c2[0] === 0; c2.splice(0, 1), e3 -= LOG_BASE) ;
10097           for (i3 = 1, v3 = c2[0]; v3 >= 10; v3 /= 10, i3++) ;
10098           if (i3 < LOG_BASE) e3 -= LOG_BASE - i3;
10099         }
10100         rand.e = e3;
10101         rand.c = c2;
10102         return rand;
10103       };
10104     })();
10105     BigNumber2.sum = function() {
10106       var i3 = 1, args = arguments, sum = new BigNumber2(args[0]);
10107       for (; i3 < args.length; ) sum = sum.plus(args[i3++]);
10108       return sum;
10109     };
10110     convertBase = /* @__PURE__ */ (function() {
10111       var decimal = "0123456789";
10112       function toBaseOut(str, baseIn, baseOut, alphabet) {
10113         var j3, arr = [0], arrL, i3 = 0, len = str.length;
10114         for (; i3 < len; ) {
10115           for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
10116           arr[0] += alphabet.indexOf(str.charAt(i3++));
10117           for (j3 = 0; j3 < arr.length; j3++) {
10118             if (arr[j3] > baseOut - 1) {
10119               if (arr[j3 + 1] == null) arr[j3 + 1] = 0;
10120               arr[j3 + 1] += arr[j3] / baseOut | 0;
10121               arr[j3] %= baseOut;
10122             }
10123           }
10124         }
10125         return arr.reverse();
10126       }
10127       return function(str, baseIn, baseOut, sign2, callerIsToString) {
10128         var alphabet, d2, e3, k3, r2, x3, xc, y3, i3 = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
10129         if (i3 >= 0) {
10130           k3 = POW_PRECISION;
10131           POW_PRECISION = 0;
10132           str = str.replace(".", "");
10133           y3 = new BigNumber2(baseIn);
10134           x3 = y3.pow(str.length - i3);
10135           POW_PRECISION = k3;
10136           y3.c = toBaseOut(
10137             toFixedPoint(coeffToString(x3.c), x3.e, "0"),
10138             10,
10139             baseOut,
10140             decimal
10141           );
10142           y3.e = y3.c.length;
10143         }
10144         xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
10145         e3 = k3 = xc.length;
10146         for (; xc[--k3] == 0; xc.pop()) ;
10147         if (!xc[0]) return alphabet.charAt(0);
10148         if (i3 < 0) {
10149           --e3;
10150         } else {
10151           x3.c = xc;
10152           x3.e = e3;
10153           x3.s = sign2;
10154           x3 = div(x3, y3, dp, rm, baseOut);
10155           xc = x3.c;
10156           r2 = x3.r;
10157           e3 = x3.e;
10158         }
10159         d2 = e3 + dp + 1;
10160         i3 = xc[d2];
10161         k3 = baseOut / 2;
10162         r2 = r2 || d2 < 0 || xc[d2 + 1] != null;
10163         r2 = rm < 4 ? (i3 != null || r2) && (rm == 0 || rm == (x3.s < 0 ? 3 : 2)) : i3 > k3 || i3 == k3 && (rm == 4 || r2 || rm == 6 && xc[d2 - 1] & 1 || rm == (x3.s < 0 ? 8 : 7));
10164         if (d2 < 1 || !xc[0]) {
10165           str = r2 ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
10166         } else {
10167           xc.length = d2;
10168           if (r2) {
10169             for (--baseOut; ++xc[--d2] > baseOut; ) {
10170               xc[d2] = 0;
10171               if (!d2) {
10172                 ++e3;
10173                 xc = [1].concat(xc);
10174               }
10175             }
10176           }
10177           for (k3 = xc.length; !xc[--k3]; ) ;
10178           for (i3 = 0, str = ""; i3 <= k3; str += alphabet.charAt(xc[i3++])) ;
10179           str = toFixedPoint(str, e3, alphabet.charAt(0));
10180         }
10181         return str;
10182       };
10183     })();
10184     div = /* @__PURE__ */ (function() {
10185       function multiply(x3, k3, base) {
10186         var m3, temp, xlo, xhi, carry = 0, i3 = x3.length, klo = k3 % SQRT_BASE, khi = k3 / SQRT_BASE | 0;
10187         for (x3 = x3.slice(); i3--; ) {
10188           xlo = x3[i3] % SQRT_BASE;
10189           xhi = x3[i3] / SQRT_BASE | 0;
10190           m3 = khi * xlo + xhi * klo;
10191           temp = klo * xlo + m3 % SQRT_BASE * SQRT_BASE + carry;
10192           carry = (temp / base | 0) + (m3 / SQRT_BASE | 0) + khi * xhi;
10193           x3[i3] = temp % base;
10194         }
10195         if (carry) x3 = [carry].concat(x3);
10196         return x3;
10197       }
10198       function compare2(a2, b3, aL, bL) {
10199         var i3, cmp;
10200         if (aL != bL) {
10201           cmp = aL > bL ? 1 : -1;
10202         } else {
10203           for (i3 = cmp = 0; i3 < aL; i3++) {
10204             if (a2[i3] != b3[i3]) {
10205               cmp = a2[i3] > b3[i3] ? 1 : -1;
10206               break;
10207             }
10208           }
10209         }
10210         return cmp;
10211       }
10212       function subtract(a2, b3, aL, base) {
10213         var i3 = 0;
10214         for (; aL--; ) {
10215           a2[aL] -= i3;
10216           i3 = a2[aL] < b3[aL] ? 1 : 0;
10217           a2[aL] = i3 * base + a2[aL] - b3[aL];
10218         }
10219         for (; !a2[0] && a2.length > 1; a2.splice(0, 1)) ;
10220       }
10221       return function(x3, y3, dp, rm, base) {
10222         var cmp, e3, i3, more, n3, prod, prodL, q3, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s2 = x3.s == y3.s ? 1 : -1, xc = x3.c, yc = y3.c;
10223         if (!xc || !xc[0] || !yc || !yc[0]) {
10224           return new BigNumber2(
10225             // Return NaN if either NaN, or both Infinity or 0.
10226             !x3.s || !y3.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
10227               // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
10228               xc && xc[0] == 0 || !yc ? s2 * 0 : s2 / 0
10229             )
10230           );
10231         }
10232         q3 = new BigNumber2(s2);
10233         qc = q3.c = [];
10234         e3 = x3.e - y3.e;
10235         s2 = dp + e3 + 1;
10236         if (!base) {
10237           base = BASE;
10238           e3 = bitFloor(x3.e / LOG_BASE) - bitFloor(y3.e / LOG_BASE);
10239           s2 = s2 / LOG_BASE | 0;
10240         }
10241         for (i3 = 0; yc[i3] == (xc[i3] || 0); i3++) ;
10242         if (yc[i3] > (xc[i3] || 0)) e3--;
10243         if (s2 < 0) {
10244           qc.push(1);
10245           more = true;
10246         } else {
10247           xL = xc.length;
10248           yL = yc.length;
10249           i3 = 0;
10250           s2 += 2;
10251           n3 = mathfloor(base / (yc[0] + 1));
10252           if (n3 > 1) {
10253             yc = multiply(yc, n3, base);
10254             xc = multiply(xc, n3, base);
10255             yL = yc.length;
10256             xL = xc.length;
10257           }
10258           xi = yL;
10259           rem = xc.slice(0, yL);
10260           remL = rem.length;
10261           for (; remL < yL; rem[remL++] = 0) ;
10262           yz = yc.slice();
10263           yz = [0].concat(yz);
10264           yc0 = yc[0];
10265           if (yc[1] >= base / 2) yc0++;
10266           do {
10267             n3 = 0;
10268             cmp = compare2(yc, rem, yL, remL);
10269             if (cmp < 0) {
10270               rem0 = rem[0];
10271               if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
10272               n3 = mathfloor(rem0 / yc0);
10273               if (n3 > 1) {
10274                 if (n3 >= base) n3 = base - 1;
10275                 prod = multiply(yc, n3, base);
10276                 prodL = prod.length;
10277                 remL = rem.length;
10278                 while (compare2(prod, rem, prodL, remL) == 1) {
10279                   n3--;
10280                   subtract(prod, yL < prodL ? yz : yc, prodL, base);
10281                   prodL = prod.length;
10282                   cmp = 1;
10283                 }
10284               } else {
10285                 if (n3 == 0) {
10286                   cmp = n3 = 1;
10287                 }
10288                 prod = yc.slice();
10289                 prodL = prod.length;
10290               }
10291               if (prodL < remL) prod = [0].concat(prod);
10292               subtract(rem, prod, remL, base);
10293               remL = rem.length;
10294               if (cmp == -1) {
10295                 while (compare2(yc, rem, yL, remL) < 1) {
10296                   n3++;
10297                   subtract(rem, yL < remL ? yz : yc, remL, base);
10298                   remL = rem.length;
10299                 }
10300               }
10301             } else if (cmp === 0) {
10302               n3++;
10303               rem = [0];
10304             }
10305             qc[i3++] = n3;
10306             if (rem[0]) {
10307               rem[remL++] = xc[xi] || 0;
10308             } else {
10309               rem = [xc[xi]];
10310               remL = 1;
10311             }
10312           } while ((xi++ < xL || rem[0] != null) && s2--);
10313           more = rem[0] != null;
10314           if (!qc[0]) qc.splice(0, 1);
10315         }
10316         if (base == BASE) {
10317           for (i3 = 1, s2 = qc[0]; s2 >= 10; s2 /= 10, i3++) ;
10318           round(q3, dp + (q3.e = i3 + e3 * LOG_BASE - 1) + 1, rm, more);
10319         } else {
10320           q3.e = e3;
10321           q3.r = +more;
10322         }
10323         return q3;
10324       };
10325     })();
10326     function format2(n3, i3, rm, id2) {
10327       var c0, e3, ne2, len, str;
10328       if (rm == null) rm = ROUNDING_MODE;
10329       else intCheck(rm, 0, 8);
10330       if (!n3.c) return n3.toString();
10331       c0 = n3.c[0];
10332       ne2 = n3.e;
10333       if (i3 == null) {
10334         str = coeffToString(n3.c);
10335         str = id2 == 1 || id2 == 2 && (ne2 <= TO_EXP_NEG || ne2 >= TO_EXP_POS) ? toExponential(str, ne2) : toFixedPoint(str, ne2, "0");
10336       } else {
10337         n3 = round(new BigNumber2(n3), i3, rm);
10338         e3 = n3.e;
10339         str = coeffToString(n3.c);
10340         len = str.length;
10341         if (id2 == 1 || id2 == 2 && (i3 <= e3 || e3 <= TO_EXP_NEG)) {
10342           for (; len < i3; str += "0", len++) ;
10343           str = toExponential(str, e3);
10344         } else {
10345           i3 -= ne2;
10346           str = toFixedPoint(str, e3, "0");
10347           if (e3 + 1 > len) {
10348             if (--i3 > 0) for (str += "."; i3--; str += "0") ;
10349           } else {
10350             i3 += e3 - len;
10351             if (i3 > 0) {
10352               if (e3 + 1 == len) str += ".";
10353               for (; i3--; str += "0") ;
10354             }
10355           }
10356         }
10357       }
10358       return n3.s < 0 && c0 ? "-" + str : str;
10359     }
10360     function maxOrMin(args, n3) {
10361       var k3, y3, i3 = 1, x3 = new BigNumber2(args[0]);
10362       for (; i3 < args.length; i3++) {
10363         y3 = new BigNumber2(args[i3]);
10364         if (!y3.s || (k3 = compare(x3, y3)) === n3 || k3 === 0 && x3.s === n3) {
10365           x3 = y3;
10366         }
10367       }
10368       return x3;
10369     }
10370     function normalise(n3, c2, e3) {
10371       var i3 = 1, j3 = c2.length;
10372       for (; !c2[--j3]; c2.pop()) ;
10373       for (j3 = c2[0]; j3 >= 10; j3 /= 10, i3++) ;
10374       if ((e3 = i3 + e3 * LOG_BASE - 1) > MAX_EXP) {
10375         n3.c = n3.e = null;
10376       } else if (e3 < MIN_EXP) {
10377         n3.c = [n3.e = 0];
10378       } else {
10379         n3.e = e3;
10380         n3.c = c2;
10381       }
10382       return n3;
10383     }
10384     parseNumeric2 = /* @__PURE__ */ (function() {
10385       var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
10386       return function(x3, str, isNum, b3) {
10387         var base, s2 = isNum ? str : str.replace(whitespaceOrPlus, "");
10388         if (isInfinityOrNaN.test(s2)) {
10389           x3.s = isNaN(s2) ? null : s2 < 0 ? -1 : 1;
10390         } else {
10391           if (!isNum) {
10392             s2 = s2.replace(basePrefix, function(m3, p1, p2) {
10393               base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
10394               return !b3 || b3 == base ? p1 : m3;
10395             });
10396             if (b3) {
10397               base = b3;
10398               s2 = s2.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
10399             }
10400             if (str != s2) return new BigNumber2(s2, base);
10401           }
10402           if (BigNumber2.DEBUG) {
10403             throw Error(bignumberError + "Not a" + (b3 ? " base " + b3 : "") + " number: " + str);
10404           }
10405           x3.s = null;
10406         }
10407         x3.c = x3.e = null;
10408       };
10409     })();
10410     function round(x3, sd, rm, r2) {
10411       var d2, i3, j3, k3, n3, ni, rd, xc = x3.c, pows10 = POWS_TEN;
10412       if (xc) {
10413         out: {
10414           for (d2 = 1, k3 = xc[0]; k3 >= 10; k3 /= 10, d2++) ;
10415           i3 = sd - d2;
10416           if (i3 < 0) {
10417             i3 += LOG_BASE;
10418             j3 = sd;
10419             n3 = xc[ni = 0];
10420             rd = mathfloor(n3 / pows10[d2 - j3 - 1] % 10);
10421           } else {
10422             ni = mathceil((i3 + 1) / LOG_BASE);
10423             if (ni >= xc.length) {
10424               if (r2) {
10425                 for (; xc.length <= ni; xc.push(0)) ;
10426                 n3 = rd = 0;
10427                 d2 = 1;
10428                 i3 %= LOG_BASE;
10429                 j3 = i3 - LOG_BASE + 1;
10430               } else {
10431                 break out;
10432               }
10433             } else {
10434               n3 = k3 = xc[ni];
10435               for (d2 = 1; k3 >= 10; k3 /= 10, d2++) ;
10436               i3 %= LOG_BASE;
10437               j3 = i3 - LOG_BASE + d2;
10438               rd = j3 < 0 ? 0 : mathfloor(n3 / pows10[d2 - j3 - 1] % 10);
10439             }
10440           }
10441           r2 = r2 || sd < 0 || // Are there any non-zero digits after the rounding digit?
10442           // The expression  n % pows10[d - j - 1]  returns all digits of n to the right
10443           // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
10444           xc[ni + 1] != null || (j3 < 0 ? n3 : n3 % pows10[d2 - j3 - 1]);
10445           r2 = rm < 4 ? (rd || r2) && (rm == 0 || rm == (x3.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.
10446           (i3 > 0 ? j3 > 0 ? n3 / pows10[d2 - j3] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x3.s < 0 ? 8 : 7));
10447           if (sd < 1 || !xc[0]) {
10448             xc.length = 0;
10449             if (r2) {
10450               sd -= x3.e + 1;
10451               xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
10452               x3.e = -sd || 0;
10453             } else {
10454               xc[0] = x3.e = 0;
10455             }
10456             return x3;
10457           }
10458           if (i3 == 0) {
10459             xc.length = ni;
10460             k3 = 1;
10461             ni--;
10462           } else {
10463             xc.length = ni + 1;
10464             k3 = pows10[LOG_BASE - i3];
10465             xc[ni] = j3 > 0 ? mathfloor(n3 / pows10[d2 - j3] % pows10[j3]) * k3 : 0;
10466           }
10467           if (r2) {
10468             for (; ; ) {
10469               if (ni == 0) {
10470                 for (i3 = 1, j3 = xc[0]; j3 >= 10; j3 /= 10, i3++) ;
10471                 j3 = xc[0] += k3;
10472                 for (k3 = 1; j3 >= 10; j3 /= 10, k3++) ;
10473                 if (i3 != k3) {
10474                   x3.e++;
10475                   if (xc[0] == BASE) xc[0] = 1;
10476                 }
10477                 break;
10478               } else {
10479                 xc[ni] += k3;
10480                 if (xc[ni] != BASE) break;
10481                 xc[ni--] = 0;
10482                 k3 = 1;
10483               }
10484             }
10485           }
10486           for (i3 = xc.length; xc[--i3] === 0; xc.pop()) ;
10487         }
10488         if (x3.e > MAX_EXP) {
10489           x3.c = x3.e = null;
10490         } else if (x3.e < MIN_EXP) {
10491           x3.c = [x3.e = 0];
10492         }
10493       }
10494       return x3;
10495     }
10496     function valueOf(n3) {
10497       var str, e3 = n3.e;
10498       if (e3 === null) return n3.toString();
10499       str = coeffToString(n3.c);
10500       str = e3 <= TO_EXP_NEG || e3 >= TO_EXP_POS ? toExponential(str, e3) : toFixedPoint(str, e3, "0");
10501       return n3.s < 0 ? "-" + str : str;
10502     }
10503     P3.absoluteValue = P3.abs = function() {
10504       var x3 = new BigNumber2(this);
10505       if (x3.s < 0) x3.s = 1;
10506       return x3;
10507     };
10508     P3.comparedTo = function(y3, b3) {
10509       return compare(this, new BigNumber2(y3, b3));
10510     };
10511     P3.decimalPlaces = P3.dp = function(dp, rm) {
10512       var c2, n3, v3, x3 = this;
10513       if (dp != null) {
10514         intCheck(dp, 0, MAX);
10515         if (rm == null) rm = ROUNDING_MODE;
10516         else intCheck(rm, 0, 8);
10517         return round(new BigNumber2(x3), dp + x3.e + 1, rm);
10518       }
10519       if (!(c2 = x3.c)) return null;
10520       n3 = ((v3 = c2.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
10521       if (v3 = c2[v3]) for (; v3 % 10 == 0; v3 /= 10, n3--) ;
10522       if (n3 < 0) n3 = 0;
10523       return n3;
10524     };
10525     P3.dividedBy = P3.div = function(y3, b3) {
10526       return div(this, new BigNumber2(y3, b3), DECIMAL_PLACES, ROUNDING_MODE);
10527     };
10528     P3.dividedToIntegerBy = P3.idiv = function(y3, b3) {
10529       return div(this, new BigNumber2(y3, b3), 0, 1);
10530     };
10531     P3.exponentiatedBy = P3.pow = function(n3, m3) {
10532       var half, isModExp, i3, k3, more, nIsBig, nIsNeg, nIsOdd, y3, x3 = this;
10533       n3 = new BigNumber2(n3);
10534       if (n3.c && !n3.isInteger()) {
10535         throw Error(bignumberError + "Exponent not an integer: " + valueOf(n3));
10536       }
10537       if (m3 != null) m3 = new BigNumber2(m3);
10538       nIsBig = n3.e > 14;
10539       if (!x3.c || !x3.c[0] || x3.c[0] == 1 && !x3.e && x3.c.length == 1 || !n3.c || !n3.c[0]) {
10540         y3 = new BigNumber2(Math.pow(+valueOf(x3), nIsBig ? n3.s * (2 - isOdd(n3)) : +valueOf(n3)));
10541         return m3 ? y3.mod(m3) : y3;
10542       }
10543       nIsNeg = n3.s < 0;
10544       if (m3) {
10545         if (m3.c ? !m3.c[0] : !m3.s) return new BigNumber2(NaN);
10546         isModExp = !nIsNeg && x3.isInteger() && m3.isInteger();
10547         if (isModExp) x3 = x3.mod(m3);
10548       } else if (n3.e > 9 && (x3.e > 0 || x3.e < -1 || (x3.e == 0 ? x3.c[0] > 1 || nIsBig && x3.c[1] >= 24e7 : x3.c[0] < 8e13 || nIsBig && x3.c[0] <= 9999975e7))) {
10549         k3 = x3.s < 0 && isOdd(n3) ? -0 : 0;
10550         if (x3.e > -1) k3 = 1 / k3;
10551         return new BigNumber2(nIsNeg ? 1 / k3 : k3);
10552       } else if (POW_PRECISION) {
10553         k3 = mathceil(POW_PRECISION / LOG_BASE + 2);
10554       }
10555       if (nIsBig) {
10556         half = new BigNumber2(0.5);
10557         if (nIsNeg) n3.s = 1;
10558         nIsOdd = isOdd(n3);
10559       } else {
10560         i3 = Math.abs(+valueOf(n3));
10561         nIsOdd = i3 % 2;
10562       }
10563       y3 = new BigNumber2(ONE);
10564       for (; ; ) {
10565         if (nIsOdd) {
10566           y3 = y3.times(x3);
10567           if (!y3.c) break;
10568           if (k3) {
10569             if (y3.c.length > k3) y3.c.length = k3;
10570           } else if (isModExp) {
10571             y3 = y3.mod(m3);
10572           }
10573         }
10574         if (i3) {
10575           i3 = mathfloor(i3 / 2);
10576           if (i3 === 0) break;
10577           nIsOdd = i3 % 2;
10578         } else {
10579           n3 = n3.times(half);
10580           round(n3, n3.e + 1, 1);
10581           if (n3.e > 14) {
10582             nIsOdd = isOdd(n3);
10583           } else {
10584             i3 = +valueOf(n3);
10585             if (i3 === 0) break;
10586             nIsOdd = i3 % 2;
10587           }
10588         }
10589         x3 = x3.times(x3);
10590         if (k3) {
10591           if (x3.c && x3.c.length > k3) x3.c.length = k3;
10592         } else if (isModExp) {
10593           x3 = x3.mod(m3);
10594         }
10595       }
10596       if (isModExp) return y3;
10597       if (nIsNeg) y3 = ONE.div(y3);
10598       return m3 ? y3.mod(m3) : k3 ? round(y3, POW_PRECISION, ROUNDING_MODE, more) : y3;
10599     };
10600     P3.integerValue = function(rm) {
10601       var n3 = new BigNumber2(this);
10602       if (rm == null) rm = ROUNDING_MODE;
10603       else intCheck(rm, 0, 8);
10604       return round(n3, n3.e + 1, rm);
10605     };
10606     P3.isEqualTo = P3.eq = function(y3, b3) {
10607       return compare(this, new BigNumber2(y3, b3)) === 0;
10608     };
10609     P3.isFinite = function() {
10610       return !!this.c;
10611     };
10612     P3.isGreaterThan = P3.gt = function(y3, b3) {
10613       return compare(this, new BigNumber2(y3, b3)) > 0;
10614     };
10615     P3.isGreaterThanOrEqualTo = P3.gte = function(y3, b3) {
10616       return (b3 = compare(this, new BigNumber2(y3, b3))) === 1 || b3 === 0;
10617     };
10618     P3.isInteger = function() {
10619       return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
10620     };
10621     P3.isLessThan = P3.lt = function(y3, b3) {
10622       return compare(this, new BigNumber2(y3, b3)) < 0;
10623     };
10624     P3.isLessThanOrEqualTo = P3.lte = function(y3, b3) {
10625       return (b3 = compare(this, new BigNumber2(y3, b3))) === -1 || b3 === 0;
10626     };
10627     P3.isNaN = function() {
10628       return !this.s;
10629     };
10630     P3.isNegative = function() {
10631       return this.s < 0;
10632     };
10633     P3.isPositive = function() {
10634       return this.s > 0;
10635     };
10636     P3.isZero = function() {
10637       return !!this.c && this.c[0] == 0;
10638     };
10639     P3.minus = function(y3, b3) {
10640       var i3, j3, t2, xLTy, x3 = this, a2 = x3.s;
10641       y3 = new BigNumber2(y3, b3);
10642       b3 = y3.s;
10643       if (!a2 || !b3) return new BigNumber2(NaN);
10644       if (a2 != b3) {
10645         y3.s = -b3;
10646         return x3.plus(y3);
10647       }
10648       var xe2 = x3.e / LOG_BASE, ye3 = y3.e / LOG_BASE, xc = x3.c, yc = y3.c;
10649       if (!xe2 || !ye3) {
10650         if (!xc || !yc) return xc ? (y3.s = -b3, y3) : new BigNumber2(yc ? x3 : NaN);
10651         if (!xc[0] || !yc[0]) {
10652           return yc[0] ? (y3.s = -b3, y3) : new BigNumber2(xc[0] ? x3 : (
10653             // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
10654             ROUNDING_MODE == 3 ? -0 : 0
10655           ));
10656         }
10657       }
10658       xe2 = bitFloor(xe2);
10659       ye3 = bitFloor(ye3);
10660       xc = xc.slice();
10661       if (a2 = xe2 - ye3) {
10662         if (xLTy = a2 < 0) {
10663           a2 = -a2;
10664           t2 = xc;
10665         } else {
10666           ye3 = xe2;
10667           t2 = yc;
10668         }
10669         t2.reverse();
10670         for (b3 = a2; b3--; t2.push(0)) ;
10671         t2.reverse();
10672       } else {
10673         j3 = (xLTy = (a2 = xc.length) < (b3 = yc.length)) ? a2 : b3;
10674         for (a2 = b3 = 0; b3 < j3; b3++) {
10675           if (xc[b3] != yc[b3]) {
10676             xLTy = xc[b3] < yc[b3];
10677             break;
10678           }
10679         }
10680       }
10681       if (xLTy) {
10682         t2 = xc;
10683         xc = yc;
10684         yc = t2;
10685         y3.s = -y3.s;
10686       }
10687       b3 = (j3 = yc.length) - (i3 = xc.length);
10688       if (b3 > 0) for (; b3--; xc[i3++] = 0) ;
10689       b3 = BASE - 1;
10690       for (; j3 > a2; ) {
10691         if (xc[--j3] < yc[j3]) {
10692           for (i3 = j3; i3 && !xc[--i3]; xc[i3] = b3) ;
10693           --xc[i3];
10694           xc[j3] += BASE;
10695         }
10696         xc[j3] -= yc[j3];
10697       }
10698       for (; xc[0] == 0; xc.splice(0, 1), --ye3) ;
10699       if (!xc[0]) {
10700         y3.s = ROUNDING_MODE == 3 ? -1 : 1;
10701         y3.c = [y3.e = 0];
10702         return y3;
10703       }
10704       return normalise(y3, xc, ye3);
10705     };
10706     P3.modulo = P3.mod = function(y3, b3) {
10707       var q3, s2, x3 = this;
10708       y3 = new BigNumber2(y3, b3);
10709       if (!x3.c || !y3.s || y3.c && !y3.c[0]) {
10710         return new BigNumber2(NaN);
10711       } else if (!y3.c || x3.c && !x3.c[0]) {
10712         return new BigNumber2(x3);
10713       }
10714       if (MODULO_MODE == 9) {
10715         s2 = y3.s;
10716         y3.s = 1;
10717         q3 = div(x3, y3, 0, 3);
10718         y3.s = s2;
10719         q3.s *= s2;
10720       } else {
10721         q3 = div(x3, y3, 0, MODULO_MODE);
10722       }
10723       y3 = x3.minus(q3.times(y3));
10724       if (!y3.c[0] && MODULO_MODE == 1) y3.s = x3.s;
10725       return y3;
10726     };
10727     P3.multipliedBy = P3.times = function(y3, b3) {
10728       var c2, e3, i3, j3, k3, m3, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x3 = this, xc = x3.c, yc = (y3 = new BigNumber2(y3, b3)).c;
10729       if (!xc || !yc || !xc[0] || !yc[0]) {
10730         if (!x3.s || !y3.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
10731           y3.c = y3.e = y3.s = null;
10732         } else {
10733           y3.s *= x3.s;
10734           if (!xc || !yc) {
10735             y3.c = y3.e = null;
10736           } else {
10737             y3.c = [0];
10738             y3.e = 0;
10739           }
10740         }
10741         return y3;
10742       }
10743       e3 = bitFloor(x3.e / LOG_BASE) + bitFloor(y3.e / LOG_BASE);
10744       y3.s *= x3.s;
10745       xcL = xc.length;
10746       ycL = yc.length;
10747       if (xcL < ycL) {
10748         zc = xc;
10749         xc = yc;
10750         yc = zc;
10751         i3 = xcL;
10752         xcL = ycL;
10753         ycL = i3;
10754       }
10755       for (i3 = xcL + ycL, zc = []; i3--; zc.push(0)) ;
10756       base = BASE;
10757       sqrtBase = SQRT_BASE;
10758       for (i3 = ycL; --i3 >= 0; ) {
10759         c2 = 0;
10760         ylo = yc[i3] % sqrtBase;
10761         yhi = yc[i3] / sqrtBase | 0;
10762         for (k3 = xcL, j3 = i3 + k3; j3 > i3; ) {
10763           xlo = xc[--k3] % sqrtBase;
10764           xhi = xc[k3] / sqrtBase | 0;
10765           m3 = yhi * xlo + xhi * ylo;
10766           xlo = ylo * xlo + m3 % sqrtBase * sqrtBase + zc[j3] + c2;
10767           c2 = (xlo / base | 0) + (m3 / sqrtBase | 0) + yhi * xhi;
10768           zc[j3--] = xlo % base;
10769         }
10770         zc[j3] = c2;
10771       }
10772       if (c2) {
10773         ++e3;
10774       } else {
10775         zc.splice(0, 1);
10776       }
10777       return normalise(y3, zc, e3);
10778     };
10779     P3.negated = function() {
10780       var x3 = new BigNumber2(this);
10781       x3.s = -x3.s || null;
10782       return x3;
10783     };
10784     P3.plus = function(y3, b3) {
10785       var t2, x3 = this, a2 = x3.s;
10786       y3 = new BigNumber2(y3, b3);
10787       b3 = y3.s;
10788       if (!a2 || !b3) return new BigNumber2(NaN);
10789       if (a2 != b3) {
10790         y3.s = -b3;
10791         return x3.minus(y3);
10792       }
10793       var xe2 = x3.e / LOG_BASE, ye3 = y3.e / LOG_BASE, xc = x3.c, yc = y3.c;
10794       if (!xe2 || !ye3) {
10795         if (!xc || !yc) return new BigNumber2(a2 / 0);
10796         if (!xc[0] || !yc[0]) return yc[0] ? y3 : new BigNumber2(xc[0] ? x3 : a2 * 0);
10797       }
10798       xe2 = bitFloor(xe2);
10799       ye3 = bitFloor(ye3);
10800       xc = xc.slice();
10801       if (a2 = xe2 - ye3) {
10802         if (a2 > 0) {
10803           ye3 = xe2;
10804           t2 = yc;
10805         } else {
10806           a2 = -a2;
10807           t2 = xc;
10808         }
10809         t2.reverse();
10810         for (; a2--; t2.push(0)) ;
10811         t2.reverse();
10812       }
10813       a2 = xc.length;
10814       b3 = yc.length;
10815       if (a2 - b3 < 0) {
10816         t2 = yc;
10817         yc = xc;
10818         xc = t2;
10819         b3 = a2;
10820       }
10821       for (a2 = 0; b3; ) {
10822         a2 = (xc[--b3] = xc[b3] + yc[b3] + a2) / BASE | 0;
10823         xc[b3] = BASE === xc[b3] ? 0 : xc[b3] % BASE;
10824       }
10825       if (a2) {
10826         xc = [a2].concat(xc);
10827         ++ye3;
10828       }
10829       return normalise(y3, xc, ye3);
10830     };
10831     P3.precision = P3.sd = function(sd, rm) {
10832       var c2, n3, v3, x3 = this;
10833       if (sd != null && sd !== !!sd) {
10834         intCheck(sd, 1, MAX);
10835         if (rm == null) rm = ROUNDING_MODE;
10836         else intCheck(rm, 0, 8);
10837         return round(new BigNumber2(x3), sd, rm);
10838       }
10839       if (!(c2 = x3.c)) return null;
10840       v3 = c2.length - 1;
10841       n3 = v3 * LOG_BASE + 1;
10842       if (v3 = c2[v3]) {
10843         for (; v3 % 10 == 0; v3 /= 10, n3--) ;
10844         for (v3 = c2[0]; v3 >= 10; v3 /= 10, n3++) ;
10845       }
10846       if (sd && x3.e + 1 > n3) n3 = x3.e + 1;
10847       return n3;
10848     };
10849     P3.shiftedBy = function(k3) {
10850       intCheck(k3, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
10851       return this.times("1e" + k3);
10852     };
10853     P3.squareRoot = P3.sqrt = function() {
10854       var m3, n3, r2, rep, t2, x3 = this, c2 = x3.c, s2 = x3.s, e3 = x3.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
10855       if (s2 !== 1 || !c2 || !c2[0]) {
10856         return new BigNumber2(!s2 || s2 < 0 && (!c2 || c2[0]) ? NaN : c2 ? x3 : 1 / 0);
10857       }
10858       s2 = Math.sqrt(+valueOf(x3));
10859       if (s2 == 0 || s2 == 1 / 0) {
10860         n3 = coeffToString(c2);
10861         if ((n3.length + e3) % 2 == 0) n3 += "0";
10862         s2 = Math.sqrt(+n3);
10863         e3 = bitFloor((e3 + 1) / 2) - (e3 < 0 || e3 % 2);
10864         if (s2 == 1 / 0) {
10865           n3 = "5e" + e3;
10866         } else {
10867           n3 = s2.toExponential();
10868           n3 = n3.slice(0, n3.indexOf("e") + 1) + e3;
10869         }
10870         r2 = new BigNumber2(n3);
10871       } else {
10872         r2 = new BigNumber2(s2 + "");
10873       }
10874       if (r2.c[0]) {
10875         e3 = r2.e;
10876         s2 = e3 + dp;
10877         if (s2 < 3) s2 = 0;
10878         for (; ; ) {
10879           t2 = r2;
10880           r2 = half.times(t2.plus(div(x3, t2, dp, 1)));
10881           if (coeffToString(t2.c).slice(0, s2) === (n3 = coeffToString(r2.c)).slice(0, s2)) {
10882             if (r2.e < e3) --s2;
10883             n3 = n3.slice(s2 - 3, s2 + 1);
10884             if (n3 == "9999" || !rep && n3 == "4999") {
10885               if (!rep) {
10886                 round(t2, t2.e + DECIMAL_PLACES + 2, 0);
10887                 if (t2.times(t2).eq(x3)) {
10888                   r2 = t2;
10889                   break;
10890                 }
10891               }
10892               dp += 4;
10893               s2 += 4;
10894               rep = 1;
10895             } else {
10896               if (!+n3 || !+n3.slice(1) && n3.charAt(0) == "5") {
10897                 round(r2, r2.e + DECIMAL_PLACES + 2, 1);
10898                 m3 = !r2.times(r2).eq(x3);
10899               }
10900               break;
10901             }
10902           }
10903         }
10904       }
10905       return round(r2, r2.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m3);
10906     };
10907     P3.toExponential = function(dp, rm) {
10908       if (dp != null) {
10909         intCheck(dp, 0, MAX);
10910         dp++;
10911       }
10912       return format2(this, dp, rm, 1);
10913     };
10914     P3.toFixed = function(dp, rm) {
10915       if (dp != null) {
10916         intCheck(dp, 0, MAX);
10917         dp = dp + this.e + 1;
10918       }
10919       return format2(this, dp, rm);
10920     };
10921     P3.toFormat = function(dp, rm, format3) {
10922       var str, x3 = this;
10923       if (format3 == null) {
10924         if (dp != null && rm && typeof rm == "object") {
10925           format3 = rm;
10926           rm = null;
10927         } else if (dp && typeof dp == "object") {
10928           format3 = dp;
10929           dp = rm = null;
10930         } else {
10931           format3 = FORMAT;
10932         }
10933       } else if (typeof format3 != "object") {
10934         throw Error(bignumberError + "Argument not an object: " + format3);
10935       }
10936       str = x3.toFixed(dp, rm);
10937       if (x3.c) {
10938         var i3, arr = str.split("."), g1 = +format3.groupSize, g22 = +format3.secondaryGroupSize, groupSeparator = format3.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x3.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
10939         if (g22) {
10940           i3 = g1;
10941           g1 = g22;
10942           g22 = i3;
10943           len -= i3;
10944         }
10945         if (g1 > 0 && len > 0) {
10946           i3 = len % g1 || g1;
10947           intPart = intDigits.substr(0, i3);
10948           for (; i3 < len; i3 += g1) intPart += groupSeparator + intDigits.substr(i3, g1);
10949           if (g22 > 0) intPart += groupSeparator + intDigits.slice(i3);
10950           if (isNeg) intPart = "-" + intPart;
10951         }
10952         str = fractionPart ? intPart + (format3.decimalSeparator || "") + ((g22 = +format3.fractionGroupSize) ? fractionPart.replace(
10953           new RegExp("\\d{" + g22 + "}\\B", "g"),
10954           "$&" + (format3.fractionGroupSeparator || "")
10955         ) : fractionPart) : intPart;
10956       }
10957       return (format3.prefix || "") + str + (format3.suffix || "");
10958     };
10959     P3.toFraction = function(md) {
10960       var d2, d0, d1, d22, e3, exp2, n3, n0, n1, q3, r2, s2, x3 = this, xc = x3.c;
10961       if (md != null) {
10962         n3 = new BigNumber2(md);
10963         if (!n3.isInteger() && (n3.c || n3.s !== 1) || n3.lt(ONE)) {
10964           throw Error(bignumberError + "Argument " + (n3.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n3));
10965         }
10966       }
10967       if (!xc) return new BigNumber2(x3);
10968       d2 = new BigNumber2(ONE);
10969       n1 = d0 = new BigNumber2(ONE);
10970       d1 = n0 = new BigNumber2(ONE);
10971       s2 = coeffToString(xc);
10972       e3 = d2.e = s2.length - x3.e - 1;
10973       d2.c[0] = POWS_TEN[(exp2 = e3 % LOG_BASE) < 0 ? LOG_BASE + exp2 : exp2];
10974       md = !md || n3.comparedTo(d2) > 0 ? e3 > 0 ? d2 : n1 : n3;
10975       exp2 = MAX_EXP;
10976       MAX_EXP = 1 / 0;
10977       n3 = new BigNumber2(s2);
10978       n0.c[0] = 0;
10979       for (; ; ) {
10980         q3 = div(n3, d2, 0, 1);
10981         d22 = d0.plus(q3.times(d1));
10982         if (d22.comparedTo(md) == 1) break;
10983         d0 = d1;
10984         d1 = d22;
10985         n1 = n0.plus(q3.times(d22 = n1));
10986         n0 = d22;
10987         d2 = n3.minus(q3.times(d22 = d2));
10988         n3 = d22;
10989       }
10990       d22 = div(md.minus(d0), d1, 0, 1);
10991       n0 = n0.plus(d22.times(n1));
10992       d0 = d0.plus(d22.times(d1));
10993       n0.s = n1.s = x3.s;
10994       e3 = e3 * 2;
10995       r2 = div(n1, d1, e3, ROUNDING_MODE).minus(x3).abs().comparedTo(
10996         div(n0, d0, e3, ROUNDING_MODE).minus(x3).abs()
10997       ) < 1 ? [n1, d1] : [n0, d0];
10998       MAX_EXP = exp2;
10999       return r2;
11000     };
11001     P3.toNumber = function() {
11002       return +valueOf(this);
11003     };
11004     P3.toPrecision = function(sd, rm) {
11005       if (sd != null) intCheck(sd, 1, MAX);
11006       return format2(this, sd, rm, 2);
11007     };
11008     P3.toString = function(b3) {
11009       var str, n3 = this, s2 = n3.s, e3 = n3.e;
11010       if (e3 === null) {
11011         if (s2) {
11012           str = "Infinity";
11013           if (s2 < 0) str = "-" + str;
11014         } else {
11015           str = "NaN";
11016         }
11017       } else {
11018         if (b3 == null) {
11019           str = e3 <= TO_EXP_NEG || e3 >= TO_EXP_POS ? toExponential(coeffToString(n3.c), e3) : toFixedPoint(coeffToString(n3.c), e3, "0");
11020         } else if (b3 === 10 && alphabetHasNormalDecimalDigits) {
11021           n3 = round(new BigNumber2(n3), DECIMAL_PLACES + e3 + 1, ROUNDING_MODE);
11022           str = toFixedPoint(coeffToString(n3.c), n3.e, "0");
11023         } else {
11024           intCheck(b3, 2, ALPHABET.length, "Base");
11025           str = convertBase(toFixedPoint(coeffToString(n3.c), e3, "0"), 10, b3, s2, true);
11026         }
11027         if (s2 < 0 && n3.c[0]) str = "-" + str;
11028       }
11029       return str;
11030     };
11031     P3.valueOf = P3.toJSON = function() {
11032       return valueOf(this);
11033     };
11034     P3._isBigNumber = true;
11035     P3[Symbol.toStringTag] = "BigNumber";
11036     P3[Symbol.for("nodejs.util.inspect.custom")] = P3.valueOf;
11037     if (configObject != null) BigNumber2.set(configObject);
11038     return BigNumber2;
11039   }
11040   function bitFloor(n3) {
11041     var i3 = n3 | 0;
11042     return n3 > 0 || n3 === i3 ? i3 : i3 - 1;
11043   }
11044   function coeffToString(a2) {
11045     var s2, z3, i3 = 1, j3 = a2.length, r2 = a2[0] + "";
11046     for (; i3 < j3; ) {
11047       s2 = a2[i3++] + "";
11048       z3 = LOG_BASE - s2.length;
11049       for (; z3--; s2 = "0" + s2) ;
11050       r2 += s2;
11051     }
11052     for (j3 = r2.length; r2.charCodeAt(--j3) === 48; ) ;
11053     return r2.slice(0, j3 + 1 || 1);
11054   }
11055   function compare(x3, y3) {
11056     var a2, b3, xc = x3.c, yc = y3.c, i3 = x3.s, j3 = y3.s, k3 = x3.e, l2 = y3.e;
11057     if (!i3 || !j3) return null;
11058     a2 = xc && !xc[0];
11059     b3 = yc && !yc[0];
11060     if (a2 || b3) return a2 ? b3 ? 0 : -j3 : i3;
11061     if (i3 != j3) return i3;
11062     a2 = i3 < 0;
11063     b3 = k3 == l2;
11064     if (!xc || !yc) return b3 ? 0 : !xc ^ a2 ? 1 : -1;
11065     if (!b3) return k3 > l2 ^ a2 ? 1 : -1;
11066     j3 = (k3 = xc.length) < (l2 = yc.length) ? k3 : l2;
11067     for (i3 = 0; i3 < j3; i3++) if (xc[i3] != yc[i3]) return xc[i3] > yc[i3] ^ a2 ? 1 : -1;
11068     return k3 == l2 ? 0 : k3 > l2 ^ a2 ? 1 : -1;
11069   }
11070   function intCheck(n3, min3, max3, name) {
11071     if (n3 < min3 || n3 > max3 || n3 !== mathfloor(n3)) {
11072       throw Error(bignumberError + (name || "Argument") + (typeof n3 == "number" ? n3 < min3 || n3 > max3 ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n3));
11073     }
11074   }
11075   function isOdd(n3) {
11076     var k3 = n3.c.length - 1;
11077     return bitFloor(n3.e / LOG_BASE) == k3 && n3.c[k3] % 2 != 0;
11078   }
11079   function toExponential(str, e3) {
11080     return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e3 < 0 ? "e" : "e+") + e3;
11081   }
11082   function toFixedPoint(str, e3, z3) {
11083     var len, zs;
11084     if (e3 < 0) {
11085       for (zs = z3 + "."; ++e3; zs += z3) ;
11086       str = zs + str;
11087     } else {
11088       len = str.length;
11089       if (++e3 > len) {
11090         for (zs = z3, e3 -= len; --e3; zs += z3) ;
11091         str += zs;
11092       } else if (e3 < len) {
11093         str = str.slice(0, e3) + "." + str.slice(e3);
11094       }
11095     }
11096     return str;
11097   }
11098   var BigNumber = clone();
11099   var bignumber_default = BigNumber;
11100
11101   // node_modules/splaytree-ts/dist/esm/index.js
11102   var SplayTreeNode = class {
11103     constructor(key) {
11104       __publicField(this, "key");
11105       __publicField(this, "left", null);
11106       __publicField(this, "right", null);
11107       this.key = key;
11108     }
11109   };
11110   var SplayTreeSetNode = class extends SplayTreeNode {
11111     constructor(key) {
11112       super(key);
11113     }
11114   };
11115   var SplayTree = class {
11116     constructor() {
11117       __publicField(this, "size", 0);
11118       __publicField(this, "modificationCount", 0);
11119       __publicField(this, "splayCount", 0);
11120     }
11121     splay(key) {
11122       const root3 = this.root;
11123       if (root3 == null) {
11124         this.compare(key, key);
11125         return -1;
11126       }
11127       let right = null;
11128       let newTreeRight = null;
11129       let left = null;
11130       let newTreeLeft = null;
11131       let current = root3;
11132       const compare2 = this.compare;
11133       let comp;
11134       while (true) {
11135         comp = compare2(current.key, key);
11136         if (comp > 0) {
11137           let currentLeft = current.left;
11138           if (currentLeft == null) break;
11139           comp = compare2(currentLeft.key, key);
11140           if (comp > 0) {
11141             current.left = currentLeft.right;
11142             currentLeft.right = current;
11143             current = currentLeft;
11144             currentLeft = current.left;
11145             if (currentLeft == null) break;
11146           }
11147           if (right == null) {
11148             newTreeRight = current;
11149           } else {
11150             right.left = current;
11151           }
11152           right = current;
11153           current = currentLeft;
11154         } else if (comp < 0) {
11155           let currentRight = current.right;
11156           if (currentRight == null) break;
11157           comp = compare2(currentRight.key, key);
11158           if (comp < 0) {
11159             current.right = currentRight.left;
11160             currentRight.left = current;
11161             current = currentRight;
11162             currentRight = current.right;
11163             if (currentRight == null) break;
11164           }
11165           if (left == null) {
11166             newTreeLeft = current;
11167           } else {
11168             left.right = current;
11169           }
11170           left = current;
11171           current = currentRight;
11172         } else {
11173           break;
11174         }
11175       }
11176       if (left != null) {
11177         left.right = current.left;
11178         current.left = newTreeLeft;
11179       }
11180       if (right != null) {
11181         right.left = current.right;
11182         current.right = newTreeRight;
11183       }
11184       if (this.root !== current) {
11185         this.root = current;
11186         this.splayCount++;
11187       }
11188       return comp;
11189     }
11190     splayMin(node) {
11191       let current = node;
11192       let nextLeft = current.left;
11193       while (nextLeft != null) {
11194         const left = nextLeft;
11195         current.left = left.right;
11196         left.right = current;
11197         current = left;
11198         nextLeft = current.left;
11199       }
11200       return current;
11201     }
11202     splayMax(node) {
11203       let current = node;
11204       let nextRight = current.right;
11205       while (nextRight != null) {
11206         const right = nextRight;
11207         current.right = right.left;
11208         right.left = current;
11209         current = right;
11210         nextRight = current.right;
11211       }
11212       return current;
11213     }
11214     _delete(key) {
11215       if (this.root == null) return null;
11216       const comp = this.splay(key);
11217       if (comp != 0) return null;
11218       let root3 = this.root;
11219       const result = root3;
11220       const left = root3.left;
11221       this.size--;
11222       if (left == null) {
11223         this.root = root3.right;
11224       } else {
11225         const right = root3.right;
11226         root3 = this.splayMax(left);
11227         root3.right = right;
11228         this.root = root3;
11229       }
11230       this.modificationCount++;
11231       return result;
11232     }
11233     addNewRoot(node, comp) {
11234       this.size++;
11235       this.modificationCount++;
11236       const root3 = this.root;
11237       if (root3 == null) {
11238         this.root = node;
11239         return;
11240       }
11241       if (comp < 0) {
11242         node.left = root3;
11243         node.right = root3.right;
11244         root3.right = null;
11245       } else {
11246         node.right = root3;
11247         node.left = root3.left;
11248         root3.left = null;
11249       }
11250       this.root = node;
11251     }
11252     _first() {
11253       const root3 = this.root;
11254       if (root3 == null) return null;
11255       this.root = this.splayMin(root3);
11256       return this.root;
11257     }
11258     _last() {
11259       const root3 = this.root;
11260       if (root3 == null) return null;
11261       this.root = this.splayMax(root3);
11262       return this.root;
11263     }
11264     clear() {
11265       this.root = null;
11266       this.size = 0;
11267       this.modificationCount++;
11268     }
11269     has(key) {
11270       return this.validKey(key) && this.splay(key) == 0;
11271     }
11272     defaultCompare() {
11273       return (a2, b3) => a2 < b3 ? -1 : a2 > b3 ? 1 : 0;
11274     }
11275     wrap() {
11276       return {
11277         getRoot: () => {
11278           return this.root;
11279         },
11280         setRoot: (root3) => {
11281           this.root = root3;
11282         },
11283         getSize: () => {
11284           return this.size;
11285         },
11286         getModificationCount: () => {
11287           return this.modificationCount;
11288         },
11289         getSplayCount: () => {
11290           return this.splayCount;
11291         },
11292         setSplayCount: (count) => {
11293           this.splayCount = count;
11294         },
11295         splay: (key) => {
11296           return this.splay(key);
11297         },
11298         has: (key) => {
11299           return this.has(key);
11300         }
11301       };
11302     }
11303   };
11304   var _a, _b;
11305   var SplayTreeSet = class _SplayTreeSet extends SplayTree {
11306     constructor(compare2, isValidKey) {
11307       super();
11308       __publicField(this, "root", null);
11309       __publicField(this, "compare");
11310       __publicField(this, "validKey");
11311       __publicField(this, _a, "[object Set]");
11312       this.compare = compare2 != null ? compare2 : this.defaultCompare();
11313       this.validKey = isValidKey != null ? isValidKey : ((v3) => v3 != null && v3 != void 0);
11314     }
11315     delete(element) {
11316       if (!this.validKey(element)) return false;
11317       return this._delete(element) != null;
11318     }
11319     deleteAll(elements) {
11320       for (const element of elements) {
11321         this.delete(element);
11322       }
11323     }
11324     forEach(f2) {
11325       const nodes = this[Symbol.iterator]();
11326       let result;
11327       while (result = nodes.next(), !result.done) {
11328         f2(result.value, result.value, this);
11329       }
11330     }
11331     add(element) {
11332       const compare2 = this.splay(element);
11333       if (compare2 != 0) this.addNewRoot(new SplayTreeSetNode(element), compare2);
11334       return this;
11335     }
11336     addAndReturn(element) {
11337       const compare2 = this.splay(element);
11338       if (compare2 != 0) this.addNewRoot(new SplayTreeSetNode(element), compare2);
11339       return this.root.key;
11340     }
11341     addAll(elements) {
11342       for (const element of elements) {
11343         this.add(element);
11344       }
11345     }
11346     isEmpty() {
11347       return this.root == null;
11348     }
11349     isNotEmpty() {
11350       return this.root != null;
11351     }
11352     single() {
11353       if (this.size == 0) throw "Bad state: No element";
11354       if (this.size > 1) throw "Bad state: Too many element";
11355       return this.root.key;
11356     }
11357     first() {
11358       if (this.size == 0) throw "Bad state: No element";
11359       return this._first().key;
11360     }
11361     last() {
11362       if (this.size == 0) throw "Bad state: No element";
11363       return this._last().key;
11364     }
11365     lastBefore(element) {
11366       if (element == null) throw "Invalid arguments(s)";
11367       if (this.root == null) return null;
11368       const comp = this.splay(element);
11369       if (comp < 0) return this.root.key;
11370       let node = this.root.left;
11371       if (node == null) return null;
11372       let nodeRight = node.right;
11373       while (nodeRight != null) {
11374         node = nodeRight;
11375         nodeRight = node.right;
11376       }
11377       return node.key;
11378     }
11379     firstAfter(element) {
11380       if (element == null) throw "Invalid arguments(s)";
11381       if (this.root == null) return null;
11382       const comp = this.splay(element);
11383       if (comp > 0) return this.root.key;
11384       let node = this.root.right;
11385       if (node == null) return null;
11386       let nodeLeft = node.left;
11387       while (nodeLeft != null) {
11388         node = nodeLeft;
11389         nodeLeft = node.left;
11390       }
11391       return node.key;
11392     }
11393     retainAll(elements) {
11394       const retainSet = new _SplayTreeSet(this.compare, this.validKey);
11395       const modificationCount = this.modificationCount;
11396       for (const object of elements) {
11397         if (modificationCount != this.modificationCount) {
11398           throw "Concurrent modification during iteration.";
11399         }
11400         if (this.validKey(object) && this.splay(object) == 0) {
11401           retainSet.add(this.root.key);
11402         }
11403       }
11404       if (retainSet.size != this.size) {
11405         this.root = retainSet.root;
11406         this.size = retainSet.size;
11407         this.modificationCount++;
11408       }
11409     }
11410     lookup(object) {
11411       if (!this.validKey(object)) return null;
11412       const comp = this.splay(object);
11413       if (comp != 0) return null;
11414       return this.root.key;
11415     }
11416     intersection(other) {
11417       const result = new _SplayTreeSet(this.compare, this.validKey);
11418       for (const element of this) {
11419         if (other.has(element)) result.add(element);
11420       }
11421       return result;
11422     }
11423     difference(other) {
11424       const result = new _SplayTreeSet(this.compare, this.validKey);
11425       for (const element of this) {
11426         if (!other.has(element)) result.add(element);
11427       }
11428       return result;
11429     }
11430     union(other) {
11431       const u4 = this.clone();
11432       u4.addAll(other);
11433       return u4;
11434     }
11435     clone() {
11436       const set5 = new _SplayTreeSet(this.compare, this.validKey);
11437       set5.size = this.size;
11438       set5.root = this.copyNode(this.root);
11439       return set5;
11440     }
11441     copyNode(node) {
11442       if (node == null) return null;
11443       function copyChildren(node2, dest) {
11444         let left;
11445         let right;
11446         do {
11447           left = node2.left;
11448           right = node2.right;
11449           if (left != null) {
11450             const newLeft = new SplayTreeSetNode(left.key);
11451             dest.left = newLeft;
11452             copyChildren(left, newLeft);
11453           }
11454           if (right != null) {
11455             const newRight = new SplayTreeSetNode(right.key);
11456             dest.right = newRight;
11457             node2 = right;
11458             dest = newRight;
11459           }
11460         } while (right != null);
11461       }
11462       const result = new SplayTreeSetNode(node.key);
11463       copyChildren(node, result);
11464       return result;
11465     }
11466     toSet() {
11467       return this.clone();
11468     }
11469     entries() {
11470       return new SplayTreeSetEntryIterableIterator(this.wrap());
11471     }
11472     keys() {
11473       return this[Symbol.iterator]();
11474     }
11475     values() {
11476       return this[Symbol.iterator]();
11477     }
11478     [(_b = Symbol.iterator, _a = Symbol.toStringTag, _b)]() {
11479       return new SplayTreeKeyIterableIterator(this.wrap());
11480     }
11481   };
11482   var SplayTreeIterableIterator = class {
11483     constructor(tree) {
11484       __publicField(this, "tree");
11485       __publicField(this, "path", new Array());
11486       __publicField(this, "modificationCount", null);
11487       __publicField(this, "splayCount");
11488       this.tree = tree;
11489       this.splayCount = tree.getSplayCount();
11490     }
11491     [Symbol.iterator]() {
11492       return this;
11493     }
11494     next() {
11495       if (this.moveNext()) return { done: false, value: this.current() };
11496       return { done: true, value: null };
11497     }
11498     current() {
11499       if (!this.path.length) return null;
11500       const node = this.path[this.path.length - 1];
11501       return this.getValue(node);
11502     }
11503     rebuildPath(key) {
11504       this.path.splice(0, this.path.length);
11505       this.tree.splay(key);
11506       this.path.push(this.tree.getRoot());
11507       this.splayCount = this.tree.getSplayCount();
11508     }
11509     findLeftMostDescendent(node) {
11510       while (node != null) {
11511         this.path.push(node);
11512         node = node.left;
11513       }
11514     }
11515     moveNext() {
11516       if (this.modificationCount != this.tree.getModificationCount()) {
11517         if (this.modificationCount == null) {
11518           this.modificationCount = this.tree.getModificationCount();
11519           let node2 = this.tree.getRoot();
11520           while (node2 != null) {
11521             this.path.push(node2);
11522             node2 = node2.left;
11523           }
11524           return this.path.length > 0;
11525         }
11526         throw "Concurrent modification during iteration.";
11527       }
11528       if (!this.path.length) return false;
11529       if (this.splayCount != this.tree.getSplayCount()) {
11530         this.rebuildPath(this.path[this.path.length - 1].key);
11531       }
11532       let node = this.path[this.path.length - 1];
11533       let next = node.right;
11534       if (next != null) {
11535         while (next != null) {
11536           this.path.push(next);
11537           next = next.left;
11538         }
11539         return true;
11540       }
11541       this.path.pop();
11542       while (this.path.length && this.path[this.path.length - 1].right === node) {
11543         node = this.path.pop();
11544       }
11545       return this.path.length > 0;
11546     }
11547   };
11548   var SplayTreeKeyIterableIterator = class extends SplayTreeIterableIterator {
11549     getValue(node) {
11550       return node.key;
11551     }
11552   };
11553   var SplayTreeSetEntryIterableIterator = class extends SplayTreeIterableIterator {
11554     getValue(node) {
11555       return [node.key, node.key];
11556     }
11557   };
11558
11559   // node_modules/polyclip-ts/dist/esm/index.js
11560   var constant_default = (x3) => {
11561     return () => {
11562       return x3;
11563     };
11564   };
11565   var compare_default = (eps) => {
11566     const almostEqual = eps ? (a2, b3) => b3.minus(a2).abs().isLessThanOrEqualTo(eps) : constant_default(false);
11567     return (a2, b3) => {
11568       if (almostEqual(a2, b3)) return 0;
11569       return a2.comparedTo(b3);
11570     };
11571   };
11572   function orient_default(eps) {
11573     const almostCollinear = eps ? (area2, ax, ay, cx, cy) => area2.exponentiatedBy(2).isLessThanOrEqualTo(
11574       cx.minus(ax).exponentiatedBy(2).plus(cy.minus(ay).exponentiatedBy(2)).times(eps)
11575     ) : constant_default(false);
11576     return (a2, b3, c2) => {
11577       const ax = a2.x, ay = a2.y, cx = c2.x, cy = c2.y;
11578       const area2 = ay.minus(cy).times(b3.x.minus(cx)).minus(ax.minus(cx).times(b3.y.minus(cy)));
11579       if (almostCollinear(area2, ax, ay, cx, cy)) return 0;
11580       return area2.comparedTo(0);
11581     };
11582   }
11583   var identity_default = (x3) => {
11584     return x3;
11585   };
11586   var snap_default = (eps) => {
11587     if (eps) {
11588       const xTree = new SplayTreeSet(compare_default(eps));
11589       const yTree = new SplayTreeSet(compare_default(eps));
11590       const snapCoord = (coord2, tree) => {
11591         return tree.addAndReturn(coord2);
11592       };
11593       const snap = (v3) => {
11594         return {
11595           x: snapCoord(v3.x, xTree),
11596           y: snapCoord(v3.y, yTree)
11597         };
11598       };
11599       snap({ x: new bignumber_default(0), y: new bignumber_default(0) });
11600       return snap;
11601     }
11602     return identity_default;
11603   };
11604   var set3 = (eps) => {
11605     return {
11606       set: (eps2) => {
11607         precision = set3(eps2);
11608       },
11609       reset: () => set3(eps),
11610       compare: compare_default(eps),
11611       snap: snap_default(eps),
11612       orient: orient_default(eps)
11613     };
11614   };
11615   var precision = set3();
11616   var isInBbox = (bbox2, point) => {
11617     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);
11618   };
11619   var getBboxOverlap = (b1, b22) => {
11620     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))
11621       return null;
11622     const lowerX = b1.ll.x.isLessThan(b22.ll.x) ? b22.ll.x : b1.ll.x;
11623     const upperX = b1.ur.x.isLessThan(b22.ur.x) ? b1.ur.x : b22.ur.x;
11624     const lowerY = b1.ll.y.isLessThan(b22.ll.y) ? b22.ll.y : b1.ll.y;
11625     const upperY = b1.ur.y.isLessThan(b22.ur.y) ? b1.ur.y : b22.ur.y;
11626     return { ll: { x: lowerX, y: lowerY }, ur: { x: upperX, y: upperY } };
11627   };
11628   var crossProduct = (a2, b3) => a2.x.times(b3.y).minus(a2.y.times(b3.x));
11629   var dotProduct = (a2, b3) => a2.x.times(b3.x).plus(a2.y.times(b3.y));
11630   var length = (v3) => dotProduct(v3, v3).sqrt();
11631   var sineOfAngle = (pShared, pBase, pAngle) => {
11632     const vBase = { x: pBase.x.minus(pShared.x), y: pBase.y.minus(pShared.y) };
11633     const vAngle = { x: pAngle.x.minus(pShared.x), y: pAngle.y.minus(pShared.y) };
11634     return crossProduct(vAngle, vBase).div(length(vAngle)).div(length(vBase));
11635   };
11636   var cosineOfAngle = (pShared, pBase, pAngle) => {
11637     const vBase = { x: pBase.x.minus(pShared.x), y: pBase.y.minus(pShared.y) };
11638     const vAngle = { x: pAngle.x.minus(pShared.x), y: pAngle.y.minus(pShared.y) };
11639     return dotProduct(vAngle, vBase).div(length(vAngle)).div(length(vBase));
11640   };
11641   var horizontalIntersection = (pt2, v3, y3) => {
11642     if (v3.y.isZero()) return null;
11643     return { x: pt2.x.plus(v3.x.div(v3.y).times(y3.minus(pt2.y))), y: y3 };
11644   };
11645   var verticalIntersection = (pt2, v3, x3) => {
11646     if (v3.x.isZero()) return null;
11647     return { x: x3, y: pt2.y.plus(v3.y.div(v3.x).times(x3.minus(pt2.x))) };
11648   };
11649   var intersection = (pt1, v1, pt2, v22) => {
11650     if (v1.x.isZero()) return verticalIntersection(pt2, v22, pt1.x);
11651     if (v22.x.isZero()) return verticalIntersection(pt1, v1, pt2.x);
11652     if (v1.y.isZero()) return horizontalIntersection(pt2, v22, pt1.y);
11653     if (v22.y.isZero()) return horizontalIntersection(pt1, v1, pt2.y);
11654     const kross = crossProduct(v1, v22);
11655     if (kross.isZero()) return null;
11656     const ve3 = { x: pt2.x.minus(pt1.x), y: pt2.y.minus(pt1.y) };
11657     const d1 = crossProduct(ve3, v1).div(kross);
11658     const d2 = crossProduct(ve3, v22).div(kross);
11659     const x12 = pt1.x.plus(d2.times(v1.x)), x22 = pt2.x.plus(d1.times(v22.x));
11660     const y12 = pt1.y.plus(d2.times(v1.y)), y22 = pt2.y.plus(d1.times(v22.y));
11661     const x3 = x12.plus(x22).div(2);
11662     const y3 = y12.plus(y22).div(2);
11663     return { x: x3, y: y3 };
11664   };
11665   var SweepEvent = class _SweepEvent {
11666     // Warning: 'point' input will be modified and re-used (for performance)
11667     constructor(point, isLeft) {
11668       __publicField(this, "point");
11669       __publicField(this, "isLeft");
11670       __publicField(this, "segment");
11671       __publicField(this, "otherSE");
11672       __publicField(this, "consumedBy");
11673       if (point.events === void 0) point.events = [this];
11674       else point.events.push(this);
11675       this.point = point;
11676       this.isLeft = isLeft;
11677     }
11678     // for ordering sweep events in the sweep event queue
11679     static compare(a2, b3) {
11680       const ptCmp = _SweepEvent.comparePoints(a2.point, b3.point);
11681       if (ptCmp !== 0) return ptCmp;
11682       if (a2.point !== b3.point) a2.link(b3);
11683       if (a2.isLeft !== b3.isLeft) return a2.isLeft ? 1 : -1;
11684       return Segment.compare(a2.segment, b3.segment);
11685     }
11686     // for ordering points in sweep line order
11687     static comparePoints(aPt, bPt) {
11688       if (aPt.x.isLessThan(bPt.x)) return -1;
11689       if (aPt.x.isGreaterThan(bPt.x)) return 1;
11690       if (aPt.y.isLessThan(bPt.y)) return -1;
11691       if (aPt.y.isGreaterThan(bPt.y)) return 1;
11692       return 0;
11693     }
11694     link(other) {
11695       if (other.point === this.point) {
11696         throw new Error("Tried to link already linked events");
11697       }
11698       const otherEvents = other.point.events;
11699       for (let i3 = 0, iMax = otherEvents.length; i3 < iMax; i3++) {
11700         const evt = otherEvents[i3];
11701         this.point.events.push(evt);
11702         evt.point = this.point;
11703       }
11704       this.checkForConsuming();
11705     }
11706     /* Do a pass over our linked events and check to see if any pair
11707      * of segments match, and should be consumed. */
11708     checkForConsuming() {
11709       const numEvents = this.point.events.length;
11710       for (let i3 = 0; i3 < numEvents; i3++) {
11711         const evt1 = this.point.events[i3];
11712         if (evt1.segment.consumedBy !== void 0) continue;
11713         for (let j3 = i3 + 1; j3 < numEvents; j3++) {
11714           const evt2 = this.point.events[j3];
11715           if (evt2.consumedBy !== void 0) continue;
11716           if (evt1.otherSE.point.events !== evt2.otherSE.point.events) continue;
11717           evt1.segment.consume(evt2.segment);
11718         }
11719       }
11720     }
11721     getAvailableLinkedEvents() {
11722       const events = [];
11723       for (let i3 = 0, iMax = this.point.events.length; i3 < iMax; i3++) {
11724         const evt = this.point.events[i3];
11725         if (evt !== this && !evt.segment.ringOut && evt.segment.isInResult()) {
11726           events.push(evt);
11727         }
11728       }
11729       return events;
11730     }
11731     /**
11732      * Returns a comparator function for sorting linked events that will
11733      * favor the event that will give us the smallest left-side angle.
11734      * All ring construction starts as low as possible heading to the right,
11735      * so by always turning left as sharp as possible we'll get polygons
11736      * without uncessary loops & holes.
11737      *
11738      * The comparator function has a compute cache such that it avoids
11739      * re-computing already-computed values.
11740      */
11741     getLeftmostComparator(baseEvent) {
11742       const cache = /* @__PURE__ */ new Map();
11743       const fillCache = (linkedEvent) => {
11744         const nextEvent = linkedEvent.otherSE;
11745         cache.set(linkedEvent, {
11746           sine: sineOfAngle(this.point, baseEvent.point, nextEvent.point),
11747           cosine: cosineOfAngle(this.point, baseEvent.point, nextEvent.point)
11748         });
11749       };
11750       return (a2, b3) => {
11751         if (!cache.has(a2)) fillCache(a2);
11752         if (!cache.has(b3)) fillCache(b3);
11753         const { sine: asine, cosine: acosine } = cache.get(a2);
11754         const { sine: bsine, cosine: bcosine } = cache.get(b3);
11755         if (asine.isGreaterThanOrEqualTo(0) && bsine.isGreaterThanOrEqualTo(0)) {
11756           if (acosine.isLessThan(bcosine)) return 1;
11757           if (acosine.isGreaterThan(bcosine)) return -1;
11758           return 0;
11759         }
11760         if (asine.isLessThan(0) && bsine.isLessThan(0)) {
11761           if (acosine.isLessThan(bcosine)) return -1;
11762           if (acosine.isGreaterThan(bcosine)) return 1;
11763           return 0;
11764         }
11765         if (bsine.isLessThan(asine)) return -1;
11766         if (bsine.isGreaterThan(asine)) return 1;
11767         return 0;
11768       };
11769     }
11770   };
11771   var RingOut = class _RingOut {
11772     constructor(events) {
11773       __publicField(this, "events");
11774       __publicField(this, "poly");
11775       __publicField(this, "_isExteriorRing");
11776       __publicField(this, "_enclosingRing");
11777       this.events = events;
11778       for (let i3 = 0, iMax = events.length; i3 < iMax; i3++) {
11779         events[i3].segment.ringOut = this;
11780       }
11781       this.poly = null;
11782     }
11783     /* Given the segments from the sweep line pass, compute & return a series
11784      * of closed rings from all the segments marked to be part of the result */
11785     static factory(allSegments) {
11786       const ringsOut = [];
11787       for (let i3 = 0, iMax = allSegments.length; i3 < iMax; i3++) {
11788         const segment = allSegments[i3];
11789         if (!segment.isInResult() || segment.ringOut) continue;
11790         let prevEvent = null;
11791         let event = segment.leftSE;
11792         let nextEvent = segment.rightSE;
11793         const events = [event];
11794         const startingPoint = event.point;
11795         const intersectionLEs = [];
11796         while (true) {
11797           prevEvent = event;
11798           event = nextEvent;
11799           events.push(event);
11800           if (event.point === startingPoint) break;
11801           while (true) {
11802             const availableLEs = event.getAvailableLinkedEvents();
11803             if (availableLEs.length === 0) {
11804               const firstPt = events[0].point;
11805               const lastPt = events[events.length - 1].point;
11806               throw new Error(
11807                 "Unable to complete output ring starting at [".concat(firstPt.x, ", ").concat(firstPt.y, "]. Last matching segment found ends at [").concat(lastPt.x, ", ").concat(lastPt.y, "].")
11808               );
11809             }
11810             if (availableLEs.length === 1) {
11811               nextEvent = availableLEs[0].otherSE;
11812               break;
11813             }
11814             let indexLE = null;
11815             for (let j3 = 0, jMax = intersectionLEs.length; j3 < jMax; j3++) {
11816               if (intersectionLEs[j3].point === event.point) {
11817                 indexLE = j3;
11818                 break;
11819               }
11820             }
11821             if (indexLE !== null) {
11822               const intersectionLE = intersectionLEs.splice(indexLE)[0];
11823               const ringEvents = events.splice(intersectionLE.index);
11824               ringEvents.unshift(ringEvents[0].otherSE);
11825               ringsOut.push(new _RingOut(ringEvents.reverse()));
11826               continue;
11827             }
11828             intersectionLEs.push({
11829               index: events.length,
11830               point: event.point
11831             });
11832             const comparator = event.getLeftmostComparator(prevEvent);
11833             nextEvent = availableLEs.sort(comparator)[0].otherSE;
11834             break;
11835           }
11836         }
11837         ringsOut.push(new _RingOut(events));
11838       }
11839       return ringsOut;
11840     }
11841     getGeom() {
11842       let prevPt = this.events[0].point;
11843       const points = [prevPt];
11844       for (let i3 = 1, iMax = this.events.length - 1; i3 < iMax; i3++) {
11845         const pt22 = this.events[i3].point;
11846         const nextPt2 = this.events[i3 + 1].point;
11847         if (precision.orient(pt22, prevPt, nextPt2) === 0) continue;
11848         points.push(pt22);
11849         prevPt = pt22;
11850       }
11851       if (points.length === 1) return null;
11852       const pt2 = points[0];
11853       const nextPt = points[1];
11854       if (precision.orient(pt2, prevPt, nextPt) === 0) points.shift();
11855       points.push(points[0]);
11856       const step = this.isExteriorRing() ? 1 : -1;
11857       const iStart = this.isExteriorRing() ? 0 : points.length - 1;
11858       const iEnd = this.isExteriorRing() ? points.length : -1;
11859       const orderedPoints = [];
11860       for (let i3 = iStart; i3 != iEnd; i3 += step)
11861         orderedPoints.push([points[i3].x.toNumber(), points[i3].y.toNumber()]);
11862       return orderedPoints;
11863     }
11864     isExteriorRing() {
11865       if (this._isExteriorRing === void 0) {
11866         const enclosing = this.enclosingRing();
11867         this._isExteriorRing = enclosing ? !enclosing.isExteriorRing() : true;
11868       }
11869       return this._isExteriorRing;
11870     }
11871     enclosingRing() {
11872       if (this._enclosingRing === void 0) {
11873         this._enclosingRing = this._calcEnclosingRing();
11874       }
11875       return this._enclosingRing;
11876     }
11877     /* Returns the ring that encloses this one, if any */
11878     _calcEnclosingRing() {
11879       var _a5, _b3;
11880       let leftMostEvt = this.events[0];
11881       for (let i3 = 1, iMax = this.events.length; i3 < iMax; i3++) {
11882         const evt = this.events[i3];
11883         if (SweepEvent.compare(leftMostEvt, evt) > 0) leftMostEvt = evt;
11884       }
11885       let prevSeg = leftMostEvt.segment.prevInResult();
11886       let prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
11887       while (true) {
11888         if (!prevSeg) return null;
11889         if (!prevPrevSeg) return prevSeg.ringOut;
11890         if (prevPrevSeg.ringOut !== prevSeg.ringOut) {
11891           if (((_a5 = prevPrevSeg.ringOut) == null ? void 0 : _a5.enclosingRing()) !== prevSeg.ringOut) {
11892             return prevSeg.ringOut;
11893           } else return (_b3 = prevSeg.ringOut) == null ? void 0 : _b3.enclosingRing();
11894         }
11895         prevSeg = prevPrevSeg.prevInResult();
11896         prevPrevSeg = prevSeg ? prevSeg.prevInResult() : null;
11897       }
11898     }
11899   };
11900   var PolyOut = class {
11901     constructor(exteriorRing) {
11902       __publicField(this, "exteriorRing");
11903       __publicField(this, "interiorRings");
11904       this.exteriorRing = exteriorRing;
11905       exteriorRing.poly = this;
11906       this.interiorRings = [];
11907     }
11908     addInterior(ring) {
11909       this.interiorRings.push(ring);
11910       ring.poly = this;
11911     }
11912     getGeom() {
11913       const geom0 = this.exteriorRing.getGeom();
11914       if (geom0 === null) return null;
11915       const geom = [geom0];
11916       for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
11917         const ringGeom = this.interiorRings[i3].getGeom();
11918         if (ringGeom === null) continue;
11919         geom.push(ringGeom);
11920       }
11921       return geom;
11922     }
11923   };
11924   var MultiPolyOut = class {
11925     constructor(rings) {
11926       __publicField(this, "rings");
11927       __publicField(this, "polys");
11928       this.rings = rings;
11929       this.polys = this._composePolys(rings);
11930     }
11931     getGeom() {
11932       const geom = [];
11933       for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
11934         const polyGeom = this.polys[i3].getGeom();
11935         if (polyGeom === null) continue;
11936         geom.push(polyGeom);
11937       }
11938       return geom;
11939     }
11940     _composePolys(rings) {
11941       var _a5;
11942       const polys = [];
11943       for (let i3 = 0, iMax = rings.length; i3 < iMax; i3++) {
11944         const ring = rings[i3];
11945         if (ring.poly) continue;
11946         if (ring.isExteriorRing()) polys.push(new PolyOut(ring));
11947         else {
11948           const enclosingRing = ring.enclosingRing();
11949           if (!(enclosingRing == null ? void 0 : enclosingRing.poly)) polys.push(new PolyOut(enclosingRing));
11950           (_a5 = enclosingRing == null ? void 0 : enclosingRing.poly) == null ? void 0 : _a5.addInterior(ring);
11951         }
11952       }
11953       return polys;
11954     }
11955   };
11956   var SweepLine = class {
11957     constructor(queue, comparator = Segment.compare) {
11958       __publicField(this, "queue");
11959       __publicField(this, "tree");
11960       __publicField(this, "segments");
11961       this.queue = queue;
11962       this.tree = new SplayTreeSet(comparator);
11963       this.segments = [];
11964     }
11965     process(event) {
11966       const segment = event.segment;
11967       const newEvents = [];
11968       if (event.consumedBy) {
11969         if (event.isLeft) this.queue.delete(event.otherSE);
11970         else this.tree.delete(segment);
11971         return newEvents;
11972       }
11973       if (event.isLeft) this.tree.add(segment);
11974       let prevSeg = segment;
11975       let nextSeg = segment;
11976       do {
11977         prevSeg = this.tree.lastBefore(prevSeg);
11978       } while (prevSeg != null && prevSeg.consumedBy != void 0);
11979       do {
11980         nextSeg = this.tree.firstAfter(nextSeg);
11981       } while (nextSeg != null && nextSeg.consumedBy != void 0);
11982       if (event.isLeft) {
11983         let prevMySplitter = null;
11984         if (prevSeg) {
11985           const prevInter = prevSeg.getIntersection(segment);
11986           if (prevInter !== null) {
11987             if (!segment.isAnEndpoint(prevInter)) prevMySplitter = prevInter;
11988             if (!prevSeg.isAnEndpoint(prevInter)) {
11989               const newEventsFromSplit = this._splitSafely(prevSeg, prevInter);
11990               for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
11991                 newEvents.push(newEventsFromSplit[i3]);
11992               }
11993             }
11994           }
11995         }
11996         let nextMySplitter = null;
11997         if (nextSeg) {
11998           const nextInter = nextSeg.getIntersection(segment);
11999           if (nextInter !== null) {
12000             if (!segment.isAnEndpoint(nextInter)) nextMySplitter = nextInter;
12001             if (!nextSeg.isAnEndpoint(nextInter)) {
12002               const newEventsFromSplit = this._splitSafely(nextSeg, nextInter);
12003               for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
12004                 newEvents.push(newEventsFromSplit[i3]);
12005               }
12006             }
12007           }
12008         }
12009         if (prevMySplitter !== null || nextMySplitter !== null) {
12010           let mySplitter = null;
12011           if (prevMySplitter === null) mySplitter = nextMySplitter;
12012           else if (nextMySplitter === null) mySplitter = prevMySplitter;
12013           else {
12014             const cmpSplitters = SweepEvent.comparePoints(
12015               prevMySplitter,
12016               nextMySplitter
12017             );
12018             mySplitter = cmpSplitters <= 0 ? prevMySplitter : nextMySplitter;
12019           }
12020           this.queue.delete(segment.rightSE);
12021           newEvents.push(segment.rightSE);
12022           const newEventsFromSplit = segment.split(mySplitter);
12023           for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
12024             newEvents.push(newEventsFromSplit[i3]);
12025           }
12026         }
12027         if (newEvents.length > 0) {
12028           this.tree.delete(segment);
12029           newEvents.push(event);
12030         } else {
12031           this.segments.push(segment);
12032           segment.prev = prevSeg;
12033         }
12034       } else {
12035         if (prevSeg && nextSeg) {
12036           const inter = prevSeg.getIntersection(nextSeg);
12037           if (inter !== null) {
12038             if (!prevSeg.isAnEndpoint(inter)) {
12039               const newEventsFromSplit = this._splitSafely(prevSeg, inter);
12040               for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
12041                 newEvents.push(newEventsFromSplit[i3]);
12042               }
12043             }
12044             if (!nextSeg.isAnEndpoint(inter)) {
12045               const newEventsFromSplit = this._splitSafely(nextSeg, inter);
12046               for (let i3 = 0, iMax = newEventsFromSplit.length; i3 < iMax; i3++) {
12047                 newEvents.push(newEventsFromSplit[i3]);
12048               }
12049             }
12050           }
12051         }
12052         this.tree.delete(segment);
12053       }
12054       return newEvents;
12055     }
12056     /* Safely split a segment that is currently in the datastructures
12057      * IE - a segment other than the one that is currently being processed. */
12058     _splitSafely(seg, pt2) {
12059       this.tree.delete(seg);
12060       const rightSE = seg.rightSE;
12061       this.queue.delete(rightSE);
12062       const newEvents = seg.split(pt2);
12063       newEvents.push(rightSE);
12064       if (seg.consumedBy === void 0) this.tree.add(seg);
12065       return newEvents;
12066     }
12067   };
12068   var Operation = class {
12069     constructor() {
12070       __publicField(this, "type");
12071       __publicField(this, "numMultiPolys");
12072     }
12073     run(type2, geom, moreGeoms) {
12074       operation.type = type2;
12075       const multipolys = [new MultiPolyIn(geom, true)];
12076       for (let i3 = 0, iMax = moreGeoms.length; i3 < iMax; i3++) {
12077         multipolys.push(new MultiPolyIn(moreGeoms[i3], false));
12078       }
12079       operation.numMultiPolys = multipolys.length;
12080       if (operation.type === "difference") {
12081         const subject = multipolys[0];
12082         let i3 = 1;
12083         while (i3 < multipolys.length) {
12084           if (getBboxOverlap(multipolys[i3].bbox, subject.bbox) !== null) i3++;
12085           else multipolys.splice(i3, 1);
12086         }
12087       }
12088       if (operation.type === "intersection") {
12089         for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
12090           const mpA = multipolys[i3];
12091           for (let j3 = i3 + 1, jMax = multipolys.length; j3 < jMax; j3++) {
12092             if (getBboxOverlap(mpA.bbox, multipolys[j3].bbox) === null) return [];
12093           }
12094         }
12095       }
12096       const queue = new SplayTreeSet(SweepEvent.compare);
12097       for (let i3 = 0, iMax = multipolys.length; i3 < iMax; i3++) {
12098         const sweepEvents = multipolys[i3].getSweepEvents();
12099         for (let j3 = 0, jMax = sweepEvents.length; j3 < jMax; j3++) {
12100           queue.add(sweepEvents[j3]);
12101         }
12102       }
12103       const sweepLine = new SweepLine(queue);
12104       let evt = null;
12105       if (queue.size != 0) {
12106         evt = queue.first();
12107         queue.delete(evt);
12108       }
12109       while (evt) {
12110         const newEvents = sweepLine.process(evt);
12111         for (let i3 = 0, iMax = newEvents.length; i3 < iMax; i3++) {
12112           const evt2 = newEvents[i3];
12113           if (evt2.consumedBy === void 0) queue.add(evt2);
12114         }
12115         if (queue.size != 0) {
12116           evt = queue.first();
12117           queue.delete(evt);
12118         } else {
12119           evt = null;
12120         }
12121       }
12122       precision.reset();
12123       const ringsOut = RingOut.factory(sweepLine.segments);
12124       const result = new MultiPolyOut(ringsOut);
12125       return result.getGeom();
12126     }
12127   };
12128   var operation = new Operation();
12129   var operation_default = operation;
12130   var segmentId = 0;
12131   var Segment = class _Segment {
12132     /* Warning: a reference to ringWindings input will be stored,
12133      *  and possibly will be later modified */
12134     constructor(leftSE, rightSE, rings, windings) {
12135       __publicField(this, "id");
12136       __publicField(this, "leftSE");
12137       __publicField(this, "rightSE");
12138       __publicField(this, "rings");
12139       __publicField(this, "windings");
12140       __publicField(this, "ringOut");
12141       __publicField(this, "consumedBy");
12142       __publicField(this, "prev");
12143       __publicField(this, "_prevInResult");
12144       __publicField(this, "_beforeState");
12145       __publicField(this, "_afterState");
12146       __publicField(this, "_isInResult");
12147       this.id = ++segmentId;
12148       this.leftSE = leftSE;
12149       leftSE.segment = this;
12150       leftSE.otherSE = rightSE;
12151       this.rightSE = rightSE;
12152       rightSE.segment = this;
12153       rightSE.otherSE = leftSE;
12154       this.rings = rings;
12155       this.windings = windings;
12156     }
12157     /* This compare() function is for ordering segments in the sweep
12158      * line tree, and does so according to the following criteria:
12159      *
12160      * Consider the vertical line that lies an infinestimal step to the
12161      * right of the right-more of the two left endpoints of the input
12162      * segments. Imagine slowly moving a point up from negative infinity
12163      * in the increasing y direction. Which of the two segments will that
12164      * point intersect first? That segment comes 'before' the other one.
12165      *
12166      * If neither segment would be intersected by such a line, (if one
12167      * or more of the segments are vertical) then the line to be considered
12168      * is directly on the right-more of the two left inputs.
12169      */
12170     static compare(a2, b3) {
12171       const alx = a2.leftSE.point.x;
12172       const blx = b3.leftSE.point.x;
12173       const arx = a2.rightSE.point.x;
12174       const brx = b3.rightSE.point.x;
12175       if (brx.isLessThan(alx)) return 1;
12176       if (arx.isLessThan(blx)) return -1;
12177       const aly = a2.leftSE.point.y;
12178       const bly = b3.leftSE.point.y;
12179       const ary = a2.rightSE.point.y;
12180       const bry = b3.rightSE.point.y;
12181       if (alx.isLessThan(blx)) {
12182         if (bly.isLessThan(aly) && bly.isLessThan(ary)) return 1;
12183         if (bly.isGreaterThan(aly) && bly.isGreaterThan(ary)) return -1;
12184         const aCmpBLeft = a2.comparePoint(b3.leftSE.point);
12185         if (aCmpBLeft < 0) return 1;
12186         if (aCmpBLeft > 0) return -1;
12187         const bCmpARight = b3.comparePoint(a2.rightSE.point);
12188         if (bCmpARight !== 0) return bCmpARight;
12189         return -1;
12190       }
12191       if (alx.isGreaterThan(blx)) {
12192         if (aly.isLessThan(bly) && aly.isLessThan(bry)) return -1;
12193         if (aly.isGreaterThan(bly) && aly.isGreaterThan(bry)) return 1;
12194         const bCmpALeft = b3.comparePoint(a2.leftSE.point);
12195         if (bCmpALeft !== 0) return bCmpALeft;
12196         const aCmpBRight = a2.comparePoint(b3.rightSE.point);
12197         if (aCmpBRight < 0) return 1;
12198         if (aCmpBRight > 0) return -1;
12199         return 1;
12200       }
12201       if (aly.isLessThan(bly)) return -1;
12202       if (aly.isGreaterThan(bly)) return 1;
12203       if (arx.isLessThan(brx)) {
12204         const bCmpARight = b3.comparePoint(a2.rightSE.point);
12205         if (bCmpARight !== 0) return bCmpARight;
12206       }
12207       if (arx.isGreaterThan(brx)) {
12208         const aCmpBRight = a2.comparePoint(b3.rightSE.point);
12209         if (aCmpBRight < 0) return 1;
12210         if (aCmpBRight > 0) return -1;
12211       }
12212       if (!arx.eq(brx)) {
12213         const ay = ary.minus(aly);
12214         const ax = arx.minus(alx);
12215         const by = bry.minus(bly);
12216         const bx = brx.minus(blx);
12217         if (ay.isGreaterThan(ax) && by.isLessThan(bx)) return 1;
12218         if (ay.isLessThan(ax) && by.isGreaterThan(bx)) return -1;
12219       }
12220       if (arx.isGreaterThan(brx)) return 1;
12221       if (arx.isLessThan(brx)) return -1;
12222       if (ary.isLessThan(bry)) return -1;
12223       if (ary.isGreaterThan(bry)) return 1;
12224       if (a2.id < b3.id) return -1;
12225       if (a2.id > b3.id) return 1;
12226       return 0;
12227     }
12228     static fromRing(pt1, pt2, ring) {
12229       let leftPt, rightPt, winding;
12230       const cmpPts = SweepEvent.comparePoints(pt1, pt2);
12231       if (cmpPts < 0) {
12232         leftPt = pt1;
12233         rightPt = pt2;
12234         winding = 1;
12235       } else if (cmpPts > 0) {
12236         leftPt = pt2;
12237         rightPt = pt1;
12238         winding = -1;
12239       } else
12240         throw new Error(
12241           "Tried to create degenerate segment at [".concat(pt1.x, ", ").concat(pt1.y, "]")
12242         );
12243       const leftSE = new SweepEvent(leftPt, true);
12244       const rightSE = new SweepEvent(rightPt, false);
12245       return new _Segment(leftSE, rightSE, [ring], [winding]);
12246     }
12247     /* When a segment is split, the rightSE is replaced with a new sweep event */
12248     replaceRightSE(newRightSE) {
12249       this.rightSE = newRightSE;
12250       this.rightSE.segment = this;
12251       this.rightSE.otherSE = this.leftSE;
12252       this.leftSE.otherSE = this.rightSE;
12253     }
12254     bbox() {
12255       const y12 = this.leftSE.point.y;
12256       const y22 = this.rightSE.point.y;
12257       return {
12258         ll: { x: this.leftSE.point.x, y: y12.isLessThan(y22) ? y12 : y22 },
12259         ur: { x: this.rightSE.point.x, y: y12.isGreaterThan(y22) ? y12 : y22 }
12260       };
12261     }
12262     /* A vector from the left point to the right */
12263     vector() {
12264       return {
12265         x: this.rightSE.point.x.minus(this.leftSE.point.x),
12266         y: this.rightSE.point.y.minus(this.leftSE.point.y)
12267       };
12268     }
12269     isAnEndpoint(pt2) {
12270       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);
12271     }
12272     /* Compare this segment with a point.
12273      *
12274      * A point P is considered to be colinear to a segment if there
12275      * exists a distance D such that if we travel along the segment
12276      * from one * endpoint towards the other a distance D, we find
12277      * ourselves at point P.
12278      *
12279      * Return value indicates:
12280      *
12281      *   1: point lies above the segment (to the left of vertical)
12282      *   0: point is colinear to segment
12283      *  -1: point lies below the segment (to the right of vertical)
12284      */
12285     comparePoint(point) {
12286       return precision.orient(this.leftSE.point, point, this.rightSE.point);
12287     }
12288     /**
12289      * Given another segment, returns the first non-trivial intersection
12290      * between the two segments (in terms of sweep line ordering), if it exists.
12291      *
12292      * A 'non-trivial' intersection is one that will cause one or both of the
12293      * segments to be split(). As such, 'trivial' vs. 'non-trivial' intersection:
12294      *
12295      *   * endpoint of segA with endpoint of segB --> trivial
12296      *   * endpoint of segA with point along segB --> non-trivial
12297      *   * endpoint of segB with point along segA --> non-trivial
12298      *   * point along segA with point along segB --> non-trivial
12299      *
12300      * If no non-trivial intersection exists, return null
12301      * Else, return null.
12302      */
12303     getIntersection(other) {
12304       const tBbox = this.bbox();
12305       const oBbox = other.bbox();
12306       const bboxOverlap = getBboxOverlap(tBbox, oBbox);
12307       if (bboxOverlap === null) return null;
12308       const tlp = this.leftSE.point;
12309       const trp = this.rightSE.point;
12310       const olp = other.leftSE.point;
12311       const orp = other.rightSE.point;
12312       const touchesOtherLSE = isInBbox(tBbox, olp) && this.comparePoint(olp) === 0;
12313       const touchesThisLSE = isInBbox(oBbox, tlp) && other.comparePoint(tlp) === 0;
12314       const touchesOtherRSE = isInBbox(tBbox, orp) && this.comparePoint(orp) === 0;
12315       const touchesThisRSE = isInBbox(oBbox, trp) && other.comparePoint(trp) === 0;
12316       if (touchesThisLSE && touchesOtherLSE) {
12317         if (touchesThisRSE && !touchesOtherRSE) return trp;
12318         if (!touchesThisRSE && touchesOtherRSE) return orp;
12319         return null;
12320       }
12321       if (touchesThisLSE) {
12322         if (touchesOtherRSE) {
12323           if (tlp.x.eq(orp.x) && tlp.y.eq(orp.y)) return null;
12324         }
12325         return tlp;
12326       }
12327       if (touchesOtherLSE) {
12328         if (touchesThisRSE) {
12329           if (trp.x.eq(olp.x) && trp.y.eq(olp.y)) return null;
12330         }
12331         return olp;
12332       }
12333       if (touchesThisRSE && touchesOtherRSE) return null;
12334       if (touchesThisRSE) return trp;
12335       if (touchesOtherRSE) return orp;
12336       const pt2 = intersection(tlp, this.vector(), olp, other.vector());
12337       if (pt2 === null) return null;
12338       if (!isInBbox(bboxOverlap, pt2)) return null;
12339       return precision.snap(pt2);
12340     }
12341     /**
12342      * Split the given segment into multiple segments on the given points.
12343      *  * Each existing segment will retain its leftSE and a new rightSE will be
12344      *    generated for it.
12345      *  * A new segment will be generated which will adopt the original segment's
12346      *    rightSE, and a new leftSE will be generated for it.
12347      *  * If there are more than two points given to split on, new segments
12348      *    in the middle will be generated with new leftSE and rightSE's.
12349      *  * An array of the newly generated SweepEvents will be returned.
12350      *
12351      * Warning: input array of points is modified
12352      */
12353     split(point) {
12354       const newEvents = [];
12355       const alreadyLinked = point.events !== void 0;
12356       const newLeftSE = new SweepEvent(point, true);
12357       const newRightSE = new SweepEvent(point, false);
12358       const oldRightSE = this.rightSE;
12359       this.replaceRightSE(newRightSE);
12360       newEvents.push(newRightSE);
12361       newEvents.push(newLeftSE);
12362       const newSeg = new _Segment(
12363         newLeftSE,
12364         oldRightSE,
12365         this.rings.slice(),
12366         this.windings.slice()
12367       );
12368       if (SweepEvent.comparePoints(newSeg.leftSE.point, newSeg.rightSE.point) > 0) {
12369         newSeg.swapEvents();
12370       }
12371       if (SweepEvent.comparePoints(this.leftSE.point, this.rightSE.point) > 0) {
12372         this.swapEvents();
12373       }
12374       if (alreadyLinked) {
12375         newLeftSE.checkForConsuming();
12376         newRightSE.checkForConsuming();
12377       }
12378       return newEvents;
12379     }
12380     /* Swap which event is left and right */
12381     swapEvents() {
12382       const tmpEvt = this.rightSE;
12383       this.rightSE = this.leftSE;
12384       this.leftSE = tmpEvt;
12385       this.leftSE.isLeft = true;
12386       this.rightSE.isLeft = false;
12387       for (let i3 = 0, iMax = this.windings.length; i3 < iMax; i3++) {
12388         this.windings[i3] *= -1;
12389       }
12390     }
12391     /* Consume another segment. We take their rings under our wing
12392      * and mark them as consumed. Use for perfectly overlapping segments */
12393     consume(other) {
12394       let consumer = this;
12395       let consumee = other;
12396       while (consumer.consumedBy) consumer = consumer.consumedBy;
12397       while (consumee.consumedBy) consumee = consumee.consumedBy;
12398       const cmp = _Segment.compare(consumer, consumee);
12399       if (cmp === 0) return;
12400       if (cmp > 0) {
12401         const tmp = consumer;
12402         consumer = consumee;
12403         consumee = tmp;
12404       }
12405       if (consumer.prev === consumee) {
12406         const tmp = consumer;
12407         consumer = consumee;
12408         consumee = tmp;
12409       }
12410       for (let i3 = 0, iMax = consumee.rings.length; i3 < iMax; i3++) {
12411         const ring = consumee.rings[i3];
12412         const winding = consumee.windings[i3];
12413         const index = consumer.rings.indexOf(ring);
12414         if (index === -1) {
12415           consumer.rings.push(ring);
12416           consumer.windings.push(winding);
12417         } else consumer.windings[index] += winding;
12418       }
12419       consumee.rings = null;
12420       consumee.windings = null;
12421       consumee.consumedBy = consumer;
12422       consumee.leftSE.consumedBy = consumer.leftSE;
12423       consumee.rightSE.consumedBy = consumer.rightSE;
12424     }
12425     /* The first segment previous segment chain that is in the result */
12426     prevInResult() {
12427       if (this._prevInResult !== void 0) return this._prevInResult;
12428       if (!this.prev) this._prevInResult = null;
12429       else if (this.prev.isInResult()) this._prevInResult = this.prev;
12430       else this._prevInResult = this.prev.prevInResult();
12431       return this._prevInResult;
12432     }
12433     beforeState() {
12434       if (this._beforeState !== void 0) return this._beforeState;
12435       if (!this.prev)
12436         this._beforeState = {
12437           rings: [],
12438           windings: [],
12439           multiPolys: []
12440         };
12441       else {
12442         const seg = this.prev.consumedBy || this.prev;
12443         this._beforeState = seg.afterState();
12444       }
12445       return this._beforeState;
12446     }
12447     afterState() {
12448       if (this._afterState !== void 0) return this._afterState;
12449       const beforeState = this.beforeState();
12450       this._afterState = {
12451         rings: beforeState.rings.slice(0),
12452         windings: beforeState.windings.slice(0),
12453         multiPolys: []
12454       };
12455       const ringsAfter = this._afterState.rings;
12456       const windingsAfter = this._afterState.windings;
12457       const mpsAfter = this._afterState.multiPolys;
12458       for (let i3 = 0, iMax = this.rings.length; i3 < iMax; i3++) {
12459         const ring = this.rings[i3];
12460         const winding = this.windings[i3];
12461         const index = ringsAfter.indexOf(ring);
12462         if (index === -1) {
12463           ringsAfter.push(ring);
12464           windingsAfter.push(winding);
12465         } else windingsAfter[index] += winding;
12466       }
12467       const polysAfter = [];
12468       const polysExclude = [];
12469       for (let i3 = 0, iMax = ringsAfter.length; i3 < iMax; i3++) {
12470         if (windingsAfter[i3] === 0) continue;
12471         const ring = ringsAfter[i3];
12472         const poly = ring.poly;
12473         if (polysExclude.indexOf(poly) !== -1) continue;
12474         if (ring.isExterior) polysAfter.push(poly);
12475         else {
12476           if (polysExclude.indexOf(poly) === -1) polysExclude.push(poly);
12477           const index = polysAfter.indexOf(ring.poly);
12478           if (index !== -1) polysAfter.splice(index, 1);
12479         }
12480       }
12481       for (let i3 = 0, iMax = polysAfter.length; i3 < iMax; i3++) {
12482         const mp = polysAfter[i3].multiPoly;
12483         if (mpsAfter.indexOf(mp) === -1) mpsAfter.push(mp);
12484       }
12485       return this._afterState;
12486     }
12487     /* Is this segment part of the final result? */
12488     isInResult() {
12489       if (this.consumedBy) return false;
12490       if (this._isInResult !== void 0) return this._isInResult;
12491       const mpsBefore = this.beforeState().multiPolys;
12492       const mpsAfter = this.afterState().multiPolys;
12493       switch (operation_default.type) {
12494         case "union": {
12495           const noBefores = mpsBefore.length === 0;
12496           const noAfters = mpsAfter.length === 0;
12497           this._isInResult = noBefores !== noAfters;
12498           break;
12499         }
12500         case "intersection": {
12501           let least;
12502           let most;
12503           if (mpsBefore.length < mpsAfter.length) {
12504             least = mpsBefore.length;
12505             most = mpsAfter.length;
12506           } else {
12507             least = mpsAfter.length;
12508             most = mpsBefore.length;
12509           }
12510           this._isInResult = most === operation_default.numMultiPolys && least < most;
12511           break;
12512         }
12513         case "xor": {
12514           const diff = Math.abs(mpsBefore.length - mpsAfter.length);
12515           this._isInResult = diff % 2 === 1;
12516           break;
12517         }
12518         case "difference": {
12519           const isJustSubject = (mps) => mps.length === 1 && mps[0].isSubject;
12520           this._isInResult = isJustSubject(mpsBefore) !== isJustSubject(mpsAfter);
12521           break;
12522         }
12523       }
12524       return this._isInResult;
12525     }
12526   };
12527   var RingIn = class {
12528     constructor(geomRing, poly, isExterior) {
12529       __publicField(this, "poly");
12530       __publicField(this, "isExterior");
12531       __publicField(this, "segments");
12532       __publicField(this, "bbox");
12533       if (!Array.isArray(geomRing) || geomRing.length === 0) {
12534         throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
12535       }
12536       this.poly = poly;
12537       this.isExterior = isExterior;
12538       this.segments = [];
12539       if (typeof geomRing[0][0] !== "number" || typeof geomRing[0][1] !== "number") {
12540         throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
12541       }
12542       const firstPoint = precision.snap({ x: new bignumber_default(geomRing[0][0]), y: new bignumber_default(geomRing[0][1]) });
12543       this.bbox = {
12544         ll: { x: firstPoint.x, y: firstPoint.y },
12545         ur: { x: firstPoint.x, y: firstPoint.y }
12546       };
12547       let prevPoint = firstPoint;
12548       for (let i3 = 1, iMax = geomRing.length; i3 < iMax; i3++) {
12549         if (typeof geomRing[i3][0] !== "number" || typeof geomRing[i3][1] !== "number") {
12550           throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
12551         }
12552         const point = precision.snap({ x: new bignumber_default(geomRing[i3][0]), y: new bignumber_default(geomRing[i3][1]) });
12553         if (point.x.eq(prevPoint.x) && point.y.eq(prevPoint.y)) continue;
12554         this.segments.push(Segment.fromRing(prevPoint, point, this));
12555         if (point.x.isLessThan(this.bbox.ll.x)) this.bbox.ll.x = point.x;
12556         if (point.y.isLessThan(this.bbox.ll.y)) this.bbox.ll.y = point.y;
12557         if (point.x.isGreaterThan(this.bbox.ur.x)) this.bbox.ur.x = point.x;
12558         if (point.y.isGreaterThan(this.bbox.ur.y)) this.bbox.ur.y = point.y;
12559         prevPoint = point;
12560       }
12561       if (!firstPoint.x.eq(prevPoint.x) || !firstPoint.y.eq(prevPoint.y)) {
12562         this.segments.push(Segment.fromRing(prevPoint, firstPoint, this));
12563       }
12564     }
12565     getSweepEvents() {
12566       const sweepEvents = [];
12567       for (let i3 = 0, iMax = this.segments.length; i3 < iMax; i3++) {
12568         const segment = this.segments[i3];
12569         sweepEvents.push(segment.leftSE);
12570         sweepEvents.push(segment.rightSE);
12571       }
12572       return sweepEvents;
12573     }
12574   };
12575   var PolyIn = class {
12576     constructor(geomPoly, multiPoly) {
12577       __publicField(this, "multiPoly");
12578       __publicField(this, "exteriorRing");
12579       __publicField(this, "interiorRings");
12580       __publicField(this, "bbox");
12581       if (!Array.isArray(geomPoly)) {
12582         throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
12583       }
12584       this.exteriorRing = new RingIn(geomPoly[0], this, true);
12585       this.bbox = {
12586         ll: { x: this.exteriorRing.bbox.ll.x, y: this.exteriorRing.bbox.ll.y },
12587         ur: { x: this.exteriorRing.bbox.ur.x, y: this.exteriorRing.bbox.ur.y }
12588       };
12589       this.interiorRings = [];
12590       for (let i3 = 1, iMax = geomPoly.length; i3 < iMax; i3++) {
12591         const ring = new RingIn(geomPoly[i3], this, false);
12592         if (ring.bbox.ll.x.isLessThan(this.bbox.ll.x)) this.bbox.ll.x = ring.bbox.ll.x;
12593         if (ring.bbox.ll.y.isLessThan(this.bbox.ll.y)) this.bbox.ll.y = ring.bbox.ll.y;
12594         if (ring.bbox.ur.x.isGreaterThan(this.bbox.ur.x)) this.bbox.ur.x = ring.bbox.ur.x;
12595         if (ring.bbox.ur.y.isGreaterThan(this.bbox.ur.y)) this.bbox.ur.y = ring.bbox.ur.y;
12596         this.interiorRings.push(ring);
12597       }
12598       this.multiPoly = multiPoly;
12599     }
12600     getSweepEvents() {
12601       const sweepEvents = this.exteriorRing.getSweepEvents();
12602       for (let i3 = 0, iMax = this.interiorRings.length; i3 < iMax; i3++) {
12603         const ringSweepEvents = this.interiorRings[i3].getSweepEvents();
12604         for (let j3 = 0, jMax = ringSweepEvents.length; j3 < jMax; j3++) {
12605           sweepEvents.push(ringSweepEvents[j3]);
12606         }
12607       }
12608       return sweepEvents;
12609     }
12610   };
12611   var MultiPolyIn = class {
12612     constructor(geom, isSubject) {
12613       __publicField(this, "isSubject");
12614       __publicField(this, "polys");
12615       __publicField(this, "bbox");
12616       if (!Array.isArray(geom)) {
12617         throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
12618       }
12619       try {
12620         if (typeof geom[0][0][0] === "number") geom = [geom];
12621       } catch (ex) {
12622       }
12623       this.polys = [];
12624       this.bbox = {
12625         ll: { x: new bignumber_default(Number.POSITIVE_INFINITY), y: new bignumber_default(Number.POSITIVE_INFINITY) },
12626         ur: { x: new bignumber_default(Number.NEGATIVE_INFINITY), y: new bignumber_default(Number.NEGATIVE_INFINITY) }
12627       };
12628       for (let i3 = 0, iMax = geom.length; i3 < iMax; i3++) {
12629         const poly = new PolyIn(geom[i3], this);
12630         if (poly.bbox.ll.x.isLessThan(this.bbox.ll.x)) this.bbox.ll.x = poly.bbox.ll.x;
12631         if (poly.bbox.ll.y.isLessThan(this.bbox.ll.y)) this.bbox.ll.y = poly.bbox.ll.y;
12632         if (poly.bbox.ur.x.isGreaterThan(this.bbox.ur.x)) this.bbox.ur.x = poly.bbox.ur.x;
12633         if (poly.bbox.ur.y.isGreaterThan(this.bbox.ur.y)) this.bbox.ur.y = poly.bbox.ur.y;
12634         this.polys.push(poly);
12635       }
12636       this.isSubject = isSubject;
12637     }
12638     getSweepEvents() {
12639       const sweepEvents = [];
12640       for (let i3 = 0, iMax = this.polys.length; i3 < iMax; i3++) {
12641         const polySweepEvents = this.polys[i3].getSweepEvents();
12642         for (let j3 = 0, jMax = polySweepEvents.length; j3 < jMax; j3++) {
12643           sweepEvents.push(polySweepEvents[j3]);
12644         }
12645       }
12646       return sweepEvents;
12647     }
12648   };
12649   var union = (geom, ...moreGeoms) => operation_default.run("union", geom, moreGeoms);
12650   var difference = (geom, ...moreGeoms) => operation_default.run("difference", geom, moreGeoms);
12651   var setPrecision = precision.set;
12652
12653   // node_modules/@rapideditor/location-conflation/dist/location-conflation.mjs
12654   var import_geojson_area = __toESM(require_geojson_area(), 1);
12655   var import_circle_to_polygon = __toESM(require_circle_to_polygon(), 1);
12656   var import_geojson_precision = __toESM(require_geojson_precision(), 1);
12657   var import_json_stringify_pretty_compact = __toESM(require_json_stringify_pretty_compact(), 1);
12658   var LocationConflation = class {
12659     constructor(fc) {
12660       this._cache = {};
12661       this.strict = true;
12662       if (fc && fc.type === "FeatureCollection" && Array.isArray(fc.features)) {
12663         fc.features.forEach((feature22) => {
12664           feature22.properties = feature22.properties || {};
12665           let props = feature22.properties;
12666           let id2 = feature22.id || props.id;
12667           if (!id2 || !/^\S+\.geojson$/i.test(id2))
12668             return;
12669           id2 = id2.toLowerCase();
12670           feature22.id = id2;
12671           props.id = id2;
12672           if (!props.area) {
12673             const area = import_geojson_area.default.geometry(feature22.geometry) / 1e6;
12674             props.area = Number(area.toFixed(2));
12675           }
12676           this._cache[id2] = feature22;
12677         });
12678       }
12679       let world = _cloneDeep(feature("Q2"));
12680       world.geometry = {
12681         type: "Polygon",
12682         coordinates: [[[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]]]
12683       };
12684       world.id = "Q2";
12685       world.properties.id = "Q2";
12686       world.properties.area = import_geojson_area.default.geometry(world.geometry) / 1e6;
12687       this._cache.Q2 = world;
12688     }
12689     validateLocation(location) {
12690       if (Array.isArray(location) && (location.length === 2 || location.length === 3)) {
12691         const lon = location[0];
12692         const lat = location[1];
12693         const radius = location[2];
12694         if (Number.isFinite(lon) && lon >= -180 && lon <= 180 && Number.isFinite(lat) && lat >= -90 && lat <= 90 && (location.length === 2 || Number.isFinite(radius) && radius > 0)) {
12695           const id2 = "[" + location.toString() + "]";
12696           return { type: "point", location, id: id2 };
12697         }
12698       } else if (typeof location === "string" && /^\S+\.geojson$/i.test(location)) {
12699         const id2 = location.toLowerCase();
12700         if (this._cache[id2]) {
12701           return { type: "geojson", location, id: id2 };
12702         }
12703       } else if (typeof location === "string" || typeof location === "number") {
12704         const feature22 = feature(location);
12705         if (feature22) {
12706           const id2 = feature22.properties.wikidata;
12707           return { type: "countrycoder", location, id: id2 };
12708         }
12709       }
12710       if (this.strict) {
12711         throw new Error('validateLocation:  Invalid location: "'.concat(location, '".'));
12712       } else {
12713         return null;
12714       }
12715     }
12716     resolveLocation(location) {
12717       const valid = this.validateLocation(location);
12718       if (!valid)
12719         return null;
12720       const id2 = valid.id;
12721       if (this._cache[id2]) {
12722         return Object.assign(valid, { feature: this._cache[id2] });
12723       }
12724       if (valid.type === "point") {
12725         const lon = location[0];
12726         const lat = location[1];
12727         const radius = location[2] || 25;
12728         const EDGES = 10;
12729         const PRECISION = 3;
12730         const area = Math.PI * radius * radius;
12731         const feature22 = this._cache[id2] = (0, import_geojson_precision.default)({
12732           type: "Feature",
12733           id: id2,
12734           properties: { id: id2, area: Number(area.toFixed(2)) },
12735           geometry: (0, import_circle_to_polygon.default)([lon, lat], radius * 1e3, EDGES)
12736         }, PRECISION);
12737         return Object.assign(valid, { feature: feature22 });
12738       } else if (valid.type === "geojson") {
12739       } else if (valid.type === "countrycoder") {
12740         let feature22 = _cloneDeep(feature(id2));
12741         let props = feature22.properties;
12742         if (Array.isArray(props.members)) {
12743           let aggregate = aggregateFeature(id2);
12744           aggregate.geometry.coordinates = _clip([aggregate], "UNION").geometry.coordinates;
12745           feature22.geometry = aggregate.geometry;
12746         }
12747         if (!props.area) {
12748           const area = import_geojson_area.default.geometry(feature22.geometry) / 1e6;
12749           props.area = Number(area.toFixed(2));
12750         }
12751         feature22.id = id2;
12752         props.id = id2;
12753         this._cache[id2] = feature22;
12754         return Object.assign(valid, { feature: feature22 });
12755       }
12756       if (this.strict) {
12757         throw new Error("resolveLocation:  Couldn't resolve location \"".concat(location, '".'));
12758       } else {
12759         return null;
12760       }
12761     }
12762     validateLocationSet(locationSet) {
12763       locationSet = locationSet || {};
12764       const validator = this.validateLocation.bind(this);
12765       let include = (locationSet.include || []).map(validator).filter(Boolean);
12766       let exclude = (locationSet.exclude || []).map(validator).filter(Boolean);
12767       if (!include.length) {
12768         if (this.strict) {
12769           throw new Error("validateLocationSet:  LocationSet includes nothing.");
12770         } else {
12771           locationSet.include = ["Q2"];
12772           include = [{ type: "countrycoder", location: "Q2", id: "Q2" }];
12773         }
12774       }
12775       include.sort(_sortLocations);
12776       let id2 = "+[" + include.map((d2) => d2.id).join(",") + "]";
12777       if (exclude.length) {
12778         exclude.sort(_sortLocations);
12779         id2 += "-[" + exclude.map((d2) => d2.id).join(",") + "]";
12780       }
12781       return { type: "locationset", locationSet, id: id2 };
12782     }
12783     resolveLocationSet(locationSet) {
12784       locationSet = locationSet || {};
12785       const valid = this.validateLocationSet(locationSet);
12786       if (!valid)
12787         return null;
12788       const id2 = valid.id;
12789       if (this._cache[id2]) {
12790         return Object.assign(valid, { feature: this._cache[id2] });
12791       }
12792       const resolver = this.resolveLocation.bind(this);
12793       const includes = (locationSet.include || []).map(resolver).filter(Boolean);
12794       const excludes = (locationSet.exclude || []).map(resolver).filter(Boolean);
12795       if (includes.length === 1 && excludes.length === 0) {
12796         return Object.assign(valid, { feature: includes[0].feature });
12797       }
12798       const includeGeoJSON = _clip(includes.map((d2) => d2.feature), "UNION");
12799       const excludeGeoJSON = _clip(excludes.map((d2) => d2.feature), "UNION");
12800       let resultGeoJSON = excludeGeoJSON ? _clip([includeGeoJSON, excludeGeoJSON], "DIFFERENCE") : includeGeoJSON;
12801       const area = import_geojson_area.default.geometry(resultGeoJSON.geometry) / 1e6;
12802       resultGeoJSON.id = id2;
12803       resultGeoJSON.properties = { id: id2, area: Number(area.toFixed(2)) };
12804       this._cache[id2] = resultGeoJSON;
12805       return Object.assign(valid, { feature: resultGeoJSON });
12806     }
12807     stringify(obj, options) {
12808       return (0, import_json_stringify_pretty_compact.default)(obj, options);
12809     }
12810   };
12811   function _clip(features, which) {
12812     if (!Array.isArray(features) || !features.length)
12813       return null;
12814     const fn = { UNION: union, DIFFERENCE: difference }[which];
12815     const args = features.map((feature22) => feature22.geometry.coordinates);
12816     const coords = fn.apply(null, args);
12817     return {
12818       type: "Feature",
12819       properties: {},
12820       geometry: {
12821         type: whichType(coords),
12822         coordinates: coords
12823       }
12824     };
12825     function whichType(coords2) {
12826       const a2 = Array.isArray(coords2);
12827       const b3 = a2 && Array.isArray(coords2[0]);
12828       const c2 = b3 && Array.isArray(coords2[0][0]);
12829       const d2 = c2 && Array.isArray(coords2[0][0][0]);
12830       return d2 ? "MultiPolygon" : "Polygon";
12831     }
12832   }
12833   function _cloneDeep(obj) {
12834     return JSON.parse(JSON.stringify(obj));
12835   }
12836   function _sortLocations(a2, b3) {
12837     const rank = { countrycoder: 1, geojson: 2, point: 3 };
12838     const aRank = rank[a2.type];
12839     const bRank = rank[b3.type];
12840     return aRank > bRank ? 1 : aRank < bRank ? -1 : a2.id.localeCompare(b3.id);
12841   }
12842
12843   // modules/core/LocationManager.js
12844   var import_which_polygon2 = __toESM(require_which_polygon(), 1);
12845   var import_geojson_area2 = __toESM(require_geojson_area(), 1);
12846   var _loco = new LocationConflation();
12847   var LocationManager = class {
12848     /**
12849      * @constructor
12850      */
12851     constructor() {
12852       this._wp = null;
12853       this._resolved = /* @__PURE__ */ new Map();
12854       this._knownLocationSets = /* @__PURE__ */ new Map();
12855       this._locationIncludedIn = /* @__PURE__ */ new Map();
12856       this._locationExcludedIn = /* @__PURE__ */ new Map();
12857       const world = { locationSet: { include: ["Q2"] } };
12858       this._resolveLocationSet(world);
12859       this._rebuildIndex();
12860     }
12861     /**
12862      * _validateLocationSet
12863      * Pass an Object with a `locationSet` property.
12864      * Validates the `locationSet` and sets a `locationSetID` property on the object.
12865      * To avoid so much computation we only resolve the include and exclude regions, but not the locationSet itself.
12866      *
12867      * Use `_resolveLocationSet()` instead if you need to resolve geojson of locationSet, for example to render it.
12868      * Note: You need to call `_rebuildIndex()` after you're all finished validating the locationSets.
12869      *
12870      * @param  `obj`  Object to check, it should have `locationSet` property
12871      */
12872     _validateLocationSet(obj) {
12873       if (obj.locationSetID) return;
12874       try {
12875         let locationSet = obj.locationSet;
12876         if (!locationSet) {
12877           throw new Error("object missing locationSet property");
12878         }
12879         if (!locationSet.include) {
12880           locationSet.include = ["Q2"];
12881         }
12882         const locationSetID = _loco.validateLocationSet(locationSet).id;
12883         obj.locationSetID = locationSetID;
12884         if (this._knownLocationSets.has(locationSetID)) return;
12885         let area = 0;
12886         (locationSet.include || []).forEach((location) => {
12887           const locationID = _loco.validateLocation(location).id;
12888           let geojson = this._resolved.get(locationID);
12889           if (!geojson) {
12890             geojson = _loco.resolveLocation(location).feature;
12891             this._resolved.set(locationID, geojson);
12892           }
12893           area += geojson.properties.area;
12894           let s2 = this._locationIncludedIn.get(locationID);
12895           if (!s2) {
12896             s2 = /* @__PURE__ */ new Set();
12897             this._locationIncludedIn.set(locationID, s2);
12898           }
12899           s2.add(locationSetID);
12900         });
12901         (locationSet.exclude || []).forEach((location) => {
12902           const locationID = _loco.validateLocation(location).id;
12903           let geojson = this._resolved.get(locationID);
12904           if (!geojson) {
12905             geojson = _loco.resolveLocation(location).feature;
12906             this._resolved.set(locationID, geojson);
12907           }
12908           area -= geojson.properties.area;
12909           let s2 = this._locationExcludedIn.get(locationID);
12910           if (!s2) {
12911             s2 = /* @__PURE__ */ new Set();
12912             this._locationExcludedIn.set(locationID, s2);
12913           }
12914           s2.add(locationSetID);
12915         });
12916         this._knownLocationSets.set(locationSetID, area);
12917       } catch (e3) {
12918         obj.locationSet = { include: ["Q2"] };
12919         obj.locationSetID = "+[Q2]";
12920       }
12921     }
12922     /**
12923      * _resolveLocationSet
12924      * Does everything that `_validateLocationSet()` does, but then "resolves" the locationSet into GeoJSON.
12925      * This step is a bit more computationally expensive, so really only needed if you intend to render the shape.
12926      *
12927      * Note: You need to call `_rebuildIndex()` after you're all finished validating the locationSets.
12928      *
12929      * @param  `obj`  Object to check, it should have `locationSet` property
12930      */
12931     _resolveLocationSet(obj) {
12932       this._validateLocationSet(obj);
12933       if (this._resolved.has(obj.locationSetID)) return;
12934       try {
12935         const result = _loco.resolveLocationSet(obj.locationSet);
12936         const locationSetID = result.id;
12937         obj.locationSetID = locationSetID;
12938         if (!result.feature.geometry.coordinates.length || !result.feature.properties.area) {
12939           throw new Error("locationSet ".concat(locationSetID, " resolves to an empty feature."));
12940         }
12941         let geojson = JSON.parse(JSON.stringify(result.feature));
12942         geojson.id = locationSetID;
12943         geojson.properties.id = locationSetID;
12944         this._resolved.set(locationSetID, geojson);
12945       } catch (e3) {
12946         obj.locationSet = { include: ["Q2"] };
12947         obj.locationSetID = "+[Q2]";
12948       }
12949     }
12950     /**
12951      * _rebuildIndex
12952      * Rebuilds the whichPolygon index with whatever features have been resolved into GeoJSON.
12953      */
12954     _rebuildIndex() {
12955       this._wp = (0, import_which_polygon2.default)({ features: [...this._resolved.values()] });
12956     }
12957     /**
12958      * mergeCustomGeoJSON
12959      * Accepts a FeatureCollection-like object containing custom locations
12960      * Each feature must have a filename-like `id`, for example: `something.geojson`
12961      * {
12962      *   "type": "FeatureCollection"
12963      *   "features": [
12964      *     {
12965      *       "type": "Feature",
12966      *       "id": "philly_metro.geojson",
12967      *       "properties": { … },
12968      *       "geometry": { … }
12969      *     }
12970      *   ]
12971      * }
12972      *
12973      * @param  `fc`  FeatureCollection-like Object containing custom locations
12974      */
12975     mergeCustomGeoJSON(fc) {
12976       if (!fc || fc.type !== "FeatureCollection" || !Array.isArray(fc.features)) return;
12977       fc.features.forEach((feature4) => {
12978         feature4.properties = feature4.properties || {};
12979         let props = feature4.properties;
12980         let id2 = feature4.id || props.id;
12981         if (!id2 || !/^\S+\.geojson$/i.test(id2)) return;
12982         id2 = id2.toLowerCase();
12983         feature4.id = id2;
12984         props.id = id2;
12985         if (!props.area) {
12986           const area = import_geojson_area2.default.geometry(feature4.geometry) / 1e6;
12987           props.area = Number(area.toFixed(2));
12988         }
12989         _loco._cache[id2] = feature4;
12990       });
12991     }
12992     /**
12993      * mergeLocationSets
12994      * Accepts an Array of Objects containing `locationSet` properties:
12995      * [
12996      *  { id: 'preset1', locationSet: {…} },
12997      *  { id: 'preset2', locationSet: {…} },
12998      *  …
12999      * ]
13000      * After validating, the Objects will be decorated with a `locationSetID` property:
13001      * [
13002      *  { id: 'preset1', locationSet: {…}, locationSetID: '+[Q2]' },
13003      *  { id: 'preset2', locationSet: {…}, locationSetID: '+[Q30]' },
13004      *  …
13005      * ]
13006      *
13007      * @param  `objects`  Objects to check - they should have `locationSet` property
13008      * @return  Promise resolved true (this function used to be slow/async, now it's faster and sync)
13009      */
13010     mergeLocationSets(objects) {
13011       if (!Array.isArray(objects)) return Promise.reject("nothing to do");
13012       objects.forEach((obj) => this._validateLocationSet(obj));
13013       this._rebuildIndex();
13014       return Promise.resolve(objects);
13015     }
13016     /**
13017      * locationSetID
13018      * Returns a locationSetID for a given locationSet (fallback to `+[Q2]`, world)
13019      * (The locationSet doesn't necessarily need to be resolved to compute its `id`)
13020      *
13021      * @param  `locationSet`  A locationSet Object, e.g. `{ include: ['us'] }`
13022      * @return  String locationSetID, e.g. `+[Q30]`
13023      */
13024     locationSetID(locationSet) {
13025       let locationSetID;
13026       try {
13027         locationSetID = _loco.validateLocationSet(locationSet).id;
13028       } catch (e3) {
13029         locationSetID = "+[Q2]";
13030       }
13031       return locationSetID;
13032     }
13033     /**
13034      * feature
13035      * Returns the resolved GeoJSON feature for a given locationSetID (fallback to 'world')
13036      * A GeoJSON feature:
13037      * {
13038      *   type: 'Feature',
13039      *   id: '+[Q30]',
13040      *   properties: { id: '+[Q30]', area: 21817019.17, … },
13041      *   geometry: { … }
13042      * }
13043      *
13044      * @param  `locationSetID`  String identifier, e.g. `+[Q30]`
13045      * @return  GeoJSON object (fallback to world)
13046      */
13047     feature(locationSetID = "+[Q2]") {
13048       const feature4 = this._resolved.get(locationSetID);
13049       return feature4 || this._resolved.get("+[Q2]");
13050     }
13051     /**
13052      * locationSetsAt
13053      * Find all the locationSets valid at the given location.
13054      * Results include the area (in km²) to facilitate sorting.
13055      *
13056      * Object of locationSetIDs to areas (in km²)
13057      * {
13058      *   "+[Q2]": 511207893.3958111,
13059      *   "+[Q30]": 21817019.17,
13060      *   "+[new_jersey.geojson]": 22390.77,
13061      *   …
13062      * }
13063      *
13064      * @param  `loc`  `[lon,lat]` location to query, e.g. `[-74.4813, 40.7967]`
13065      * @return  Object of locationSetIDs valid at given location
13066      */
13067     locationSetsAt(loc) {
13068       let result = {};
13069       const hits = this._wp(loc, true) || [];
13070       const thiz = this;
13071       hits.forEach((prop) => {
13072         if (prop.id[0] !== "+") return;
13073         const locationSetID = prop.id;
13074         const area = thiz._knownLocationSets.get(locationSetID);
13075         if (area) {
13076           result[locationSetID] = area;
13077         }
13078       });
13079       hits.forEach((prop) => {
13080         if (prop.id[0] === "+") return;
13081         const locationID = prop.id;
13082         const included = thiz._locationIncludedIn.get(locationID);
13083         (included || []).forEach((locationSetID) => {
13084           const area = thiz._knownLocationSets.get(locationSetID);
13085           if (area) {
13086             result[locationSetID] = area;
13087           }
13088         });
13089       });
13090       hits.forEach((prop) => {
13091         if (prop.id[0] === "+") return;
13092         const locationID = prop.id;
13093         const excluded = thiz._locationExcludedIn.get(locationID);
13094         (excluded || []).forEach((locationSetID) => {
13095           delete result[locationSetID];
13096         });
13097       });
13098       return result;
13099     }
13100     // Direct access to the location-conflation resolver
13101     loco() {
13102       return _loco;
13103     }
13104   };
13105   var _sharedLocationManager = new LocationManager();
13106
13107   // node_modules/lodash-es/_freeGlobal.js
13108   var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
13109   var freeGlobal_default = freeGlobal;
13110
13111   // node_modules/lodash-es/_root.js
13112   var freeSelf = typeof self == "object" && self && self.Object === Object && self;
13113   var root = freeGlobal_default || freeSelf || Function("return this")();
13114   var root_default = root;
13115
13116   // node_modules/lodash-es/_Symbol.js
13117   var Symbol2 = root_default.Symbol;
13118   var Symbol_default = Symbol2;
13119
13120   // node_modules/lodash-es/_getRawTag.js
13121   var objectProto = Object.prototype;
13122   var hasOwnProperty = objectProto.hasOwnProperty;
13123   var nativeObjectToString = objectProto.toString;
13124   var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
13125   function getRawTag(value) {
13126     var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
13127     try {
13128       value[symToStringTag] = void 0;
13129       var unmasked = true;
13130     } catch (e3) {
13131     }
13132     var result = nativeObjectToString.call(value);
13133     if (unmasked) {
13134       if (isOwn) {
13135         value[symToStringTag] = tag;
13136       } else {
13137         delete value[symToStringTag];
13138       }
13139     }
13140     return result;
13141   }
13142   var getRawTag_default = getRawTag;
13143
13144   // node_modules/lodash-es/_objectToString.js
13145   var objectProto2 = Object.prototype;
13146   var nativeObjectToString2 = objectProto2.toString;
13147   function objectToString(value) {
13148     return nativeObjectToString2.call(value);
13149   }
13150   var objectToString_default = objectToString;
13151
13152   // node_modules/lodash-es/_baseGetTag.js
13153   var nullTag = "[object Null]";
13154   var undefinedTag = "[object Undefined]";
13155   var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
13156   function baseGetTag(value) {
13157     if (value == null) {
13158       return value === void 0 ? undefinedTag : nullTag;
13159     }
13160     return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
13161   }
13162   var baseGetTag_default = baseGetTag;
13163
13164   // node_modules/lodash-es/isObjectLike.js
13165   function isObjectLike(value) {
13166     return value != null && typeof value == "object";
13167   }
13168   var isObjectLike_default = isObjectLike;
13169
13170   // node_modules/lodash-es/isSymbol.js
13171   var symbolTag = "[object Symbol]";
13172   function isSymbol(value) {
13173     return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
13174   }
13175   var isSymbol_default = isSymbol;
13176
13177   // node_modules/lodash-es/_arrayMap.js
13178   function arrayMap(array2, iteratee) {
13179     var index = -1, length2 = array2 == null ? 0 : array2.length, result = Array(length2);
13180     while (++index < length2) {
13181       result[index] = iteratee(array2[index], index, array2);
13182     }
13183     return result;
13184   }
13185   var arrayMap_default = arrayMap;
13186
13187   // node_modules/lodash-es/isArray.js
13188   var isArray = Array.isArray;
13189   var isArray_default = isArray;
13190
13191   // node_modules/lodash-es/_baseToString.js
13192   var INFINITY = 1 / 0;
13193   var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
13194   var symbolToString = symbolProto ? symbolProto.toString : void 0;
13195   function baseToString(value) {
13196     if (typeof value == "string") {
13197       return value;
13198     }
13199     if (isArray_default(value)) {
13200       return arrayMap_default(value, baseToString) + "";
13201     }
13202     if (isSymbol_default(value)) {
13203       return symbolToString ? symbolToString.call(value) : "";
13204     }
13205     var result = value + "";
13206     return result == "0" && 1 / value == -INFINITY ? "-0" : result;
13207   }
13208   var baseToString_default = baseToString;
13209
13210   // node_modules/lodash-es/_trimmedEndIndex.js
13211   var reWhitespace = /\s/;
13212   function trimmedEndIndex(string) {
13213     var index = string.length;
13214     while (index-- && reWhitespace.test(string.charAt(index))) {
13215     }
13216     return index;
13217   }
13218   var trimmedEndIndex_default = trimmedEndIndex;
13219
13220   // node_modules/lodash-es/_baseTrim.js
13221   var reTrimStart = /^\s+/;
13222   function baseTrim(string) {
13223     return string ? string.slice(0, trimmedEndIndex_default(string) + 1).replace(reTrimStart, "") : string;
13224   }
13225   var baseTrim_default = baseTrim;
13226
13227   // node_modules/lodash-es/isObject.js
13228   function isObject(value) {
13229     var type2 = typeof value;
13230     return value != null && (type2 == "object" || type2 == "function");
13231   }
13232   var isObject_default = isObject;
13233
13234   // node_modules/lodash-es/toNumber.js
13235   var NAN = 0 / 0;
13236   var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
13237   var reIsBinary = /^0b[01]+$/i;
13238   var reIsOctal = /^0o[0-7]+$/i;
13239   var freeParseInt = parseInt;
13240   function toNumber(value) {
13241     if (typeof value == "number") {
13242       return value;
13243     }
13244     if (isSymbol_default(value)) {
13245       return NAN;
13246     }
13247     if (isObject_default(value)) {
13248       var other = typeof value.valueOf == "function" ? value.valueOf() : value;
13249       value = isObject_default(other) ? other + "" : other;
13250     }
13251     if (typeof value != "string") {
13252       return value === 0 ? value : +value;
13253     }
13254     value = baseTrim_default(value);
13255     var isBinary = reIsBinary.test(value);
13256     return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
13257   }
13258   var toNumber_default = toNumber;
13259
13260   // node_modules/lodash-es/identity.js
13261   function identity(value) {
13262     return value;
13263   }
13264   var identity_default2 = identity;
13265
13266   // node_modules/lodash-es/isFunction.js
13267   var asyncTag = "[object AsyncFunction]";
13268   var funcTag = "[object Function]";
13269   var genTag = "[object GeneratorFunction]";
13270   var proxyTag = "[object Proxy]";
13271   function isFunction(value) {
13272     if (!isObject_default(value)) {
13273       return false;
13274     }
13275     var tag = baseGetTag_default(value);
13276     return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
13277   }
13278   var isFunction_default = isFunction;
13279
13280   // node_modules/lodash-es/_coreJsData.js
13281   var coreJsData = root_default["__core-js_shared__"];
13282   var coreJsData_default = coreJsData;
13283
13284   // node_modules/lodash-es/_isMasked.js
13285   var maskSrcKey = (function() {
13286     var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
13287     return uid ? "Symbol(src)_1." + uid : "";
13288   })();
13289   function isMasked(func) {
13290     return !!maskSrcKey && maskSrcKey in func;
13291   }
13292   var isMasked_default = isMasked;
13293
13294   // node_modules/lodash-es/_toSource.js
13295   var funcProto = Function.prototype;
13296   var funcToString = funcProto.toString;
13297   function toSource(func) {
13298     if (func != null) {
13299       try {
13300         return funcToString.call(func);
13301       } catch (e3) {
13302       }
13303       try {
13304         return func + "";
13305       } catch (e3) {
13306       }
13307     }
13308     return "";
13309   }
13310   var toSource_default = toSource;
13311
13312   // node_modules/lodash-es/_baseIsNative.js
13313   var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
13314   var reIsHostCtor = /^\[object .+?Constructor\]$/;
13315   var funcProto2 = Function.prototype;
13316   var objectProto3 = Object.prototype;
13317   var funcToString2 = funcProto2.toString;
13318   var hasOwnProperty2 = objectProto3.hasOwnProperty;
13319   var reIsNative = RegExp(
13320     "^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
13321   );
13322   function baseIsNative(value) {
13323     if (!isObject_default(value) || isMasked_default(value)) {
13324       return false;
13325     }
13326     var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
13327     return pattern.test(toSource_default(value));
13328   }
13329   var baseIsNative_default = baseIsNative;
13330
13331   // node_modules/lodash-es/_getValue.js
13332   function getValue(object, key) {
13333     return object == null ? void 0 : object[key];
13334   }
13335   var getValue_default = getValue;
13336
13337   // node_modules/lodash-es/_getNative.js
13338   function getNative(object, key) {
13339     var value = getValue_default(object, key);
13340     return baseIsNative_default(value) ? value : void 0;
13341   }
13342   var getNative_default = getNative;
13343
13344   // node_modules/lodash-es/_WeakMap.js
13345   var WeakMap = getNative_default(root_default, "WeakMap");
13346   var WeakMap_default = WeakMap;
13347
13348   // node_modules/lodash-es/_baseCreate.js
13349   var objectCreate = Object.create;
13350   var baseCreate = /* @__PURE__ */ (function() {
13351     function object() {
13352     }
13353     return function(proto) {
13354       if (!isObject_default(proto)) {
13355         return {};
13356       }
13357       if (objectCreate) {
13358         return objectCreate(proto);
13359       }
13360       object.prototype = proto;
13361       var result = new object();
13362       object.prototype = void 0;
13363       return result;
13364     };
13365   })();
13366   var baseCreate_default = baseCreate;
13367
13368   // node_modules/lodash-es/_apply.js
13369   function apply(func, thisArg, args) {
13370     switch (args.length) {
13371       case 0:
13372         return func.call(thisArg);
13373       case 1:
13374         return func.call(thisArg, args[0]);
13375       case 2:
13376         return func.call(thisArg, args[0], args[1]);
13377       case 3:
13378         return func.call(thisArg, args[0], args[1], args[2]);
13379     }
13380     return func.apply(thisArg, args);
13381   }
13382   var apply_default = apply;
13383
13384   // node_modules/lodash-es/_copyArray.js
13385   function copyArray(source, array2) {
13386     var index = -1, length2 = source.length;
13387     array2 || (array2 = Array(length2));
13388     while (++index < length2) {
13389       array2[index] = source[index];
13390     }
13391     return array2;
13392   }
13393   var copyArray_default = copyArray;
13394
13395   // node_modules/lodash-es/_shortOut.js
13396   var HOT_COUNT = 800;
13397   var HOT_SPAN = 16;
13398   var nativeNow = Date.now;
13399   function shortOut(func) {
13400     var count = 0, lastCalled = 0;
13401     return function() {
13402       var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
13403       lastCalled = stamp;
13404       if (remaining > 0) {
13405         if (++count >= HOT_COUNT) {
13406           return arguments[0];
13407         }
13408       } else {
13409         count = 0;
13410       }
13411       return func.apply(void 0, arguments);
13412     };
13413   }
13414   var shortOut_default = shortOut;
13415
13416   // node_modules/lodash-es/constant.js
13417   function constant(value) {
13418     return function() {
13419       return value;
13420     };
13421   }
13422   var constant_default2 = constant;
13423
13424   // node_modules/lodash-es/_defineProperty.js
13425   var defineProperty = (function() {
13426     try {
13427       var func = getNative_default(Object, "defineProperty");
13428       func({}, "", {});
13429       return func;
13430     } catch (e3) {
13431     }
13432   })();
13433   var defineProperty_default = defineProperty;
13434
13435   // node_modules/lodash-es/_baseSetToString.js
13436   var baseSetToString = !defineProperty_default ? identity_default2 : function(func, string) {
13437     return defineProperty_default(func, "toString", {
13438       "configurable": true,
13439       "enumerable": false,
13440       "value": constant_default2(string),
13441       "writable": true
13442     });
13443   };
13444   var baseSetToString_default = baseSetToString;
13445
13446   // node_modules/lodash-es/_setToString.js
13447   var setToString = shortOut_default(baseSetToString_default);
13448   var setToString_default = setToString;
13449
13450   // node_modules/lodash-es/_arrayEach.js
13451   function arrayEach(array2, iteratee) {
13452     var index = -1, length2 = array2 == null ? 0 : array2.length;
13453     while (++index < length2) {
13454       if (iteratee(array2[index], index, array2) === false) {
13455         break;
13456       }
13457     }
13458     return array2;
13459   }
13460   var arrayEach_default = arrayEach;
13461
13462   // node_modules/lodash-es/_isIndex.js
13463   var MAX_SAFE_INTEGER2 = 9007199254740991;
13464   var reIsUint = /^(?:0|[1-9]\d*)$/;
13465   function isIndex(value, length2) {
13466     var type2 = typeof value;
13467     length2 = length2 == null ? MAX_SAFE_INTEGER2 : length2;
13468     return !!length2 && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length2);
13469   }
13470   var isIndex_default = isIndex;
13471
13472   // node_modules/lodash-es/_baseAssignValue.js
13473   function baseAssignValue(object, key, value) {
13474     if (key == "__proto__" && defineProperty_default) {
13475       defineProperty_default(object, key, {
13476         "configurable": true,
13477         "enumerable": true,
13478         "value": value,
13479         "writable": true
13480       });
13481     } else {
13482       object[key] = value;
13483     }
13484   }
13485   var baseAssignValue_default = baseAssignValue;
13486
13487   // node_modules/lodash-es/eq.js
13488   function eq(value, other) {
13489     return value === other || value !== value && other !== other;
13490   }
13491   var eq_default = eq;
13492
13493   // node_modules/lodash-es/_assignValue.js
13494   var objectProto4 = Object.prototype;
13495   var hasOwnProperty3 = objectProto4.hasOwnProperty;
13496   function assignValue(object, key, value) {
13497     var objValue = object[key];
13498     if (!(hasOwnProperty3.call(object, key) && eq_default(objValue, value)) || value === void 0 && !(key in object)) {
13499       baseAssignValue_default(object, key, value);
13500     }
13501   }
13502   var assignValue_default = assignValue;
13503
13504   // node_modules/lodash-es/_copyObject.js
13505   function copyObject(source, props, object, customizer) {
13506     var isNew = !object;
13507     object || (object = {});
13508     var index = -1, length2 = props.length;
13509     while (++index < length2) {
13510       var key = props[index];
13511       var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
13512       if (newValue === void 0) {
13513         newValue = source[key];
13514       }
13515       if (isNew) {
13516         baseAssignValue_default(object, key, newValue);
13517       } else {
13518         assignValue_default(object, key, newValue);
13519       }
13520     }
13521     return object;
13522   }
13523   var copyObject_default = copyObject;
13524
13525   // node_modules/lodash-es/_overRest.js
13526   var nativeMax = Math.max;
13527   function overRest(func, start2, transform2) {
13528     start2 = nativeMax(start2 === void 0 ? func.length - 1 : start2, 0);
13529     return function() {
13530       var args = arguments, index = -1, length2 = nativeMax(args.length - start2, 0), array2 = Array(length2);
13531       while (++index < length2) {
13532         array2[index] = args[start2 + index];
13533       }
13534       index = -1;
13535       var otherArgs = Array(start2 + 1);
13536       while (++index < start2) {
13537         otherArgs[index] = args[index];
13538       }
13539       otherArgs[start2] = transform2(array2);
13540       return apply_default(func, this, otherArgs);
13541     };
13542   }
13543   var overRest_default = overRest;
13544
13545   // node_modules/lodash-es/_baseRest.js
13546   function baseRest(func, start2) {
13547     return setToString_default(overRest_default(func, start2, identity_default2), func + "");
13548   }
13549   var baseRest_default = baseRest;
13550
13551   // node_modules/lodash-es/isLength.js
13552   var MAX_SAFE_INTEGER3 = 9007199254740991;
13553   function isLength(value) {
13554     return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER3;
13555   }
13556   var isLength_default = isLength;
13557
13558   // node_modules/lodash-es/isArrayLike.js
13559   function isArrayLike(value) {
13560     return value != null && isLength_default(value.length) && !isFunction_default(value);
13561   }
13562   var isArrayLike_default = isArrayLike;
13563
13564   // node_modules/lodash-es/_isIterateeCall.js
13565   function isIterateeCall(value, index, object) {
13566     if (!isObject_default(object)) {
13567       return false;
13568     }
13569     var type2 = typeof index;
13570     if (type2 == "number" ? isArrayLike_default(object) && isIndex_default(index, object.length) : type2 == "string" && index in object) {
13571       return eq_default(object[index], value);
13572     }
13573     return false;
13574   }
13575   var isIterateeCall_default = isIterateeCall;
13576
13577   // node_modules/lodash-es/_createAssigner.js
13578   function createAssigner(assigner) {
13579     return baseRest_default(function(object, sources) {
13580       var index = -1, length2 = sources.length, customizer = length2 > 1 ? sources[length2 - 1] : void 0, guard = length2 > 2 ? sources[2] : void 0;
13581       customizer = assigner.length > 3 && typeof customizer == "function" ? (length2--, customizer) : void 0;
13582       if (guard && isIterateeCall_default(sources[0], sources[1], guard)) {
13583         customizer = length2 < 3 ? void 0 : customizer;
13584         length2 = 1;
13585       }
13586       object = Object(object);
13587       while (++index < length2) {
13588         var source = sources[index];
13589         if (source) {
13590           assigner(object, source, index, customizer);
13591         }
13592       }
13593       return object;
13594     });
13595   }
13596   var createAssigner_default = createAssigner;
13597
13598   // node_modules/lodash-es/_isPrototype.js
13599   var objectProto5 = Object.prototype;
13600   function isPrototype(value) {
13601     var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto5;
13602     return value === proto;
13603   }
13604   var isPrototype_default = isPrototype;
13605
13606   // node_modules/lodash-es/_baseTimes.js
13607   function baseTimes(n3, iteratee) {
13608     var index = -1, result = Array(n3);
13609     while (++index < n3) {
13610       result[index] = iteratee(index);
13611     }
13612     return result;
13613   }
13614   var baseTimes_default = baseTimes;
13615
13616   // node_modules/lodash-es/_baseIsArguments.js
13617   var argsTag = "[object Arguments]";
13618   function baseIsArguments(value) {
13619     return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
13620   }
13621   var baseIsArguments_default = baseIsArguments;
13622
13623   // node_modules/lodash-es/isArguments.js
13624   var objectProto6 = Object.prototype;
13625   var hasOwnProperty4 = objectProto6.hasOwnProperty;
13626   var propertyIsEnumerable = objectProto6.propertyIsEnumerable;
13627   var isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
13628     return arguments;
13629   })()) ? baseIsArguments_default : function(value) {
13630     return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
13631   };
13632   var isArguments_default = isArguments;
13633
13634   // node_modules/lodash-es/stubFalse.js
13635   function stubFalse() {
13636     return false;
13637   }
13638   var stubFalse_default = stubFalse;
13639
13640   // node_modules/lodash-es/isBuffer.js
13641   var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
13642   var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
13643   var moduleExports = freeModule && freeModule.exports === freeExports;
13644   var Buffer2 = moduleExports ? root_default.Buffer : void 0;
13645   var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
13646   var isBuffer = nativeIsBuffer || stubFalse_default;
13647   var isBuffer_default = isBuffer;
13648
13649   // node_modules/lodash-es/_baseIsTypedArray.js
13650   var argsTag2 = "[object Arguments]";
13651   var arrayTag = "[object Array]";
13652   var boolTag = "[object Boolean]";
13653   var dateTag = "[object Date]";
13654   var errorTag = "[object Error]";
13655   var funcTag2 = "[object Function]";
13656   var mapTag = "[object Map]";
13657   var numberTag = "[object Number]";
13658   var objectTag = "[object Object]";
13659   var regexpTag = "[object RegExp]";
13660   var setTag = "[object Set]";
13661   var stringTag = "[object String]";
13662   var weakMapTag = "[object WeakMap]";
13663   var arrayBufferTag = "[object ArrayBuffer]";
13664   var dataViewTag = "[object DataView]";
13665   var float32Tag = "[object Float32Array]";
13666   var float64Tag = "[object Float64Array]";
13667   var int8Tag = "[object Int8Array]";
13668   var int16Tag = "[object Int16Array]";
13669   var int32Tag = "[object Int32Array]";
13670   var uint8Tag = "[object Uint8Array]";
13671   var uint8ClampedTag = "[object Uint8ClampedArray]";
13672   var uint16Tag = "[object Uint16Array]";
13673   var uint32Tag = "[object Uint32Array]";
13674   var typedArrayTags = {};
13675   typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
13676   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;
13677   function baseIsTypedArray(value) {
13678     return isObjectLike_default(value) && isLength_default(value.length) && !!typedArrayTags[baseGetTag_default(value)];
13679   }
13680   var baseIsTypedArray_default = baseIsTypedArray;
13681
13682   // node_modules/lodash-es/_baseUnary.js
13683   function baseUnary(func) {
13684     return function(value) {
13685       return func(value);
13686     };
13687   }
13688   var baseUnary_default = baseUnary;
13689
13690   // node_modules/lodash-es/_nodeUtil.js
13691   var freeExports2 = typeof exports == "object" && exports && !exports.nodeType && exports;
13692   var freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
13693   var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
13694   var freeProcess = moduleExports2 && freeGlobal_default.process;
13695   var nodeUtil = (function() {
13696     try {
13697       var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
13698       if (types) {
13699         return types;
13700       }
13701       return freeProcess && freeProcess.binding && freeProcess.binding("util");
13702     } catch (e3) {
13703     }
13704   })();
13705   var nodeUtil_default = nodeUtil;
13706
13707   // node_modules/lodash-es/isTypedArray.js
13708   var nodeIsTypedArray = nodeUtil_default && nodeUtil_default.isTypedArray;
13709   var isTypedArray = nodeIsTypedArray ? baseUnary_default(nodeIsTypedArray) : baseIsTypedArray_default;
13710   var isTypedArray_default = isTypedArray;
13711
13712   // node_modules/lodash-es/_arrayLikeKeys.js
13713   var objectProto7 = Object.prototype;
13714   var hasOwnProperty5 = objectProto7.hasOwnProperty;
13715   function arrayLikeKeys(value, inherited) {
13716     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;
13717     for (var key in value) {
13718       if ((inherited || hasOwnProperty5.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
13719       (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
13720       isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
13721       isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
13722       isIndex_default(key, length2)))) {
13723         result.push(key);
13724       }
13725     }
13726     return result;
13727   }
13728   var arrayLikeKeys_default = arrayLikeKeys;
13729
13730   // node_modules/lodash-es/_overArg.js
13731   function overArg(func, transform2) {
13732     return function(arg) {
13733       return func(transform2(arg));
13734     };
13735   }
13736   var overArg_default = overArg;
13737
13738   // node_modules/lodash-es/_nativeKeys.js
13739   var nativeKeys = overArg_default(Object.keys, Object);
13740   var nativeKeys_default = nativeKeys;
13741
13742   // node_modules/lodash-es/_baseKeys.js
13743   var objectProto8 = Object.prototype;
13744   var hasOwnProperty6 = objectProto8.hasOwnProperty;
13745   function baseKeys(object) {
13746     if (!isPrototype_default(object)) {
13747       return nativeKeys_default(object);
13748     }
13749     var result = [];
13750     for (var key in Object(object)) {
13751       if (hasOwnProperty6.call(object, key) && key != "constructor") {
13752         result.push(key);
13753       }
13754     }
13755     return result;
13756   }
13757   var baseKeys_default = baseKeys;
13758
13759   // node_modules/lodash-es/keys.js
13760   function keys(object) {
13761     return isArrayLike_default(object) ? arrayLikeKeys_default(object) : baseKeys_default(object);
13762   }
13763   var keys_default = keys;
13764
13765   // node_modules/lodash-es/_nativeKeysIn.js
13766   function nativeKeysIn(object) {
13767     var result = [];
13768     if (object != null) {
13769       for (var key in Object(object)) {
13770         result.push(key);
13771       }
13772     }
13773     return result;
13774   }
13775   var nativeKeysIn_default = nativeKeysIn;
13776
13777   // node_modules/lodash-es/_baseKeysIn.js
13778   var objectProto9 = Object.prototype;
13779   var hasOwnProperty7 = objectProto9.hasOwnProperty;
13780   function baseKeysIn(object) {
13781     if (!isObject_default(object)) {
13782       return nativeKeysIn_default(object);
13783     }
13784     var isProto = isPrototype_default(object), result = [];
13785     for (var key in object) {
13786       if (!(key == "constructor" && (isProto || !hasOwnProperty7.call(object, key)))) {
13787         result.push(key);
13788       }
13789     }
13790     return result;
13791   }
13792   var baseKeysIn_default = baseKeysIn;
13793
13794   // node_modules/lodash-es/keysIn.js
13795   function keysIn(object) {
13796     return isArrayLike_default(object) ? arrayLikeKeys_default(object, true) : baseKeysIn_default(object);
13797   }
13798   var keysIn_default = keysIn;
13799
13800   // node_modules/lodash-es/_isKey.js
13801   var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
13802   var reIsPlainProp = /^\w*$/;
13803   function isKey(value, object) {
13804     if (isArray_default(value)) {
13805       return false;
13806     }
13807     var type2 = typeof value;
13808     if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol_default(value)) {
13809       return true;
13810     }
13811     return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
13812   }
13813   var isKey_default = isKey;
13814
13815   // node_modules/lodash-es/_nativeCreate.js
13816   var nativeCreate = getNative_default(Object, "create");
13817   var nativeCreate_default = nativeCreate;
13818
13819   // node_modules/lodash-es/_hashClear.js
13820   function hashClear() {
13821     this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
13822     this.size = 0;
13823   }
13824   var hashClear_default = hashClear;
13825
13826   // node_modules/lodash-es/_hashDelete.js
13827   function hashDelete(key) {
13828     var result = this.has(key) && delete this.__data__[key];
13829     this.size -= result ? 1 : 0;
13830     return result;
13831   }
13832   var hashDelete_default = hashDelete;
13833
13834   // node_modules/lodash-es/_hashGet.js
13835   var HASH_UNDEFINED = "__lodash_hash_undefined__";
13836   var objectProto10 = Object.prototype;
13837   var hasOwnProperty8 = objectProto10.hasOwnProperty;
13838   function hashGet(key) {
13839     var data = this.__data__;
13840     if (nativeCreate_default) {
13841       var result = data[key];
13842       return result === HASH_UNDEFINED ? void 0 : result;
13843     }
13844     return hasOwnProperty8.call(data, key) ? data[key] : void 0;
13845   }
13846   var hashGet_default = hashGet;
13847
13848   // node_modules/lodash-es/_hashHas.js
13849   var objectProto11 = Object.prototype;
13850   var hasOwnProperty9 = objectProto11.hasOwnProperty;
13851   function hashHas(key) {
13852     var data = this.__data__;
13853     return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty9.call(data, key);
13854   }
13855   var hashHas_default = hashHas;
13856
13857   // node_modules/lodash-es/_hashSet.js
13858   var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
13859   function hashSet(key, value) {
13860     var data = this.__data__;
13861     this.size += this.has(key) ? 0 : 1;
13862     data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
13863     return this;
13864   }
13865   var hashSet_default = hashSet;
13866
13867   // node_modules/lodash-es/_Hash.js
13868   function Hash(entries) {
13869     var index = -1, length2 = entries == null ? 0 : entries.length;
13870     this.clear();
13871     while (++index < length2) {
13872       var entry = entries[index];
13873       this.set(entry[0], entry[1]);
13874     }
13875   }
13876   Hash.prototype.clear = hashClear_default;
13877   Hash.prototype["delete"] = hashDelete_default;
13878   Hash.prototype.get = hashGet_default;
13879   Hash.prototype.has = hashHas_default;
13880   Hash.prototype.set = hashSet_default;
13881   var Hash_default = Hash;
13882
13883   // node_modules/lodash-es/_listCacheClear.js
13884   function listCacheClear() {
13885     this.__data__ = [];
13886     this.size = 0;
13887   }
13888   var listCacheClear_default = listCacheClear;
13889
13890   // node_modules/lodash-es/_assocIndexOf.js
13891   function assocIndexOf(array2, key) {
13892     var length2 = array2.length;
13893     while (length2--) {
13894       if (eq_default(array2[length2][0], key)) {
13895         return length2;
13896       }
13897     }
13898     return -1;
13899   }
13900   var assocIndexOf_default = assocIndexOf;
13901
13902   // node_modules/lodash-es/_listCacheDelete.js
13903   var arrayProto = Array.prototype;
13904   var splice = arrayProto.splice;
13905   function listCacheDelete(key) {
13906     var data = this.__data__, index = assocIndexOf_default(data, key);
13907     if (index < 0) {
13908       return false;
13909     }
13910     var lastIndex = data.length - 1;
13911     if (index == lastIndex) {
13912       data.pop();
13913     } else {
13914       splice.call(data, index, 1);
13915     }
13916     --this.size;
13917     return true;
13918   }
13919   var listCacheDelete_default = listCacheDelete;
13920
13921   // node_modules/lodash-es/_listCacheGet.js
13922   function listCacheGet(key) {
13923     var data = this.__data__, index = assocIndexOf_default(data, key);
13924     return index < 0 ? void 0 : data[index][1];
13925   }
13926   var listCacheGet_default = listCacheGet;
13927
13928   // node_modules/lodash-es/_listCacheHas.js
13929   function listCacheHas(key) {
13930     return assocIndexOf_default(this.__data__, key) > -1;
13931   }
13932   var listCacheHas_default = listCacheHas;
13933
13934   // node_modules/lodash-es/_listCacheSet.js
13935   function listCacheSet(key, value) {
13936     var data = this.__data__, index = assocIndexOf_default(data, key);
13937     if (index < 0) {
13938       ++this.size;
13939       data.push([key, value]);
13940     } else {
13941       data[index][1] = value;
13942     }
13943     return this;
13944   }
13945   var listCacheSet_default = listCacheSet;
13946
13947   // node_modules/lodash-es/_ListCache.js
13948   function ListCache(entries) {
13949     var index = -1, length2 = entries == null ? 0 : entries.length;
13950     this.clear();
13951     while (++index < length2) {
13952       var entry = entries[index];
13953       this.set(entry[0], entry[1]);
13954     }
13955   }
13956   ListCache.prototype.clear = listCacheClear_default;
13957   ListCache.prototype["delete"] = listCacheDelete_default;
13958   ListCache.prototype.get = listCacheGet_default;
13959   ListCache.prototype.has = listCacheHas_default;
13960   ListCache.prototype.set = listCacheSet_default;
13961   var ListCache_default = ListCache;
13962
13963   // node_modules/lodash-es/_Map.js
13964   var Map2 = getNative_default(root_default, "Map");
13965   var Map_default = Map2;
13966
13967   // node_modules/lodash-es/_mapCacheClear.js
13968   function mapCacheClear() {
13969     this.size = 0;
13970     this.__data__ = {
13971       "hash": new Hash_default(),
13972       "map": new (Map_default || ListCache_default)(),
13973       "string": new Hash_default()
13974     };
13975   }
13976   var mapCacheClear_default = mapCacheClear;
13977
13978   // node_modules/lodash-es/_isKeyable.js
13979   function isKeyable(value) {
13980     var type2 = typeof value;
13981     return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
13982   }
13983   var isKeyable_default = isKeyable;
13984
13985   // node_modules/lodash-es/_getMapData.js
13986   function getMapData(map2, key) {
13987     var data = map2.__data__;
13988     return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
13989   }
13990   var getMapData_default = getMapData;
13991
13992   // node_modules/lodash-es/_mapCacheDelete.js
13993   function mapCacheDelete(key) {
13994     var result = getMapData_default(this, key)["delete"](key);
13995     this.size -= result ? 1 : 0;
13996     return result;
13997   }
13998   var mapCacheDelete_default = mapCacheDelete;
13999
14000   // node_modules/lodash-es/_mapCacheGet.js
14001   function mapCacheGet(key) {
14002     return getMapData_default(this, key).get(key);
14003   }
14004   var mapCacheGet_default = mapCacheGet;
14005
14006   // node_modules/lodash-es/_mapCacheHas.js
14007   function mapCacheHas(key) {
14008     return getMapData_default(this, key).has(key);
14009   }
14010   var mapCacheHas_default = mapCacheHas;
14011
14012   // node_modules/lodash-es/_mapCacheSet.js
14013   function mapCacheSet(key, value) {
14014     var data = getMapData_default(this, key), size = data.size;
14015     data.set(key, value);
14016     this.size += data.size == size ? 0 : 1;
14017     return this;
14018   }
14019   var mapCacheSet_default = mapCacheSet;
14020
14021   // node_modules/lodash-es/_MapCache.js
14022   function MapCache(entries) {
14023     var index = -1, length2 = entries == null ? 0 : entries.length;
14024     this.clear();
14025     while (++index < length2) {
14026       var entry = entries[index];
14027       this.set(entry[0], entry[1]);
14028     }
14029   }
14030   MapCache.prototype.clear = mapCacheClear_default;
14031   MapCache.prototype["delete"] = mapCacheDelete_default;
14032   MapCache.prototype.get = mapCacheGet_default;
14033   MapCache.prototype.has = mapCacheHas_default;
14034   MapCache.prototype.set = mapCacheSet_default;
14035   var MapCache_default = MapCache;
14036
14037   // node_modules/lodash-es/memoize.js
14038   var FUNC_ERROR_TEXT = "Expected a function";
14039   function memoize(func, resolver) {
14040     if (typeof func != "function" || resolver != null && typeof resolver != "function") {
14041       throw new TypeError(FUNC_ERROR_TEXT);
14042     }
14043     var memoized = function() {
14044       var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
14045       if (cache.has(key)) {
14046         return cache.get(key);
14047       }
14048       var result = func.apply(this, args);
14049       memoized.cache = cache.set(key, result) || cache;
14050       return result;
14051     };
14052     memoized.cache = new (memoize.Cache || MapCache_default)();
14053     return memoized;
14054   }
14055   memoize.Cache = MapCache_default;
14056   var memoize_default = memoize;
14057
14058   // node_modules/lodash-es/_memoizeCapped.js
14059   var MAX_MEMOIZE_SIZE = 500;
14060   function memoizeCapped(func) {
14061     var result = memoize_default(func, function(key) {
14062       if (cache.size === MAX_MEMOIZE_SIZE) {
14063         cache.clear();
14064       }
14065       return key;
14066     });
14067     var cache = result.cache;
14068     return result;
14069   }
14070   var memoizeCapped_default = memoizeCapped;
14071
14072   // node_modules/lodash-es/_stringToPath.js
14073   var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
14074   var reEscapeChar = /\\(\\)?/g;
14075   var stringToPath = memoizeCapped_default(function(string) {
14076     var result = [];
14077     if (string.charCodeAt(0) === 46) {
14078       result.push("");
14079     }
14080     string.replace(rePropName, function(match, number3, quote, subString) {
14081       result.push(quote ? subString.replace(reEscapeChar, "$1") : number3 || match);
14082     });
14083     return result;
14084   });
14085   var stringToPath_default = stringToPath;
14086
14087   // node_modules/lodash-es/toString.js
14088   function toString(value) {
14089     return value == null ? "" : baseToString_default(value);
14090   }
14091   var toString_default = toString;
14092
14093   // node_modules/lodash-es/_castPath.js
14094   function castPath(value, object) {
14095     if (isArray_default(value)) {
14096       return value;
14097     }
14098     return isKey_default(value, object) ? [value] : stringToPath_default(toString_default(value));
14099   }
14100   var castPath_default = castPath;
14101
14102   // node_modules/lodash-es/_toKey.js
14103   var INFINITY2 = 1 / 0;
14104   function toKey(value) {
14105     if (typeof value == "string" || isSymbol_default(value)) {
14106       return value;
14107     }
14108     var result = value + "";
14109     return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
14110   }
14111   var toKey_default = toKey;
14112
14113   // node_modules/lodash-es/_baseGet.js
14114   function baseGet(object, path) {
14115     path = castPath_default(path, object);
14116     var index = 0, length2 = path.length;
14117     while (object != null && index < length2) {
14118       object = object[toKey_default(path[index++])];
14119     }
14120     return index && index == length2 ? object : void 0;
14121   }
14122   var baseGet_default = baseGet;
14123
14124   // node_modules/lodash-es/_arrayPush.js
14125   function arrayPush(array2, values) {
14126     var index = -1, length2 = values.length, offset = array2.length;
14127     while (++index < length2) {
14128       array2[offset + index] = values[index];
14129     }
14130     return array2;
14131   }
14132   var arrayPush_default = arrayPush;
14133
14134   // node_modules/lodash-es/_isFlattenable.js
14135   var spreadableSymbol = Symbol_default ? Symbol_default.isConcatSpreadable : void 0;
14136   function isFlattenable(value) {
14137     return isArray_default(value) || isArguments_default(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
14138   }
14139   var isFlattenable_default = isFlattenable;
14140
14141   // node_modules/lodash-es/_baseFlatten.js
14142   function baseFlatten(array2, depth, predicate, isStrict, result) {
14143     var index = -1, length2 = array2.length;
14144     predicate || (predicate = isFlattenable_default);
14145     result || (result = []);
14146     while (++index < length2) {
14147       var value = array2[index];
14148       if (depth > 0 && predicate(value)) {
14149         if (depth > 1) {
14150           baseFlatten(value, depth - 1, predicate, isStrict, result);
14151         } else {
14152           arrayPush_default(result, value);
14153         }
14154       } else if (!isStrict) {
14155         result[result.length] = value;
14156       }
14157     }
14158     return result;
14159   }
14160   var baseFlatten_default = baseFlatten;
14161
14162   // node_modules/lodash-es/flatten.js
14163   function flatten(array2) {
14164     var length2 = array2 == null ? 0 : array2.length;
14165     return length2 ? baseFlatten_default(array2, 1) : [];
14166   }
14167   var flatten_default = flatten;
14168
14169   // node_modules/lodash-es/_flatRest.js
14170   function flatRest(func) {
14171     return setToString_default(overRest_default(func, void 0, flatten_default), func + "");
14172   }
14173   var flatRest_default = flatRest;
14174
14175   // node_modules/lodash-es/_getPrototype.js
14176   var getPrototype = overArg_default(Object.getPrototypeOf, Object);
14177   var getPrototype_default = getPrototype;
14178
14179   // node_modules/lodash-es/isPlainObject.js
14180   var objectTag2 = "[object Object]";
14181   var funcProto3 = Function.prototype;
14182   var objectProto12 = Object.prototype;
14183   var funcToString3 = funcProto3.toString;
14184   var hasOwnProperty10 = objectProto12.hasOwnProperty;
14185   var objectCtorString = funcToString3.call(Object);
14186   function isPlainObject(value) {
14187     if (!isObjectLike_default(value) || baseGetTag_default(value) != objectTag2) {
14188       return false;
14189     }
14190     var proto = getPrototype_default(value);
14191     if (proto === null) {
14192       return true;
14193     }
14194     var Ctor = hasOwnProperty10.call(proto, "constructor") && proto.constructor;
14195     return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString3.call(Ctor) == objectCtorString;
14196   }
14197   var isPlainObject_default = isPlainObject;
14198
14199   // node_modules/lodash-es/_baseSlice.js
14200   function baseSlice(array2, start2, end) {
14201     var index = -1, length2 = array2.length;
14202     if (start2 < 0) {
14203       start2 = -start2 > length2 ? 0 : length2 + start2;
14204     }
14205     end = end > length2 ? length2 : end;
14206     if (end < 0) {
14207       end += length2;
14208     }
14209     length2 = start2 > end ? 0 : end - start2 >>> 0;
14210     start2 >>>= 0;
14211     var result = Array(length2);
14212     while (++index < length2) {
14213       result[index] = array2[index + start2];
14214     }
14215     return result;
14216   }
14217   var baseSlice_default = baseSlice;
14218
14219   // node_modules/lodash-es/_basePropertyOf.js
14220   function basePropertyOf(object) {
14221     return function(key) {
14222       return object == null ? void 0 : object[key];
14223     };
14224   }
14225   var basePropertyOf_default = basePropertyOf;
14226
14227   // node_modules/lodash-es/_baseClamp.js
14228   function baseClamp(number3, lower2, upper) {
14229     if (number3 === number3) {
14230       if (upper !== void 0) {
14231         number3 = number3 <= upper ? number3 : upper;
14232       }
14233       if (lower2 !== void 0) {
14234         number3 = number3 >= lower2 ? number3 : lower2;
14235       }
14236     }
14237     return number3;
14238   }
14239   var baseClamp_default = baseClamp;
14240
14241   // node_modules/lodash-es/clamp.js
14242   function clamp(number3, lower2, upper) {
14243     if (upper === void 0) {
14244       upper = lower2;
14245       lower2 = void 0;
14246     }
14247     if (upper !== void 0) {
14248       upper = toNumber_default(upper);
14249       upper = upper === upper ? upper : 0;
14250     }
14251     if (lower2 !== void 0) {
14252       lower2 = toNumber_default(lower2);
14253       lower2 = lower2 === lower2 ? lower2 : 0;
14254     }
14255     return baseClamp_default(toNumber_default(number3), lower2, upper);
14256   }
14257   var clamp_default = clamp;
14258
14259   // node_modules/lodash-es/_stackClear.js
14260   function stackClear() {
14261     this.__data__ = new ListCache_default();
14262     this.size = 0;
14263   }
14264   var stackClear_default = stackClear;
14265
14266   // node_modules/lodash-es/_stackDelete.js
14267   function stackDelete(key) {
14268     var data = this.__data__, result = data["delete"](key);
14269     this.size = data.size;
14270     return result;
14271   }
14272   var stackDelete_default = stackDelete;
14273
14274   // node_modules/lodash-es/_stackGet.js
14275   function stackGet(key) {
14276     return this.__data__.get(key);
14277   }
14278   var stackGet_default = stackGet;
14279
14280   // node_modules/lodash-es/_stackHas.js
14281   function stackHas(key) {
14282     return this.__data__.has(key);
14283   }
14284   var stackHas_default = stackHas;
14285
14286   // node_modules/lodash-es/_stackSet.js
14287   var LARGE_ARRAY_SIZE = 200;
14288   function stackSet(key, value) {
14289     var data = this.__data__;
14290     if (data instanceof ListCache_default) {
14291       var pairs2 = data.__data__;
14292       if (!Map_default || pairs2.length < LARGE_ARRAY_SIZE - 1) {
14293         pairs2.push([key, value]);
14294         this.size = ++data.size;
14295         return this;
14296       }
14297       data = this.__data__ = new MapCache_default(pairs2);
14298     }
14299     data.set(key, value);
14300     this.size = data.size;
14301     return this;
14302   }
14303   var stackSet_default = stackSet;
14304
14305   // node_modules/lodash-es/_Stack.js
14306   function Stack(entries) {
14307     var data = this.__data__ = new ListCache_default(entries);
14308     this.size = data.size;
14309   }
14310   Stack.prototype.clear = stackClear_default;
14311   Stack.prototype["delete"] = stackDelete_default;
14312   Stack.prototype.get = stackGet_default;
14313   Stack.prototype.has = stackHas_default;
14314   Stack.prototype.set = stackSet_default;
14315   var Stack_default = Stack;
14316
14317   // node_modules/lodash-es/_baseAssign.js
14318   function baseAssign(object, source) {
14319     return object && copyObject_default(source, keys_default(source), object);
14320   }
14321   var baseAssign_default = baseAssign;
14322
14323   // node_modules/lodash-es/_baseAssignIn.js
14324   function baseAssignIn(object, source) {
14325     return object && copyObject_default(source, keysIn_default(source), object);
14326   }
14327   var baseAssignIn_default = baseAssignIn;
14328
14329   // node_modules/lodash-es/_cloneBuffer.js
14330   var freeExports3 = typeof exports == "object" && exports && !exports.nodeType && exports;
14331   var freeModule3 = freeExports3 && typeof module == "object" && module && !module.nodeType && module;
14332   var moduleExports3 = freeModule3 && freeModule3.exports === freeExports3;
14333   var Buffer3 = moduleExports3 ? root_default.Buffer : void 0;
14334   var allocUnsafe = Buffer3 ? Buffer3.allocUnsafe : void 0;
14335   function cloneBuffer(buffer, isDeep) {
14336     if (isDeep) {
14337       return buffer.slice();
14338     }
14339     var length2 = buffer.length, result = allocUnsafe ? allocUnsafe(length2) : new buffer.constructor(length2);
14340     buffer.copy(result);
14341     return result;
14342   }
14343   var cloneBuffer_default = cloneBuffer;
14344
14345   // node_modules/lodash-es/_arrayFilter.js
14346   function arrayFilter(array2, predicate) {
14347     var index = -1, length2 = array2 == null ? 0 : array2.length, resIndex = 0, result = [];
14348     while (++index < length2) {
14349       var value = array2[index];
14350       if (predicate(value, index, array2)) {
14351         result[resIndex++] = value;
14352       }
14353     }
14354     return result;
14355   }
14356   var arrayFilter_default = arrayFilter;
14357
14358   // node_modules/lodash-es/stubArray.js
14359   function stubArray() {
14360     return [];
14361   }
14362   var stubArray_default = stubArray;
14363
14364   // node_modules/lodash-es/_getSymbols.js
14365   var objectProto13 = Object.prototype;
14366   var propertyIsEnumerable2 = objectProto13.propertyIsEnumerable;
14367   var nativeGetSymbols = Object.getOwnPropertySymbols;
14368   var getSymbols = !nativeGetSymbols ? stubArray_default : function(object) {
14369     if (object == null) {
14370       return [];
14371     }
14372     object = Object(object);
14373     return arrayFilter_default(nativeGetSymbols(object), function(symbol) {
14374       return propertyIsEnumerable2.call(object, symbol);
14375     });
14376   };
14377   var getSymbols_default = getSymbols;
14378
14379   // node_modules/lodash-es/_copySymbols.js
14380   function copySymbols(source, object) {
14381     return copyObject_default(source, getSymbols_default(source), object);
14382   }
14383   var copySymbols_default = copySymbols;
14384
14385   // node_modules/lodash-es/_getSymbolsIn.js
14386   var nativeGetSymbols2 = Object.getOwnPropertySymbols;
14387   var getSymbolsIn = !nativeGetSymbols2 ? stubArray_default : function(object) {
14388     var result = [];
14389     while (object) {
14390       arrayPush_default(result, getSymbols_default(object));
14391       object = getPrototype_default(object);
14392     }
14393     return result;
14394   };
14395   var getSymbolsIn_default = getSymbolsIn;
14396
14397   // node_modules/lodash-es/_copySymbolsIn.js
14398   function copySymbolsIn(source, object) {
14399     return copyObject_default(source, getSymbolsIn_default(source), object);
14400   }
14401   var copySymbolsIn_default = copySymbolsIn;
14402
14403   // node_modules/lodash-es/_baseGetAllKeys.js
14404   function baseGetAllKeys(object, keysFunc, symbolsFunc) {
14405     var result = keysFunc(object);
14406     return isArray_default(object) ? result : arrayPush_default(result, symbolsFunc(object));
14407   }
14408   var baseGetAllKeys_default = baseGetAllKeys;
14409
14410   // node_modules/lodash-es/_getAllKeys.js
14411   function getAllKeys(object) {
14412     return baseGetAllKeys_default(object, keys_default, getSymbols_default);
14413   }
14414   var getAllKeys_default = getAllKeys;
14415
14416   // node_modules/lodash-es/_getAllKeysIn.js
14417   function getAllKeysIn(object) {
14418     return baseGetAllKeys_default(object, keysIn_default, getSymbolsIn_default);
14419   }
14420   var getAllKeysIn_default = getAllKeysIn;
14421
14422   // node_modules/lodash-es/_DataView.js
14423   var DataView2 = getNative_default(root_default, "DataView");
14424   var DataView_default = DataView2;
14425
14426   // node_modules/lodash-es/_Promise.js
14427   var Promise2 = getNative_default(root_default, "Promise");
14428   var Promise_default = Promise2;
14429
14430   // node_modules/lodash-es/_Set.js
14431   var Set2 = getNative_default(root_default, "Set");
14432   var Set_default = Set2;
14433
14434   // node_modules/lodash-es/_getTag.js
14435   var mapTag2 = "[object Map]";
14436   var objectTag3 = "[object Object]";
14437   var promiseTag = "[object Promise]";
14438   var setTag2 = "[object Set]";
14439   var weakMapTag2 = "[object WeakMap]";
14440   var dataViewTag2 = "[object DataView]";
14441   var dataViewCtorString = toSource_default(DataView_default);
14442   var mapCtorString = toSource_default(Map_default);
14443   var promiseCtorString = toSource_default(Promise_default);
14444   var setCtorString = toSource_default(Set_default);
14445   var weakMapCtorString = toSource_default(WeakMap_default);
14446   var getTag = baseGetTag_default;
14447   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) {
14448     getTag = function(value) {
14449       var result = baseGetTag_default(value), Ctor = result == objectTag3 ? value.constructor : void 0, ctorString = Ctor ? toSource_default(Ctor) : "";
14450       if (ctorString) {
14451         switch (ctorString) {
14452           case dataViewCtorString:
14453             return dataViewTag2;
14454           case mapCtorString:
14455             return mapTag2;
14456           case promiseCtorString:
14457             return promiseTag;
14458           case setCtorString:
14459             return setTag2;
14460           case weakMapCtorString:
14461             return weakMapTag2;
14462         }
14463       }
14464       return result;
14465     };
14466   }
14467   var getTag_default = getTag;
14468
14469   // node_modules/lodash-es/_initCloneArray.js
14470   var objectProto14 = Object.prototype;
14471   var hasOwnProperty11 = objectProto14.hasOwnProperty;
14472   function initCloneArray(array2) {
14473     var length2 = array2.length, result = new array2.constructor(length2);
14474     if (length2 && typeof array2[0] == "string" && hasOwnProperty11.call(array2, "index")) {
14475       result.index = array2.index;
14476       result.input = array2.input;
14477     }
14478     return result;
14479   }
14480   var initCloneArray_default = initCloneArray;
14481
14482   // node_modules/lodash-es/_Uint8Array.js
14483   var Uint8Array2 = root_default.Uint8Array;
14484   var Uint8Array_default = Uint8Array2;
14485
14486   // node_modules/lodash-es/_cloneArrayBuffer.js
14487   function cloneArrayBuffer(arrayBuffer) {
14488     var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
14489     new Uint8Array_default(result).set(new Uint8Array_default(arrayBuffer));
14490     return result;
14491   }
14492   var cloneArrayBuffer_default = cloneArrayBuffer;
14493
14494   // node_modules/lodash-es/_cloneDataView.js
14495   function cloneDataView(dataView, isDeep) {
14496     var buffer = isDeep ? cloneArrayBuffer_default(dataView.buffer) : dataView.buffer;
14497     return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
14498   }
14499   var cloneDataView_default = cloneDataView;
14500
14501   // node_modules/lodash-es/_cloneRegExp.js
14502   var reFlags = /\w*$/;
14503   function cloneRegExp(regexp) {
14504     var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
14505     result.lastIndex = regexp.lastIndex;
14506     return result;
14507   }
14508   var cloneRegExp_default = cloneRegExp;
14509
14510   // node_modules/lodash-es/_cloneSymbol.js
14511   var symbolProto2 = Symbol_default ? Symbol_default.prototype : void 0;
14512   var symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
14513   function cloneSymbol(symbol) {
14514     return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
14515   }
14516   var cloneSymbol_default = cloneSymbol;
14517
14518   // node_modules/lodash-es/_cloneTypedArray.js
14519   function cloneTypedArray(typedArray, isDeep) {
14520     var buffer = isDeep ? cloneArrayBuffer_default(typedArray.buffer) : typedArray.buffer;
14521     return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
14522   }
14523   var cloneTypedArray_default = cloneTypedArray;
14524
14525   // node_modules/lodash-es/_initCloneByTag.js
14526   var boolTag2 = "[object Boolean]";
14527   var dateTag2 = "[object Date]";
14528   var mapTag3 = "[object Map]";
14529   var numberTag2 = "[object Number]";
14530   var regexpTag2 = "[object RegExp]";
14531   var setTag3 = "[object Set]";
14532   var stringTag2 = "[object String]";
14533   var symbolTag2 = "[object Symbol]";
14534   var arrayBufferTag2 = "[object ArrayBuffer]";
14535   var dataViewTag3 = "[object DataView]";
14536   var float32Tag2 = "[object Float32Array]";
14537   var float64Tag2 = "[object Float64Array]";
14538   var int8Tag2 = "[object Int8Array]";
14539   var int16Tag2 = "[object Int16Array]";
14540   var int32Tag2 = "[object Int32Array]";
14541   var uint8Tag2 = "[object Uint8Array]";
14542   var uint8ClampedTag2 = "[object Uint8ClampedArray]";
14543   var uint16Tag2 = "[object Uint16Array]";
14544   var uint32Tag2 = "[object Uint32Array]";
14545   function initCloneByTag(object, tag, isDeep) {
14546     var Ctor = object.constructor;
14547     switch (tag) {
14548       case arrayBufferTag2:
14549         return cloneArrayBuffer_default(object);
14550       case boolTag2:
14551       case dateTag2:
14552         return new Ctor(+object);
14553       case dataViewTag3:
14554         return cloneDataView_default(object, isDeep);
14555       case float32Tag2:
14556       case float64Tag2:
14557       case int8Tag2:
14558       case int16Tag2:
14559       case int32Tag2:
14560       case uint8Tag2:
14561       case uint8ClampedTag2:
14562       case uint16Tag2:
14563       case uint32Tag2:
14564         return cloneTypedArray_default(object, isDeep);
14565       case mapTag3:
14566         return new Ctor();
14567       case numberTag2:
14568       case stringTag2:
14569         return new Ctor(object);
14570       case regexpTag2:
14571         return cloneRegExp_default(object);
14572       case setTag3:
14573         return new Ctor();
14574       case symbolTag2:
14575         return cloneSymbol_default(object);
14576     }
14577   }
14578   var initCloneByTag_default = initCloneByTag;
14579
14580   // node_modules/lodash-es/_initCloneObject.js
14581   function initCloneObject(object) {
14582     return typeof object.constructor == "function" && !isPrototype_default(object) ? baseCreate_default(getPrototype_default(object)) : {};
14583   }
14584   var initCloneObject_default = initCloneObject;
14585
14586   // node_modules/lodash-es/_baseIsMap.js
14587   var mapTag4 = "[object Map]";
14588   function baseIsMap(value) {
14589     return isObjectLike_default(value) && getTag_default(value) == mapTag4;
14590   }
14591   var baseIsMap_default = baseIsMap;
14592
14593   // node_modules/lodash-es/isMap.js
14594   var nodeIsMap = nodeUtil_default && nodeUtil_default.isMap;
14595   var isMap = nodeIsMap ? baseUnary_default(nodeIsMap) : baseIsMap_default;
14596   var isMap_default = isMap;
14597
14598   // node_modules/lodash-es/_baseIsSet.js
14599   var setTag4 = "[object Set]";
14600   function baseIsSet(value) {
14601     return isObjectLike_default(value) && getTag_default(value) == setTag4;
14602   }
14603   var baseIsSet_default = baseIsSet;
14604
14605   // node_modules/lodash-es/isSet.js
14606   var nodeIsSet = nodeUtil_default && nodeUtil_default.isSet;
14607   var isSet = nodeIsSet ? baseUnary_default(nodeIsSet) : baseIsSet_default;
14608   var isSet_default = isSet;
14609
14610   // node_modules/lodash-es/_baseClone.js
14611   var CLONE_DEEP_FLAG = 1;
14612   var CLONE_FLAT_FLAG = 2;
14613   var CLONE_SYMBOLS_FLAG = 4;
14614   var argsTag3 = "[object Arguments]";
14615   var arrayTag2 = "[object Array]";
14616   var boolTag3 = "[object Boolean]";
14617   var dateTag3 = "[object Date]";
14618   var errorTag2 = "[object Error]";
14619   var funcTag3 = "[object Function]";
14620   var genTag2 = "[object GeneratorFunction]";
14621   var mapTag5 = "[object Map]";
14622   var numberTag3 = "[object Number]";
14623   var objectTag4 = "[object Object]";
14624   var regexpTag3 = "[object RegExp]";
14625   var setTag5 = "[object Set]";
14626   var stringTag3 = "[object String]";
14627   var symbolTag3 = "[object Symbol]";
14628   var weakMapTag3 = "[object WeakMap]";
14629   var arrayBufferTag3 = "[object ArrayBuffer]";
14630   var dataViewTag4 = "[object DataView]";
14631   var float32Tag3 = "[object Float32Array]";
14632   var float64Tag3 = "[object Float64Array]";
14633   var int8Tag3 = "[object Int8Array]";
14634   var int16Tag3 = "[object Int16Array]";
14635   var int32Tag3 = "[object Int32Array]";
14636   var uint8Tag3 = "[object Uint8Array]";
14637   var uint8ClampedTag3 = "[object Uint8ClampedArray]";
14638   var uint16Tag3 = "[object Uint16Array]";
14639   var uint32Tag3 = "[object Uint32Array]";
14640   var cloneableTags = {};
14641   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;
14642   cloneableTags[errorTag2] = cloneableTags[funcTag3] = cloneableTags[weakMapTag3] = false;
14643   function baseClone(value, bitmask, customizer, key, object, stack) {
14644     var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
14645     if (customizer) {
14646       result = object ? customizer(value, key, object, stack) : customizer(value);
14647     }
14648     if (result !== void 0) {
14649       return result;
14650     }
14651     if (!isObject_default(value)) {
14652       return value;
14653     }
14654     var isArr = isArray_default(value);
14655     if (isArr) {
14656       result = initCloneArray_default(value);
14657       if (!isDeep) {
14658         return copyArray_default(value, result);
14659       }
14660     } else {
14661       var tag = getTag_default(value), isFunc = tag == funcTag3 || tag == genTag2;
14662       if (isBuffer_default(value)) {
14663         return cloneBuffer_default(value, isDeep);
14664       }
14665       if (tag == objectTag4 || tag == argsTag3 || isFunc && !object) {
14666         result = isFlat || isFunc ? {} : initCloneObject_default(value);
14667         if (!isDeep) {
14668           return isFlat ? copySymbolsIn_default(value, baseAssignIn_default(result, value)) : copySymbols_default(value, baseAssign_default(result, value));
14669         }
14670       } else {
14671         if (!cloneableTags[tag]) {
14672           return object ? value : {};
14673         }
14674         result = initCloneByTag_default(value, tag, isDeep);
14675       }
14676     }
14677     stack || (stack = new Stack_default());
14678     var stacked = stack.get(value);
14679     if (stacked) {
14680       return stacked;
14681     }
14682     stack.set(value, result);
14683     if (isSet_default(value)) {
14684       value.forEach(function(subValue) {
14685         result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
14686       });
14687     } else if (isMap_default(value)) {
14688       value.forEach(function(subValue, key2) {
14689         result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
14690       });
14691     }
14692     var keysFunc = isFull ? isFlat ? getAllKeysIn_default : getAllKeys_default : isFlat ? keysIn_default : keys_default;
14693     var props = isArr ? void 0 : keysFunc(value);
14694     arrayEach_default(props || value, function(subValue, key2) {
14695       if (props) {
14696         key2 = subValue;
14697         subValue = value[key2];
14698       }
14699       assignValue_default(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
14700     });
14701     return result;
14702   }
14703   var baseClone_default = baseClone;
14704
14705   // node_modules/lodash-es/_setCacheAdd.js
14706   var HASH_UNDEFINED3 = "__lodash_hash_undefined__";
14707   function setCacheAdd(value) {
14708     this.__data__.set(value, HASH_UNDEFINED3);
14709     return this;
14710   }
14711   var setCacheAdd_default = setCacheAdd;
14712
14713   // node_modules/lodash-es/_setCacheHas.js
14714   function setCacheHas(value) {
14715     return this.__data__.has(value);
14716   }
14717   var setCacheHas_default = setCacheHas;
14718
14719   // node_modules/lodash-es/_SetCache.js
14720   function SetCache(values) {
14721     var index = -1, length2 = values == null ? 0 : values.length;
14722     this.__data__ = new MapCache_default();
14723     while (++index < length2) {
14724       this.add(values[index]);
14725     }
14726   }
14727   SetCache.prototype.add = SetCache.prototype.push = setCacheAdd_default;
14728   SetCache.prototype.has = setCacheHas_default;
14729   var SetCache_default = SetCache;
14730
14731   // node_modules/lodash-es/_arraySome.js
14732   function arraySome(array2, predicate) {
14733     var index = -1, length2 = array2 == null ? 0 : array2.length;
14734     while (++index < length2) {
14735       if (predicate(array2[index], index, array2)) {
14736         return true;
14737       }
14738     }
14739     return false;
14740   }
14741   var arraySome_default = arraySome;
14742
14743   // node_modules/lodash-es/_cacheHas.js
14744   function cacheHas(cache, key) {
14745     return cache.has(key);
14746   }
14747   var cacheHas_default = cacheHas;
14748
14749   // node_modules/lodash-es/_equalArrays.js
14750   var COMPARE_PARTIAL_FLAG = 1;
14751   var COMPARE_UNORDERED_FLAG = 2;
14752   function equalArrays(array2, other, bitmask, customizer, equalFunc, stack) {
14753     var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array2.length, othLength = other.length;
14754     if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
14755       return false;
14756     }
14757     var arrStacked = stack.get(array2);
14758     var othStacked = stack.get(other);
14759     if (arrStacked && othStacked) {
14760       return arrStacked == other && othStacked == array2;
14761     }
14762     var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache_default() : void 0;
14763     stack.set(array2, other);
14764     stack.set(other, array2);
14765     while (++index < arrLength) {
14766       var arrValue = array2[index], othValue = other[index];
14767       if (customizer) {
14768         var compared = isPartial ? customizer(othValue, arrValue, index, other, array2, stack) : customizer(arrValue, othValue, index, array2, other, stack);
14769       }
14770       if (compared !== void 0) {
14771         if (compared) {
14772           continue;
14773         }
14774         result = false;
14775         break;
14776       }
14777       if (seen) {
14778         if (!arraySome_default(other, function(othValue2, othIndex) {
14779           if (!cacheHas_default(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
14780             return seen.push(othIndex);
14781           }
14782         })) {
14783           result = false;
14784           break;
14785         }
14786       } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
14787         result = false;
14788         break;
14789       }
14790     }
14791     stack["delete"](array2);
14792     stack["delete"](other);
14793     return result;
14794   }
14795   var equalArrays_default = equalArrays;
14796
14797   // node_modules/lodash-es/_mapToArray.js
14798   function mapToArray(map2) {
14799     var index = -1, result = Array(map2.size);
14800     map2.forEach(function(value, key) {
14801       result[++index] = [key, value];
14802     });
14803     return result;
14804   }
14805   var mapToArray_default = mapToArray;
14806
14807   // node_modules/lodash-es/_setToArray.js
14808   function setToArray(set5) {
14809     var index = -1, result = Array(set5.size);
14810     set5.forEach(function(value) {
14811       result[++index] = value;
14812     });
14813     return result;
14814   }
14815   var setToArray_default = setToArray;
14816
14817   // node_modules/lodash-es/_equalByTag.js
14818   var COMPARE_PARTIAL_FLAG2 = 1;
14819   var COMPARE_UNORDERED_FLAG2 = 2;
14820   var boolTag4 = "[object Boolean]";
14821   var dateTag4 = "[object Date]";
14822   var errorTag3 = "[object Error]";
14823   var mapTag6 = "[object Map]";
14824   var numberTag4 = "[object Number]";
14825   var regexpTag4 = "[object RegExp]";
14826   var setTag6 = "[object Set]";
14827   var stringTag4 = "[object String]";
14828   var symbolTag4 = "[object Symbol]";
14829   var arrayBufferTag4 = "[object ArrayBuffer]";
14830   var dataViewTag5 = "[object DataView]";
14831   var symbolProto3 = Symbol_default ? Symbol_default.prototype : void 0;
14832   var symbolValueOf2 = symbolProto3 ? symbolProto3.valueOf : void 0;
14833   function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
14834     switch (tag) {
14835       case dataViewTag5:
14836         if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
14837           return false;
14838         }
14839         object = object.buffer;
14840         other = other.buffer;
14841       case arrayBufferTag4:
14842         if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array_default(object), new Uint8Array_default(other))) {
14843           return false;
14844         }
14845         return true;
14846       case boolTag4:
14847       case dateTag4:
14848       case numberTag4:
14849         return eq_default(+object, +other);
14850       case errorTag3:
14851         return object.name == other.name && object.message == other.message;
14852       case regexpTag4:
14853       case stringTag4:
14854         return object == other + "";
14855       case mapTag6:
14856         var convert = mapToArray_default;
14857       case setTag6:
14858         var isPartial = bitmask & COMPARE_PARTIAL_FLAG2;
14859         convert || (convert = setToArray_default);
14860         if (object.size != other.size && !isPartial) {
14861           return false;
14862         }
14863         var stacked = stack.get(object);
14864         if (stacked) {
14865           return stacked == other;
14866         }
14867         bitmask |= COMPARE_UNORDERED_FLAG2;
14868         stack.set(object, other);
14869         var result = equalArrays_default(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
14870         stack["delete"](object);
14871         return result;
14872       case symbolTag4:
14873         if (symbolValueOf2) {
14874           return symbolValueOf2.call(object) == symbolValueOf2.call(other);
14875         }
14876     }
14877     return false;
14878   }
14879   var equalByTag_default = equalByTag;
14880
14881   // node_modules/lodash-es/_equalObjects.js
14882   var COMPARE_PARTIAL_FLAG3 = 1;
14883   var objectProto15 = Object.prototype;
14884   var hasOwnProperty12 = objectProto15.hasOwnProperty;
14885   function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
14886     var isPartial = bitmask & COMPARE_PARTIAL_FLAG3, objProps = getAllKeys_default(object), objLength = objProps.length, othProps = getAllKeys_default(other), othLength = othProps.length;
14887     if (objLength != othLength && !isPartial) {
14888       return false;
14889     }
14890     var index = objLength;
14891     while (index--) {
14892       var key = objProps[index];
14893       if (!(isPartial ? key in other : hasOwnProperty12.call(other, key))) {
14894         return false;
14895       }
14896     }
14897     var objStacked = stack.get(object);
14898     var othStacked = stack.get(other);
14899     if (objStacked && othStacked) {
14900       return objStacked == other && othStacked == object;
14901     }
14902     var result = true;
14903     stack.set(object, other);
14904     stack.set(other, object);
14905     var skipCtor = isPartial;
14906     while (++index < objLength) {
14907       key = objProps[index];
14908       var objValue = object[key], othValue = other[key];
14909       if (customizer) {
14910         var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
14911       }
14912       if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
14913         result = false;
14914         break;
14915       }
14916       skipCtor || (skipCtor = key == "constructor");
14917     }
14918     if (result && !skipCtor) {
14919       var objCtor = object.constructor, othCtor = other.constructor;
14920       if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
14921         result = false;
14922       }
14923     }
14924     stack["delete"](object);
14925     stack["delete"](other);
14926     return result;
14927   }
14928   var equalObjects_default = equalObjects;
14929
14930   // node_modules/lodash-es/_baseIsEqualDeep.js
14931   var COMPARE_PARTIAL_FLAG4 = 1;
14932   var argsTag4 = "[object Arguments]";
14933   var arrayTag3 = "[object Array]";
14934   var objectTag5 = "[object Object]";
14935   var objectProto16 = Object.prototype;
14936   var hasOwnProperty13 = objectProto16.hasOwnProperty;
14937   function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
14938     var objIsArr = isArray_default(object), othIsArr = isArray_default(other), objTag = objIsArr ? arrayTag3 : getTag_default(object), othTag = othIsArr ? arrayTag3 : getTag_default(other);
14939     objTag = objTag == argsTag4 ? objectTag5 : objTag;
14940     othTag = othTag == argsTag4 ? objectTag5 : othTag;
14941     var objIsObj = objTag == objectTag5, othIsObj = othTag == objectTag5, isSameTag = objTag == othTag;
14942     if (isSameTag && isBuffer_default(object)) {
14943       if (!isBuffer_default(other)) {
14944         return false;
14945       }
14946       objIsArr = true;
14947       objIsObj = false;
14948     }
14949     if (isSameTag && !objIsObj) {
14950       stack || (stack = new Stack_default());
14951       return objIsArr || isTypedArray_default(object) ? equalArrays_default(object, other, bitmask, customizer, equalFunc, stack) : equalByTag_default(object, other, objTag, bitmask, customizer, equalFunc, stack);
14952     }
14953     if (!(bitmask & COMPARE_PARTIAL_FLAG4)) {
14954       var objIsWrapped = objIsObj && hasOwnProperty13.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty13.call(other, "__wrapped__");
14955       if (objIsWrapped || othIsWrapped) {
14956         var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
14957         stack || (stack = new Stack_default());
14958         return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
14959       }
14960     }
14961     if (!isSameTag) {
14962       return false;
14963     }
14964     stack || (stack = new Stack_default());
14965     return equalObjects_default(object, other, bitmask, customizer, equalFunc, stack);
14966   }
14967   var baseIsEqualDeep_default = baseIsEqualDeep;
14968
14969   // node_modules/lodash-es/_baseIsEqual.js
14970   function baseIsEqual(value, other, bitmask, customizer, stack) {
14971     if (value === other) {
14972       return true;
14973     }
14974     if (value == null || other == null || !isObjectLike_default(value) && !isObjectLike_default(other)) {
14975       return value !== value && other !== other;
14976     }
14977     return baseIsEqualDeep_default(value, other, bitmask, customizer, baseIsEqual, stack);
14978   }
14979   var baseIsEqual_default = baseIsEqual;
14980
14981   // node_modules/lodash-es/_createBaseFor.js
14982   function createBaseFor(fromRight) {
14983     return function(object, iteratee, keysFunc) {
14984       var index = -1, iterable = Object(object), props = keysFunc(object), length2 = props.length;
14985       while (length2--) {
14986         var key = props[fromRight ? length2 : ++index];
14987         if (iteratee(iterable[key], key, iterable) === false) {
14988           break;
14989         }
14990       }
14991       return object;
14992     };
14993   }
14994   var createBaseFor_default = createBaseFor;
14995
14996   // node_modules/lodash-es/_baseFor.js
14997   var baseFor = createBaseFor_default();
14998   var baseFor_default = baseFor;
14999
15000   // node_modules/lodash-es/now.js
15001   var now = function() {
15002     return root_default.Date.now();
15003   };
15004   var now_default = now;
15005
15006   // node_modules/lodash-es/debounce.js
15007   var FUNC_ERROR_TEXT2 = "Expected a function";
15008   var nativeMax2 = Math.max;
15009   var nativeMin = Math.min;
15010   function debounce(func, wait, options) {
15011     var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
15012     if (typeof func != "function") {
15013       throw new TypeError(FUNC_ERROR_TEXT2);
15014     }
15015     wait = toNumber_default(wait) || 0;
15016     if (isObject_default(options)) {
15017       leading = !!options.leading;
15018       maxing = "maxWait" in options;
15019       maxWait = maxing ? nativeMax2(toNumber_default(options.maxWait) || 0, wait) : maxWait;
15020       trailing = "trailing" in options ? !!options.trailing : trailing;
15021     }
15022     function invokeFunc(time) {
15023       var args = lastArgs, thisArg = lastThis;
15024       lastArgs = lastThis = void 0;
15025       lastInvokeTime = time;
15026       result = func.apply(thisArg, args);
15027       return result;
15028     }
15029     function leadingEdge(time) {
15030       lastInvokeTime = time;
15031       timerId = setTimeout(timerExpired, wait);
15032       return leading ? invokeFunc(time) : result;
15033     }
15034     function remainingWait(time) {
15035       var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
15036       return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
15037     }
15038     function shouldInvoke(time) {
15039       var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
15040       return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
15041     }
15042     function timerExpired() {
15043       var time = now_default();
15044       if (shouldInvoke(time)) {
15045         return trailingEdge(time);
15046       }
15047       timerId = setTimeout(timerExpired, remainingWait(time));
15048     }
15049     function trailingEdge(time) {
15050       timerId = void 0;
15051       if (trailing && lastArgs) {
15052         return invokeFunc(time);
15053       }
15054       lastArgs = lastThis = void 0;
15055       return result;
15056     }
15057     function cancel() {
15058       if (timerId !== void 0) {
15059         clearTimeout(timerId);
15060       }
15061       lastInvokeTime = 0;
15062       lastArgs = lastCallTime = lastThis = timerId = void 0;
15063     }
15064     function flush() {
15065       return timerId === void 0 ? result : trailingEdge(now_default());
15066     }
15067     function debounced() {
15068       var time = now_default(), isInvoking = shouldInvoke(time);
15069       lastArgs = arguments;
15070       lastThis = this;
15071       lastCallTime = time;
15072       if (isInvoking) {
15073         if (timerId === void 0) {
15074           return leadingEdge(lastCallTime);
15075         }
15076         if (maxing) {
15077           clearTimeout(timerId);
15078           timerId = setTimeout(timerExpired, wait);
15079           return invokeFunc(lastCallTime);
15080         }
15081       }
15082       if (timerId === void 0) {
15083         timerId = setTimeout(timerExpired, wait);
15084       }
15085       return result;
15086     }
15087     debounced.cancel = cancel;
15088     debounced.flush = flush;
15089     return debounced;
15090   }
15091   var debounce_default = debounce;
15092
15093   // node_modules/lodash-es/_assignMergeValue.js
15094   function assignMergeValue(object, key, value) {
15095     if (value !== void 0 && !eq_default(object[key], value) || value === void 0 && !(key in object)) {
15096       baseAssignValue_default(object, key, value);
15097     }
15098   }
15099   var assignMergeValue_default = assignMergeValue;
15100
15101   // node_modules/lodash-es/isArrayLikeObject.js
15102   function isArrayLikeObject(value) {
15103     return isObjectLike_default(value) && isArrayLike_default(value);
15104   }
15105   var isArrayLikeObject_default = isArrayLikeObject;
15106
15107   // node_modules/lodash-es/_safeGet.js
15108   function safeGet(object, key) {
15109     if (key === "constructor" && typeof object[key] === "function") {
15110       return;
15111     }
15112     if (key == "__proto__") {
15113       return;
15114     }
15115     return object[key];
15116   }
15117   var safeGet_default = safeGet;
15118
15119   // node_modules/lodash-es/toPlainObject.js
15120   function toPlainObject(value) {
15121     return copyObject_default(value, keysIn_default(value));
15122   }
15123   var toPlainObject_default = toPlainObject;
15124
15125   // node_modules/lodash-es/_baseMergeDeep.js
15126   function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
15127     var objValue = safeGet_default(object, key), srcValue = safeGet_default(source, key), stacked = stack.get(srcValue);
15128     if (stacked) {
15129       assignMergeValue_default(object, key, stacked);
15130       return;
15131     }
15132     var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
15133     var isCommon = newValue === void 0;
15134     if (isCommon) {
15135       var isArr = isArray_default(srcValue), isBuff = !isArr && isBuffer_default(srcValue), isTyped = !isArr && !isBuff && isTypedArray_default(srcValue);
15136       newValue = srcValue;
15137       if (isArr || isBuff || isTyped) {
15138         if (isArray_default(objValue)) {
15139           newValue = objValue;
15140         } else if (isArrayLikeObject_default(objValue)) {
15141           newValue = copyArray_default(objValue);
15142         } else if (isBuff) {
15143           isCommon = false;
15144           newValue = cloneBuffer_default(srcValue, true);
15145         } else if (isTyped) {
15146           isCommon = false;
15147           newValue = cloneTypedArray_default(srcValue, true);
15148         } else {
15149           newValue = [];
15150         }
15151       } else if (isPlainObject_default(srcValue) || isArguments_default(srcValue)) {
15152         newValue = objValue;
15153         if (isArguments_default(objValue)) {
15154           newValue = toPlainObject_default(objValue);
15155         } else if (!isObject_default(objValue) || isFunction_default(objValue)) {
15156           newValue = initCloneObject_default(srcValue);
15157         }
15158       } else {
15159         isCommon = false;
15160       }
15161     }
15162     if (isCommon) {
15163       stack.set(srcValue, newValue);
15164       mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
15165       stack["delete"](srcValue);
15166     }
15167     assignMergeValue_default(object, key, newValue);
15168   }
15169   var baseMergeDeep_default = baseMergeDeep;
15170
15171   // node_modules/lodash-es/_baseMerge.js
15172   function baseMerge(object, source, srcIndex, customizer, stack) {
15173     if (object === source) {
15174       return;
15175     }
15176     baseFor_default(source, function(srcValue, key) {
15177       stack || (stack = new Stack_default());
15178       if (isObject_default(srcValue)) {
15179         baseMergeDeep_default(object, source, key, srcIndex, baseMerge, customizer, stack);
15180       } else {
15181         var newValue = customizer ? customizer(safeGet_default(object, key), srcValue, key + "", object, source, stack) : void 0;
15182         if (newValue === void 0) {
15183           newValue = srcValue;
15184         }
15185         assignMergeValue_default(object, key, newValue);
15186       }
15187     }, keysIn_default);
15188   }
15189   var baseMerge_default = baseMerge;
15190
15191   // node_modules/lodash-es/last.js
15192   function last(array2) {
15193     var length2 = array2 == null ? 0 : array2.length;
15194     return length2 ? array2[length2 - 1] : void 0;
15195   }
15196   var last_default = last;
15197
15198   // node_modules/lodash-es/_escapeHtmlChar.js
15199   var htmlEscapes = {
15200     "&": "&amp;",
15201     "<": "&lt;",
15202     ">": "&gt;",
15203     '"': "&quot;",
15204     "'": "&#39;"
15205   };
15206   var escapeHtmlChar = basePropertyOf_default(htmlEscapes);
15207   var escapeHtmlChar_default = escapeHtmlChar;
15208
15209   // node_modules/lodash-es/escape.js
15210   var reUnescapedHtml = /[&<>"']/g;
15211   var reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
15212   function escape2(string) {
15213     string = toString_default(string);
15214     return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar_default) : string;
15215   }
15216   var escape_default = escape2;
15217
15218   // node_modules/lodash-es/_parent.js
15219   function parent(object, path) {
15220     return path.length < 2 ? object : baseGet_default(object, baseSlice_default(path, 0, -1));
15221   }
15222   var parent_default = parent;
15223
15224   // node_modules/lodash-es/isEmpty.js
15225   var mapTag7 = "[object Map]";
15226   var setTag7 = "[object Set]";
15227   var objectProto17 = Object.prototype;
15228   var hasOwnProperty14 = objectProto17.hasOwnProperty;
15229   function isEmpty(value) {
15230     if (value == null) {
15231       return true;
15232     }
15233     if (isArrayLike_default(value) && (isArray_default(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer_default(value) || isTypedArray_default(value) || isArguments_default(value))) {
15234       return !value.length;
15235     }
15236     var tag = getTag_default(value);
15237     if (tag == mapTag7 || tag == setTag7) {
15238       return !value.size;
15239     }
15240     if (isPrototype_default(value)) {
15241       return !baseKeys_default(value).length;
15242     }
15243     for (var key in value) {
15244       if (hasOwnProperty14.call(value, key)) {
15245         return false;
15246       }
15247     }
15248     return true;
15249   }
15250   var isEmpty_default = isEmpty;
15251
15252   // node_modules/lodash-es/isEqual.js
15253   function isEqual(value, other) {
15254     return baseIsEqual_default(value, other);
15255   }
15256   var isEqual_default = isEqual;
15257
15258   // node_modules/lodash-es/isNumber.js
15259   var numberTag5 = "[object Number]";
15260   function isNumber(value) {
15261     return typeof value == "number" || isObjectLike_default(value) && baseGetTag_default(value) == numberTag5;
15262   }
15263   var isNumber_default = isNumber;
15264
15265   // node_modules/lodash-es/merge.js
15266   var merge = createAssigner_default(function(object, source, srcIndex) {
15267     baseMerge_default(object, source, srcIndex);
15268   });
15269   var merge_default = merge;
15270
15271   // node_modules/lodash-es/_baseUnset.js
15272   function baseUnset(object, path) {
15273     path = castPath_default(path, object);
15274     object = parent_default(object, path);
15275     return object == null || delete object[toKey_default(last_default(path))];
15276   }
15277   var baseUnset_default = baseUnset;
15278
15279   // node_modules/lodash-es/_customOmitClone.js
15280   function customOmitClone(value) {
15281     return isPlainObject_default(value) ? void 0 : value;
15282   }
15283   var customOmitClone_default = customOmitClone;
15284
15285   // node_modules/lodash-es/omit.js
15286   var CLONE_DEEP_FLAG2 = 1;
15287   var CLONE_FLAT_FLAG2 = 2;
15288   var CLONE_SYMBOLS_FLAG2 = 4;
15289   var omit = flatRest_default(function(object, paths) {
15290     var result = {};
15291     if (object == null) {
15292       return result;
15293     }
15294     var isDeep = false;
15295     paths = arrayMap_default(paths, function(path) {
15296       path = castPath_default(path, object);
15297       isDeep || (isDeep = path.length > 1);
15298       return path;
15299     });
15300     copyObject_default(object, getAllKeysIn_default(object), result);
15301     if (isDeep) {
15302       result = baseClone_default(result, CLONE_DEEP_FLAG2 | CLONE_FLAT_FLAG2 | CLONE_SYMBOLS_FLAG2, customOmitClone_default);
15303     }
15304     var length2 = paths.length;
15305     while (length2--) {
15306       baseUnset_default(result, paths[length2]);
15307     }
15308     return result;
15309   });
15310   var omit_default = omit;
15311
15312   // node_modules/lodash-es/throttle.js
15313   var FUNC_ERROR_TEXT3 = "Expected a function";
15314   function throttle(func, wait, options) {
15315     var leading = true, trailing = true;
15316     if (typeof func != "function") {
15317       throw new TypeError(FUNC_ERROR_TEXT3);
15318     }
15319     if (isObject_default(options)) {
15320       leading = "leading" in options ? !!options.leading : leading;
15321       trailing = "trailing" in options ? !!options.trailing : trailing;
15322     }
15323     return debounce_default(func, wait, {
15324       "leading": leading,
15325       "maxWait": wait,
15326       "trailing": trailing
15327     });
15328   }
15329   var throttle_default = throttle;
15330
15331   // node_modules/lodash-es/_unescapeHtmlChar.js
15332   var htmlUnescapes = {
15333     "&amp;": "&",
15334     "&lt;": "<",
15335     "&gt;": ">",
15336     "&quot;": '"',
15337     "&#39;": "'"
15338   };
15339   var unescapeHtmlChar = basePropertyOf_default(htmlUnescapes);
15340   var unescapeHtmlChar_default = unescapeHtmlChar;
15341
15342   // node_modules/lodash-es/unescape.js
15343   var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
15344   var reHasEscapedHtml = RegExp(reEscapedHtml.source);
15345   function unescape(string) {
15346     string = toString_default(string);
15347     return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar_default) : string;
15348   }
15349   var unescape_default = unescape;
15350
15351   // modules/osm/tags.js
15352   var uninterestingKeys = /* @__PURE__ */ new Set([
15353     "attribution",
15354     "created_by",
15355     "import_uuid",
15356     "geobase:datasetName",
15357     "geobase:uuid",
15358     "KSJ2:curve_id",
15359     "KSJ2:lat",
15360     "KSJ2:long",
15361     "lat",
15362     "latitude",
15363     "lon",
15364     "longitude",
15365     "source",
15366     "source_ref",
15367     "odbl",
15368     "odbl:note"
15369   ]);
15370   var uninterestingKeyRegex = /^(source(_ref)?|tiger):/;
15371   function osmIsInterestingTag(key) {
15372     if (uninterestingKeys.has(key)) return false;
15373     if (uninterestingKeyRegex.test(key)) return false;
15374     return true;
15375   }
15376   var osmLifecyclePrefixes = {
15377     // nonexistent, might be built
15378     proposed: true,
15379     planned: true,
15380     // under maintenance or between groundbreaking and opening
15381     construction: true,
15382     // existent but not functional
15383     disused: true,
15384     // dilapidated to nonexistent
15385     abandoned: true,
15386     was: true,
15387     // nonexistent, still may appear in imagery
15388     dismantled: true,
15389     razed: true,
15390     demolished: true,
15391     destroyed: true,
15392     removed: true,
15393     obliterated: true,
15394     // existent occasionally, e.g. stormwater drainage basin
15395     intermittent: true
15396   };
15397   function osmRemoveLifecyclePrefix(key) {
15398     const keySegments = key.split(":");
15399     if (keySegments.length === 1) return key;
15400     if (keySegments[0] in osmLifecyclePrefixes) {
15401       return key.slice(keySegments[0].length + 1);
15402     }
15403     return key;
15404   }
15405   var osmAreaKeys = {};
15406   function osmSetAreaKeys(value) {
15407     osmAreaKeys = value;
15408   }
15409   var osmAreaKeysExceptions = {
15410     highway: {
15411       elevator: true,
15412       rest_area: true,
15413       services: true
15414     },
15415     public_transport: {
15416       platform: true
15417     },
15418     railway: {
15419       platform: true,
15420       roundhouse: true,
15421       station: true,
15422       traverser: true,
15423       turntable: true,
15424       wash: true,
15425       ventilation_shaft: true
15426     },
15427     waterway: {
15428       dam: true
15429     },
15430     amenity: {
15431       bicycle_parking: true
15432     }
15433   };
15434   function osmTagSuggestingArea(tags) {
15435     if (tags.area === "yes") return { area: "yes" };
15436     if (tags.area === "no") return null;
15437     var returnTags = {};
15438     for (var realKey in tags) {
15439       const key = osmRemoveLifecyclePrefix(realKey);
15440       if (key in osmAreaKeys && !(tags[realKey] in osmAreaKeys[key])) {
15441         returnTags[realKey] = tags[realKey];
15442         return returnTags;
15443       }
15444       if (key in osmAreaKeysExceptions && tags[realKey] in osmAreaKeysExceptions[key]) {
15445         returnTags[realKey] = tags[realKey];
15446         return returnTags;
15447       }
15448     }
15449     return null;
15450   }
15451   var osmLineTags = {};
15452   function osmSetLineTags(value) {
15453     osmLineTags = value;
15454   }
15455   var osmPointTags = {};
15456   function osmSetPointTags(value) {
15457     osmPointTags = value;
15458   }
15459   var osmVertexTags = {};
15460   function osmSetVertexTags(value) {
15461     osmVertexTags = value;
15462   }
15463   function osmNodeGeometriesForTags(nodeTags) {
15464     var geometries = {};
15465     for (var key in nodeTags) {
15466       if (osmPointTags[key] && (osmPointTags[key]["*"] || osmPointTags[key][nodeTags[key]])) {
15467         geometries.point = true;
15468       }
15469       if (osmVertexTags[key] && (osmVertexTags[key]["*"] || osmVertexTags[key][nodeTags[key]])) {
15470         geometries.vertex = true;
15471       }
15472       if (geometries.point && geometries.vertex) break;
15473     }
15474     return geometries;
15475   }
15476   var osmOneWayForwardTags = {
15477     "aerialway": {
15478       "chair_lift": true,
15479       "drag_lift": true,
15480       "j-bar": true,
15481       "magic_carpet": true,
15482       "mixed_lift": true,
15483       "platter": true,
15484       "rope_tow": true,
15485       "t-bar": true,
15486       "zip_line": true
15487     },
15488     "conveying": {
15489       "forward": true
15490     },
15491     "highway": {
15492       "motorway": true
15493     },
15494     "junction": {
15495       "circular": true,
15496       "roundabout": true
15497     },
15498     "man_made": {
15499       "goods_conveyor": true,
15500       "piste:halfpipe": true
15501     },
15502     "oneway": {
15503       "yes": true
15504     },
15505     "piste:type": {
15506       "downhill": true,
15507       "sled": true,
15508       "yes": true
15509     },
15510     "seamark:type": {
15511       "two-way_route": true,
15512       "recommended_traffic_lane": true,
15513       "separation_lane": true,
15514       "separation_roundabout": true
15515     },
15516     "waterway": {
15517       "canal": true,
15518       "ditch": true,
15519       "drain": true,
15520       "fish_pass": true,
15521       "flowline": true,
15522       "pressurised": true,
15523       "river": true,
15524       "spillway": true,
15525       "stream": true,
15526       "tidal_channel": true
15527     }
15528   };
15529   var osmOneWayBackwardTags = {
15530     "conveying": {
15531       "backward": true
15532     },
15533     "oneway": {
15534       "-1": true
15535     }
15536   };
15537   var osmOneWayBiDirectionalTags = {
15538     "conveying": {
15539       "reversible": true
15540     },
15541     "oneway": {
15542       "alternating": true,
15543       "reversible": true
15544     }
15545   };
15546   var osmOneWayTags = merge_default(
15547     osmOneWayForwardTags,
15548     osmOneWayBackwardTags,
15549     osmOneWayBiDirectionalTags
15550   );
15551   var osmPavedTags = {
15552     "surface": {
15553       "paved": true,
15554       "asphalt": true,
15555       "concrete": true,
15556       "chipseal": true,
15557       "concrete:lanes": true,
15558       "concrete:plates": true
15559     },
15560     "tracktype": {
15561       "grade1": true
15562     }
15563   };
15564   var osmSemipavedTags = {
15565     "surface": {
15566       "cobblestone": true,
15567       "cobblestone:flattened": true,
15568       "unhewn_cobblestone": true,
15569       "sett": true,
15570       "paving_stones": true,
15571       "metal": true,
15572       "wood": true
15573     }
15574   };
15575   var osmRightSideIsInsideTags = {
15576     "natural": {
15577       "cliff": true,
15578       "coastline": "coastline"
15579     },
15580     "barrier": {
15581       "retaining_wall": true,
15582       "kerb": true,
15583       "guard_rail": true,
15584       "city_wall": true
15585     },
15586     "man_made": {
15587       "embankment": true,
15588       "quay": true
15589     },
15590     "waterway": {
15591       "weir": true
15592     }
15593   };
15594   var osmRoutableHighwayTagValues = {
15595     motorway: true,
15596     trunk: true,
15597     primary: true,
15598     secondary: true,
15599     tertiary: true,
15600     residential: true,
15601     motorway_link: true,
15602     trunk_link: true,
15603     primary_link: true,
15604     secondary_link: true,
15605     tertiary_link: true,
15606     unclassified: true,
15607     road: true,
15608     service: true,
15609     track: true,
15610     living_street: true,
15611     bus_guideway: true,
15612     busway: true,
15613     path: true,
15614     footway: true,
15615     cycleway: true,
15616     bridleway: true,
15617     pedestrian: true,
15618     corridor: true,
15619     steps: true,
15620     ladder: true
15621   };
15622   var osmRoutableAerowayTags = {
15623     runway: true,
15624     taxiway: true
15625   };
15626   var osmPathHighwayTagValues = {
15627     path: true,
15628     footway: true,
15629     cycleway: true,
15630     bridleway: true,
15631     pedestrian: true,
15632     corridor: true,
15633     steps: true,
15634     ladder: true
15635   };
15636   var osmRailwayTrackTagValues = {
15637     rail: true,
15638     light_rail: true,
15639     tram: true,
15640     subway: true,
15641     monorail: true,
15642     funicular: true,
15643     miniature: true,
15644     narrow_gauge: true,
15645     disused: true,
15646     preserved: true
15647   };
15648   var osmFlowingWaterwayTagValues = {
15649     canal: true,
15650     ditch: true,
15651     drain: true,
15652     fish_pass: true,
15653     flowline: true,
15654     river: true,
15655     stream: true,
15656     tidal_channel: true
15657   };
15658   var osmLanduseTags = {
15659     "amenity": {
15660       "bicycle_parking": true,
15661       "college": true,
15662       "grave_yard": true,
15663       "hospital": true,
15664       "marketplace": true,
15665       "motorcycle_parking": true,
15666       "parking": true,
15667       "place_of_worship": true,
15668       "prison": true,
15669       "school": true,
15670       "university": true
15671     },
15672     "landuse": true,
15673     "leisure": true,
15674     "natural": true
15675   };
15676   var 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/;
15677   function isColourValid(value) {
15678     if (!value.match(/^(#([0-9a-fA-F]{3}){1,2}|\w+)$/)) {
15679       return false;
15680     }
15681     if (!CSS.supports("color", value) || ["unset", "inherit", "initial", "revert"].includes(value)) {
15682       return false;
15683     }
15684     return true;
15685   }
15686   var osmMutuallyExclusiveTagPairs = [
15687     ["noname", "name"],
15688     ["noref", "ref"],
15689     ["nohousenumber", "addr:housenumber"],
15690     ["noaddress", "addr:housenumber"],
15691     ["noaddress", "addr:housename"],
15692     ["noaddress", "addr:unit"],
15693     ["addr:nostreet", "addr:street"]
15694   ];
15695   function osmShouldRenderDirection(vertexTags, wayTags) {
15696     if (vertexTags.highway || vertexTags.traffic_sign || vertexTags.traffic_calming || vertexTags.barrier) {
15697       return !!(wayTags.highway || wayTags.railway);
15698     }
15699     if (vertexTags.railway) return !!wayTags.railway;
15700     if (vertexTags.waterway) return !!wayTags.waterway;
15701     if (vertexTags.cycleway === "asl") return !!wayTags.highway;
15702     return true;
15703   }
15704   var osmSummableTags = /* @__PURE__ */ new Set([
15705     "step_count",
15706     "parking:both:capacity",
15707     "parking:left:capacity",
15708     "parking:left:capacity"
15709   ]);
15710
15711   // modules/util/detect.js
15712   var _detected;
15713   function utilDetect(refresh2) {
15714     if (_detected && !refresh2) return _detected;
15715     _detected = {};
15716     const ua = navigator.userAgent;
15717     let m3 = null;
15718     m3 = ua.match(/(edge)\/?\s*(\.?\d+(\.\d+)*)/i);
15719     if (m3 !== null) {
15720       _detected.browser = m3[1];
15721       _detected.version = m3[2];
15722     }
15723     if (!_detected.browser) {
15724       m3 = ua.match(/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/i);
15725       if (m3 !== null) {
15726         _detected.browser = "msie";
15727         _detected.version = m3[1];
15728       }
15729     }
15730     if (!_detected.browser) {
15731       m3 = ua.match(/(opr)\/?\s*(\.?\d+(\.\d+)*)/i);
15732       if (m3 !== null) {
15733         _detected.browser = "Opera";
15734         _detected.version = m3[2];
15735       }
15736     }
15737     if (!_detected.browser) {
15738       m3 = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);
15739       if (m3 !== null) {
15740         _detected.browser = m3[1];
15741         _detected.version = m3[2];
15742         m3 = ua.match(/version\/([\.\d]+)/i);
15743         if (m3 !== null) _detected.version = m3[1];
15744       }
15745     }
15746     if (!_detected.browser) {
15747       _detected.browser = navigator.appName;
15748       _detected.version = navigator.appVersion;
15749     }
15750     _detected.version = _detected.version.split(/\W/).slice(0, 2).join(".");
15751     _detected.opera = _detected.browser.toLowerCase() === "opera" && Number(_detected.version) < 15;
15752     if (_detected.browser.toLowerCase() === "msie") {
15753       _detected.ie = true;
15754       _detected.browser = "Internet Explorer";
15755       _detected.support = false;
15756     } else {
15757       _detected.ie = false;
15758       _detected.support = true;
15759     }
15760     _detected.filedrop = window.FileReader && "ondrop" in window;
15761     if (/Win/.test(ua)) {
15762       _detected.os = "win";
15763       _detected.platform = "Windows";
15764     } else if (/Mac/.test(ua)) {
15765       _detected.os = "mac";
15766       _detected.platform = "Macintosh";
15767     } else if (/X11/.test(ua) || /Linux/.test(ua)) {
15768       _detected.os = "linux";
15769       _detected.platform = "Linux";
15770     } else {
15771       _detected.os = "win";
15772       _detected.platform = "Unknown";
15773     }
15774     _detected.isMobileWebKit = (/\b(iPad|iPhone|iPod)\b/.test(ua) || // HACK: iPadOS 13+ requests desktop sites by default by using a Mac user agent,
15775     // so assume any "mac" with multitouch is actually iOS
15776     navigator.platform === "MacIntel" && "maxTouchPoints" in navigator && navigator.maxTouchPoints > 1) && /WebKit/.test(ua) && !/Edge/.test(ua) && !window.MSStream;
15777     _detected.browserLocales = Array.from(new Set(
15778       // remove duplicates
15779       [navigator.language].concat(navigator.languages || []).concat([
15780         // old property for backwards compatibility
15781         navigator.userLanguage
15782       ]).filter(Boolean)
15783     ));
15784     let loc;
15785     try {
15786       loc = window.top.location;
15787     } catch (e3) {
15788       loc = window.location;
15789     }
15790     _detected.host = loc.origin + loc.pathname;
15791     return _detected;
15792   }
15793
15794   // modules/util/aes.js
15795   var import_aes_js = __toESM(require_aes_js(), 1);
15796   var DEFAULT_128 = [250, 157, 60, 79, 142, 134, 229, 129, 138, 126, 210, 129, 29, 71, 160, 208];
15797   function utilAesEncrypt(text, key) {
15798     key = key || DEFAULT_128;
15799     const textBytes = import_aes_js.default.utils.utf8.toBytes(text);
15800     const aesCtr = new import_aes_js.default.ModeOfOperation.ctr(key);
15801     const encryptedBytes = aesCtr.encrypt(textBytes);
15802     const encryptedHex = import_aes_js.default.utils.hex.fromBytes(encryptedBytes);
15803     return encryptedHex;
15804   }
15805   function utilAesDecrypt(encryptedHex, key) {
15806     key = key || DEFAULT_128;
15807     const encryptedBytes = import_aes_js.default.utils.hex.toBytes(encryptedHex);
15808     const aesCtr = new import_aes_js.default.ModeOfOperation.ctr(key);
15809     const decryptedBytes = aesCtr.decrypt(encryptedBytes);
15810     const text = import_aes_js.default.utils.utf8.fromBytes(decryptedBytes);
15811     return text;
15812   }
15813
15814   // modules/util/array.js
15815   function utilArrayIdentical(a2, b3) {
15816     if (a2 === b3) return true;
15817     var i3 = a2.length;
15818     if (i3 !== b3.length) return false;
15819     while (i3--) {
15820       if (a2[i3] !== b3[i3]) return false;
15821     }
15822     return true;
15823   }
15824   function utilArrayDifference(a2, b3) {
15825     var other = new Set(b3);
15826     return Array.from(new Set(a2)).filter(function(v3) {
15827       return !other.has(v3);
15828     });
15829   }
15830   function utilArrayIntersection(a2, b3) {
15831     var other = new Set(b3);
15832     return Array.from(new Set(a2)).filter(function(v3) {
15833       return other.has(v3);
15834     });
15835   }
15836   function utilArrayUnion(a2, b3) {
15837     var result = new Set(a2);
15838     b3.forEach(function(v3) {
15839       result.add(v3);
15840     });
15841     return Array.from(result);
15842   }
15843   function utilArrayUniq(a2) {
15844     return Array.from(new Set(a2));
15845   }
15846   function utilArrayChunk(a2, chunkSize) {
15847     if (!chunkSize || chunkSize < 0) return [a2.slice()];
15848     var result = new Array(Math.ceil(a2.length / chunkSize));
15849     return Array.from(result, function(item, i3) {
15850       return a2.slice(i3 * chunkSize, i3 * chunkSize + chunkSize);
15851     });
15852   }
15853   function utilArrayFlatten(a2) {
15854     return a2.reduce(function(acc, val) {
15855       return acc.concat(val);
15856     }, []);
15857   }
15858   function utilArrayGroupBy(a2, key) {
15859     return a2.reduce(function(acc, item) {
15860       var group = typeof key === "function" ? key(item) : item[key];
15861       (acc[group] = acc[group] || []).push(item);
15862       return acc;
15863     }, {});
15864   }
15865   function utilArrayUniqBy(a2, key) {
15866     var seen = /* @__PURE__ */ new Set();
15867     return a2.reduce(function(acc, item) {
15868       var val = typeof key === "function" ? key(item) : item[key];
15869       if (val && !seen.has(val)) {
15870         seen.add(val);
15871         acc.push(item);
15872       }
15873       return acc;
15874     }, []);
15875   }
15876
15877   // modules/util/util.js
15878   var import_diacritics = __toESM(require_diacritics(), 1);
15879
15880   // modules/util/svg_paths_rtl_fix.js
15881   var import_alif_toolkit = __toESM(require_lib(), 1);
15882   var rtlRegex = /[\u0590-\u05FF\u0600-\u06FF\u0750-\u07BF\u08A0–\u08BF]/;
15883   function fixRTLTextForSvg(inputText) {
15884     var ret = "", rtlBuffer = [];
15885     var arabicRegex = /[\u0600-\u06FF]/g;
15886     var arabicDiacritics = /[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06ED]/g;
15887     var arabicMath = /[\u0660-\u066C\u06F0-\u06F9]+/g;
15888     var thaanaVowel = /[\u07A6-\u07B0]/;
15889     var hebrewSign = /[\u0591-\u05bd\u05bf\u05c1-\u05c5\u05c7]/;
15890     if (arabicRegex.test(inputText)) {
15891       inputText = (0, import_alif_toolkit.WordShaper)(inputText);
15892     }
15893     for (var n3 = 0; n3 < inputText.length; n3++) {
15894       var c2 = inputText[n3];
15895       if (arabicMath.test(c2)) {
15896         ret += rtlBuffer.reverse().join("");
15897         rtlBuffer = [c2];
15898       } else {
15899         if (rtlBuffer.length && arabicMath.test(rtlBuffer[rtlBuffer.length - 1])) {
15900           ret += rtlBuffer.reverse().join("");
15901           rtlBuffer = [];
15902         }
15903         if ((thaanaVowel.test(c2) || hebrewSign.test(c2) || arabicDiacritics.test(c2)) && rtlBuffer.length) {
15904           rtlBuffer[rtlBuffer.length - 1] += c2;
15905         } else if (rtlRegex.test(c2) || c2.charCodeAt(0) >= 64336 && c2.charCodeAt(0) <= 65023 || c2.charCodeAt(0) >= 65136 && c2.charCodeAt(0) <= 65279) {
15906           rtlBuffer.push(c2);
15907         } else if (c2 === " " && rtlBuffer.length) {
15908           rtlBuffer = [rtlBuffer.reverse().join("") + " "];
15909         } else {
15910           ret += rtlBuffer.reverse().join("") + c2;
15911           rtlBuffer = [];
15912         }
15913       }
15914     }
15915     ret += rtlBuffer.reverse().join("");
15916     return ret;
15917   }
15918
15919   // modules/geo/geo.ts
15920   var TAU = 2 * Math.PI;
15921   var EQUATORIAL_RADIUS = 6378137;
15922   var POLAR_RADIUS = 63567523e-1;
15923   function geoLatToMeters(dLat) {
15924     return dLat * (TAU * POLAR_RADIUS / 360);
15925   }
15926   function geoLonToMeters(dLon, atLat) {
15927     return Math.abs(atLat) >= 90 ? 0 : dLon * (TAU * EQUATORIAL_RADIUS / 360) * Math.abs(Math.cos(atLat * (Math.PI / 180)));
15928   }
15929   function geoMetersToLat(m3) {
15930     return m3 / (TAU * POLAR_RADIUS / 360);
15931   }
15932   function geoMetersToLon(m3, atLat) {
15933     return Math.abs(atLat) >= 90 ? 0 : m3 / (TAU * EQUATORIAL_RADIUS / 360) / Math.abs(Math.cos(atLat * (Math.PI / 180)));
15934   }
15935   function geoMetersToOffset(meters, tileSize) {
15936     tileSize = tileSize || 256;
15937     return [
15938       meters[0] * tileSize / (TAU * EQUATORIAL_RADIUS),
15939       -meters[1] * tileSize / (TAU * POLAR_RADIUS)
15940     ];
15941   }
15942   function geoOffsetToMeters(offset, tileSize) {
15943     tileSize = tileSize || 256;
15944     return [
15945       offset[0] * TAU * EQUATORIAL_RADIUS / tileSize,
15946       -offset[1] * TAU * POLAR_RADIUS / tileSize
15947     ];
15948   }
15949   function geoSphericalDistance(a2, b3) {
15950     var x3 = geoLonToMeters(a2[0] - b3[0], (a2[1] + b3[1]) / 2);
15951     var y3 = geoLatToMeters(a2[1] - b3[1]);
15952     return Math.sqrt(x3 * x3 + y3 * y3);
15953   }
15954   function geoScaleToZoom(k3, tileSize) {
15955     tileSize = tileSize || 256;
15956     var log2ts = Math.log(tileSize) * Math.LOG2E;
15957     return Math.log(k3 * TAU) / Math.LN2 - log2ts;
15958   }
15959   function geoZoomToScale(z3, tileSize) {
15960     tileSize = tileSize || 256;
15961     return tileSize * Math.pow(2, z3) / TAU;
15962   }
15963   function geoSphericalClosestNode(nodes, point) {
15964     var minDistance = Infinity, distance;
15965     var indexOfMin;
15966     for (var i3 in nodes) {
15967       distance = geoSphericalDistance(nodes[i3].loc, point);
15968       if (distance < minDistance) {
15969         minDistance = distance;
15970         indexOfMin = +i3;
15971       }
15972     }
15973     if (indexOfMin !== void 0) {
15974       return { index: indexOfMin, distance: minDistance, node: nodes[indexOfMin] };
15975     } else {
15976       return null;
15977     }
15978   }
15979
15980   // modules/geo/extent.js
15981   function geoExtent(min3, max3) {
15982     if (!(this instanceof geoExtent)) {
15983       return new geoExtent(min3, max3);
15984     } else if (min3 instanceof geoExtent) {
15985       return min3;
15986     } else if (min3 && min3.length === 2 && min3[0].length === 2 && min3[1].length === 2) {
15987       this[0] = min3[0];
15988       this[1] = min3[1];
15989     } else {
15990       this[0] = min3 || [Infinity, Infinity];
15991       this[1] = max3 || min3 || [-Infinity, -Infinity];
15992     }
15993   }
15994   geoExtent.prototype = new Array(2);
15995   Object.assign(geoExtent.prototype, {
15996     equals: function(obj) {
15997       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];
15998     },
15999     extend: function(obj) {
16000       if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
16001       return geoExtent(
16002         [Math.min(obj[0][0], this[0][0]), Math.min(obj[0][1], this[0][1])],
16003         [Math.max(obj[1][0], this[1][0]), Math.max(obj[1][1], this[1][1])]
16004       );
16005     },
16006     _extend: function(extent) {
16007       this[0][0] = Math.min(extent[0][0], this[0][0]);
16008       this[0][1] = Math.min(extent[0][1], this[0][1]);
16009       this[1][0] = Math.max(extent[1][0], this[1][0]);
16010       this[1][1] = Math.max(extent[1][1], this[1][1]);
16011     },
16012     area: function() {
16013       return Math.abs((this[1][0] - this[0][0]) * (this[1][1] - this[0][1]));
16014     },
16015     center: function() {
16016       return [(this[0][0] + this[1][0]) / 2, (this[0][1] + this[1][1]) / 2];
16017     },
16018     rectangle: function() {
16019       return [this[0][0], this[0][1], this[1][0], this[1][1]];
16020     },
16021     bbox: function() {
16022       return { minX: this[0][0], minY: this[0][1], maxX: this[1][0], maxY: this[1][1] };
16023     },
16024     polygon: function() {
16025       return [
16026         [this[0][0], this[0][1]],
16027         [this[0][0], this[1][1]],
16028         [this[1][0], this[1][1]],
16029         [this[1][0], this[0][1]],
16030         [this[0][0], this[0][1]]
16031       ];
16032     },
16033     contains: function(obj) {
16034       if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
16035       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];
16036     },
16037     intersects: function(obj) {
16038       if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
16039       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];
16040     },
16041     intersection: function(obj) {
16042       if (!this.intersects(obj)) return new geoExtent();
16043       return new geoExtent(
16044         [Math.max(obj[0][0], this[0][0]), Math.max(obj[0][1], this[0][1])],
16045         [Math.min(obj[1][0], this[1][0]), Math.min(obj[1][1], this[1][1])]
16046       );
16047     },
16048     percentContainedIn: function(obj) {
16049       if (!(obj instanceof geoExtent)) obj = new geoExtent(obj);
16050       var a1 = this.intersection(obj).area();
16051       var a2 = this.area();
16052       if (a1 === Infinity || a2 === Infinity) {
16053         return 0;
16054       } else if (a1 === 0 || a2 === 0) {
16055         if (obj.contains(this)) {
16056           return 1;
16057         }
16058         return 0;
16059       } else {
16060         return a1 / a2;
16061       }
16062     },
16063     padByMeters: function(meters) {
16064       var dLat = geoMetersToLat(meters);
16065       var dLon = geoMetersToLon(meters, this.center()[1]);
16066       return geoExtent(
16067         [this[0][0] - dLon, this[0][1] - dLat],
16068         [this[1][0] + dLon, this[1][1] + dLat]
16069       );
16070     },
16071     toParam: function() {
16072       return this.rectangle().join(",");
16073     },
16074     split: function() {
16075       const center = this.center();
16076       return [
16077         geoExtent(this[0], center),
16078         geoExtent([center[0], this[0][1]], [this[1][0], center[1]]),
16079         geoExtent(center, this[1]),
16080         geoExtent([this[0][0], center[1]], [center[0], this[1][1]])
16081       ];
16082     }
16083   });
16084
16085   // modules/util/util.js
16086   function utilTagText(entity) {
16087     var obj = entity && entity.tags || {};
16088     return Object.keys(obj).map(function(k3) {
16089       return k3 + "=" + obj[k3];
16090     }).join(", ");
16091   }
16092   function utilTotalExtent(array2, graph) {
16093     var extent = geoExtent();
16094     var val, entity;
16095     for (var i3 = 0; i3 < array2.length; i3++) {
16096       val = array2[i3];
16097       entity = typeof val === "string" ? graph.hasEntity(val) : val;
16098       if (entity) {
16099         extent._extend(entity.extent(graph));
16100       }
16101     }
16102     return extent;
16103   }
16104   function utilTagDiff(oldTags, newTags) {
16105     var tagDiff = [];
16106     var keys2 = utilArrayUnion(Object.keys(oldTags), Object.keys(newTags)).sort();
16107     keys2.forEach(function(k3) {
16108       var oldVal = oldTags[k3];
16109       var newVal = newTags[k3];
16110       if ((oldVal || oldVal === "") && (newVal === void 0 || newVal !== oldVal)) {
16111         tagDiff.push({
16112           type: "-",
16113           key: k3,
16114           oldVal,
16115           newVal,
16116           display: "- " + k3 + "=" + oldVal
16117         });
16118       }
16119       if ((newVal || newVal === "") && (oldVal === void 0 || newVal !== oldVal)) {
16120         tagDiff.push({
16121           type: "+",
16122           key: k3,
16123           oldVal,
16124           newVal,
16125           display: "+ " + k3 + "=" + newVal
16126         });
16127       }
16128     });
16129     return tagDiff;
16130   }
16131   function utilEntitySelector(ids) {
16132     return ids.length ? "." + ids.join(",.") : "nothing";
16133   }
16134   function utilEntityOrMemberSelector(ids, graph) {
16135     var seen = new Set(ids);
16136     ids.forEach(collectShallowDescendants);
16137     return utilEntitySelector(Array.from(seen));
16138     function collectShallowDescendants(id2) {
16139       var entity = graph.hasEntity(id2);
16140       if (!entity || entity.type !== "relation") return;
16141       entity.members.map(function(member) {
16142         return member.id;
16143       }).forEach(function(id3) {
16144         seen.add(id3);
16145       });
16146     }
16147   }
16148   function utilEntityOrDeepMemberSelector(ids, graph) {
16149     return utilEntitySelector(utilEntityAndDeepMemberIDs(ids, graph));
16150   }
16151   function utilEntityAndDeepMemberIDs(ids, graph) {
16152     var seen = /* @__PURE__ */ new Set();
16153     ids.forEach(collectDeepDescendants);
16154     return Array.from(seen);
16155     function collectDeepDescendants(id2) {
16156       if (seen.has(id2)) return;
16157       seen.add(id2);
16158       var entity = graph.hasEntity(id2);
16159       if (!entity || entity.type !== "relation") return;
16160       entity.members.map(function(member) {
16161         return member.id;
16162       }).forEach(collectDeepDescendants);
16163     }
16164   }
16165   function utilDeepMemberSelector(ids, graph, skipMultipolgonMembers) {
16166     var idsSet = new Set(ids);
16167     var seen = /* @__PURE__ */ new Set();
16168     var returners = /* @__PURE__ */ new Set();
16169     ids.forEach(collectDeepDescendants);
16170     return utilEntitySelector(Array.from(returners));
16171     function collectDeepDescendants(id2) {
16172       if (seen.has(id2)) return;
16173       seen.add(id2);
16174       if (!idsSet.has(id2)) {
16175         returners.add(id2);
16176       }
16177       var entity = graph.hasEntity(id2);
16178       if (!entity || entity.type !== "relation") return;
16179       if (skipMultipolgonMembers && entity.isMultipolygon()) return;
16180       entity.members.map(function(member) {
16181         return member.id;
16182       }).forEach(collectDeepDescendants);
16183     }
16184   }
16185   function utilHighlightEntities(ids, highlighted, context) {
16186     context.surface().selectAll(utilEntityOrDeepMemberSelector(ids, context.graph())).classed("highlighted", highlighted);
16187   }
16188   function utilGetAllNodes(ids, graph) {
16189     var seen = /* @__PURE__ */ new Set();
16190     var nodes = /* @__PURE__ */ new Set();
16191     ids.forEach(collectNodes);
16192     return Array.from(nodes);
16193     function collectNodes(id2) {
16194       if (seen.has(id2)) return;
16195       seen.add(id2);
16196       var entity = graph.hasEntity(id2);
16197       if (!entity) return;
16198       if (entity.type === "node") {
16199         nodes.add(entity);
16200       } else if (entity.type === "way") {
16201         entity.nodes.forEach(collectNodes);
16202       } else {
16203         entity.members.map(function(member) {
16204           return member.id;
16205         }).forEach(collectNodes);
16206       }
16207     }
16208   }
16209   function utilDisplayName(entity, hideNetwork, isMapLabel) {
16210     var localizedNameKey = "name:" + _mainLocalizer.languageCode().toLowerCase();
16211     var name = entity.tags[localizedNameKey] || entity.tags.name || "";
16212     var tags = {
16213       direction: entity.tags.direction,
16214       from: entity.tags.from,
16215       name,
16216       network: hideNetwork ? void 0 : entity.tags.cycle_network || entity.tags.network,
16217       ref: entity.tags.ref,
16218       to: entity.tags.to,
16219       via: entity.tags.via
16220     };
16221     if (entity.tags.route && entity.tags.name && entity.tags.name.match(/[→⇒↔⇔]|[-=]>/)) {
16222       return entity.tags.name;
16223     }
16224     if (!entity.tags.route && name) {
16225       return name;
16226     }
16227     var keyComponents = [];
16228     if (tags.network) {
16229       keyComponents.push("network");
16230     }
16231     if (tags.ref) {
16232       keyComponents.push("ref");
16233     }
16234     if (tags.name) {
16235       keyComponents.push("name");
16236     }
16237     if (entity.tags.route) {
16238       if (tags.direction) {
16239         keyComponents.push("direction");
16240       } else if (tags.from && tags.to) {
16241         keyComponents.push("from");
16242         keyComponents.push("to");
16243         if (tags.via) {
16244           keyComponents.push("via");
16245         }
16246       }
16247     }
16248     if (keyComponents.length) {
16249       return _t("inspector.display_name." + keyComponents.join("_"), tags);
16250     }
16251     const alternativeNameKeys = [
16252       "addr:housename",
16253       "alt_name",
16254       "official_name",
16255       "loc_name",
16256       "loc_ref",
16257       "unsigned_ref",
16258       "seamark:name",
16259       "sector:name",
16260       "lock_name"
16261     ];
16262     if (entity.tags.highway === "milestone" || entity.tags.railway === "milestone") {
16263       alternativeNameKeys.push("distance", "railway:position");
16264     }
16265     for (const key of alternativeNameKeys) {
16266       if (key in entity.tags) {
16267         return entity.tags[key];
16268       }
16269     }
16270     const unit2 = entity.tags["addr:unit"];
16271     const housenumber = entity.tags["addr:housenumber"];
16272     const streetOrPlace = entity.tags["addr:street"] || entity.tags["addr:place"];
16273     if (!isMapLabel && unit2 && housenumber && streetOrPlace) {
16274       return _t("inspector.display_name_addr_with_unit", {
16275         unit: unit2,
16276         housenumber,
16277         streetOrPlace
16278       });
16279     }
16280     if (!isMapLabel && housenumber && streetOrPlace) {
16281       return _t("inspector.display_name_addr", {
16282         housenumber,
16283         streetOrPlace
16284       });
16285     }
16286     if (housenumber) return housenumber;
16287     return "";
16288   }
16289   function utilDisplayNameForPath(entity) {
16290     var name = utilDisplayName(entity, void 0, true);
16291     var isFirefox = utilDetect().browser.toLowerCase().indexOf("firefox") > -1;
16292     var isNewChromium = Number(utilDetect().version.split(".")[0]) >= 96;
16293     if (!isFirefox && !isNewChromium && name && rtlRegex.test(name)) {
16294       name = fixRTLTextForSvg(name);
16295     }
16296     return name;
16297   }
16298   function utilDisplayType(id2) {
16299     return {
16300       n: _t("inspector.node"),
16301       w: _t("inspector.way"),
16302       r: _t("inspector.relation")
16303     }[id2.charAt(0)];
16304   }
16305   function utilEntityRoot(entityType) {
16306     return {
16307       node: "n",
16308       way: "w",
16309       relation: "r"
16310     }[entityType];
16311   }
16312   function utilCombinedTags(entityIDs, graph) {
16313     var tags = {};
16314     var tagCounts = {};
16315     var allKeys = /* @__PURE__ */ new Set();
16316     var allTags = [];
16317     var entities = entityIDs.map(function(entityID) {
16318       return graph.hasEntity(entityID);
16319     }).filter(Boolean);
16320     entities.forEach(function(entity) {
16321       var keys2 = Object.keys(entity.tags).filter(Boolean);
16322       keys2.forEach(function(key2) {
16323         allKeys.add(key2);
16324       });
16325     });
16326     entities.forEach(function(entity) {
16327       allTags.push(entity.tags);
16328       allKeys.forEach(function(key2) {
16329         var value = entity.tags[key2];
16330         if (!tags.hasOwnProperty(key2)) {
16331           tags[key2] = value;
16332         } else {
16333           if (!Array.isArray(tags[key2])) {
16334             if (tags[key2] !== value) {
16335               tags[key2] = [tags[key2], value];
16336             }
16337           } else {
16338             if (tags[key2].indexOf(value) === -1) {
16339               tags[key2].push(value);
16340             }
16341           }
16342         }
16343         var tagHash = key2 + "=" + value;
16344         if (!tagCounts[tagHash]) tagCounts[tagHash] = 0;
16345         tagCounts[tagHash] += 1;
16346       });
16347     });
16348     for (var key in tags) {
16349       if (!Array.isArray(tags[key])) continue;
16350       tags[key] = tags[key].sort(function(val12, val2) {
16351         var key2 = key2;
16352         var count2 = tagCounts[key2 + "=" + val2];
16353         var count1 = tagCounts[key2 + "=" + val12];
16354         if (count2 !== count1) {
16355           return count2 - count1;
16356         }
16357         if (val2 && val12) {
16358           return val12.localeCompare(val2);
16359         }
16360         return val12 ? 1 : -1;
16361       });
16362     }
16363     tags = Object.defineProperty(tags, Symbol.for("allTags"), { enumerable: false, value: allTags });
16364     return tags;
16365   }
16366   function utilStringQs(str) {
16367     str = str.replace(/^[#?]{0,2}/, "");
16368     return Object.fromEntries(new URLSearchParams(str));
16369   }
16370   function utilQsString(obj, softEncode) {
16371     let str = new URLSearchParams(obj).toString();
16372     if (softEncode) {
16373       str = str.replace(/(%2F|%3A|%2C|%7B|%7D)/g, decodeURIComponent);
16374     }
16375     return str;
16376   }
16377   function utilPrefixDOMProperty(property) {
16378     var prefixes2 = ["webkit", "ms", "moz", "o"];
16379     var i3 = -1;
16380     var n3 = prefixes2.length;
16381     var s2 = document.body;
16382     if (property in s2) return property;
16383     property = property.slice(0, 1).toUpperCase() + property.slice(1);
16384     while (++i3 < n3) {
16385       if (prefixes2[i3] + property in s2) {
16386         return prefixes2[i3] + property;
16387       }
16388     }
16389     return false;
16390   }
16391   function utilPrefixCSSProperty(property) {
16392     var prefixes2 = ["webkit", "ms", "Moz", "O"];
16393     var i3 = -1;
16394     var n3 = prefixes2.length;
16395     var s2 = document.body.style;
16396     if (property.toLowerCase() in s2) {
16397       return property.toLowerCase();
16398     }
16399     while (++i3 < n3) {
16400       if (prefixes2[i3] + property in s2) {
16401         return "-" + prefixes2[i3].toLowerCase() + property.replace(/([A-Z])/g, "-$1").toLowerCase();
16402       }
16403     }
16404     return false;
16405   }
16406   var transformProperty;
16407   function utilSetTransform(el, x3, y3, scale) {
16408     var prop = transformProperty = transformProperty || utilPrefixCSSProperty("Transform");
16409     var translate = utilDetect().opera ? "translate(" + x3 + "px," + y3 + "px)" : "translate3d(" + x3 + "px," + y3 + "px,0)";
16410     return el.style(prop, translate + (scale ? " scale(" + scale + ")" : ""));
16411   }
16412   function utilEditDistance(a2, b3) {
16413     a2 = (0, import_diacritics.remove)(a2.toLowerCase());
16414     b3 = (0, import_diacritics.remove)(b3.toLowerCase());
16415     if (a2.length === 0) return b3.length;
16416     if (b3.length === 0) return a2.length;
16417     var matrix = [];
16418     var i3, j3;
16419     for (i3 = 0; i3 <= b3.length; i3++) {
16420       matrix[i3] = [i3];
16421     }
16422     for (j3 = 0; j3 <= a2.length; j3++) {
16423       matrix[0][j3] = j3;
16424     }
16425     for (i3 = 1; i3 <= b3.length; i3++) {
16426       for (j3 = 1; j3 <= a2.length; j3++) {
16427         if (b3.charAt(i3 - 1) === a2.charAt(j3 - 1)) {
16428           matrix[i3][j3] = matrix[i3 - 1][j3 - 1];
16429         } else {
16430           matrix[i3][j3] = Math.min(
16431             matrix[i3 - 1][j3 - 1] + 1,
16432             // substitution
16433             Math.min(
16434               matrix[i3][j3 - 1] + 1,
16435               // insertion
16436               matrix[i3 - 1][j3] + 1
16437             )
16438           );
16439         }
16440       }
16441     }
16442     return matrix[b3.length][a2.length];
16443   }
16444   function utilFastMouse(container) {
16445     var rect = container.getBoundingClientRect();
16446     var rectLeft = rect.left;
16447     var rectTop = rect.top;
16448     var clientLeft = +container.clientLeft;
16449     var clientTop = +container.clientTop;
16450     return function(e3) {
16451       return [
16452         e3.clientX - rectLeft - clientLeft,
16453         e3.clientY - rectTop - clientTop
16454       ];
16455     };
16456   }
16457   function utilAsyncMap(inputs, func, callback) {
16458     var remaining = inputs.length;
16459     var results = [];
16460     var errors = [];
16461     inputs.forEach(function(d2, i3) {
16462       func(d2, function done(err, data) {
16463         errors[i3] = err;
16464         results[i3] = data;
16465         remaining--;
16466         if (!remaining) callback(errors, results);
16467       });
16468     });
16469   }
16470   function utilWrap(index, length2) {
16471     if (index < 0) {
16472       index += Math.ceil(-index / length2) * length2;
16473     }
16474     return index % length2;
16475   }
16476   function utilFunctor(value) {
16477     if (typeof value === "function") return value;
16478     return function() {
16479       return value;
16480     };
16481   }
16482   function utilNoAuto(selection2) {
16483     var isText = selection2.size() && selection2.node().tagName.toLowerCase() === "textarea";
16484     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");
16485   }
16486   function utilHashcode(str) {
16487     var hash2 = 0;
16488     if (str.length === 0) {
16489       return hash2;
16490     }
16491     for (var i3 = 0; i3 < str.length; i3++) {
16492       var char = str.charCodeAt(i3);
16493       hash2 = (hash2 << 5) - hash2 + char;
16494       hash2 = hash2 & hash2;
16495     }
16496     return hash2;
16497   }
16498   function utilSafeClassName(str) {
16499     return str.toLowerCase().replace(/[^a-z0-9]+/g, "_");
16500   }
16501   function utilUniqueDomId(val) {
16502     return "ideditor-" + utilSafeClassName(val.toString()) + "-" + (/* @__PURE__ */ new Date()).getTime().toString();
16503   }
16504   function utilUnicodeCharsCount(str) {
16505     return Array.from(str).length;
16506   }
16507   function utilUnicodeCharsTruncated(str, limit) {
16508     return Array.from(str).slice(0, limit).join("");
16509   }
16510   function toNumericID(id2) {
16511     var match = id2.match(/^[cnwr](-?\d+)$/);
16512     if (match) {
16513       return parseInt(match[1], 10);
16514     }
16515     return NaN;
16516   }
16517   function compareNumericIDs(left, right) {
16518     if (isNaN(left) && isNaN(right)) return -1;
16519     if (isNaN(left)) return 1;
16520     if (isNaN(right)) return -1;
16521     if (Math.sign(left) !== Math.sign(right)) return -Math.sign(left);
16522     if (Math.sign(left) < 0) return Math.sign(right - left);
16523     return Math.sign(left - right);
16524   }
16525   function utilCompareIDs(left, right) {
16526     return compareNumericIDs(toNumericID(left), toNumericID(right));
16527   }
16528   function utilOldestID(ids) {
16529     if (ids.length === 0) {
16530       return void 0;
16531     }
16532     var oldestIDIndex = 0;
16533     var oldestID = toNumericID(ids[0]);
16534     for (var i3 = 1; i3 < ids.length; i3++) {
16535       var num = toNumericID(ids[i3]);
16536       if (compareNumericIDs(oldestID, num) === 1) {
16537         oldestIDIndex = i3;
16538         oldestID = num;
16539       }
16540     }
16541     return ids[oldestIDIndex];
16542   }
16543   function utilCleanOsmString(val, maxChars) {
16544     if (val === void 0 || val === null) {
16545       val = "";
16546     } else {
16547       val = val.toString();
16548     }
16549     val = val.trim();
16550     if (val.normalize) val = val.normalize("NFC");
16551     return utilUnicodeCharsTruncated(val, maxChars);
16552   }
16553   function utilGzip(input) {
16554     if (!globalThis.CompressionStream) return void 0;
16555     try {
16556       const stream = new Response(input).body.pipeThrough(
16557         new CompressionStream("gzip")
16558       );
16559       return new Response(stream).blob();
16560     } catch (e3) {
16561       return void 0;
16562     }
16563   }
16564
16565   // modules/util/clean_tags.js
16566   function utilCleanTags(tags) {
16567     var out = {};
16568     for (var k3 in tags) {
16569       if (!k3) continue;
16570       var v3 = tags[k3];
16571       if (v3 !== void 0) {
16572         out[k3] = cleanValue(k3, v3);
16573       }
16574     }
16575     return out;
16576     function cleanValue(k4, v4) {
16577       function keepSpaces(k5) {
16578         return /_hours|_times|:conditional$/.test(k5);
16579       }
16580       function skip(k5) {
16581         return /^(description|note|fixme|inscription)(:.+)?$/.test(k5);
16582       }
16583       if (skip(k4)) return v4;
16584       var cleaned = v4.split(";").map(function(s2) {
16585         return s2.trim();
16586       }).join(keepSpaces(k4) ? "; " : ";");
16587       if (k4.indexOf("website") !== -1 || k4.indexOf("email") !== -1 || cleaned.indexOf("http") === 0) {
16588         cleaned = cleaned.replace(/[\u200B-\u200F\uFEFF]/g, "");
16589       }
16590       return cleaned;
16591     }
16592   }
16593
16594   // modules/util/get_set_value.js
16595   function utilGetSetValue(selection2, value, shouldUpdate) {
16596     function setValue(value2, shouldUpdate2) {
16597       function valueNull() {
16598         delete this.value;
16599       }
16600       function valueConstant() {
16601         if (shouldUpdate2(this.value, value2)) {
16602           this.value = value2;
16603         }
16604       }
16605       function valueFunction() {
16606         var x3 = value2.apply(this, arguments);
16607         if (x3 === null) {
16608           return;
16609         } else if (x3 === void 0) {
16610           this.value = "";
16611         } else if (shouldUpdate2(this.value, x3)) {
16612           this.value = x3;
16613         }
16614       }
16615       return value2 === null || value2 === void 0 ? valueNull : typeof value2 === "function" ? valueFunction : valueConstant;
16616     }
16617     if (arguments.length === 1) {
16618       return selection2.property("value");
16619     }
16620     if (shouldUpdate === void 0) {
16621       shouldUpdate = (a2, b3) => a2 !== b3;
16622     }
16623     return selection2.each(setValue(value, shouldUpdate));
16624   }
16625
16626   // node_modules/d3-selection/src/namespaces.js
16627   var xhtml = "http://www.w3.org/1999/xhtml";
16628   var namespaces_default = {
16629     svg: "http://www.w3.org/2000/svg",
16630     xhtml,
16631     xlink: "http://www.w3.org/1999/xlink",
16632     xml: "http://www.w3.org/XML/1998/namespace",
16633     xmlns: "http://www.w3.org/2000/xmlns/"
16634   };
16635
16636   // node_modules/d3-selection/src/namespace.js
16637   function namespace_default(name) {
16638     var prefix = name += "", i3 = prefix.indexOf(":");
16639     if (i3 >= 0 && (prefix = name.slice(0, i3)) !== "xmlns") name = name.slice(i3 + 1);
16640     return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name;
16641   }
16642
16643   // node_modules/d3-selection/src/creator.js
16644   function creatorInherit(name) {
16645     return function() {
16646       var document2 = this.ownerDocument, uri = this.namespaceURI;
16647       return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
16648     };
16649   }
16650   function creatorFixed(fullname) {
16651     return function() {
16652       return this.ownerDocument.createElementNS(fullname.space, fullname.local);
16653     };
16654   }
16655   function creator_default(name) {
16656     var fullname = namespace_default(name);
16657     return (fullname.local ? creatorFixed : creatorInherit)(fullname);
16658   }
16659
16660   // node_modules/d3-selection/src/selector.js
16661   function none() {
16662   }
16663   function selector_default(selector) {
16664     return selector == null ? none : function() {
16665       return this.querySelector(selector);
16666     };
16667   }
16668
16669   // node_modules/d3-selection/src/selection/select.js
16670   function select_default(select) {
16671     if (typeof select !== "function") select = selector_default(select);
16672     for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
16673       for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = new Array(n3), node, subnode, i3 = 0; i3 < n3; ++i3) {
16674         if ((node = group[i3]) && (subnode = select.call(node, node.__data__, i3, group))) {
16675           if ("__data__" in node) subnode.__data__ = node.__data__;
16676           subgroup[i3] = subnode;
16677         }
16678       }
16679     }
16680     return new Selection(subgroups, this._parents);
16681   }
16682
16683   // node_modules/d3-selection/src/array.js
16684   function array(x3) {
16685     return x3 == null ? [] : Array.isArray(x3) ? x3 : Array.from(x3);
16686   }
16687
16688   // node_modules/d3-selection/src/selectorAll.js
16689   function empty() {
16690     return [];
16691   }
16692   function selectorAll_default(selector) {
16693     return selector == null ? empty : function() {
16694       return this.querySelectorAll(selector);
16695     };
16696   }
16697
16698   // node_modules/d3-selection/src/selection/selectAll.js
16699   function arrayAll(select) {
16700     return function() {
16701       return array(select.apply(this, arguments));
16702     };
16703   }
16704   function selectAll_default(select) {
16705     if (typeof select === "function") select = arrayAll(select);
16706     else select = selectorAll_default(select);
16707     for (var groups = this._groups, m3 = groups.length, subgroups = [], parents = [], j3 = 0; j3 < m3; ++j3) {
16708       for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
16709         if (node = group[i3]) {
16710           subgroups.push(select.call(node, node.__data__, i3, group));
16711           parents.push(node);
16712         }
16713       }
16714     }
16715     return new Selection(subgroups, parents);
16716   }
16717
16718   // node_modules/d3-selection/src/matcher.js
16719   function matcher_default(selector) {
16720     return function() {
16721       return this.matches(selector);
16722     };
16723   }
16724   function childMatcher(selector) {
16725     return function(node) {
16726       return node.matches(selector);
16727     };
16728   }
16729
16730   // node_modules/d3-selection/src/selection/selectChild.js
16731   var find = Array.prototype.find;
16732   function childFind(match) {
16733     return function() {
16734       return find.call(this.children, match);
16735     };
16736   }
16737   function childFirst() {
16738     return this.firstElementChild;
16739   }
16740   function selectChild_default(match) {
16741     return this.select(match == null ? childFirst : childFind(typeof match === "function" ? match : childMatcher(match)));
16742   }
16743
16744   // node_modules/d3-selection/src/selection/selectChildren.js
16745   var filter = Array.prototype.filter;
16746   function children() {
16747     return Array.from(this.children);
16748   }
16749   function childrenFilter(match) {
16750     return function() {
16751       return filter.call(this.children, match);
16752     };
16753   }
16754   function selectChildren_default(match) {
16755     return this.selectAll(match == null ? children : childrenFilter(typeof match === "function" ? match : childMatcher(match)));
16756   }
16757
16758   // node_modules/d3-selection/src/selection/filter.js
16759   function filter_default(match) {
16760     if (typeof match !== "function") match = matcher_default(match);
16761     for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
16762       for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = [], node, i3 = 0; i3 < n3; ++i3) {
16763         if ((node = group[i3]) && match.call(node, node.__data__, i3, group)) {
16764           subgroup.push(node);
16765         }
16766       }
16767     }
16768     return new Selection(subgroups, this._parents);
16769   }
16770
16771   // node_modules/d3-selection/src/selection/sparse.js
16772   function sparse_default(update) {
16773     return new Array(update.length);
16774   }
16775
16776   // node_modules/d3-selection/src/selection/enter.js
16777   function enter_default() {
16778     return new Selection(this._enter || this._groups.map(sparse_default), this._parents);
16779   }
16780   function EnterNode(parent2, datum2) {
16781     this.ownerDocument = parent2.ownerDocument;
16782     this.namespaceURI = parent2.namespaceURI;
16783     this._next = null;
16784     this._parent = parent2;
16785     this.__data__ = datum2;
16786   }
16787   EnterNode.prototype = {
16788     constructor: EnterNode,
16789     appendChild: function(child) {
16790       return this._parent.insertBefore(child, this._next);
16791     },
16792     insertBefore: function(child, next) {
16793       return this._parent.insertBefore(child, next);
16794     },
16795     querySelector: function(selector) {
16796       return this._parent.querySelector(selector);
16797     },
16798     querySelectorAll: function(selector) {
16799       return this._parent.querySelectorAll(selector);
16800     }
16801   };
16802
16803   // node_modules/d3-selection/src/constant.js
16804   function constant_default3(x3) {
16805     return function() {
16806       return x3;
16807     };
16808   }
16809
16810   // node_modules/d3-selection/src/selection/data.js
16811   function bindIndex(parent2, group, enter, update, exit, data) {
16812     var i3 = 0, node, groupLength = group.length, dataLength = data.length;
16813     for (; i3 < dataLength; ++i3) {
16814       if (node = group[i3]) {
16815         node.__data__ = data[i3];
16816         update[i3] = node;
16817       } else {
16818         enter[i3] = new EnterNode(parent2, data[i3]);
16819       }
16820     }
16821     for (; i3 < groupLength; ++i3) {
16822       if (node = group[i3]) {
16823         exit[i3] = node;
16824       }
16825     }
16826   }
16827   function bindKey(parent2, group, enter, update, exit, data, key) {
16828     var i3, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
16829     for (i3 = 0; i3 < groupLength; ++i3) {
16830       if (node = group[i3]) {
16831         keyValues[i3] = keyValue = key.call(node, node.__data__, i3, group) + "";
16832         if (nodeByKeyValue.has(keyValue)) {
16833           exit[i3] = node;
16834         } else {
16835           nodeByKeyValue.set(keyValue, node);
16836         }
16837       }
16838     }
16839     for (i3 = 0; i3 < dataLength; ++i3) {
16840       keyValue = key.call(parent2, data[i3], i3, data) + "";
16841       if (node = nodeByKeyValue.get(keyValue)) {
16842         update[i3] = node;
16843         node.__data__ = data[i3];
16844         nodeByKeyValue.delete(keyValue);
16845       } else {
16846         enter[i3] = new EnterNode(parent2, data[i3]);
16847       }
16848     }
16849     for (i3 = 0; i3 < groupLength; ++i3) {
16850       if ((node = group[i3]) && nodeByKeyValue.get(keyValues[i3]) === node) {
16851         exit[i3] = node;
16852       }
16853     }
16854   }
16855   function datum(node) {
16856     return node.__data__;
16857   }
16858   function data_default(value, key) {
16859     if (!arguments.length) return Array.from(this, datum);
16860     var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
16861     if (typeof value !== "function") value = constant_default3(value);
16862     for (var m3 = groups.length, update = new Array(m3), enter = new Array(m3), exit = new Array(m3), j3 = 0; j3 < m3; ++j3) {
16863       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);
16864       bind(parent2, group, enterGroup, updateGroup, exitGroup, data, key);
16865       for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
16866         if (previous = enterGroup[i0]) {
16867           if (i0 >= i1) i1 = i0 + 1;
16868           while (!(next = updateGroup[i1]) && ++i1 < dataLength) ;
16869           previous._next = next || null;
16870         }
16871       }
16872     }
16873     update = new Selection(update, parents);
16874     update._enter = enter;
16875     update._exit = exit;
16876     return update;
16877   }
16878   function arraylike(data) {
16879     return typeof data === "object" && "length" in data ? data : Array.from(data);
16880   }
16881
16882   // node_modules/d3-selection/src/selection/exit.js
16883   function exit_default() {
16884     return new Selection(this._exit || this._groups.map(sparse_default), this._parents);
16885   }
16886
16887   // node_modules/d3-selection/src/selection/join.js
16888   function join_default(onenter, onupdate, onexit) {
16889     var enter = this.enter(), update = this, exit = this.exit();
16890     if (typeof onenter === "function") {
16891       enter = onenter(enter);
16892       if (enter) enter = enter.selection();
16893     } else {
16894       enter = enter.append(onenter + "");
16895     }
16896     if (onupdate != null) {
16897       update = onupdate(update);
16898       if (update) update = update.selection();
16899     }
16900     if (onexit == null) exit.remove();
16901     else onexit(exit);
16902     return enter && update ? enter.merge(update).order() : update;
16903   }
16904
16905   // node_modules/d3-selection/src/selection/merge.js
16906   function merge_default2(context) {
16907     var selection2 = context.selection ? context.selection() : context;
16908     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) {
16909       for (var group0 = groups0[j3], group1 = groups1[j3], n3 = group0.length, merge3 = merges[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
16910         if (node = group0[i3] || group1[i3]) {
16911           merge3[i3] = node;
16912         }
16913       }
16914     }
16915     for (; j3 < m0; ++j3) {
16916       merges[j3] = groups0[j3];
16917     }
16918     return new Selection(merges, this._parents);
16919   }
16920
16921   // node_modules/d3-selection/src/selection/order.js
16922   function order_default() {
16923     for (var groups = this._groups, j3 = -1, m3 = groups.length; ++j3 < m3; ) {
16924       for (var group = groups[j3], i3 = group.length - 1, next = group[i3], node; --i3 >= 0; ) {
16925         if (node = group[i3]) {
16926           if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
16927           next = node;
16928         }
16929       }
16930     }
16931     return this;
16932   }
16933
16934   // node_modules/d3-selection/src/selection/sort.js
16935   function sort_default(compare2) {
16936     if (!compare2) compare2 = ascending;
16937     function compareNode(a2, b3) {
16938       return a2 && b3 ? compare2(a2.__data__, b3.__data__) : !a2 - !b3;
16939     }
16940     for (var groups = this._groups, m3 = groups.length, sortgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
16941       for (var group = groups[j3], n3 = group.length, sortgroup = sortgroups[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
16942         if (node = group[i3]) {
16943           sortgroup[i3] = node;
16944         }
16945       }
16946       sortgroup.sort(compareNode);
16947     }
16948     return new Selection(sortgroups, this._parents).order();
16949   }
16950   function ascending(a2, b3) {
16951     return a2 < b3 ? -1 : a2 > b3 ? 1 : a2 >= b3 ? 0 : NaN;
16952   }
16953
16954   // node_modules/d3-selection/src/selection/call.js
16955   function call_default() {
16956     var callback = arguments[0];
16957     arguments[0] = this;
16958     callback.apply(null, arguments);
16959     return this;
16960   }
16961
16962   // node_modules/d3-selection/src/selection/nodes.js
16963   function nodes_default() {
16964     return Array.from(this);
16965   }
16966
16967   // node_modules/d3-selection/src/selection/node.js
16968   function node_default() {
16969     for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
16970       for (var group = groups[j3], i3 = 0, n3 = group.length; i3 < n3; ++i3) {
16971         var node = group[i3];
16972         if (node) return node;
16973       }
16974     }
16975     return null;
16976   }
16977
16978   // node_modules/d3-selection/src/selection/size.js
16979   function size_default() {
16980     let size = 0;
16981     for (const node of this) ++size;
16982     return size;
16983   }
16984
16985   // node_modules/d3-selection/src/selection/empty.js
16986   function empty_default() {
16987     return !this.node();
16988   }
16989
16990   // node_modules/d3-selection/src/selection/each.js
16991   function each_default(callback) {
16992     for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
16993       for (var group = groups[j3], i3 = 0, n3 = group.length, node; i3 < n3; ++i3) {
16994         if (node = group[i3]) callback.call(node, node.__data__, i3, group);
16995       }
16996     }
16997     return this;
16998   }
16999
17000   // node_modules/d3-selection/src/selection/attr.js
17001   function attrRemove(name) {
17002     return function() {
17003       this.removeAttribute(name);
17004     };
17005   }
17006   function attrRemoveNS(fullname) {
17007     return function() {
17008       this.removeAttributeNS(fullname.space, fullname.local);
17009     };
17010   }
17011   function attrConstant(name, value) {
17012     return function() {
17013       this.setAttribute(name, value);
17014     };
17015   }
17016   function attrConstantNS(fullname, value) {
17017     return function() {
17018       this.setAttributeNS(fullname.space, fullname.local, value);
17019     };
17020   }
17021   function attrFunction(name, value) {
17022     return function() {
17023       var v3 = value.apply(this, arguments);
17024       if (v3 == null) this.removeAttribute(name);
17025       else this.setAttribute(name, v3);
17026     };
17027   }
17028   function attrFunctionNS(fullname, value) {
17029     return function() {
17030       var v3 = value.apply(this, arguments);
17031       if (v3 == null) this.removeAttributeNS(fullname.space, fullname.local);
17032       else this.setAttributeNS(fullname.space, fullname.local, v3);
17033     };
17034   }
17035   function attr_default(name, value) {
17036     var fullname = namespace_default(name);
17037     if (arguments.length < 2) {
17038       var node = this.node();
17039       return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
17040     }
17041     return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
17042   }
17043
17044   // node_modules/d3-selection/src/window.js
17045   function window_default(node) {
17046     return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
17047   }
17048
17049   // node_modules/d3-selection/src/selection/style.js
17050   function styleRemove(name) {
17051     return function() {
17052       this.style.removeProperty(name);
17053     };
17054   }
17055   function styleConstant(name, value, priority) {
17056     return function() {
17057       this.style.setProperty(name, value, priority);
17058     };
17059   }
17060   function styleFunction(name, value, priority) {
17061     return function() {
17062       var v3 = value.apply(this, arguments);
17063       if (v3 == null) this.style.removeProperty(name);
17064       else this.style.setProperty(name, v3, priority);
17065     };
17066   }
17067   function style_default(name, value, priority) {
17068     return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
17069   }
17070   function styleValue(node, name) {
17071     return node.style.getPropertyValue(name) || window_default(node).getComputedStyle(node, null).getPropertyValue(name);
17072   }
17073
17074   // node_modules/d3-selection/src/selection/property.js
17075   function propertyRemove(name) {
17076     return function() {
17077       delete this[name];
17078     };
17079   }
17080   function propertyConstant(name, value) {
17081     return function() {
17082       this[name] = value;
17083     };
17084   }
17085   function propertyFunction(name, value) {
17086     return function() {
17087       var v3 = value.apply(this, arguments);
17088       if (v3 == null) delete this[name];
17089       else this[name] = v3;
17090     };
17091   }
17092   function property_default(name, value) {
17093     return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
17094   }
17095
17096   // node_modules/d3-selection/src/selection/classed.js
17097   function classArray(string) {
17098     return string.trim().split(/^|\s+/);
17099   }
17100   function classList(node) {
17101     return node.classList || new ClassList(node);
17102   }
17103   function ClassList(node) {
17104     this._node = node;
17105     this._names = classArray(node.getAttribute("class") || "");
17106   }
17107   ClassList.prototype = {
17108     add: function(name) {
17109       var i3 = this._names.indexOf(name);
17110       if (i3 < 0) {
17111         this._names.push(name);
17112         this._node.setAttribute("class", this._names.join(" "));
17113       }
17114     },
17115     remove: function(name) {
17116       var i3 = this._names.indexOf(name);
17117       if (i3 >= 0) {
17118         this._names.splice(i3, 1);
17119         this._node.setAttribute("class", this._names.join(" "));
17120       }
17121     },
17122     contains: function(name) {
17123       return this._names.indexOf(name) >= 0;
17124     }
17125   };
17126   function classedAdd(node, names) {
17127     var list = classList(node), i3 = -1, n3 = names.length;
17128     while (++i3 < n3) list.add(names[i3]);
17129   }
17130   function classedRemove(node, names) {
17131     var list = classList(node), i3 = -1, n3 = names.length;
17132     while (++i3 < n3) list.remove(names[i3]);
17133   }
17134   function classedTrue(names) {
17135     return function() {
17136       classedAdd(this, names);
17137     };
17138   }
17139   function classedFalse(names) {
17140     return function() {
17141       classedRemove(this, names);
17142     };
17143   }
17144   function classedFunction(names, value) {
17145     return function() {
17146       (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
17147     };
17148   }
17149   function classed_default(name, value) {
17150     var names = classArray(name + "");
17151     if (arguments.length < 2) {
17152       var list = classList(this.node()), i3 = -1, n3 = names.length;
17153       while (++i3 < n3) if (!list.contains(names[i3])) return false;
17154       return true;
17155     }
17156     return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
17157   }
17158
17159   // node_modules/d3-selection/src/selection/text.js
17160   function textRemove() {
17161     this.textContent = "";
17162   }
17163   function textConstant(value) {
17164     return function() {
17165       this.textContent = value;
17166     };
17167   }
17168   function textFunction(value) {
17169     return function() {
17170       var v3 = value.apply(this, arguments);
17171       this.textContent = v3 == null ? "" : v3;
17172     };
17173   }
17174   function text_default(value) {
17175     return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
17176   }
17177
17178   // node_modules/d3-selection/src/selection/html.js
17179   function htmlRemove() {
17180     this.innerHTML = "";
17181   }
17182   function htmlConstant(value) {
17183     return function() {
17184       this.innerHTML = value;
17185     };
17186   }
17187   function htmlFunction(value) {
17188     return function() {
17189       var v3 = value.apply(this, arguments);
17190       this.innerHTML = v3 == null ? "" : v3;
17191     };
17192   }
17193   function html_default(value) {
17194     return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
17195   }
17196
17197   // node_modules/d3-selection/src/selection/raise.js
17198   function raise() {
17199     if (this.nextSibling) this.parentNode.appendChild(this);
17200   }
17201   function raise_default() {
17202     return this.each(raise);
17203   }
17204
17205   // node_modules/d3-selection/src/selection/lower.js
17206   function lower() {
17207     if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
17208   }
17209   function lower_default() {
17210     return this.each(lower);
17211   }
17212
17213   // node_modules/d3-selection/src/selection/append.js
17214   function append_default(name) {
17215     var create2 = typeof name === "function" ? name : creator_default(name);
17216     return this.select(function() {
17217       return this.appendChild(create2.apply(this, arguments));
17218     });
17219   }
17220
17221   // node_modules/d3-selection/src/selection/insert.js
17222   function constantNull() {
17223     return null;
17224   }
17225   function insert_default(name, before) {
17226     var create2 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before);
17227     return this.select(function() {
17228       return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null);
17229     });
17230   }
17231
17232   // node_modules/d3-selection/src/selection/remove.js
17233   function remove() {
17234     var parent2 = this.parentNode;
17235     if (parent2) parent2.removeChild(this);
17236   }
17237   function remove_default() {
17238     return this.each(remove);
17239   }
17240
17241   // node_modules/d3-selection/src/selection/clone.js
17242   function selection_cloneShallow() {
17243     var clone2 = this.cloneNode(false), parent2 = this.parentNode;
17244     return parent2 ? parent2.insertBefore(clone2, this.nextSibling) : clone2;
17245   }
17246   function selection_cloneDeep() {
17247     var clone2 = this.cloneNode(true), parent2 = this.parentNode;
17248     return parent2 ? parent2.insertBefore(clone2, this.nextSibling) : clone2;
17249   }
17250   function clone_default(deep) {
17251     return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
17252   }
17253
17254   // node_modules/d3-selection/src/selection/datum.js
17255   function datum_default(value) {
17256     return arguments.length ? this.property("__data__", value) : this.node().__data__;
17257   }
17258
17259   // node_modules/d3-selection/src/selection/on.js
17260   function contextListener(listener) {
17261     return function(event) {
17262       listener.call(this, event, this.__data__);
17263     };
17264   }
17265   function parseTypenames2(typenames) {
17266     return typenames.trim().split(/^|\s+/).map(function(t2) {
17267       var name = "", i3 = t2.indexOf(".");
17268       if (i3 >= 0) name = t2.slice(i3 + 1), t2 = t2.slice(0, i3);
17269       return { type: t2, name };
17270     });
17271   }
17272   function onRemove(typename) {
17273     return function() {
17274       var on = this.__on;
17275       if (!on) return;
17276       for (var j3 = 0, i3 = -1, m3 = on.length, o2; j3 < m3; ++j3) {
17277         if (o2 = on[j3], (!typename.type || o2.type === typename.type) && o2.name === typename.name) {
17278           this.removeEventListener(o2.type, o2.listener, o2.options);
17279         } else {
17280           on[++i3] = o2;
17281         }
17282       }
17283       if (++i3) on.length = i3;
17284       else delete this.__on;
17285     };
17286   }
17287   function onAdd(typename, value, options) {
17288     return function() {
17289       var on = this.__on, o2, listener = contextListener(value);
17290       if (on) for (var j3 = 0, m3 = on.length; j3 < m3; ++j3) {
17291         if ((o2 = on[j3]).type === typename.type && o2.name === typename.name) {
17292           this.removeEventListener(o2.type, o2.listener, o2.options);
17293           this.addEventListener(o2.type, o2.listener = listener, o2.options = options);
17294           o2.value = value;
17295           return;
17296         }
17297       }
17298       this.addEventListener(typename.type, listener, options);
17299       o2 = { type: typename.type, name: typename.name, value, listener, options };
17300       if (!on) this.__on = [o2];
17301       else on.push(o2);
17302     };
17303   }
17304   function on_default(typename, value, options) {
17305     var typenames = parseTypenames2(typename + ""), i3, n3 = typenames.length, t2;
17306     if (arguments.length < 2) {
17307       var on = this.node().__on;
17308       if (on) for (var j3 = 0, m3 = on.length, o2; j3 < m3; ++j3) {
17309         for (i3 = 0, o2 = on[j3]; i3 < n3; ++i3) {
17310           if ((t2 = typenames[i3]).type === o2.type && t2.name === o2.name) {
17311             return o2.value;
17312           }
17313         }
17314       }
17315       return;
17316     }
17317     on = value ? onAdd : onRemove;
17318     for (i3 = 0; i3 < n3; ++i3) this.each(on(typenames[i3], value, options));
17319     return this;
17320   }
17321
17322   // node_modules/d3-selection/src/selection/dispatch.js
17323   function dispatchEvent(node, type2, params) {
17324     var window2 = window_default(node), event = window2.CustomEvent;
17325     if (typeof event === "function") {
17326       event = new event(type2, params);
17327     } else {
17328       event = window2.document.createEvent("Event");
17329       if (params) event.initEvent(type2, params.bubbles, params.cancelable), event.detail = params.detail;
17330       else event.initEvent(type2, false, false);
17331     }
17332     node.dispatchEvent(event);
17333   }
17334   function dispatchConstant(type2, params) {
17335     return function() {
17336       return dispatchEvent(this, type2, params);
17337     };
17338   }
17339   function dispatchFunction(type2, params) {
17340     return function() {
17341       return dispatchEvent(this, type2, params.apply(this, arguments));
17342     };
17343   }
17344   function dispatch_default2(type2, params) {
17345     return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params));
17346   }
17347
17348   // node_modules/d3-selection/src/selection/iterator.js
17349   function* iterator_default() {
17350     for (var groups = this._groups, j3 = 0, m3 = groups.length; j3 < m3; ++j3) {
17351       for (var group = groups[j3], i3 = 0, n3 = group.length, node; i3 < n3; ++i3) {
17352         if (node = group[i3]) yield node;
17353       }
17354     }
17355   }
17356
17357   // node_modules/d3-selection/src/selection/index.js
17358   var root2 = [null];
17359   function Selection(groups, parents) {
17360     this._groups = groups;
17361     this._parents = parents;
17362   }
17363   function selection() {
17364     return new Selection([[document.documentElement]], root2);
17365   }
17366   function selection_selection() {
17367     return this;
17368   }
17369   Selection.prototype = selection.prototype = {
17370     constructor: Selection,
17371     select: select_default,
17372     selectAll: selectAll_default,
17373     selectChild: selectChild_default,
17374     selectChildren: selectChildren_default,
17375     filter: filter_default,
17376     data: data_default,
17377     enter: enter_default,
17378     exit: exit_default,
17379     join: join_default,
17380     merge: merge_default2,
17381     selection: selection_selection,
17382     order: order_default,
17383     sort: sort_default,
17384     call: call_default,
17385     nodes: nodes_default,
17386     node: node_default,
17387     size: size_default,
17388     empty: empty_default,
17389     each: each_default,
17390     attr: attr_default,
17391     style: style_default,
17392     property: property_default,
17393     classed: classed_default,
17394     text: text_default,
17395     html: html_default,
17396     raise: raise_default,
17397     lower: lower_default,
17398     append: append_default,
17399     insert: insert_default,
17400     remove: remove_default,
17401     clone: clone_default,
17402     datum: datum_default,
17403     on: on_default,
17404     dispatch: dispatch_default2,
17405     [Symbol.iterator]: iterator_default
17406   };
17407   var selection_default = selection;
17408
17409   // node_modules/d3-selection/src/select.js
17410   function select_default2(selector) {
17411     return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root2);
17412   }
17413
17414   // node_modules/d3-selection/src/sourceEvent.js
17415   function sourceEvent_default(event) {
17416     let sourceEvent;
17417     while (sourceEvent = event.sourceEvent) event = sourceEvent;
17418     return event;
17419   }
17420
17421   // node_modules/d3-selection/src/pointer.js
17422   function pointer_default(event, node) {
17423     event = sourceEvent_default(event);
17424     if (node === void 0) node = event.currentTarget;
17425     if (node) {
17426       var svg2 = node.ownerSVGElement || node;
17427       if (svg2.createSVGPoint) {
17428         var point = svg2.createSVGPoint();
17429         point.x = event.clientX, point.y = event.clientY;
17430         point = point.matrixTransform(node.getScreenCTM().inverse());
17431         return [point.x, point.y];
17432       }
17433       if (node.getBoundingClientRect) {
17434         var rect = node.getBoundingClientRect();
17435         return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
17436       }
17437     }
17438     return [event.pageX, event.pageY];
17439   }
17440
17441   // node_modules/d3-selection/src/selectAll.js
17442   function selectAll_default2(selector) {
17443     return typeof selector === "string" ? new Selection([document.querySelectorAll(selector)], [document.documentElement]) : new Selection([array(selector)], root2);
17444   }
17445
17446   // modules/util/keybinding.js
17447   function utilKeybinding(namespace) {
17448     var _keybindings = {};
17449     function testBindings(d3_event, isCapturing) {
17450       var didMatch = false;
17451       var bindings = Object.keys(_keybindings).map(function(id2) {
17452         return _keybindings[id2];
17453       });
17454       for (const binding of bindings) {
17455         if (!binding.event.modifiers.shiftKey) continue;
17456         if (!!binding.capture !== isCapturing) continue;
17457         if (matches(d3_event, binding, true)) {
17458           binding.callback(d3_event);
17459           didMatch = true;
17460           break;
17461         }
17462       }
17463       if (didMatch) return;
17464       for (const binding of bindings) {
17465         if (binding.event.modifiers.shiftKey) continue;
17466         if (!!binding.capture !== isCapturing) continue;
17467         if (matches(d3_event, binding, false)) {
17468           binding.callback(d3_event);
17469           break;
17470         }
17471       }
17472       function matches(d3_event2, binding, testShift) {
17473         var event = d3_event2;
17474         var isMatch = false;
17475         var tryKeyCode = true;
17476         if (event.key !== void 0) {
17477           tryKeyCode = event.key.charCodeAt(0) > 127;
17478           isMatch = true;
17479           if (binding.event.key === void 0) {
17480             isMatch = false;
17481           } else if (Array.isArray(binding.event.key)) {
17482             if (binding.event.key.map(function(s2) {
17483               return s2.toLowerCase();
17484             }).indexOf(event.key.toLowerCase()) === -1) {
17485               isMatch = false;
17486             }
17487           } else {
17488             if (event.key.toLowerCase() !== binding.event.key.toLowerCase()) {
17489               isMatch = false;
17490             }
17491           }
17492         }
17493         if (!isMatch && (tryKeyCode || binding.event.modifiers.altKey)) {
17494           isMatch = event.keyCode === binding.event.keyCode;
17495         }
17496         if (!isMatch) return false;
17497         if (!(event.ctrlKey && event.altKey)) {
17498           if (event.ctrlKey !== binding.event.modifiers.ctrlKey) return false;
17499           if (event.altKey !== binding.event.modifiers.altKey) return false;
17500         }
17501         if (event.metaKey !== binding.event.modifiers.metaKey) return false;
17502         if (testShift && event.shiftKey !== binding.event.modifiers.shiftKey) return false;
17503         return true;
17504       }
17505     }
17506     function capture(d3_event) {
17507       testBindings(d3_event, true);
17508     }
17509     function bubble(d3_event) {
17510       var tagName = select_default2(d3_event.target).node().tagName;
17511       if (tagName === "INPUT" || tagName === "SELECT" || tagName === "TEXTAREA") {
17512         return;
17513       }
17514       testBindings(d3_event, false);
17515     }
17516     function keybinding(selection2) {
17517       selection2 = selection2 || select_default2(document);
17518       selection2.on("keydown.capture." + namespace, capture, true);
17519       selection2.on("keydown.bubble." + namespace, bubble, false);
17520       return keybinding;
17521     }
17522     keybinding.unbind = function(selection2) {
17523       _keybindings = [];
17524       selection2 = selection2 || select_default2(document);
17525       selection2.on("keydown.capture." + namespace, null);
17526       selection2.on("keydown.bubble." + namespace, null);
17527       return keybinding;
17528     };
17529     keybinding.clear = function() {
17530       _keybindings = {};
17531       return keybinding;
17532     };
17533     keybinding.off = function(codes, capture2) {
17534       var arr = utilArrayUniq([].concat(codes));
17535       for (var i3 = 0; i3 < arr.length; i3++) {
17536         var id2 = arr[i3] + (capture2 ? "-capture" : "-bubble");
17537         delete _keybindings[id2];
17538       }
17539       return keybinding;
17540     };
17541     keybinding.on = function(codes, callback, capture2) {
17542       if (typeof callback !== "function") {
17543         return keybinding.off(codes, capture2);
17544       }
17545       var arr = utilArrayUniq([].concat(codes));
17546       for (var i3 = 0; i3 < arr.length; i3++) {
17547         var id2 = arr[i3] + (capture2 ? "-capture" : "-bubble");
17548         var binding = {
17549           id: id2,
17550           capture: capture2,
17551           callback,
17552           event: {
17553             key: void 0,
17554             // preferred
17555             keyCode: 0,
17556             // fallback
17557             modifiers: {
17558               shiftKey: false,
17559               ctrlKey: false,
17560               altKey: false,
17561               metaKey: false
17562             }
17563           }
17564         };
17565         if (_keybindings[id2]) {
17566           console.warn('warning: duplicate keybinding for "' + id2 + '"');
17567         }
17568         _keybindings[id2] = binding;
17569         var matches = arr[i3].toLowerCase().match(/(?:(?:[^+⇧⌃⌥⌘])+|[⇧⌃⌥⌘]|\+\+|^\+$)/g);
17570         for (var j3 = 0; j3 < matches.length; j3++) {
17571           if (matches[j3] === "++") matches[j3] = "+";
17572           if (matches[j3] in utilKeybinding.modifierCodes) {
17573             var prop = utilKeybinding.modifierProperties[utilKeybinding.modifierCodes[matches[j3]]];
17574             binding.event.modifiers[prop] = true;
17575           } else {
17576             binding.event.key = utilKeybinding.keys[matches[j3]] || matches[j3];
17577             if (matches[j3] in utilKeybinding.keyCodes) {
17578               binding.event.keyCode = utilKeybinding.keyCodes[matches[j3]];
17579             }
17580           }
17581         }
17582       }
17583       return keybinding;
17584     };
17585     return keybinding;
17586   }
17587   utilKeybinding.modifierCodes = {
17588     // Shift key, ⇧
17589     "\u21E7": 16,
17590     shift: 16,
17591     // CTRL key, on Mac: ⌃
17592     "\u2303": 17,
17593     ctrl: 17,
17594     // ALT key, on Mac: ⌥ (Alt)
17595     "\u2325": 18,
17596     alt: 18,
17597     option: 18,
17598     // META, on Mac: ⌘ (CMD), on Windows (Win), on Linux (Super)
17599     "\u2318": 91,
17600     meta: 91,
17601     cmd: 91,
17602     "super": 91,
17603     win: 91
17604   };
17605   utilKeybinding.modifierProperties = {
17606     16: "shiftKey",
17607     17: "ctrlKey",
17608     18: "altKey",
17609     91: "metaKey"
17610   };
17611   utilKeybinding.plusKeys = ["plus", "ffplus", "=", "ffequals", "\u2260", "\xB1"];
17612   utilKeybinding.minusKeys = ["_", "-", "ffminus", "dash", "\u2013", "\u2014"];
17613   utilKeybinding.keys = {
17614     // Backspace key, on Mac: ⌫ (Backspace)
17615     "\u232B": "Backspace",
17616     backspace: "Backspace",
17617     // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
17618     "\u21E5": "Tab",
17619     "\u21C6": "Tab",
17620     tab: "Tab",
17621     // Return key, ↩
17622     "\u21A9": "Enter",
17623     "\u21B5": "Enter",
17624     "\u23CE": "Enter",
17625     "return": "Enter",
17626     enter: "Enter",
17627     "\u2305": "Enter",
17628     // Pause/Break key
17629     "pause": "Pause",
17630     "pause-break": "Pause",
17631     // Caps Lock key, ⇪
17632     "\u21EA": "CapsLock",
17633     caps: "CapsLock",
17634     "caps-lock": "CapsLock",
17635     // Escape key, on Mac: ⎋, on Windows: Esc
17636     "\u238B": ["Escape", "Esc"],
17637     escape: ["Escape", "Esc"],
17638     esc: ["Escape", "Esc"],
17639     // Space key
17640     space: [" ", "Spacebar"],
17641     // Page-Up key, or pgup, on Mac: ↖
17642     "\u2196": "PageUp",
17643     pgup: "PageUp",
17644     "page-up": "PageUp",
17645     // Page-Down key, or pgdown, on Mac: ↘
17646     "\u2198": "PageDown",
17647     pgdown: "PageDown",
17648     "page-down": "PageDown",
17649     // END key, on Mac: ⇟
17650     "\u21DF": "End",
17651     end: "End",
17652     // HOME key, on Mac: ⇞
17653     "\u21DE": "Home",
17654     home: "Home",
17655     // Insert key, or ins
17656     ins: "Insert",
17657     insert: "Insert",
17658     // Delete key, on Mac: ⌦ (Delete)
17659     "\u2326": ["Delete", "Del"],
17660     del: ["Delete", "Del"],
17661     "delete": ["Delete", "Del"],
17662     // Left Arrow Key, or ←
17663     "\u2190": ["ArrowLeft", "Left"],
17664     left: ["ArrowLeft", "Left"],
17665     "arrow-left": ["ArrowLeft", "Left"],
17666     // Up Arrow Key, or ↑
17667     "\u2191": ["ArrowUp", "Up"],
17668     up: ["ArrowUp", "Up"],
17669     "arrow-up": ["ArrowUp", "Up"],
17670     // Right Arrow Key, or →
17671     "\u2192": ["ArrowRight", "Right"],
17672     right: ["ArrowRight", "Right"],
17673     "arrow-right": ["ArrowRight", "Right"],
17674     // Up Arrow Key, or ↓
17675     "\u2193": ["ArrowDown", "Down"],
17676     down: ["ArrowDown", "Down"],
17677     "arrow-down": ["ArrowDown", "Down"],
17678     // odities, stuff for backward compatibility (browsers and code):
17679     // Num-Multiply, or *
17680     "*": ["*", "Multiply"],
17681     star: ["*", "Multiply"],
17682     asterisk: ["*", "Multiply"],
17683     multiply: ["*", "Multiply"],
17684     // Num-Plus or +
17685     "+": ["+", "Add"],
17686     "plus": ["+", "Add"],
17687     // Num-Subtract, or -
17688     "-": ["-", "Subtract"],
17689     subtract: ["-", "Subtract"],
17690     "dash": ["-", "Subtract"],
17691     // Semicolon
17692     semicolon: ";",
17693     // = or equals
17694     equals: "=",
17695     // Comma, or ,
17696     comma: ",",
17697     // Period, or ., or full-stop
17698     period: ".",
17699     "full-stop": ".",
17700     // Slash, or /, or forward-slash
17701     slash: "/",
17702     "forward-slash": "/",
17703     // Tick, or `, or back-quote
17704     tick: "`",
17705     "back-quote": "`",
17706     // Open bracket, or [
17707     "open-bracket": "[",
17708     // Back slash, or \
17709     "back-slash": "\\",
17710     // Close bracket, or ]
17711     "close-bracket": "]",
17712     // Apostrophe, or Quote, or '
17713     quote: "'",
17714     apostrophe: "'",
17715     // NUMPAD 0-9
17716     "num-0": "0",
17717     "num-1": "1",
17718     "num-2": "2",
17719     "num-3": "3",
17720     "num-4": "4",
17721     "num-5": "5",
17722     "num-6": "6",
17723     "num-7": "7",
17724     "num-8": "8",
17725     "num-9": "9",
17726     // F1-F25
17727     f1: "F1",
17728     f2: "F2",
17729     f3: "F3",
17730     f4: "F4",
17731     f5: "F5",
17732     f6: "F6",
17733     f7: "F7",
17734     f8: "F8",
17735     f9: "F9",
17736     f10: "F10",
17737     f11: "F11",
17738     f12: "F12",
17739     f13: "F13",
17740     f14: "F14",
17741     f15: "F15",
17742     f16: "F16",
17743     f17: "F17",
17744     f18: "F18",
17745     f19: "F19",
17746     f20: "F20",
17747     f21: "F21",
17748     f22: "F22",
17749     f23: "F23",
17750     f24: "F24",
17751     f25: "F25"
17752   };
17753   utilKeybinding.keyCodes = {
17754     // Backspace key, on Mac: ⌫ (Backspace)
17755     "\u232B": 8,
17756     backspace: 8,
17757     // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
17758     "\u21E5": 9,
17759     "\u21C6": 9,
17760     tab: 9,
17761     // Return key, ↩
17762     "\u21A9": 13,
17763     "\u21B5": 13,
17764     "\u23CE": 13,
17765     "return": 13,
17766     enter: 13,
17767     "\u2305": 13,
17768     // Pause/Break key
17769     "pause": 19,
17770     "pause-break": 19,
17771     // Caps Lock key, ⇪
17772     "\u21EA": 20,
17773     caps: 20,
17774     "caps-lock": 20,
17775     // Escape key, on Mac: ⎋, on Windows: Esc
17776     "\u238B": 27,
17777     escape: 27,
17778     esc: 27,
17779     // Space key
17780     space: 32,
17781     // Page-Up key, or pgup, on Mac: ↖
17782     "\u2196": 33,
17783     pgup: 33,
17784     "page-up": 33,
17785     // Page-Down key, or pgdown, on Mac: ↘
17786     "\u2198": 34,
17787     pgdown: 34,
17788     "page-down": 34,
17789     // END key, on Mac: ⇟
17790     "\u21DF": 35,
17791     end: 35,
17792     // HOME key, on Mac: ⇞
17793     "\u21DE": 36,
17794     home: 36,
17795     // Insert key, or ins
17796     ins: 45,
17797     insert: 45,
17798     // Delete key, on Mac: ⌦ (Delete)
17799     "\u2326": 46,
17800     del: 46,
17801     "delete": 46,
17802     // Left Arrow Key, or ←
17803     "\u2190": 37,
17804     left: 37,
17805     "arrow-left": 37,
17806     // Up Arrow Key, or ↑
17807     "\u2191": 38,
17808     up: 38,
17809     "arrow-up": 38,
17810     // Right Arrow Key, or →
17811     "\u2192": 39,
17812     right: 39,
17813     "arrow-right": 39,
17814     // Up Arrow Key, or ↓
17815     "\u2193": 40,
17816     down: 40,
17817     "arrow-down": 40,
17818     // odities, printing characters that come out wrong:
17819     // Firefox Equals
17820     "ffequals": 61,
17821     // Num-Multiply, or *
17822     "*": 106,
17823     star: 106,
17824     asterisk: 106,
17825     multiply: 106,
17826     // Num-Plus or +
17827     "+": 107,
17828     "plus": 107,
17829     // Num-Subtract, or -
17830     "-": 109,
17831     subtract: 109,
17832     // Vertical Bar / Pipe
17833     "|": 124,
17834     // Firefox Plus
17835     "ffplus": 171,
17836     // Firefox Minus
17837     "ffminus": 173,
17838     // Semicolon
17839     ";": 186,
17840     semicolon: 186,
17841     // = or equals
17842     "=": 187,
17843     "equals": 187,
17844     // Comma, or ,
17845     ",": 188,
17846     comma: 188,
17847     // Dash / Underscore key
17848     "dash": 189,
17849     // Period, or ., or full-stop
17850     ".": 190,
17851     period: 190,
17852     "full-stop": 190,
17853     // Slash, or /, or forward-slash
17854     "/": 191,
17855     slash: 191,
17856     "forward-slash": 191,
17857     // Tick, or `, or back-quote
17858     "`": 192,
17859     tick: 192,
17860     "back-quote": 192,
17861     // Open bracket, or [
17862     "[": 219,
17863     "open-bracket": 219,
17864     // Back slash, or \
17865     "\\": 220,
17866     "back-slash": 220,
17867     // Close bracket, or ]
17868     "]": 221,
17869     "close-bracket": 221,
17870     // Apostrophe, or Quote, or '
17871     "'": 222,
17872     quote: 222,
17873     apostrophe: 222
17874   };
17875   var i = 95;
17876   var n = 0;
17877   while (++i < 106) {
17878     utilKeybinding.keyCodes["num-" + n] = i;
17879     ++n;
17880   }
17881   i = 47;
17882   n = 0;
17883   while (++i < 58) {
17884     utilKeybinding.keyCodes[n] = i;
17885     ++n;
17886   }
17887   i = 111;
17888   n = 1;
17889   while (++i < 136) {
17890     utilKeybinding.keyCodes["f" + n] = i;
17891     ++n;
17892   }
17893   i = 64;
17894   while (++i < 91) {
17895     utilKeybinding.keyCodes[String.fromCharCode(i).toLowerCase()] = i;
17896   }
17897
17898   // modules/util/object.js
17899   function utilObjectOmit(obj, omitKeys) {
17900     return Object.keys(obj).reduce(function(result, key) {
17901       if (omitKeys.indexOf(key) === -1) {
17902         result[key] = obj[key];
17903       }
17904       return result;
17905     }, {});
17906   }
17907   function utilCheckTagDictionary(tags, tagDictionary) {
17908     for (const key in tags) {
17909       const value = tags[key];
17910       if (tagDictionary[key] && value in tagDictionary[key]) {
17911         return tagDictionary[key][value];
17912       }
17913     }
17914     return void 0;
17915   }
17916
17917   // modules/util/rebind.js
17918   function utilRebind(target, source, ...args) {
17919     for (const method of args) {
17920       target[method] = d3_rebind(target, source, source[method]);
17921     }
17922     return target;
17923   }
17924   function d3_rebind(target, source, method) {
17925     return function() {
17926       var value = method.apply(source, arguments);
17927       return value === source ? target : value;
17928     };
17929   }
17930
17931   // modules/util/session_mutex.js
17932   function utilSessionMutex(name) {
17933     var mutex = {};
17934     var intervalID;
17935     function renew() {
17936       if (typeof window === "undefined") return;
17937       var expires = /* @__PURE__ */ new Date();
17938       expires.setSeconds(expires.getSeconds() + 5);
17939       document.cookie = name + "=1; expires=" + expires.toUTCString() + "; sameSite=strict";
17940     }
17941     mutex.lock = function() {
17942       if (intervalID) return true;
17943       var cookie = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + name + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1");
17944       if (cookie) return false;
17945       renew();
17946       intervalID = window.setInterval(renew, 4e3);
17947       return true;
17948     };
17949     mutex.unlock = function() {
17950       if (!intervalID) return;
17951       document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; sameSite=strict";
17952       clearInterval(intervalID);
17953       intervalID = null;
17954     };
17955     mutex.locked = function() {
17956       return !!intervalID;
17957     };
17958     return mutex;
17959   }
17960
17961   // node_modules/d3-array/src/ascending.js
17962   function ascending2(a2, b3) {
17963     return a2 == null || b3 == null ? NaN : a2 < b3 ? -1 : a2 > b3 ? 1 : a2 >= b3 ? 0 : NaN;
17964   }
17965
17966   // node_modules/d3-array/src/descending.js
17967   function descending(a2, b3) {
17968     return a2 == null || b3 == null ? NaN : b3 < a2 ? -1 : b3 > a2 ? 1 : b3 >= a2 ? 0 : NaN;
17969   }
17970
17971   // node_modules/d3-array/src/bisector.js
17972   function bisector(f2) {
17973     let compare1, compare2, delta;
17974     if (f2.length !== 2) {
17975       compare1 = ascending2;
17976       compare2 = (d2, x3) => ascending2(f2(d2), x3);
17977       delta = (d2, x3) => f2(d2) - x3;
17978     } else {
17979       compare1 = f2 === ascending2 || f2 === descending ? f2 : zero;
17980       compare2 = f2;
17981       delta = f2;
17982     }
17983     function left(a2, x3, lo = 0, hi = a2.length) {
17984       if (lo < hi) {
17985         if (compare1(x3, x3) !== 0) return hi;
17986         do {
17987           const mid = lo + hi >>> 1;
17988           if (compare2(a2[mid], x3) < 0) lo = mid + 1;
17989           else hi = mid;
17990         } while (lo < hi);
17991       }
17992       return lo;
17993     }
17994     function right(a2, x3, lo = 0, hi = a2.length) {
17995       if (lo < hi) {
17996         if (compare1(x3, x3) !== 0) return hi;
17997         do {
17998           const mid = lo + hi >>> 1;
17999           if (compare2(a2[mid], x3) <= 0) lo = mid + 1;
18000           else hi = mid;
18001         } while (lo < hi);
18002       }
18003       return lo;
18004     }
18005     function center(a2, x3, lo = 0, hi = a2.length) {
18006       const i3 = left(a2, x3, lo, hi - 1);
18007       return i3 > lo && delta(a2[i3 - 1], x3) > -delta(a2[i3], x3) ? i3 - 1 : i3;
18008     }
18009     return { left, center, right };
18010   }
18011   function zero() {
18012     return 0;
18013   }
18014
18015   // node_modules/d3-array/src/number.js
18016   function number(x3) {
18017     return x3 === null ? NaN : +x3;
18018   }
18019   function* numbers(values, valueof) {
18020     if (valueof === void 0) {
18021       for (let value of values) {
18022         if (value != null && (value = +value) >= value) {
18023           yield value;
18024         }
18025       }
18026     } else {
18027       let index = -1;
18028       for (let value of values) {
18029         if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {
18030           yield value;
18031         }
18032       }
18033     }
18034   }
18035
18036   // node_modules/d3-array/src/bisect.js
18037   var ascendingBisect = bisector(ascending2);
18038   var bisectRight = ascendingBisect.right;
18039   var bisectLeft = ascendingBisect.left;
18040   var bisectCenter = bisector(number).center;
18041   var bisect_default = bisectRight;
18042
18043   // node_modules/d3-array/src/fsum.js
18044   var Adder = class {
18045     constructor() {
18046       this._partials = new Float64Array(32);
18047       this._n = 0;
18048     }
18049     add(x3) {
18050       const p2 = this._partials;
18051       let i3 = 0;
18052       for (let j3 = 0; j3 < this._n && j3 < 32; j3++) {
18053         const y3 = p2[j3], hi = x3 + y3, lo = Math.abs(x3) < Math.abs(y3) ? x3 - (hi - y3) : y3 - (hi - x3);
18054         if (lo) p2[i3++] = lo;
18055         x3 = hi;
18056       }
18057       p2[i3] = x3;
18058       this._n = i3 + 1;
18059       return this;
18060     }
18061     valueOf() {
18062       const p2 = this._partials;
18063       let n3 = this._n, x3, y3, lo, hi = 0;
18064       if (n3 > 0) {
18065         hi = p2[--n3];
18066         while (n3 > 0) {
18067           x3 = hi;
18068           y3 = p2[--n3];
18069           hi = x3 + y3;
18070           lo = y3 - (hi - x3);
18071           if (lo) break;
18072         }
18073         if (n3 > 0 && (lo < 0 && p2[n3 - 1] < 0 || lo > 0 && p2[n3 - 1] > 0)) {
18074           y3 = lo * 2;
18075           x3 = hi + y3;
18076           if (y3 == x3 - hi) hi = x3;
18077         }
18078       }
18079       return hi;
18080     }
18081   };
18082
18083   // node_modules/d3-array/src/sort.js
18084   function compareDefined(compare2 = ascending2) {
18085     if (compare2 === ascending2) return ascendingDefined;
18086     if (typeof compare2 !== "function") throw new TypeError("compare is not a function");
18087     return (a2, b3) => {
18088       const x3 = compare2(a2, b3);
18089       if (x3 || x3 === 0) return x3;
18090       return (compare2(b3, b3) === 0) - (compare2(a2, a2) === 0);
18091     };
18092   }
18093   function ascendingDefined(a2, b3) {
18094     return (a2 == null || !(a2 >= a2)) - (b3 == null || !(b3 >= b3)) || (a2 < b3 ? -1 : a2 > b3 ? 1 : 0);
18095   }
18096
18097   // node_modules/d3-array/src/ticks.js
18098   var e10 = Math.sqrt(50);
18099   var e5 = Math.sqrt(10);
18100   var e2 = Math.sqrt(2);
18101   function tickSpec(start2, stop, count) {
18102     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;
18103     let i1, i22, inc;
18104     if (power < 0) {
18105       inc = Math.pow(10, -power) / factor;
18106       i1 = Math.round(start2 * inc);
18107       i22 = Math.round(stop * inc);
18108       if (i1 / inc < start2) ++i1;
18109       if (i22 / inc > stop) --i22;
18110       inc = -inc;
18111     } else {
18112       inc = Math.pow(10, power) * factor;
18113       i1 = Math.round(start2 / inc);
18114       i22 = Math.round(stop / inc);
18115       if (i1 * inc < start2) ++i1;
18116       if (i22 * inc > stop) --i22;
18117     }
18118     if (i22 < i1 && 0.5 <= count && count < 2) return tickSpec(start2, stop, count * 2);
18119     return [i1, i22, inc];
18120   }
18121   function ticks(start2, stop, count) {
18122     stop = +stop, start2 = +start2, count = +count;
18123     if (!(count > 0)) return [];
18124     if (start2 === stop) return [start2];
18125     const reverse = stop < start2, [i1, i22, inc] = reverse ? tickSpec(stop, start2, count) : tickSpec(start2, stop, count);
18126     if (!(i22 >= i1)) return [];
18127     const n3 = i22 - i1 + 1, ticks2 = new Array(n3);
18128     if (reverse) {
18129       if (inc < 0) for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i22 - i3) / -inc;
18130       else for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i22 - i3) * inc;
18131     } else {
18132       if (inc < 0) for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i1 + i3) / -inc;
18133       else for (let i3 = 0; i3 < n3; ++i3) ticks2[i3] = (i1 + i3) * inc;
18134     }
18135     return ticks2;
18136   }
18137   function tickIncrement(start2, stop, count) {
18138     stop = +stop, start2 = +start2, count = +count;
18139     return tickSpec(start2, stop, count)[2];
18140   }
18141   function tickStep(start2, stop, count) {
18142     stop = +stop, start2 = +start2, count = +count;
18143     const reverse = stop < start2, inc = reverse ? tickIncrement(stop, start2, count) : tickIncrement(start2, stop, count);
18144     return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
18145   }
18146
18147   // node_modules/d3-array/src/max.js
18148   function max(values, valueof) {
18149     let max3;
18150     if (valueof === void 0) {
18151       for (const value of values) {
18152         if (value != null && (max3 < value || max3 === void 0 && value >= value)) {
18153           max3 = value;
18154         }
18155       }
18156     } else {
18157       let index = -1;
18158       for (let value of values) {
18159         if ((value = valueof(value, ++index, values)) != null && (max3 < value || max3 === void 0 && value >= value)) {
18160           max3 = value;
18161         }
18162       }
18163     }
18164     return max3;
18165   }
18166
18167   // node_modules/d3-array/src/min.js
18168   function min(values, valueof) {
18169     let min3;
18170     if (valueof === void 0) {
18171       for (const value of values) {
18172         if (value != null && (min3 > value || min3 === void 0 && value >= value)) {
18173           min3 = value;
18174         }
18175       }
18176     } else {
18177       let index = -1;
18178       for (let value of values) {
18179         if ((value = valueof(value, ++index, values)) != null && (min3 > value || min3 === void 0 && value >= value)) {
18180           min3 = value;
18181         }
18182       }
18183     }
18184     return min3;
18185   }
18186
18187   // node_modules/d3-array/src/quickselect.js
18188   function quickselect(array2, k3, left = 0, right = Infinity, compare2) {
18189     k3 = Math.floor(k3);
18190     left = Math.floor(Math.max(0, left));
18191     right = Math.floor(Math.min(array2.length - 1, right));
18192     if (!(left <= k3 && k3 <= right)) return array2;
18193     compare2 = compare2 === void 0 ? ascendingDefined : compareDefined(compare2);
18194     while (right > left) {
18195       if (right - left > 600) {
18196         const n3 = right - left + 1;
18197         const m3 = k3 - left + 1;
18198         const z3 = Math.log(n3);
18199         const s2 = 0.5 * Math.exp(2 * z3 / 3);
18200         const sd = 0.5 * Math.sqrt(z3 * s2 * (n3 - s2) / n3) * (m3 - n3 / 2 < 0 ? -1 : 1);
18201         const newLeft = Math.max(left, Math.floor(k3 - m3 * s2 / n3 + sd));
18202         const newRight = Math.min(right, Math.floor(k3 + (n3 - m3) * s2 / n3 + sd));
18203         quickselect(array2, k3, newLeft, newRight, compare2);
18204       }
18205       const t2 = array2[k3];
18206       let i3 = left;
18207       let j3 = right;
18208       swap(array2, left, k3);
18209       if (compare2(array2[right], t2) > 0) swap(array2, left, right);
18210       while (i3 < j3) {
18211         swap(array2, i3, j3), ++i3, --j3;
18212         while (compare2(array2[i3], t2) < 0) ++i3;
18213         while (compare2(array2[j3], t2) > 0) --j3;
18214       }
18215       if (compare2(array2[left], t2) === 0) swap(array2, left, j3);
18216       else ++j3, swap(array2, j3, right);
18217       if (j3 <= k3) left = j3 + 1;
18218       if (k3 <= j3) right = j3 - 1;
18219     }
18220     return array2;
18221   }
18222   function swap(array2, i3, j3) {
18223     const t2 = array2[i3];
18224     array2[i3] = array2[j3];
18225     array2[j3] = t2;
18226   }
18227
18228   // node_modules/d3-array/src/quantile.js
18229   function quantile(values, p2, valueof) {
18230     values = Float64Array.from(numbers(values, valueof));
18231     if (!(n3 = values.length) || isNaN(p2 = +p2)) return;
18232     if (p2 <= 0 || n3 < 2) return min(values);
18233     if (p2 >= 1) return max(values);
18234     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));
18235     return value0 + (value1 - value0) * (i3 - i0);
18236   }
18237
18238   // node_modules/d3-array/src/median.js
18239   function median(values, valueof) {
18240     return quantile(values, 0.5, valueof);
18241   }
18242
18243   // node_modules/d3-array/src/merge.js
18244   function* flatten2(arrays) {
18245     for (const array2 of arrays) {
18246       yield* __yieldStar(array2);
18247     }
18248   }
18249   function merge2(arrays) {
18250     return Array.from(flatten2(arrays));
18251   }
18252
18253   // node_modules/d3-array/src/pairs.js
18254   function pairs(values, pairof = pair) {
18255     const pairs2 = [];
18256     let previous;
18257     let first = false;
18258     for (const value of values) {
18259       if (first) pairs2.push(pairof(previous, value));
18260       previous = value;
18261       first = true;
18262     }
18263     return pairs2;
18264   }
18265   function pair(a2, b3) {
18266     return [a2, b3];
18267   }
18268
18269   // node_modules/d3-array/src/range.js
18270   function range(start2, stop, step) {
18271     start2 = +start2, stop = +stop, step = (n3 = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n3 < 3 ? 1 : +step;
18272     var i3 = -1, n3 = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range3 = new Array(n3);
18273     while (++i3 < n3) {
18274       range3[i3] = start2 + i3 * step;
18275     }
18276     return range3;
18277   }
18278
18279   // node_modules/d3-polygon/src/area.js
18280   function area_default(polygon2) {
18281     var i3 = -1, n3 = polygon2.length, a2, b3 = polygon2[n3 - 1], area = 0;
18282     while (++i3 < n3) {
18283       a2 = b3;
18284       b3 = polygon2[i3];
18285       area += a2[1] * b3[0] - a2[0] * b3[1];
18286     }
18287     return area / 2;
18288   }
18289
18290   // node_modules/d3-polygon/src/centroid.js
18291   function centroid_default(polygon2) {
18292     var i3 = -1, n3 = polygon2.length, x3 = 0, y3 = 0, a2, b3 = polygon2[n3 - 1], c2, k3 = 0;
18293     while (++i3 < n3) {
18294       a2 = b3;
18295       b3 = polygon2[i3];
18296       k3 += c2 = a2[0] * b3[1] - b3[0] * a2[1];
18297       x3 += (a2[0] + b3[0]) * c2;
18298       y3 += (a2[1] + b3[1]) * c2;
18299     }
18300     return k3 *= 3, [x3 / k3, y3 / k3];
18301   }
18302
18303   // node_modules/d3-polygon/src/cross.js
18304   function cross_default(a2, b3, c2) {
18305     return (b3[0] - a2[0]) * (c2[1] - a2[1]) - (b3[1] - a2[1]) * (c2[0] - a2[0]);
18306   }
18307
18308   // node_modules/d3-polygon/src/hull.js
18309   function lexicographicOrder(a2, b3) {
18310     return a2[0] - b3[0] || a2[1] - b3[1];
18311   }
18312   function computeUpperHullIndexes(points) {
18313     const n3 = points.length, indexes = [0, 1];
18314     let size = 2, i3;
18315     for (i3 = 2; i3 < n3; ++i3) {
18316       while (size > 1 && cross_default(points[indexes[size - 2]], points[indexes[size - 1]], points[i3]) <= 0) --size;
18317       indexes[size++] = i3;
18318     }
18319     return indexes.slice(0, size);
18320   }
18321   function hull_default(points) {
18322     if ((n3 = points.length) < 3) return null;
18323     var i3, n3, sortedPoints = new Array(n3), flippedPoints = new Array(n3);
18324     for (i3 = 0; i3 < n3; ++i3) sortedPoints[i3] = [+points[i3][0], +points[i3][1], i3];
18325     sortedPoints.sort(lexicographicOrder);
18326     for (i3 = 0; i3 < n3; ++i3) flippedPoints[i3] = [sortedPoints[i3][0], -sortedPoints[i3][1]];
18327     var upperIndexes = computeUpperHullIndexes(sortedPoints), lowerIndexes = computeUpperHullIndexes(flippedPoints);
18328     var skipLeft = lowerIndexes[0] === upperIndexes[0], skipRight = lowerIndexes[lowerIndexes.length - 1] === upperIndexes[upperIndexes.length - 1], hull = [];
18329     for (i3 = upperIndexes.length - 1; i3 >= 0; --i3) hull.push(points[sortedPoints[upperIndexes[i3]][2]]);
18330     for (i3 = +skipLeft; i3 < lowerIndexes.length - skipRight; ++i3) hull.push(points[sortedPoints[lowerIndexes[i3]][2]]);
18331     return hull;
18332   }
18333
18334   // modules/geo/vector.ts
18335   function geoVecEqual(a2, b3, epsilon3) {
18336     if (epsilon3) {
18337       return Math.abs(a2[0] - b3[0]) <= epsilon3 && Math.abs(a2[1] - b3[1]) <= epsilon3;
18338     } else {
18339       return a2[0] === b3[0] && a2[1] === b3[1];
18340     }
18341   }
18342   function geoVecAdd(a2, b3) {
18343     return [a2[0] + b3[0], a2[1] + b3[1]];
18344   }
18345   function geoVecSubtract(a2, b3) {
18346     return [a2[0] - b3[0], a2[1] - b3[1]];
18347   }
18348   function geoVecScale(a2, mag) {
18349     return [a2[0] * mag, a2[1] * mag];
18350   }
18351   function geoVecFloor(a2) {
18352     return [Math.floor(a2[0]), Math.floor(a2[1])];
18353   }
18354   function geoVecInterp(a2, b3, t2) {
18355     return [
18356       a2[0] + (b3[0] - a2[0]) * t2,
18357       a2[1] + (b3[1] - a2[1]) * t2
18358     ];
18359   }
18360   function geoVecLength(a2, b3) {
18361     return Math.sqrt(geoVecLengthSquare(a2, b3));
18362   }
18363   function geoVecLengthSquare(a2, b3) {
18364     b3 = b3 || [0, 0];
18365     var x3 = a2[0] - b3[0];
18366     var y3 = a2[1] - b3[1];
18367     return x3 * x3 + y3 * y3;
18368   }
18369   function geoVecNormalize(a2) {
18370     var length2 = Math.sqrt(a2[0] * a2[0] + a2[1] * a2[1]);
18371     if (length2 !== 0) {
18372       return geoVecScale(a2, 1 / length2);
18373     }
18374     return [0, 0];
18375   }
18376   function geoVecAngle(a2, b3) {
18377     return Math.atan2(b3[1] - a2[1], b3[0] - a2[0]);
18378   }
18379   function geoVecDot(a2, b3, origin) {
18380     origin = origin || [0, 0];
18381     var p2 = geoVecSubtract(a2, origin);
18382     var q3 = geoVecSubtract(b3, origin);
18383     return p2[0] * q3[0] + p2[1] * q3[1];
18384   }
18385   function geoVecNormalizedDot(a2, b3, origin) {
18386     origin = origin || [0, 0];
18387     var p2 = geoVecNormalize(geoVecSubtract(a2, origin));
18388     var q3 = geoVecNormalize(geoVecSubtract(b3, origin));
18389     return geoVecDot(p2, q3);
18390   }
18391   function geoVecCross(a2, b3, origin) {
18392     origin = origin || [0, 0];
18393     var p2 = geoVecSubtract(a2, origin);
18394     var q3 = geoVecSubtract(b3, origin);
18395     return p2[0] * q3[1] - p2[1] * q3[0];
18396   }
18397   function geoVecProject(a2, points) {
18398     var min3 = Infinity;
18399     var idx;
18400     var target;
18401     for (var i3 = 0; i3 < points.length - 1; i3++) {
18402       var o2 = points[i3];
18403       var s2 = geoVecSubtract(points[i3 + 1], o2);
18404       var v3 = geoVecSubtract(a2, o2);
18405       var proj = geoVecDot(v3, s2) / geoVecDot(s2, s2);
18406       var p2;
18407       if (proj < 0) {
18408         p2 = o2;
18409       } else if (proj > 1) {
18410         p2 = points[i3 + 1];
18411       } else {
18412         p2 = [o2[0] + proj * s2[0], o2[1] + proj * s2[1]];
18413       }
18414       var dist = geoVecLength(p2, a2);
18415       if (dist < min3) {
18416         min3 = dist;
18417         idx = i3 + 1;
18418         target = p2;
18419       }
18420     }
18421     if (idx !== void 0) {
18422       return { index: idx, distance: min3, target };
18423     } else {
18424       return null;
18425     }
18426   }
18427
18428   // modules/geo/geom.ts
18429   function geoAngle(a2, b3, projection2) {
18430     return geoVecAngle(projection2(a2.loc), projection2(b3.loc));
18431   }
18432   function geoEdgeEqual(a2, b3) {
18433     return a2[0] === b3[0] && a2[1] === b3[1] || a2[0] === b3[1] && a2[1] === b3[0];
18434   }
18435   function geoRotate(points, angle2, around) {
18436     return points.map(function(point) {
18437       var radial = geoVecSubtract(point, around);
18438       return [
18439         radial[0] * Math.cos(angle2) - radial[1] * Math.sin(angle2) + around[0],
18440         radial[0] * Math.sin(angle2) + radial[1] * Math.cos(angle2) + around[1]
18441       ];
18442     });
18443   }
18444   function geoChooseEdge(nodes, point, projection2, activeID) {
18445     var dist = geoVecLength;
18446     var points = nodes.map(function(n3) {
18447       return projection2(n3.loc);
18448     });
18449     var ids = nodes.map(function(n3) {
18450       return n3.id;
18451     });
18452     var min3 = Infinity;
18453     var idx;
18454     var loc;
18455     for (var i3 = 0; i3 < points.length - 1; i3++) {
18456       if (ids[i3] === activeID || ids[i3 + 1] === activeID) continue;
18457       var o2 = points[i3];
18458       var s2 = geoVecSubtract(points[i3 + 1], o2);
18459       var v3 = geoVecSubtract(point, o2);
18460       var proj = geoVecDot(v3, s2) / geoVecDot(s2, s2);
18461       var p2;
18462       if (proj < 0) {
18463         p2 = o2;
18464       } else if (proj > 1) {
18465         p2 = points[i3 + 1];
18466       } else {
18467         p2 = [o2[0] + proj * s2[0], o2[1] + proj * s2[1]];
18468       }
18469       var d2 = dist(p2, point);
18470       if (d2 < min3) {
18471         min3 = d2;
18472         idx = i3 + 1;
18473         loc = projection2.invert(p2);
18474       }
18475     }
18476     if (idx !== void 0) {
18477       return { index: idx, distance: min3, loc };
18478     } else {
18479       return null;
18480     }
18481   }
18482   function geoHasLineIntersections(activeNodes, inactiveNodes, activeID) {
18483     var actives = [];
18484     var inactives = [];
18485     var j3, k3, n1, n22, segment;
18486     for (j3 = 0; j3 < activeNodes.length - 1; j3++) {
18487       n1 = activeNodes[j3];
18488       n22 = activeNodes[j3 + 1];
18489       segment = [n1.loc, n22.loc];
18490       if (n1.id === activeID || n22.id === activeID) {
18491         actives.push(segment);
18492       }
18493     }
18494     for (j3 = 0; j3 < inactiveNodes.length - 1; j3++) {
18495       n1 = inactiveNodes[j3];
18496       n22 = inactiveNodes[j3 + 1];
18497       segment = [n1.loc, n22.loc];
18498       inactives.push(segment);
18499     }
18500     for (j3 = 0; j3 < actives.length; j3++) {
18501       for (k3 = 0; k3 < inactives.length; k3++) {
18502         var p2 = actives[j3];
18503         var q3 = inactives[k3];
18504         var hit = geoLineIntersection(p2, q3);
18505         if (hit) {
18506           return true;
18507         }
18508       }
18509     }
18510     return false;
18511   }
18512   function geoHasSelfIntersections(nodes, activeID) {
18513     var actives = [];
18514     var inactives = [];
18515     var j3, k3;
18516     for (j3 = 0; j3 < nodes.length - 1; j3++) {
18517       var n1 = nodes[j3];
18518       var n22 = nodes[j3 + 1];
18519       var segment = [n1.loc, n22.loc];
18520       if (n1.id === activeID || n22.id === activeID) {
18521         actives.push(segment);
18522       } else {
18523         inactives.push(segment);
18524       }
18525     }
18526     for (j3 = 0; j3 < actives.length; j3++) {
18527       for (k3 = 0; k3 < inactives.length; k3++) {
18528         var p2 = actives[j3];
18529         var q3 = inactives[k3];
18530         if (geoVecEqual(p2[1], q3[0]) || geoVecEqual(p2[0], q3[1]) || geoVecEqual(p2[0], q3[0]) || geoVecEqual(p2[1], q3[1])) {
18531           continue;
18532         }
18533         var hit = geoLineIntersection(p2, q3);
18534         if (hit) {
18535           var epsilon3 = 1e-8;
18536           if (geoVecEqual(p2[1], hit, epsilon3) || geoVecEqual(p2[0], hit, epsilon3) || geoVecEqual(q3[1], hit, epsilon3) || geoVecEqual(q3[0], hit, epsilon3)) {
18537             continue;
18538           } else {
18539             return true;
18540           }
18541         }
18542       }
18543     }
18544     return false;
18545   }
18546   function geoLineIntersection(a2, b3) {
18547     var p2 = [a2[0][0], a2[0][1]];
18548     var p22 = [a2[1][0], a2[1][1]];
18549     var q3 = [b3[0][0], b3[0][1]];
18550     var q22 = [b3[1][0], b3[1][1]];
18551     var r2 = geoVecSubtract(p22, p2);
18552     var s2 = geoVecSubtract(q22, q3);
18553     var uNumerator = geoVecCross(geoVecSubtract(q3, p2), r2);
18554     var denominator = geoVecCross(r2, s2);
18555     if (uNumerator && denominator) {
18556       var u4 = uNumerator / denominator;
18557       var t2 = geoVecCross(geoVecSubtract(q3, p2), s2) / denominator;
18558       if (t2 >= 0 && t2 <= 1 && u4 >= 0 && u4 <= 1) {
18559         return geoVecInterp(p2, p22, t2);
18560       }
18561     }
18562     return null;
18563   }
18564   function geoPathIntersections(path1, path2) {
18565     var intersections = [];
18566     for (var i3 = 0; i3 < path1.length - 1; i3++) {
18567       for (var j3 = 0; j3 < path2.length - 1; j3++) {
18568         var a2 = [path1[i3], path1[i3 + 1]];
18569         var b3 = [path2[j3], path2[j3 + 1]];
18570         var hit = geoLineIntersection(a2, b3);
18571         if (hit) {
18572           intersections.push(hit);
18573         }
18574       }
18575     }
18576     return intersections;
18577   }
18578   function geoPathHasIntersections(path1, path2) {
18579     for (var i3 = 0; i3 < path1.length - 1; i3++) {
18580       for (var j3 = 0; j3 < path2.length - 1; j3++) {
18581         var a2 = [path1[i3], path1[i3 + 1]];
18582         var b3 = [path2[j3], path2[j3 + 1]];
18583         var hit = geoLineIntersection(a2, b3);
18584         if (hit) {
18585           return true;
18586         }
18587       }
18588     }
18589     return false;
18590   }
18591   function geoPointInPolygon(point, polygon2) {
18592     var x3 = point[0];
18593     var y3 = point[1];
18594     var inside = false;
18595     for (var i3 = 0, j3 = polygon2.length - 1; i3 < polygon2.length; j3 = i3++) {
18596       var xi = polygon2[i3][0];
18597       var yi = polygon2[i3][1];
18598       var xj = polygon2[j3][0];
18599       var yj = polygon2[j3][1];
18600       var intersect2 = yi > y3 !== yj > y3 && x3 < (xj - xi) * (y3 - yi) / (yj - yi) + xi;
18601       if (intersect2) inside = !inside;
18602     }
18603     return inside;
18604   }
18605   function geoPolygonContainsPolygon(outer, inner) {
18606     return inner.every(function(point) {
18607       return geoPointInPolygon(point, outer);
18608     });
18609   }
18610   function geoPolygonIntersectsPolygon(outer, inner, checkSegments) {
18611     function testPoints(outer2, inner2) {
18612       return inner2.some(function(point) {
18613         return geoPointInPolygon(point, outer2);
18614       });
18615     }
18616     return testPoints(outer, inner) || !!checkSegments && geoPathHasIntersections(outer, inner);
18617   }
18618   function geoGetSmallestSurroundingRectangle(points) {
18619     var hull = hull_default(points);
18620     var centroid = centroid_default(hull);
18621     var minArea = Infinity;
18622     var ssrExtent = [];
18623     var ssrAngle = 0;
18624     var c1 = hull[0];
18625     for (var i3 = 0; i3 <= hull.length - 1; i3++) {
18626       var c2 = i3 === hull.length - 1 ? hull[0] : hull[i3 + 1];
18627       var angle2 = Math.atan2(c2[1] - c1[1], c2[0] - c1[0]);
18628       var poly = geoRotate(hull, -angle2, centroid);
18629       var extent = poly.reduce(function(extent2, point) {
18630         return extent2.extend(geoExtent(point));
18631       }, geoExtent());
18632       var area = extent.area();
18633       if (area < minArea) {
18634         minArea = area;
18635         ssrExtent = extent;
18636         ssrAngle = angle2;
18637       }
18638       c1 = c2;
18639     }
18640     return {
18641       poly: geoRotate(ssrExtent.polygon(), ssrAngle, centroid),
18642       angle: ssrAngle
18643     };
18644   }
18645   function geoPathLength(path) {
18646     var length2 = 0;
18647     for (var i3 = 0; i3 < path.length - 1; i3++) {
18648       length2 += geoVecLength(path[i3], path[i3 + 1]);
18649     }
18650     return length2;
18651   }
18652   function geoViewportEdge(point, dimensions) {
18653     var pad2 = [80, 20, 50, 20];
18654     var x3 = 0;
18655     var y3 = 0;
18656     if (point[0] > dimensions[0] - pad2[1]) {
18657       x3 = -10;
18658     }
18659     if (point[0] < pad2[3]) {
18660       x3 = 10;
18661     }
18662     if (point[1] > dimensions[1] - pad2[2]) {
18663       y3 = -10;
18664     }
18665     if (point[1] < pad2[0]) {
18666       y3 = 10;
18667     }
18668     if (x3 || y3) {
18669       return [x3, y3];
18670     } else {
18671       return null;
18672     }
18673   }
18674
18675   // node_modules/d3-geo/src/math.js
18676   var epsilon = 1e-6;
18677   var epsilon2 = 1e-12;
18678   var pi = Math.PI;
18679   var halfPi = pi / 2;
18680   var quarterPi = pi / 4;
18681   var tau = pi * 2;
18682   var degrees = 180 / pi;
18683   var radians = pi / 180;
18684   var abs = Math.abs;
18685   var atan = Math.atan;
18686   var atan2 = Math.atan2;
18687   var cos = Math.cos;
18688   var exp = Math.exp;
18689   var log = Math.log;
18690   var sin = Math.sin;
18691   var sign = Math.sign || function(x3) {
18692     return x3 > 0 ? 1 : x3 < 0 ? -1 : 0;
18693   };
18694   var sqrt = Math.sqrt;
18695   var tan = Math.tan;
18696   function acos(x3) {
18697     return x3 > 1 ? 0 : x3 < -1 ? pi : Math.acos(x3);
18698   }
18699   function asin(x3) {
18700     return x3 > 1 ? halfPi : x3 < -1 ? -halfPi : Math.asin(x3);
18701   }
18702
18703   // node_modules/d3-geo/src/noop.js
18704   function noop2() {
18705   }
18706
18707   // node_modules/d3-geo/src/stream.js
18708   function streamGeometry(geometry, stream) {
18709     if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
18710       streamGeometryType[geometry.type](geometry, stream);
18711     }
18712   }
18713   var streamObjectType = {
18714     Feature: function(object, stream) {
18715       streamGeometry(object.geometry, stream);
18716     },
18717     FeatureCollection: function(object, stream) {
18718       var features = object.features, i3 = -1, n3 = features.length;
18719       while (++i3 < n3) streamGeometry(features[i3].geometry, stream);
18720     }
18721   };
18722   var streamGeometryType = {
18723     Sphere: function(object, stream) {
18724       stream.sphere();
18725     },
18726     Point: function(object, stream) {
18727       object = object.coordinates;
18728       stream.point(object[0], object[1], object[2]);
18729     },
18730     MultiPoint: function(object, stream) {
18731       var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
18732       while (++i3 < n3) object = coordinates[i3], stream.point(object[0], object[1], object[2]);
18733     },
18734     LineString: function(object, stream) {
18735       streamLine(object.coordinates, stream, 0);
18736     },
18737     MultiLineString: function(object, stream) {
18738       var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
18739       while (++i3 < n3) streamLine(coordinates[i3], stream, 0);
18740     },
18741     Polygon: function(object, stream) {
18742       streamPolygon(object.coordinates, stream);
18743     },
18744     MultiPolygon: function(object, stream) {
18745       var coordinates = object.coordinates, i3 = -1, n3 = coordinates.length;
18746       while (++i3 < n3) streamPolygon(coordinates[i3], stream);
18747     },
18748     GeometryCollection: function(object, stream) {
18749       var geometries = object.geometries, i3 = -1, n3 = geometries.length;
18750       while (++i3 < n3) streamGeometry(geometries[i3], stream);
18751     }
18752   };
18753   function streamLine(coordinates, stream, closed) {
18754     var i3 = -1, n3 = coordinates.length - closed, coordinate;
18755     stream.lineStart();
18756     while (++i3 < n3) coordinate = coordinates[i3], stream.point(coordinate[0], coordinate[1], coordinate[2]);
18757     stream.lineEnd();
18758   }
18759   function streamPolygon(coordinates, stream) {
18760     var i3 = -1, n3 = coordinates.length;
18761     stream.polygonStart();
18762     while (++i3 < n3) streamLine(coordinates[i3], stream, 1);
18763     stream.polygonEnd();
18764   }
18765   function stream_default(object, stream) {
18766     if (object && streamObjectType.hasOwnProperty(object.type)) {
18767       streamObjectType[object.type](object, stream);
18768     } else {
18769       streamGeometry(object, stream);
18770     }
18771   }
18772
18773   // node_modules/d3-geo/src/area.js
18774   var areaRingSum = new Adder();
18775   var areaSum = new Adder();
18776   var lambda00;
18777   var phi00;
18778   var lambda0;
18779   var cosPhi0;
18780   var sinPhi0;
18781   var areaStream = {
18782     point: noop2,
18783     lineStart: noop2,
18784     lineEnd: noop2,
18785     polygonStart: function() {
18786       areaRingSum = new Adder();
18787       areaStream.lineStart = areaRingStart;
18788       areaStream.lineEnd = areaRingEnd;
18789     },
18790     polygonEnd: function() {
18791       var areaRing = +areaRingSum;
18792       areaSum.add(areaRing < 0 ? tau + areaRing : areaRing);
18793       this.lineStart = this.lineEnd = this.point = noop2;
18794     },
18795     sphere: function() {
18796       areaSum.add(tau);
18797     }
18798   };
18799   function areaRingStart() {
18800     areaStream.point = areaPointFirst;
18801   }
18802   function areaRingEnd() {
18803     areaPoint(lambda00, phi00);
18804   }
18805   function areaPointFirst(lambda, phi) {
18806     areaStream.point = areaPoint;
18807     lambda00 = lambda, phi00 = phi;
18808     lambda *= radians, phi *= radians;
18809     lambda0 = lambda, cosPhi0 = cos(phi = phi / 2 + quarterPi), sinPhi0 = sin(phi);
18810   }
18811   function areaPoint(lambda, phi) {
18812     lambda *= radians, phi *= radians;
18813     phi = phi / 2 + quarterPi;
18814     var dLambda = lambda - lambda0, sdLambda = dLambda >= 0 ? 1 : -1, adLambda = sdLambda * dLambda, cosPhi = cos(phi), sinPhi = sin(phi), k3 = sinPhi0 * sinPhi, u4 = cosPhi0 * cosPhi + k3 * cos(adLambda), v3 = k3 * sdLambda * sin(adLambda);
18815     areaRingSum.add(atan2(v3, u4));
18816     lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
18817   }
18818   function area_default2(object) {
18819     areaSum = new Adder();
18820     stream_default(object, areaStream);
18821     return areaSum * 2;
18822   }
18823
18824   // node_modules/d3-geo/src/cartesian.js
18825   function spherical(cartesian2) {
18826     return [atan2(cartesian2[1], cartesian2[0]), asin(cartesian2[2])];
18827   }
18828   function cartesian(spherical2) {
18829     var lambda = spherical2[0], phi = spherical2[1], cosPhi = cos(phi);
18830     return [cosPhi * cos(lambda), cosPhi * sin(lambda), sin(phi)];
18831   }
18832   function cartesianDot(a2, b3) {
18833     return a2[0] * b3[0] + a2[1] * b3[1] + a2[2] * b3[2];
18834   }
18835   function cartesianCross(a2, b3) {
18836     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]];
18837   }
18838   function cartesianAddInPlace(a2, b3) {
18839     a2[0] += b3[0], a2[1] += b3[1], a2[2] += b3[2];
18840   }
18841   function cartesianScale(vector, k3) {
18842     return [vector[0] * k3, vector[1] * k3, vector[2] * k3];
18843   }
18844   function cartesianNormalizeInPlace(d2) {
18845     var l2 = sqrt(d2[0] * d2[0] + d2[1] * d2[1] + d2[2] * d2[2]);
18846     d2[0] /= l2, d2[1] /= l2, d2[2] /= l2;
18847   }
18848
18849   // node_modules/d3-geo/src/bounds.js
18850   var lambda02;
18851   var phi0;
18852   var lambda1;
18853   var phi1;
18854   var lambda2;
18855   var lambda002;
18856   var phi002;
18857   var p0;
18858   var deltaSum;
18859   var ranges;
18860   var range2;
18861   var boundsStream = {
18862     point: boundsPoint,
18863     lineStart: boundsLineStart,
18864     lineEnd: boundsLineEnd,
18865     polygonStart: function() {
18866       boundsStream.point = boundsRingPoint;
18867       boundsStream.lineStart = boundsRingStart;
18868       boundsStream.lineEnd = boundsRingEnd;
18869       deltaSum = new Adder();
18870       areaStream.polygonStart();
18871     },
18872     polygonEnd: function() {
18873       areaStream.polygonEnd();
18874       boundsStream.point = boundsPoint;
18875       boundsStream.lineStart = boundsLineStart;
18876       boundsStream.lineEnd = boundsLineEnd;
18877       if (areaRingSum < 0) lambda02 = -(lambda1 = 180), phi0 = -(phi1 = 90);
18878       else if (deltaSum > epsilon) phi1 = 90;
18879       else if (deltaSum < -epsilon) phi0 = -90;
18880       range2[0] = lambda02, range2[1] = lambda1;
18881     },
18882     sphere: function() {
18883       lambda02 = -(lambda1 = 180), phi0 = -(phi1 = 90);
18884     }
18885   };
18886   function boundsPoint(lambda, phi) {
18887     ranges.push(range2 = [lambda02 = lambda, lambda1 = lambda]);
18888     if (phi < phi0) phi0 = phi;
18889     if (phi > phi1) phi1 = phi;
18890   }
18891   function linePoint(lambda, phi) {
18892     var p2 = cartesian([lambda * radians, phi * radians]);
18893     if (p0) {
18894       var normal = cartesianCross(p0, p2), equatorial = [normal[1], -normal[0], 0], inflection = cartesianCross(equatorial, normal);
18895       cartesianNormalizeInPlace(inflection);
18896       inflection = spherical(inflection);
18897       var delta = lambda - lambda2, sign2 = delta > 0 ? 1 : -1, lambdai = inflection[0] * degrees * sign2, phii, antimeridian = abs(delta) > 180;
18898       if (antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
18899         phii = inflection[1] * degrees;
18900         if (phii > phi1) phi1 = phii;
18901       } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign2 * lambda2 < lambdai && lambdai < sign2 * lambda)) {
18902         phii = -inflection[1] * degrees;
18903         if (phii < phi0) phi0 = phii;
18904       } else {
18905         if (phi < phi0) phi0 = phi;
18906         if (phi > phi1) phi1 = phi;
18907       }
18908       if (antimeridian) {
18909         if (lambda < lambda2) {
18910           if (angle(lambda02, lambda) > angle(lambda02, lambda1)) lambda1 = lambda;
18911         } else {
18912           if (angle(lambda, lambda1) > angle(lambda02, lambda1)) lambda02 = lambda;
18913         }
18914       } else {
18915         if (lambda1 >= lambda02) {
18916           if (lambda < lambda02) lambda02 = lambda;
18917           if (lambda > lambda1) lambda1 = lambda;
18918         } else {
18919           if (lambda > lambda2) {
18920             if (angle(lambda02, lambda) > angle(lambda02, lambda1)) lambda1 = lambda;
18921           } else {
18922             if (angle(lambda, lambda1) > angle(lambda02, lambda1)) lambda02 = lambda;
18923           }
18924         }
18925       }
18926     } else {
18927       ranges.push(range2 = [lambda02 = lambda, lambda1 = lambda]);
18928     }
18929     if (phi < phi0) phi0 = phi;
18930     if (phi > phi1) phi1 = phi;
18931     p0 = p2, lambda2 = lambda;
18932   }
18933   function boundsLineStart() {
18934     boundsStream.point = linePoint;
18935   }
18936   function boundsLineEnd() {
18937     range2[0] = lambda02, range2[1] = lambda1;
18938     boundsStream.point = boundsPoint;
18939     p0 = null;
18940   }
18941   function boundsRingPoint(lambda, phi) {
18942     if (p0) {
18943       var delta = lambda - lambda2;
18944       deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
18945     } else {
18946       lambda002 = lambda, phi002 = phi;
18947     }
18948     areaStream.point(lambda, phi);
18949     linePoint(lambda, phi);
18950   }
18951   function boundsRingStart() {
18952     areaStream.lineStart();
18953   }
18954   function boundsRingEnd() {
18955     boundsRingPoint(lambda002, phi002);
18956     areaStream.lineEnd();
18957     if (abs(deltaSum) > epsilon) lambda02 = -(lambda1 = 180);
18958     range2[0] = lambda02, range2[1] = lambda1;
18959     p0 = null;
18960   }
18961   function angle(lambda04, lambda12) {
18962     return (lambda12 -= lambda04) < 0 ? lambda12 + 360 : lambda12;
18963   }
18964   function rangeCompare(a2, b3) {
18965     return a2[0] - b3[0];
18966   }
18967   function rangeContains(range3, x3) {
18968     return range3[0] <= range3[1] ? range3[0] <= x3 && x3 <= range3[1] : x3 < range3[0] || range3[1] < x3;
18969   }
18970   function bounds_default(feature4) {
18971     var i3, n3, a2, b3, merged, deltaMax, delta;
18972     phi1 = lambda1 = -(lambda02 = phi0 = Infinity);
18973     ranges = [];
18974     stream_default(feature4, boundsStream);
18975     if (n3 = ranges.length) {
18976       ranges.sort(rangeCompare);
18977       for (i3 = 1, a2 = ranges[0], merged = [a2]; i3 < n3; ++i3) {
18978         b3 = ranges[i3];
18979         if (rangeContains(a2, b3[0]) || rangeContains(a2, b3[1])) {
18980           if (angle(a2[0], b3[1]) > angle(a2[0], a2[1])) a2[1] = b3[1];
18981           if (angle(b3[0], a2[1]) > angle(a2[0], a2[1])) a2[0] = b3[0];
18982         } else {
18983           merged.push(a2 = b3);
18984         }
18985       }
18986       for (deltaMax = -Infinity, n3 = merged.length - 1, i3 = 0, a2 = merged[n3]; i3 <= n3; a2 = b3, ++i3) {
18987         b3 = merged[i3];
18988         if ((delta = angle(a2[1], b3[0])) > deltaMax) deltaMax = delta, lambda02 = b3[0], lambda1 = a2[1];
18989       }
18990     }
18991     ranges = range2 = null;
18992     return lambda02 === Infinity || phi0 === Infinity ? [[NaN, NaN], [NaN, NaN]] : [[lambda02, phi0], [lambda1, phi1]];
18993   }
18994
18995   // node_modules/d3-geo/src/compose.js
18996   function compose_default(a2, b3) {
18997     function compose(x3, y3) {
18998       return x3 = a2(x3, y3), b3(x3[0], x3[1]);
18999     }
19000     if (a2.invert && b3.invert) compose.invert = function(x3, y3) {
19001       return x3 = b3.invert(x3, y3), x3 && a2.invert(x3[0], x3[1]);
19002     };
19003     return compose;
19004   }
19005
19006   // node_modules/d3-geo/src/rotation.js
19007   function rotationIdentity(lambda, phi) {
19008     if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
19009     return [lambda, phi];
19010   }
19011   rotationIdentity.invert = rotationIdentity;
19012   function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
19013     return (deltaLambda %= tau) ? deltaPhi || deltaGamma ? compose_default(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma)) : rotationLambda(deltaLambda) : deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma) : rotationIdentity;
19014   }
19015   function forwardRotationLambda(deltaLambda) {
19016     return function(lambda, phi) {
19017       lambda += deltaLambda;
19018       if (abs(lambda) > pi) lambda -= Math.round(lambda / tau) * tau;
19019       return [lambda, phi];
19020     };
19021   }
19022   function rotationLambda(deltaLambda) {
19023     var rotation = forwardRotationLambda(deltaLambda);
19024     rotation.invert = forwardRotationLambda(-deltaLambda);
19025     return rotation;
19026   }
19027   function rotationPhiGamma(deltaPhi, deltaGamma) {
19028     var cosDeltaPhi = cos(deltaPhi), sinDeltaPhi = sin(deltaPhi), cosDeltaGamma = cos(deltaGamma), sinDeltaGamma = sin(deltaGamma);
19029     function rotation(lambda, phi) {
19030       var cosPhi = cos(phi), x3 = cos(lambda) * cosPhi, y3 = sin(lambda) * cosPhi, z3 = sin(phi), k3 = z3 * cosDeltaPhi + x3 * sinDeltaPhi;
19031       return [
19032         atan2(y3 * cosDeltaGamma - k3 * sinDeltaGamma, x3 * cosDeltaPhi - z3 * sinDeltaPhi),
19033         asin(k3 * cosDeltaGamma + y3 * sinDeltaGamma)
19034       ];
19035     }
19036     rotation.invert = function(lambda, phi) {
19037       var cosPhi = cos(phi), x3 = cos(lambda) * cosPhi, y3 = sin(lambda) * cosPhi, z3 = sin(phi), k3 = z3 * cosDeltaGamma - y3 * sinDeltaGamma;
19038       return [
19039         atan2(y3 * cosDeltaGamma + z3 * sinDeltaGamma, x3 * cosDeltaPhi + k3 * sinDeltaPhi),
19040         asin(k3 * cosDeltaPhi - x3 * sinDeltaPhi)
19041       ];
19042     };
19043     return rotation;
19044   }
19045   function rotation_default(rotate) {
19046     rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
19047     function forward(coordinates) {
19048       coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
19049       return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
19050     }
19051     forward.invert = function(coordinates) {
19052       coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
19053       return coordinates[0] *= degrees, coordinates[1] *= degrees, coordinates;
19054     };
19055     return forward;
19056   }
19057
19058   // node_modules/d3-geo/src/circle.js
19059   function circleStream(stream, radius, delta, direction, t0, t1) {
19060     if (!delta) return;
19061     var cosRadius = cos(radius), sinRadius = sin(radius), step = direction * delta;
19062     if (t0 == null) {
19063       t0 = radius + direction * tau;
19064       t1 = radius - step / 2;
19065     } else {
19066       t0 = circleRadius(cosRadius, t0);
19067       t1 = circleRadius(cosRadius, t1);
19068       if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau;
19069     }
19070     for (var point, t2 = t0; direction > 0 ? t2 > t1 : t2 < t1; t2 -= step) {
19071       point = spherical([cosRadius, -sinRadius * cos(t2), -sinRadius * sin(t2)]);
19072       stream.point(point[0], point[1]);
19073     }
19074   }
19075   function circleRadius(cosRadius, point) {
19076     point = cartesian(point), point[0] -= cosRadius;
19077     cartesianNormalizeInPlace(point);
19078     var radius = acos(-point[1]);
19079     return ((-point[2] < 0 ? -radius : radius) + tau - epsilon) % tau;
19080   }
19081
19082   // node_modules/d3-geo/src/clip/buffer.js
19083   function buffer_default() {
19084     var lines = [], line;
19085     return {
19086       point: function(x3, y3, m3) {
19087         line.push([x3, y3, m3]);
19088       },
19089       lineStart: function() {
19090         lines.push(line = []);
19091       },
19092       lineEnd: noop2,
19093       rejoin: function() {
19094         if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
19095       },
19096       result: function() {
19097         var result = lines;
19098         lines = [];
19099         line = null;
19100         return result;
19101       }
19102     };
19103   }
19104
19105   // node_modules/d3-geo/src/pointEqual.js
19106   function pointEqual_default(a2, b3) {
19107     return abs(a2[0] - b3[0]) < epsilon && abs(a2[1] - b3[1]) < epsilon;
19108   }
19109
19110   // node_modules/d3-geo/src/clip/rejoin.js
19111   function Intersection(point, points, other, entry) {
19112     this.x = point;
19113     this.z = points;
19114     this.o = other;
19115     this.e = entry;
19116     this.v = false;
19117     this.n = this.p = null;
19118   }
19119   function rejoin_default(segments, compareIntersection2, startInside, interpolate, stream) {
19120     var subject = [], clip = [], i3, n3;
19121     segments.forEach(function(segment) {
19122       if ((n4 = segment.length - 1) <= 0) return;
19123       var n4, p02 = segment[0], p1 = segment[n4], x3;
19124       if (pointEqual_default(p02, p1)) {
19125         if (!p02[2] && !p1[2]) {
19126           stream.lineStart();
19127           for (i3 = 0; i3 < n4; ++i3) stream.point((p02 = segment[i3])[0], p02[1]);
19128           stream.lineEnd();
19129           return;
19130         }
19131         p1[0] += 2 * epsilon;
19132       }
19133       subject.push(x3 = new Intersection(p02, segment, null, true));
19134       clip.push(x3.o = new Intersection(p02, null, x3, false));
19135       subject.push(x3 = new Intersection(p1, segment, null, false));
19136       clip.push(x3.o = new Intersection(p1, null, x3, true));
19137     });
19138     if (!subject.length) return;
19139     clip.sort(compareIntersection2);
19140     link(subject);
19141     link(clip);
19142     for (i3 = 0, n3 = clip.length; i3 < n3; ++i3) {
19143       clip[i3].e = startInside = !startInside;
19144     }
19145     var start2 = subject[0], points, point;
19146     while (1) {
19147       var current = start2, isSubject = true;
19148       while (current.v) if ((current = current.n) === start2) return;
19149       points = current.z;
19150       stream.lineStart();
19151       do {
19152         current.v = current.o.v = true;
19153         if (current.e) {
19154           if (isSubject) {
19155             for (i3 = 0, n3 = points.length; i3 < n3; ++i3) stream.point((point = points[i3])[0], point[1]);
19156           } else {
19157             interpolate(current.x, current.n.x, 1, stream);
19158           }
19159           current = current.n;
19160         } else {
19161           if (isSubject) {
19162             points = current.p.z;
19163             for (i3 = points.length - 1; i3 >= 0; --i3) stream.point((point = points[i3])[0], point[1]);
19164           } else {
19165             interpolate(current.x, current.p.x, -1, stream);
19166           }
19167           current = current.p;
19168         }
19169         current = current.o;
19170         points = current.z;
19171         isSubject = !isSubject;
19172       } while (!current.v);
19173       stream.lineEnd();
19174     }
19175   }
19176   function link(array2) {
19177     if (!(n3 = array2.length)) return;
19178     var n3, i3 = 0, a2 = array2[0], b3;
19179     while (++i3 < n3) {
19180       a2.n = b3 = array2[i3];
19181       b3.p = a2;
19182       a2 = b3;
19183     }
19184     a2.n = b3 = array2[0];
19185     b3.p = a2;
19186   }
19187
19188   // node_modules/d3-geo/src/polygonContains.js
19189   function longitude(point) {
19190     return abs(point[0]) <= pi ? point[0] : sign(point[0]) * ((abs(point[0]) + pi) % tau - pi);
19191   }
19192   function polygonContains_default(polygon2, point) {
19193     var lambda = longitude(point), phi = point[1], sinPhi = sin(phi), normal = [sin(lambda), -cos(lambda), 0], angle2 = 0, winding = 0;
19194     var sum = new Adder();
19195     if (sinPhi === 1) phi = halfPi + epsilon;
19196     else if (sinPhi === -1) phi = -halfPi - epsilon;
19197     for (var i3 = 0, n3 = polygon2.length; i3 < n3; ++i3) {
19198       if (!(m3 = (ring = polygon2[i3]).length)) continue;
19199       var ring, m3, point0 = ring[m3 - 1], lambda04 = longitude(point0), phi02 = point0[1] / 2 + quarterPi, sinPhi03 = sin(phi02), cosPhi03 = cos(phi02);
19200       for (var j3 = 0; j3 < m3; ++j3, lambda04 = lambda12, sinPhi03 = sinPhi1, cosPhi03 = cosPhi1, point0 = point1) {
19201         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, k3 = sinPhi03 * sinPhi1;
19202         sum.add(atan2(k3 * sign2 * sin(absDelta), cosPhi03 * cosPhi1 + k3 * cos(absDelta)));
19203         angle2 += antimeridian ? delta + sign2 * tau : delta;
19204         if (antimeridian ^ lambda04 >= lambda ^ lambda12 >= lambda) {
19205           var arc = cartesianCross(cartesian(point0), cartesian(point1));
19206           cartesianNormalizeInPlace(arc);
19207           var intersection2 = cartesianCross(normal, arc);
19208           cartesianNormalizeInPlace(intersection2);
19209           var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection2[2]);
19210           if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
19211             winding += antimeridian ^ delta >= 0 ? 1 : -1;
19212           }
19213         }
19214       }
19215     }
19216     return (angle2 < -epsilon || angle2 < epsilon && sum < -epsilon2) ^ winding & 1;
19217   }
19218
19219   // node_modules/d3-geo/src/clip/index.js
19220   function clip_default(pointVisible, clipLine, interpolate, start2) {
19221     return function(sink) {
19222       var line = clipLine(sink), ringBuffer = buffer_default(), ringSink = clipLine(ringBuffer), polygonStarted = false, polygon2, segments, ring;
19223       var clip = {
19224         point,
19225         lineStart,
19226         lineEnd,
19227         polygonStart: function() {
19228           clip.point = pointRing;
19229           clip.lineStart = ringStart;
19230           clip.lineEnd = ringEnd;
19231           segments = [];
19232           polygon2 = [];
19233         },
19234         polygonEnd: function() {
19235           clip.point = point;
19236           clip.lineStart = lineStart;
19237           clip.lineEnd = lineEnd;
19238           segments = merge2(segments);
19239           var startInside = polygonContains_default(polygon2, start2);
19240           if (segments.length) {
19241             if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
19242             rejoin_default(segments, compareIntersection, startInside, interpolate, sink);
19243           } else if (startInside) {
19244             if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
19245             sink.lineStart();
19246             interpolate(null, null, 1, sink);
19247             sink.lineEnd();
19248           }
19249           if (polygonStarted) sink.polygonEnd(), polygonStarted = false;
19250           segments = polygon2 = null;
19251         },
19252         sphere: function() {
19253           sink.polygonStart();
19254           sink.lineStart();
19255           interpolate(null, null, 1, sink);
19256           sink.lineEnd();
19257           sink.polygonEnd();
19258         }
19259       };
19260       function point(lambda, phi) {
19261         if (pointVisible(lambda, phi)) sink.point(lambda, phi);
19262       }
19263       function pointLine(lambda, phi) {
19264         line.point(lambda, phi);
19265       }
19266       function lineStart() {
19267         clip.point = pointLine;
19268         line.lineStart();
19269       }
19270       function lineEnd() {
19271         clip.point = point;
19272         line.lineEnd();
19273       }
19274       function pointRing(lambda, phi) {
19275         ring.push([lambda, phi]);
19276         ringSink.point(lambda, phi);
19277       }
19278       function ringStart() {
19279         ringSink.lineStart();
19280         ring = [];
19281       }
19282       function ringEnd() {
19283         pointRing(ring[0][0], ring[0][1]);
19284         ringSink.lineEnd();
19285         var clean2 = ringSink.clean(), ringSegments = ringBuffer.result(), i3, n3 = ringSegments.length, m3, segment, point2;
19286         ring.pop();
19287         polygon2.push(ring);
19288         ring = null;
19289         if (!n3) return;
19290         if (clean2 & 1) {
19291           segment = ringSegments[0];
19292           if ((m3 = segment.length - 1) > 0) {
19293             if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
19294             sink.lineStart();
19295             for (i3 = 0; i3 < m3; ++i3) sink.point((point2 = segment[i3])[0], point2[1]);
19296             sink.lineEnd();
19297           }
19298           return;
19299         }
19300         if (n3 > 1 && clean2 & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
19301         segments.push(ringSegments.filter(validSegment));
19302       }
19303       return clip;
19304     };
19305   }
19306   function validSegment(segment) {
19307     return segment.length > 1;
19308   }
19309   function compareIntersection(a2, b3) {
19310     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]);
19311   }
19312
19313   // node_modules/d3-geo/src/clip/antimeridian.js
19314   var antimeridian_default = clip_default(
19315     function() {
19316       return true;
19317     },
19318     clipAntimeridianLine,
19319     clipAntimeridianInterpolate,
19320     [-pi, -halfPi]
19321   );
19322   function clipAntimeridianLine(stream) {
19323     var lambda04 = NaN, phi02 = NaN, sign0 = NaN, clean2;
19324     return {
19325       lineStart: function() {
19326         stream.lineStart();
19327         clean2 = 1;
19328       },
19329       point: function(lambda12, phi12) {
19330         var sign1 = lambda12 > 0 ? pi : -pi, delta = abs(lambda12 - lambda04);
19331         if (abs(delta - pi) < epsilon) {
19332           stream.point(lambda04, phi02 = (phi02 + phi12) / 2 > 0 ? halfPi : -halfPi);
19333           stream.point(sign0, phi02);
19334           stream.lineEnd();
19335           stream.lineStart();
19336           stream.point(sign1, phi02);
19337           stream.point(lambda12, phi02);
19338           clean2 = 0;
19339         } else if (sign0 !== sign1 && delta >= pi) {
19340           if (abs(lambda04 - sign0) < epsilon) lambda04 -= sign0 * epsilon;
19341           if (abs(lambda12 - sign1) < epsilon) lambda12 -= sign1 * epsilon;
19342           phi02 = clipAntimeridianIntersect(lambda04, phi02, lambda12, phi12);
19343           stream.point(sign0, phi02);
19344           stream.lineEnd();
19345           stream.lineStart();
19346           stream.point(sign1, phi02);
19347           clean2 = 0;
19348         }
19349         stream.point(lambda04 = lambda12, phi02 = phi12);
19350         sign0 = sign1;
19351       },
19352       lineEnd: function() {
19353         stream.lineEnd();
19354         lambda04 = phi02 = NaN;
19355       },
19356       clean: function() {
19357         return 2 - clean2;
19358       }
19359     };
19360   }
19361   function clipAntimeridianIntersect(lambda04, phi02, lambda12, phi12) {
19362     var cosPhi03, cosPhi1, sinLambda0Lambda1 = sin(lambda04 - lambda12);
19363     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;
19364   }
19365   function clipAntimeridianInterpolate(from, to, direction, stream) {
19366     var phi;
19367     if (from == null) {
19368       phi = direction * halfPi;
19369       stream.point(-pi, phi);
19370       stream.point(0, phi);
19371       stream.point(pi, phi);
19372       stream.point(pi, 0);
19373       stream.point(pi, -phi);
19374       stream.point(0, -phi);
19375       stream.point(-pi, -phi);
19376       stream.point(-pi, 0);
19377       stream.point(-pi, phi);
19378     } else if (abs(from[0] - to[0]) > epsilon) {
19379       var lambda = from[0] < to[0] ? pi : -pi;
19380       phi = direction * lambda / 2;
19381       stream.point(-lambda, phi);
19382       stream.point(0, phi);
19383       stream.point(lambda, phi);
19384     } else {
19385       stream.point(to[0], to[1]);
19386     }
19387   }
19388
19389   // node_modules/d3-geo/src/clip/circle.js
19390   function circle_default(radius) {
19391     var cr = cos(radius), delta = 2 * radians, smallRadius = cr > 0, notHemisphere = abs(cr) > epsilon;
19392     function interpolate(from, to, direction, stream) {
19393       circleStream(stream, radius, delta, direction, from, to);
19394     }
19395     function visible(lambda, phi) {
19396       return cos(lambda) * cos(phi) > cr;
19397     }
19398     function clipLine(stream) {
19399       var point0, c0, v0, v00, clean2;
19400       return {
19401         lineStart: function() {
19402           v00 = v0 = false;
19403           clean2 = 1;
19404         },
19405         point: function(lambda, phi) {
19406           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;
19407           if (!point0 && (v00 = v0 = v3)) stream.lineStart();
19408           if (v3 !== v0) {
19409             point2 = intersect2(point0, point1);
19410             if (!point2 || pointEqual_default(point0, point2) || pointEqual_default(point1, point2))
19411               point1[2] = 1;
19412           }
19413           if (v3 !== v0) {
19414             clean2 = 0;
19415             if (v3) {
19416               stream.lineStart();
19417               point2 = intersect2(point1, point0);
19418               stream.point(point2[0], point2[1]);
19419             } else {
19420               point2 = intersect2(point0, point1);
19421               stream.point(point2[0], point2[1], 2);
19422               stream.lineEnd();
19423             }
19424             point0 = point2;
19425           } else if (notHemisphere && point0 && smallRadius ^ v3) {
19426             var t2;
19427             if (!(c2 & c0) && (t2 = intersect2(point1, point0, true))) {
19428               clean2 = 0;
19429               if (smallRadius) {
19430                 stream.lineStart();
19431                 stream.point(t2[0][0], t2[0][1]);
19432                 stream.point(t2[1][0], t2[1][1]);
19433                 stream.lineEnd();
19434               } else {
19435                 stream.point(t2[1][0], t2[1][1]);
19436                 stream.lineEnd();
19437                 stream.lineStart();
19438                 stream.point(t2[0][0], t2[0][1], 3);
19439               }
19440             }
19441           }
19442           if (v3 && (!point0 || !pointEqual_default(point0, point1))) {
19443             stream.point(point1[0], point1[1]);
19444           }
19445           point0 = point1, v0 = v3, c0 = c2;
19446         },
19447         lineEnd: function() {
19448           if (v0) stream.lineEnd();
19449           point0 = null;
19450         },
19451         // Rejoin first and last segments if there were intersections and the first
19452         // and last points were visible.
19453         clean: function() {
19454           return clean2 | (v00 && v0) << 1;
19455         }
19456       };
19457     }
19458     function intersect2(a2, b3, two) {
19459       var pa = cartesian(a2), pb = cartesian(b3);
19460       var n1 = [1, 0, 0], n22 = cartesianCross(pa, pb), n2n2 = cartesianDot(n22, n22), n1n2 = n22[0], determinant = n2n2 - n1n2 * n1n2;
19461       if (!determinant) return !two && a2;
19462       var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = cartesianCross(n1, n22), A2 = cartesianScale(n1, c1), B3 = cartesianScale(n22, c2);
19463       cartesianAddInPlace(A2, B3);
19464       var u4 = n1xn2, w3 = cartesianDot(A2, u4), uu = cartesianDot(u4, u4), t2 = w3 * w3 - uu * (cartesianDot(A2, A2) - 1);
19465       if (t2 < 0) return;
19466       var t3 = sqrt(t2), q3 = cartesianScale(u4, (-w3 - t3) / uu);
19467       cartesianAddInPlace(q3, A2);
19468       q3 = spherical(q3);
19469       if (!two) return q3;
19470       var lambda04 = a2[0], lambda12 = b3[0], phi02 = a2[1], phi12 = b3[1], z3;
19471       if (lambda12 < lambda04) z3 = lambda04, lambda04 = lambda12, lambda12 = z3;
19472       var delta2 = lambda12 - lambda04, polar = abs(delta2 - pi) < epsilon, meridian = polar || delta2 < epsilon;
19473       if (!polar && phi12 < phi02) z3 = phi02, phi02 = phi12, phi12 = z3;
19474       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)) {
19475         var q1 = cartesianScale(u4, (-w3 + t3) / uu);
19476         cartesianAddInPlace(q1, A2);
19477         return [q3, spherical(q1)];
19478       }
19479     }
19480     function code(lambda, phi) {
19481       var r2 = smallRadius ? radius : pi - radius, code2 = 0;
19482       if (lambda < -r2) code2 |= 1;
19483       else if (lambda > r2) code2 |= 2;
19484       if (phi < -r2) code2 |= 4;
19485       else if (phi > r2) code2 |= 8;
19486       return code2;
19487     }
19488     return clip_default(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi, radius - pi]);
19489   }
19490
19491   // node_modules/d3-geo/src/clip/line.js
19492   function line_default(a2, b3, x05, y05, x12, y12) {
19493     var ax = a2[0], ay = a2[1], bx = b3[0], by = b3[1], t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r2;
19494     r2 = x05 - ax;
19495     if (!dx && r2 > 0) return;
19496     r2 /= dx;
19497     if (dx < 0) {
19498       if (r2 < t0) return;
19499       if (r2 < t1) t1 = r2;
19500     } else if (dx > 0) {
19501       if (r2 > t1) return;
19502       if (r2 > t0) t0 = r2;
19503     }
19504     r2 = x12 - ax;
19505     if (!dx && r2 < 0) return;
19506     r2 /= dx;
19507     if (dx < 0) {
19508       if (r2 > t1) return;
19509       if (r2 > t0) t0 = r2;
19510     } else if (dx > 0) {
19511       if (r2 < t0) return;
19512       if (r2 < t1) t1 = r2;
19513     }
19514     r2 = y05 - ay;
19515     if (!dy && r2 > 0) return;
19516     r2 /= dy;
19517     if (dy < 0) {
19518       if (r2 < t0) return;
19519       if (r2 < t1) t1 = r2;
19520     } else if (dy > 0) {
19521       if (r2 > t1) return;
19522       if (r2 > t0) t0 = r2;
19523     }
19524     r2 = y12 - ay;
19525     if (!dy && r2 < 0) return;
19526     r2 /= dy;
19527     if (dy < 0) {
19528       if (r2 > t1) return;
19529       if (r2 > t0) t0 = r2;
19530     } else if (dy > 0) {
19531       if (r2 < t0) return;
19532       if (r2 < t1) t1 = r2;
19533     }
19534     if (t0 > 0) a2[0] = ax + t0 * dx, a2[1] = ay + t0 * dy;
19535     if (t1 < 1) b3[0] = ax + t1 * dx, b3[1] = ay + t1 * dy;
19536     return true;
19537   }
19538
19539   // node_modules/d3-geo/src/clip/rectangle.js
19540   var clipMax = 1e9;
19541   var clipMin = -clipMax;
19542   function clipRectangle(x05, y05, x12, y12) {
19543     function visible(x3, y3) {
19544       return x05 <= x3 && x3 <= x12 && y05 <= y3 && y3 <= y12;
19545     }
19546     function interpolate(from, to, direction, stream) {
19547       var a2 = 0, a1 = 0;
19548       if (from == null || (a2 = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoint(from, to) < 0 ^ direction > 0) {
19549         do
19550           stream.point(a2 === 0 || a2 === 3 ? x05 : x12, a2 > 1 ? y12 : y05);
19551         while ((a2 = (a2 + direction + 4) % 4) !== a1);
19552       } else {
19553         stream.point(to[0], to[1]);
19554       }
19555     }
19556     function corner(p2, direction) {
19557       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;
19558     }
19559     function compareIntersection2(a2, b3) {
19560       return comparePoint(a2.x, b3.x);
19561     }
19562     function comparePoint(a2, b3) {
19563       var ca = corner(a2, 1), cb = corner(b3, 1);
19564       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];
19565     }
19566     return function(stream) {
19567       var activeStream = stream, bufferStream = buffer_default(), segments, polygon2, ring, x__, y__, v__, x_, y_, v_, first, clean2;
19568       var clipStream = {
19569         point,
19570         lineStart,
19571         lineEnd,
19572         polygonStart,
19573         polygonEnd
19574       };
19575       function point(x3, y3) {
19576         if (visible(x3, y3)) activeStream.point(x3, y3);
19577       }
19578       function polygonInside() {
19579         var winding = 0;
19580         for (var i3 = 0, n3 = polygon2.length; i3 < n3; ++i3) {
19581           for (var ring2 = polygon2[i3], j3 = 1, m3 = ring2.length, point2 = ring2[0], a0, a1, b0 = point2[0], b1 = point2[1]; j3 < m3; ++j3) {
19582             a0 = b0, a1 = b1, point2 = ring2[j3], b0 = point2[0], b1 = point2[1];
19583             if (a1 <= y12) {
19584               if (b1 > y12 && (b0 - a0) * (y12 - a1) > (b1 - a1) * (x05 - a0)) ++winding;
19585             } else {
19586               if (b1 <= y12 && (b0 - a0) * (y12 - a1) < (b1 - a1) * (x05 - a0)) --winding;
19587             }
19588           }
19589         }
19590         return winding;
19591       }
19592       function polygonStart() {
19593         activeStream = bufferStream, segments = [], polygon2 = [], clean2 = true;
19594       }
19595       function polygonEnd() {
19596         var startInside = polygonInside(), cleanInside = clean2 && startInside, visible2 = (segments = merge2(segments)).length;
19597         if (cleanInside || visible2) {
19598           stream.polygonStart();
19599           if (cleanInside) {
19600             stream.lineStart();
19601             interpolate(null, null, 1, stream);
19602             stream.lineEnd();
19603           }
19604           if (visible2) {
19605             rejoin_default(segments, compareIntersection2, startInside, interpolate, stream);
19606           }
19607           stream.polygonEnd();
19608         }
19609         activeStream = stream, segments = polygon2 = ring = null;
19610       }
19611       function lineStart() {
19612         clipStream.point = linePoint2;
19613         if (polygon2) polygon2.push(ring = []);
19614         first = true;
19615         v_ = false;
19616         x_ = y_ = NaN;
19617       }
19618       function lineEnd() {
19619         if (segments) {
19620           linePoint2(x__, y__);
19621           if (v__ && v_) bufferStream.rejoin();
19622           segments.push(bufferStream.result());
19623         }
19624         clipStream.point = point;
19625         if (v_) activeStream.lineEnd();
19626       }
19627       function linePoint2(x3, y3) {
19628         var v3 = visible(x3, y3);
19629         if (polygon2) ring.push([x3, y3]);
19630         if (first) {
19631           x__ = x3, y__ = y3, v__ = v3;
19632           first = false;
19633           if (v3) {
19634             activeStream.lineStart();
19635             activeStream.point(x3, y3);
19636           }
19637         } else {
19638           if (v3 && v_) activeStream.point(x3, y3);
19639           else {
19640             var a2 = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))], b3 = [x3 = Math.max(clipMin, Math.min(clipMax, x3)), y3 = Math.max(clipMin, Math.min(clipMax, y3))];
19641             if (line_default(a2, b3, x05, y05, x12, y12)) {
19642               if (!v_) {
19643                 activeStream.lineStart();
19644                 activeStream.point(a2[0], a2[1]);
19645               }
19646               activeStream.point(b3[0], b3[1]);
19647               if (!v3) activeStream.lineEnd();
19648               clean2 = false;
19649             } else if (v3) {
19650               activeStream.lineStart();
19651               activeStream.point(x3, y3);
19652               clean2 = false;
19653             }
19654           }
19655         }
19656         x_ = x3, y_ = y3, v_ = v3;
19657       }
19658       return clipStream;
19659     };
19660   }
19661
19662   // node_modules/d3-geo/src/length.js
19663   var lengthSum;
19664   var lambda03;
19665   var sinPhi02;
19666   var cosPhi02;
19667   var lengthStream = {
19668     sphere: noop2,
19669     point: noop2,
19670     lineStart: lengthLineStart,
19671     lineEnd: noop2,
19672     polygonStart: noop2,
19673     polygonEnd: noop2
19674   };
19675   function lengthLineStart() {
19676     lengthStream.point = lengthPointFirst;
19677     lengthStream.lineEnd = lengthLineEnd;
19678   }
19679   function lengthLineEnd() {
19680     lengthStream.point = lengthStream.lineEnd = noop2;
19681   }
19682   function lengthPointFirst(lambda, phi) {
19683     lambda *= radians, phi *= radians;
19684     lambda03 = lambda, sinPhi02 = sin(phi), cosPhi02 = cos(phi);
19685     lengthStream.point = lengthPoint;
19686   }
19687   function lengthPoint(lambda, phi) {
19688     lambda *= radians, phi *= radians;
19689     var sinPhi = sin(phi), cosPhi = cos(phi), delta = abs(lambda - lambda03), cosDelta = cos(delta), sinDelta = sin(delta), x3 = cosPhi * sinDelta, y3 = cosPhi02 * sinPhi - sinPhi02 * cosPhi * cosDelta, z3 = sinPhi02 * sinPhi + cosPhi02 * cosPhi * cosDelta;
19690     lengthSum.add(atan2(sqrt(x3 * x3 + y3 * y3), z3));
19691     lambda03 = lambda, sinPhi02 = sinPhi, cosPhi02 = cosPhi;
19692   }
19693   function length_default(object) {
19694     lengthSum = new Adder();
19695     stream_default(object, lengthStream);
19696     return +lengthSum;
19697   }
19698
19699   // node_modules/d3-geo/src/identity.js
19700   var identity_default3 = (x3) => x3;
19701
19702   // node_modules/d3-geo/src/path/area.js
19703   var areaSum2 = new Adder();
19704   var areaRingSum2 = new Adder();
19705   var x00;
19706   var y00;
19707   var x0;
19708   var y0;
19709   var areaStream2 = {
19710     point: noop2,
19711     lineStart: noop2,
19712     lineEnd: noop2,
19713     polygonStart: function() {
19714       areaStream2.lineStart = areaRingStart2;
19715       areaStream2.lineEnd = areaRingEnd2;
19716     },
19717     polygonEnd: function() {
19718       areaStream2.lineStart = areaStream2.lineEnd = areaStream2.point = noop2;
19719       areaSum2.add(abs(areaRingSum2));
19720       areaRingSum2 = new Adder();
19721     },
19722     result: function() {
19723       var area = areaSum2 / 2;
19724       areaSum2 = new Adder();
19725       return area;
19726     }
19727   };
19728   function areaRingStart2() {
19729     areaStream2.point = areaPointFirst2;
19730   }
19731   function areaPointFirst2(x3, y3) {
19732     areaStream2.point = areaPoint2;
19733     x00 = x0 = x3, y00 = y0 = y3;
19734   }
19735   function areaPoint2(x3, y3) {
19736     areaRingSum2.add(y0 * x3 - x0 * y3);
19737     x0 = x3, y0 = y3;
19738   }
19739   function areaRingEnd2() {
19740     areaPoint2(x00, y00);
19741   }
19742   var area_default3 = areaStream2;
19743
19744   // node_modules/d3-geo/src/path/bounds.js
19745   var x02 = Infinity;
19746   var y02 = x02;
19747   var x1 = -x02;
19748   var y1 = x1;
19749   var boundsStream2 = {
19750     point: boundsPoint2,
19751     lineStart: noop2,
19752     lineEnd: noop2,
19753     polygonStart: noop2,
19754     polygonEnd: noop2,
19755     result: function() {
19756       var bounds = [[x02, y02], [x1, y1]];
19757       x1 = y1 = -(y02 = x02 = Infinity);
19758       return bounds;
19759     }
19760   };
19761   function boundsPoint2(x3, y3) {
19762     if (x3 < x02) x02 = x3;
19763     if (x3 > x1) x1 = x3;
19764     if (y3 < y02) y02 = y3;
19765     if (y3 > y1) y1 = y3;
19766   }
19767   var bounds_default2 = boundsStream2;
19768
19769   // node_modules/d3-geo/src/path/centroid.js
19770   var X0 = 0;
19771   var Y0 = 0;
19772   var Z0 = 0;
19773   var X1 = 0;
19774   var Y1 = 0;
19775   var Z1 = 0;
19776   var X2 = 0;
19777   var Y2 = 0;
19778   var Z2 = 0;
19779   var x002;
19780   var y002;
19781   var x03;
19782   var y03;
19783   var centroidStream = {
19784     point: centroidPoint,
19785     lineStart: centroidLineStart,
19786     lineEnd: centroidLineEnd,
19787     polygonStart: function() {
19788       centroidStream.lineStart = centroidRingStart;
19789       centroidStream.lineEnd = centroidRingEnd;
19790     },
19791     polygonEnd: function() {
19792       centroidStream.point = centroidPoint;
19793       centroidStream.lineStart = centroidLineStart;
19794       centroidStream.lineEnd = centroidLineEnd;
19795     },
19796     result: function() {
19797       var centroid = Z2 ? [X2 / Z2, Y2 / Z2] : Z1 ? [X1 / Z1, Y1 / Z1] : Z0 ? [X0 / Z0, Y0 / Z0] : [NaN, NaN];
19798       X0 = Y0 = Z0 = X1 = Y1 = Z1 = X2 = Y2 = Z2 = 0;
19799       return centroid;
19800     }
19801   };
19802   function centroidPoint(x3, y3) {
19803     X0 += x3;
19804     Y0 += y3;
19805     ++Z0;
19806   }
19807   function centroidLineStart() {
19808     centroidStream.point = centroidPointFirstLine;
19809   }
19810   function centroidPointFirstLine(x3, y3) {
19811     centroidStream.point = centroidPointLine;
19812     centroidPoint(x03 = x3, y03 = y3);
19813   }
19814   function centroidPointLine(x3, y3) {
19815     var dx = x3 - x03, dy = y3 - y03, z3 = sqrt(dx * dx + dy * dy);
19816     X1 += z3 * (x03 + x3) / 2;
19817     Y1 += z3 * (y03 + y3) / 2;
19818     Z1 += z3;
19819     centroidPoint(x03 = x3, y03 = y3);
19820   }
19821   function centroidLineEnd() {
19822     centroidStream.point = centroidPoint;
19823   }
19824   function centroidRingStart() {
19825     centroidStream.point = centroidPointFirstRing;
19826   }
19827   function centroidRingEnd() {
19828     centroidPointRing(x002, y002);
19829   }
19830   function centroidPointFirstRing(x3, y3) {
19831     centroidStream.point = centroidPointRing;
19832     centroidPoint(x002 = x03 = x3, y002 = y03 = y3);
19833   }
19834   function centroidPointRing(x3, y3) {
19835     var dx = x3 - x03, dy = y3 - y03, z3 = sqrt(dx * dx + dy * dy);
19836     X1 += z3 * (x03 + x3) / 2;
19837     Y1 += z3 * (y03 + y3) / 2;
19838     Z1 += z3;
19839     z3 = y03 * x3 - x03 * y3;
19840     X2 += z3 * (x03 + x3);
19841     Y2 += z3 * (y03 + y3);
19842     Z2 += z3 * 3;
19843     centroidPoint(x03 = x3, y03 = y3);
19844   }
19845   var centroid_default2 = centroidStream;
19846
19847   // node_modules/d3-geo/src/path/context.js
19848   function PathContext(context) {
19849     this._context = context;
19850   }
19851   PathContext.prototype = {
19852     _radius: 4.5,
19853     pointRadius: function(_3) {
19854       return this._radius = _3, this;
19855     },
19856     polygonStart: function() {
19857       this._line = 0;
19858     },
19859     polygonEnd: function() {
19860       this._line = NaN;
19861     },
19862     lineStart: function() {
19863       this._point = 0;
19864     },
19865     lineEnd: function() {
19866       if (this._line === 0) this._context.closePath();
19867       this._point = NaN;
19868     },
19869     point: function(x3, y3) {
19870       switch (this._point) {
19871         case 0: {
19872           this._context.moveTo(x3, y3);
19873           this._point = 1;
19874           break;
19875         }
19876         case 1: {
19877           this._context.lineTo(x3, y3);
19878           break;
19879         }
19880         default: {
19881           this._context.moveTo(x3 + this._radius, y3);
19882           this._context.arc(x3, y3, this._radius, 0, tau);
19883           break;
19884         }
19885       }
19886     },
19887     result: noop2
19888   };
19889
19890   // node_modules/d3-geo/src/path/measure.js
19891   var lengthSum2 = new Adder();
19892   var lengthRing;
19893   var x003;
19894   var y003;
19895   var x04;
19896   var y04;
19897   var lengthStream2 = {
19898     point: noop2,
19899     lineStart: function() {
19900       lengthStream2.point = lengthPointFirst2;
19901     },
19902     lineEnd: function() {
19903       if (lengthRing) lengthPoint2(x003, y003);
19904       lengthStream2.point = noop2;
19905     },
19906     polygonStart: function() {
19907       lengthRing = true;
19908     },
19909     polygonEnd: function() {
19910       lengthRing = null;
19911     },
19912     result: function() {
19913       var length2 = +lengthSum2;
19914       lengthSum2 = new Adder();
19915       return length2;
19916     }
19917   };
19918   function lengthPointFirst2(x3, y3) {
19919     lengthStream2.point = lengthPoint2;
19920     x003 = x04 = x3, y003 = y04 = y3;
19921   }
19922   function lengthPoint2(x3, y3) {
19923     x04 -= x3, y04 -= y3;
19924     lengthSum2.add(sqrt(x04 * x04 + y04 * y04));
19925     x04 = x3, y04 = y3;
19926   }
19927   var measure_default = lengthStream2;
19928
19929   // node_modules/d3-geo/src/path/string.js
19930   var cacheDigits;
19931   var cacheAppend;
19932   var cacheRadius;
19933   var cacheCircle;
19934   var _a2, _b2, _c, _d;
19935   var PathString = class {
19936     constructor(digits) {
19937       this._append = digits == null ? append : appendRound(digits);
19938       this._radius = 4.5;
19939       this._ = "";
19940     }
19941     pointRadius(_3) {
19942       this._radius = +_3;
19943       return this;
19944     }
19945     polygonStart() {
19946       this._line = 0;
19947     }
19948     polygonEnd() {
19949       this._line = NaN;
19950     }
19951     lineStart() {
19952       this._point = 0;
19953     }
19954     lineEnd() {
19955       if (this._line === 0) this._ += "Z";
19956       this._point = NaN;
19957     }
19958     point(x3, y3) {
19959       switch (this._point) {
19960         case 0: {
19961           this._append(_a2 || (_a2 = __template(["M", ",", ""])), x3, y3);
19962           this._point = 1;
19963           break;
19964         }
19965         case 1: {
19966           this._append(_b2 || (_b2 = __template(["L", ",", ""])), x3, y3);
19967           break;
19968         }
19969         default: {
19970           this._append(_c || (_c = __template(["M", ",", ""])), x3, y3);
19971           if (this._radius !== cacheRadius || this._append !== cacheAppend) {
19972             const r2 = this._radius;
19973             const s2 = this._;
19974             this._ = "";
19975             this._append(_d || (_d = __template(["m0,", "a", ",", " 0 1,1 0,", "a", ",", " 0 1,1 0,", "z"])), r2, r2, r2, -2 * r2, r2, r2, 2 * r2);
19976             cacheRadius = r2;
19977             cacheAppend = this._append;
19978             cacheCircle = this._;
19979             this._ = s2;
19980           }
19981           this._ += cacheCircle;
19982           break;
19983         }
19984       }
19985     }
19986     result() {
19987       const result = this._;
19988       this._ = "";
19989       return result.length ? result : null;
19990     }
19991   };
19992   function append(strings) {
19993     let i3 = 1;
19994     this._ += strings[0];
19995     for (const j3 = strings.length; i3 < j3; ++i3) {
19996       this._ += arguments[i3] + strings[i3];
19997     }
19998   }
19999   function appendRound(digits) {
20000     const d2 = Math.floor(digits);
20001     if (!(d2 >= 0)) throw new RangeError("invalid digits: ".concat(digits));
20002     if (d2 > 15) return append;
20003     if (d2 !== cacheDigits) {
20004       const k3 = 10 ** d2;
20005       cacheDigits = d2;
20006       cacheAppend = function append2(strings) {
20007         let i3 = 1;
20008         this._ += strings[0];
20009         for (const j3 = strings.length; i3 < j3; ++i3) {
20010           this._ += Math.round(arguments[i3] * k3) / k3 + strings[i3];
20011         }
20012       };
20013     }
20014     return cacheAppend;
20015   }
20016
20017   // node_modules/d3-geo/src/path/index.js
20018   function path_default(projection2, context) {
20019     let digits = 3, pointRadius = 4.5, projectionStream, contextStream;
20020     function path(object) {
20021       if (object) {
20022         if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
20023         stream_default(object, projectionStream(contextStream));
20024       }
20025       return contextStream.result();
20026     }
20027     path.area = function(object) {
20028       stream_default(object, projectionStream(area_default3));
20029       return area_default3.result();
20030     };
20031     path.measure = function(object) {
20032       stream_default(object, projectionStream(measure_default));
20033       return measure_default.result();
20034     };
20035     path.bounds = function(object) {
20036       stream_default(object, projectionStream(bounds_default2));
20037       return bounds_default2.result();
20038     };
20039     path.centroid = function(object) {
20040       stream_default(object, projectionStream(centroid_default2));
20041       return centroid_default2.result();
20042     };
20043     path.projection = function(_3) {
20044       if (!arguments.length) return projection2;
20045       projectionStream = _3 == null ? (projection2 = null, identity_default3) : (projection2 = _3).stream;
20046       return path;
20047     };
20048     path.context = function(_3) {
20049       if (!arguments.length) return context;
20050       contextStream = _3 == null ? (context = null, new PathString(digits)) : new PathContext(context = _3);
20051       if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
20052       return path;
20053     };
20054     path.pointRadius = function(_3) {
20055       if (!arguments.length) return pointRadius;
20056       pointRadius = typeof _3 === "function" ? _3 : (contextStream.pointRadius(+_3), +_3);
20057       return path;
20058     };
20059     path.digits = function(_3) {
20060       if (!arguments.length) return digits;
20061       if (_3 == null) digits = null;
20062       else {
20063         const d2 = Math.floor(_3);
20064         if (!(d2 >= 0)) throw new RangeError("invalid digits: ".concat(_3));
20065         digits = d2;
20066       }
20067       if (context === null) contextStream = new PathString(digits);
20068       return path;
20069     };
20070     return path.projection(projection2).digits(digits).context(context);
20071   }
20072
20073   // node_modules/d3-geo/src/transform.js
20074   function transform_default(methods2) {
20075     return {
20076       stream: transformer(methods2)
20077     };
20078   }
20079   function transformer(methods2) {
20080     return function(stream) {
20081       var s2 = new TransformStream();
20082       for (var key in methods2) s2[key] = methods2[key];
20083       s2.stream = stream;
20084       return s2;
20085     };
20086   }
20087   function TransformStream() {
20088   }
20089   TransformStream.prototype = {
20090     constructor: TransformStream,
20091     point: function(x3, y3) {
20092       this.stream.point(x3, y3);
20093     },
20094     sphere: function() {
20095       this.stream.sphere();
20096     },
20097     lineStart: function() {
20098       this.stream.lineStart();
20099     },
20100     lineEnd: function() {
20101       this.stream.lineEnd();
20102     },
20103     polygonStart: function() {
20104       this.stream.polygonStart();
20105     },
20106     polygonEnd: function() {
20107       this.stream.polygonEnd();
20108     }
20109   };
20110
20111   // node_modules/d3-geo/src/projection/fit.js
20112   function fit(projection2, fitBounds, object) {
20113     var clip = projection2.clipExtent && projection2.clipExtent();
20114     projection2.scale(150).translate([0, 0]);
20115     if (clip != null) projection2.clipExtent(null);
20116     stream_default(object, projection2.stream(bounds_default2));
20117     fitBounds(bounds_default2.result());
20118     if (clip != null) projection2.clipExtent(clip);
20119     return projection2;
20120   }
20121   function fitExtent(projection2, extent, object) {
20122     return fit(projection2, function(b3) {
20123       var w3 = extent[1][0] - extent[0][0], h3 = extent[1][1] - extent[0][1], k3 = Math.min(w3 / (b3[1][0] - b3[0][0]), h3 / (b3[1][1] - b3[0][1])), x3 = +extent[0][0] + (w3 - k3 * (b3[1][0] + b3[0][0])) / 2, y3 = +extent[0][1] + (h3 - k3 * (b3[1][1] + b3[0][1])) / 2;
20124       projection2.scale(150 * k3).translate([x3, y3]);
20125     }, object);
20126   }
20127   function fitSize(projection2, size, object) {
20128     return fitExtent(projection2, [[0, 0], size], object);
20129   }
20130   function fitWidth(projection2, width, object) {
20131     return fit(projection2, function(b3) {
20132       var w3 = +width, k3 = w3 / (b3[1][0] - b3[0][0]), x3 = (w3 - k3 * (b3[1][0] + b3[0][0])) / 2, y3 = -k3 * b3[0][1];
20133       projection2.scale(150 * k3).translate([x3, y3]);
20134     }, object);
20135   }
20136   function fitHeight(projection2, height, object) {
20137     return fit(projection2, function(b3) {
20138       var h3 = +height, k3 = h3 / (b3[1][1] - b3[0][1]), x3 = -k3 * b3[0][0], y3 = (h3 - k3 * (b3[1][1] + b3[0][1])) / 2;
20139       projection2.scale(150 * k3).translate([x3, y3]);
20140     }, object);
20141   }
20142
20143   // node_modules/d3-geo/src/projection/resample.js
20144   var maxDepth = 16;
20145   var cosMinDistance = cos(30 * radians);
20146   function resample_default(project, delta2) {
20147     return +delta2 ? resample(project, delta2) : resampleNone(project);
20148   }
20149   function resampleNone(project) {
20150     return transformer({
20151       point: function(x3, y3) {
20152         x3 = project(x3, y3);
20153         this.stream.point(x3[0], x3[1]);
20154       }
20155     });
20156   }
20157   function resample(project, delta2) {
20158     function resampleLineTo(x05, y05, lambda04, a0, b0, c0, x12, y12, lambda12, a1, b1, c1, depth, stream) {
20159       var dx = x12 - x05, dy = y12 - y05, d2 = dx * dx + dy * dy;
20160       if (d2 > 4 * delta2 && depth--) {
20161         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), x22 = p2[0], y22 = p2[1], dx2 = x22 - x05, dy2 = y22 - y05, dz = dy * dx2 - dx * dy2;
20162         if (dz * dz / d2 > delta2 || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
20163           resampleLineTo(x05, y05, lambda04, a0, b0, c0, x22, y22, lambda22, a2 /= m3, b3 /= m3, c2, depth, stream);
20164           stream.point(x22, y22);
20165           resampleLineTo(x22, y22, lambda22, a2, b3, c2, x12, y12, lambda12, a1, b1, c1, depth, stream);
20166         }
20167       }
20168     }
20169     return function(stream) {
20170       var lambda003, x004, y004, a00, b00, c00, lambda04, x05, y05, a0, b0, c0;
20171       var resampleStream = {
20172         point,
20173         lineStart,
20174         lineEnd,
20175         polygonStart: function() {
20176           stream.polygonStart();
20177           resampleStream.lineStart = ringStart;
20178         },
20179         polygonEnd: function() {
20180           stream.polygonEnd();
20181           resampleStream.lineStart = lineStart;
20182         }
20183       };
20184       function point(x3, y3) {
20185         x3 = project(x3, y3);
20186         stream.point(x3[0], x3[1]);
20187       }
20188       function lineStart() {
20189         x05 = NaN;
20190         resampleStream.point = linePoint2;
20191         stream.lineStart();
20192       }
20193       function linePoint2(lambda, phi) {
20194         var c2 = cartesian([lambda, phi]), p2 = project(lambda, phi);
20195         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);
20196         stream.point(x05, y05);
20197       }
20198       function lineEnd() {
20199         resampleStream.point = point;
20200         stream.lineEnd();
20201       }
20202       function ringStart() {
20203         lineStart();
20204         resampleStream.point = ringPoint;
20205         resampleStream.lineEnd = ringEnd;
20206       }
20207       function ringPoint(lambda, phi) {
20208         linePoint2(lambda003 = lambda, phi), x004 = x05, y004 = y05, a00 = a0, b00 = b0, c00 = c0;
20209         resampleStream.point = linePoint2;
20210       }
20211       function ringEnd() {
20212         resampleLineTo(x05, y05, lambda04, a0, b0, c0, x004, y004, lambda003, a00, b00, c00, maxDepth, stream);
20213         resampleStream.lineEnd = lineEnd;
20214         lineEnd();
20215       }
20216       return resampleStream;
20217     };
20218   }
20219
20220   // node_modules/d3-geo/src/projection/index.js
20221   var transformRadians = transformer({
20222     point: function(x3, y3) {
20223       this.stream.point(x3 * radians, y3 * radians);
20224     }
20225   });
20226   function transformRotate(rotate) {
20227     return transformer({
20228       point: function(x3, y3) {
20229         var r2 = rotate(x3, y3);
20230         return this.stream.point(r2[0], r2[1]);
20231       }
20232     });
20233   }
20234   function scaleTranslate(k3, dx, dy, sx, sy) {
20235     function transform2(x3, y3) {
20236       x3 *= sx;
20237       y3 *= sy;
20238       return [dx + k3 * x3, dy - k3 * y3];
20239     }
20240     transform2.invert = function(x3, y3) {
20241       return [(x3 - dx) / k3 * sx, (dy - y3) / k3 * sy];
20242     };
20243     return transform2;
20244   }
20245   function scaleTranslateRotate(k3, dx, dy, sx, sy, alpha) {
20246     if (!alpha) return scaleTranslate(k3, dx, dy, sx, sy);
20247     var cosAlpha = cos(alpha), sinAlpha = sin(alpha), a2 = cosAlpha * k3, b3 = sinAlpha * k3, ai = cosAlpha / k3, bi = sinAlpha / k3, ci = (sinAlpha * dy - cosAlpha * dx) / k3, fi = (sinAlpha * dx + cosAlpha * dy) / k3;
20248     function transform2(x3, y3) {
20249       x3 *= sx;
20250       y3 *= sy;
20251       return [a2 * x3 - b3 * y3 + dx, dy - b3 * x3 - a2 * y3];
20252     }
20253     transform2.invert = function(x3, y3) {
20254       return [sx * (ai * x3 - bi * y3 + ci), sy * (fi - bi * x3 - ai * y3)];
20255     };
20256     return transform2;
20257   }
20258   function projection(project) {
20259     return projectionMutator(function() {
20260       return project;
20261     })();
20262   }
20263   function projectionMutator(projectAt) {
20264     var project, k3 = 150, x3 = 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_default3, delta2 = 0.5, projectResample, projectTransform, projectRotateTransform, cache, cacheStream;
20265     function projection2(point) {
20266       return projectRotateTransform(point[0] * radians, point[1] * radians);
20267     }
20268     function invert(point) {
20269       point = projectRotateTransform.invert(point[0], point[1]);
20270       return point && [point[0] * degrees, point[1] * degrees];
20271     }
20272     projection2.stream = function(stream) {
20273       return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));
20274     };
20275     projection2.preclip = function(_3) {
20276       return arguments.length ? (preclip = _3, theta = void 0, reset()) : preclip;
20277     };
20278     projection2.postclip = function(_3) {
20279       return arguments.length ? (postclip = _3, x05 = y05 = x12 = y12 = null, reset()) : postclip;
20280     };
20281     projection2.clipAngle = function(_3) {
20282       return arguments.length ? (preclip = +_3 ? circle_default(theta = _3 * radians) : (theta = null, antimeridian_default), reset()) : theta * degrees;
20283     };
20284     projection2.clipExtent = function(_3) {
20285       return arguments.length ? (postclip = _3 == null ? (x05 = y05 = x12 = y12 = null, identity_default3) : 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]];
20286     };
20287     projection2.scale = function(_3) {
20288       return arguments.length ? (k3 = +_3, recenter()) : k3;
20289     };
20290     projection2.translate = function(_3) {
20291       return arguments.length ? (x3 = +_3[0], y3 = +_3[1], recenter()) : [x3, y3];
20292     };
20293     projection2.center = function(_3) {
20294       return arguments.length ? (lambda = _3[0] % 360 * radians, phi = _3[1] % 360 * radians, recenter()) : [lambda * degrees, phi * degrees];
20295     };
20296     projection2.rotate = function(_3) {
20297       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];
20298     };
20299     projection2.angle = function(_3) {
20300       return arguments.length ? (alpha = _3 % 360 * radians, recenter()) : alpha * degrees;
20301     };
20302     projection2.reflectX = function(_3) {
20303       return arguments.length ? (sx = _3 ? -1 : 1, recenter()) : sx < 0;
20304     };
20305     projection2.reflectY = function(_3) {
20306       return arguments.length ? (sy = _3 ? -1 : 1, recenter()) : sy < 0;
20307     };
20308     projection2.precision = function(_3) {
20309       return arguments.length ? (projectResample = resample_default(projectTransform, delta2 = _3 * _3), reset()) : sqrt(delta2);
20310     };
20311     projection2.fitExtent = function(extent, object) {
20312       return fitExtent(projection2, extent, object);
20313     };
20314     projection2.fitSize = function(size, object) {
20315       return fitSize(projection2, size, object);
20316     };
20317     projection2.fitWidth = function(width, object) {
20318       return fitWidth(projection2, width, object);
20319     };
20320     projection2.fitHeight = function(height, object) {
20321       return fitHeight(projection2, height, object);
20322     };
20323     function recenter() {
20324       var center = scaleTranslateRotate(k3, 0, 0, sx, sy, alpha).apply(null, project(lambda, phi)), transform2 = scaleTranslateRotate(k3, x3 - center[0], y3 - center[1], sx, sy, alpha);
20325       rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
20326       projectTransform = compose_default(project, transform2);
20327       projectRotateTransform = compose_default(rotate, projectTransform);
20328       projectResample = resample_default(projectTransform, delta2);
20329       return reset();
20330     }
20331     function reset() {
20332       cache = cacheStream = null;
20333       return projection2;
20334     }
20335     return function() {
20336       project = projectAt.apply(this, arguments);
20337       projection2.invert = project.invert && invert;
20338       return recenter();
20339     };
20340   }
20341
20342   // node_modules/d3-geo/src/projection/mercator.js
20343   function mercatorRaw(lambda, phi) {
20344     return [lambda, log(tan((halfPi + phi) / 2))];
20345   }
20346   mercatorRaw.invert = function(x3, y3) {
20347     return [x3, 2 * atan(exp(y3)) - halfPi];
20348   };
20349   function mercator_default() {
20350     return mercatorProjection(mercatorRaw).scale(961 / tau);
20351   }
20352   function mercatorProjection(project) {
20353     var m3 = projection(project), center = m3.center, scale = m3.scale, translate = m3.translate, clipExtent = m3.clipExtent, x05 = null, y05, x12, y12;
20354     m3.scale = function(_3) {
20355       return arguments.length ? (scale(_3), reclip()) : scale();
20356     };
20357     m3.translate = function(_3) {
20358       return arguments.length ? (translate(_3), reclip()) : translate();
20359     };
20360     m3.center = function(_3) {
20361       return arguments.length ? (center(_3), reclip()) : center();
20362     };
20363     m3.clipExtent = function(_3) {
20364       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]];
20365     };
20366     function reclip() {
20367       var k3 = pi * scale(), t2 = m3(rotation_default(m3.rotate()).invert([0, 0]));
20368       return clipExtent(x05 == null ? [[t2[0] - k3, t2[1] - k3], [t2[0] + k3, t2[1] + k3]] : project === mercatorRaw ? [[Math.max(t2[0] - k3, x05), y05], [Math.min(t2[0] + k3, x12), y12]] : [[x05, Math.max(t2[1] - k3, y05)], [x12, Math.min(t2[1] + k3, y12)]]);
20369     }
20370     return reclip();
20371   }
20372
20373   // node_modules/d3-geo/src/projection/identity.js
20374   function identity_default4() {
20375     var k3 = 1, tx = 0, ty = 0, sx = 1, sy = 1, alpha = 0, ca, sa, x05 = null, y05, x12, y12, kx = 1, ky = 1, transform2 = transformer({
20376       point: function(x3, y3) {
20377         var p2 = projection2([x3, y3]);
20378         this.stream.point(p2[0], p2[1]);
20379       }
20380     }), postclip = identity_default3, cache, cacheStream;
20381     function reset() {
20382       kx = k3 * sx;
20383       ky = k3 * sy;
20384       cache = cacheStream = null;
20385       return projection2;
20386     }
20387     function projection2(p2) {
20388       var x3 = p2[0] * kx, y3 = p2[1] * ky;
20389       if (alpha) {
20390         var t2 = y3 * ca - x3 * sa;
20391         x3 = x3 * ca + y3 * sa;
20392         y3 = t2;
20393       }
20394       return [x3 + tx, y3 + ty];
20395     }
20396     projection2.invert = function(p2) {
20397       var x3 = p2[0] - tx, y3 = p2[1] - ty;
20398       if (alpha) {
20399         var t2 = y3 * ca + x3 * sa;
20400         x3 = x3 * ca - y3 * sa;
20401         y3 = t2;
20402       }
20403       return [x3 / kx, y3 / ky];
20404     };
20405     projection2.stream = function(stream) {
20406       return cache && cacheStream === stream ? cache : cache = transform2(postclip(cacheStream = stream));
20407     };
20408     projection2.postclip = function(_3) {
20409       return arguments.length ? (postclip = _3, x05 = y05 = x12 = y12 = null, reset()) : postclip;
20410     };
20411     projection2.clipExtent = function(_3) {
20412       return arguments.length ? (postclip = _3 == null ? (x05 = y05 = x12 = y12 = null, identity_default3) : 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]];
20413     };
20414     projection2.scale = function(_3) {
20415       return arguments.length ? (k3 = +_3, reset()) : k3;
20416     };
20417     projection2.translate = function(_3) {
20418       return arguments.length ? (tx = +_3[0], ty = +_3[1], reset()) : [tx, ty];
20419     };
20420     projection2.angle = function(_3) {
20421       return arguments.length ? (alpha = _3 % 360 * radians, sa = sin(alpha), ca = cos(alpha), reset()) : alpha * degrees;
20422     };
20423     projection2.reflectX = function(_3) {
20424       return arguments.length ? (sx = _3 ? -1 : 1, reset()) : sx < 0;
20425     };
20426     projection2.reflectY = function(_3) {
20427       return arguments.length ? (sy = _3 ? -1 : 1, reset()) : sy < 0;
20428     };
20429     projection2.fitExtent = function(extent, object) {
20430       return fitExtent(projection2, extent, object);
20431     };
20432     projection2.fitSize = function(size, object) {
20433       return fitSize(projection2, size, object);
20434     };
20435     projection2.fitWidth = function(width, object) {
20436       return fitWidth(projection2, width, object);
20437     };
20438     projection2.fitHeight = function(height, object) {
20439       return fitHeight(projection2, height, object);
20440     };
20441     return projection2;
20442   }
20443
20444   // node_modules/d3-drag/src/noevent.js
20445   var nonpassive = { passive: false };
20446   var nonpassivecapture = { capture: true, passive: false };
20447   function nopropagation(event) {
20448     event.stopImmediatePropagation();
20449   }
20450   function noevent_default(event) {
20451     event.preventDefault();
20452     event.stopImmediatePropagation();
20453   }
20454
20455   // node_modules/d3-drag/src/nodrag.js
20456   function nodrag_default(view) {
20457     var root3 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", noevent_default, nonpassivecapture);
20458     if ("onselectstart" in root3) {
20459       selection2.on("selectstart.drag", noevent_default, nonpassivecapture);
20460     } else {
20461       root3.__noselect = root3.style.MozUserSelect;
20462       root3.style.MozUserSelect = "none";
20463     }
20464   }
20465   function yesdrag(view, noclick) {
20466     var root3 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", null);
20467     if (noclick) {
20468       selection2.on("click.drag", noevent_default, nonpassivecapture);
20469       setTimeout(function() {
20470         selection2.on("click.drag", null);
20471       }, 0);
20472     }
20473     if ("onselectstart" in root3) {
20474       selection2.on("selectstart.drag", null);
20475     } else {
20476       root3.style.MozUserSelect = root3.__noselect;
20477       delete root3.__noselect;
20478     }
20479   }
20480
20481   // node_modules/d3-drag/src/constant.js
20482   var constant_default4 = (x3) => () => x3;
20483
20484   // node_modules/d3-drag/src/event.js
20485   function DragEvent(type2, {
20486     sourceEvent,
20487     subject,
20488     target,
20489     identifier,
20490     active,
20491     x: x3,
20492     y: y3,
20493     dx,
20494     dy,
20495     dispatch: dispatch12
20496   }) {
20497     Object.defineProperties(this, {
20498       type: { value: type2, enumerable: true, configurable: true },
20499       sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
20500       subject: { value: subject, enumerable: true, configurable: true },
20501       target: { value: target, enumerable: true, configurable: true },
20502       identifier: { value: identifier, enumerable: true, configurable: true },
20503       active: { value: active, enumerable: true, configurable: true },
20504       x: { value: x3, enumerable: true, configurable: true },
20505       y: { value: y3, enumerable: true, configurable: true },
20506       dx: { value: dx, enumerable: true, configurable: true },
20507       dy: { value: dy, enumerable: true, configurable: true },
20508       _: { value: dispatch12 }
20509     });
20510   }
20511   DragEvent.prototype.on = function() {
20512     var value = this._.on.apply(this._, arguments);
20513     return value === this._ ? this : value;
20514   };
20515
20516   // node_modules/d3-drag/src/drag.js
20517   function defaultFilter(event) {
20518     return !event.ctrlKey && !event.button;
20519   }
20520   function defaultContainer() {
20521     return this.parentNode;
20522   }
20523   function defaultSubject(event, d2) {
20524     return d2 == null ? { x: event.x, y: event.y } : d2;
20525   }
20526   function defaultTouchable() {
20527     return navigator.maxTouchPoints || "ontouchstart" in this;
20528   }
20529   function drag_default() {
20530     var filter2 = defaultFilter, container = defaultContainer, subject = defaultSubject, touchable = defaultTouchable, gestures = {}, listeners = dispatch_default("start", "drag", "end"), active = 0, mousedownx, mousedowny, mousemoving, touchending, clickDistance2 = 0;
20531     function drag(selection2) {
20532       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)");
20533     }
20534     function mousedowned(event, d2) {
20535       if (touchending || !filter2.call(this, event, d2)) return;
20536       var gesture = beforestart(this, container.call(this, event, d2), event, d2, "mouse");
20537       if (!gesture) return;
20538       select_default2(event.view).on("mousemove.drag", mousemoved, nonpassivecapture).on("mouseup.drag", mouseupped, nonpassivecapture);
20539       nodrag_default(event.view);
20540       nopropagation(event);
20541       mousemoving = false;
20542       mousedownx = event.clientX;
20543       mousedowny = event.clientY;
20544       gesture("start", event);
20545     }
20546     function mousemoved(event) {
20547       noevent_default(event);
20548       if (!mousemoving) {
20549         var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;
20550         mousemoving = dx * dx + dy * dy > clickDistance2;
20551       }
20552       gestures.mouse("drag", event);
20553     }
20554     function mouseupped(event) {
20555       select_default2(event.view).on("mousemove.drag mouseup.drag", null);
20556       yesdrag(event.view, mousemoving);
20557       noevent_default(event);
20558       gestures.mouse("end", event);
20559     }
20560     function touchstarted(event, d2) {
20561       if (!filter2.call(this, event, d2)) return;
20562       var touches = event.changedTouches, c2 = container.call(this, event, d2), n3 = touches.length, i3, gesture;
20563       for (i3 = 0; i3 < n3; ++i3) {
20564         if (gesture = beforestart(this, c2, event, d2, touches[i3].identifier, touches[i3])) {
20565           nopropagation(event);
20566           gesture("start", event, touches[i3]);
20567         }
20568       }
20569     }
20570     function touchmoved(event) {
20571       var touches = event.changedTouches, n3 = touches.length, i3, gesture;
20572       for (i3 = 0; i3 < n3; ++i3) {
20573         if (gesture = gestures[touches[i3].identifier]) {
20574           noevent_default(event);
20575           gesture("drag", event, touches[i3]);
20576         }
20577       }
20578     }
20579     function touchended(event) {
20580       var touches = event.changedTouches, n3 = touches.length, i3, gesture;
20581       if (touchending) clearTimeout(touchending);
20582       touchending = setTimeout(function() {
20583         touchending = null;
20584       }, 500);
20585       for (i3 = 0; i3 < n3; ++i3) {
20586         if (gesture = gestures[touches[i3].identifier]) {
20587           nopropagation(event);
20588           gesture("end", event, touches[i3]);
20589         }
20590       }
20591     }
20592     function beforestart(that, container2, event, d2, identifier, touch) {
20593       var dispatch12 = listeners.copy(), p2 = pointer_default(touch || event, container2), dx, dy, s2;
20594       if ((s2 = subject.call(that, new DragEvent("beforestart", {
20595         sourceEvent: event,
20596         target: drag,
20597         identifier,
20598         active,
20599         x: p2[0],
20600         y: p2[1],
20601         dx: 0,
20602         dy: 0,
20603         dispatch: dispatch12
20604       }), d2)) == null) return;
20605       dx = s2.x - p2[0] || 0;
20606       dy = s2.y - p2[1] || 0;
20607       return function gesture(type2, event2, touch2) {
20608         var p02 = p2, n3;
20609         switch (type2) {
20610           case "start":
20611             gestures[identifier] = gesture, n3 = active++;
20612             break;
20613           case "end":
20614             delete gestures[identifier], --active;
20615           // falls through
20616           case "drag":
20617             p2 = pointer_default(touch2 || event2, container2), n3 = active;
20618             break;
20619         }
20620         dispatch12.call(
20621           type2,
20622           that,
20623           new DragEvent(type2, {
20624             sourceEvent: event2,
20625             subject: s2,
20626             target: drag,
20627             identifier,
20628             active: n3,
20629             x: p2[0] + dx,
20630             y: p2[1] + dy,
20631             dx: p2[0] - p02[0],
20632             dy: p2[1] - p02[1],
20633             dispatch: dispatch12
20634           }),
20635           d2
20636         );
20637       };
20638     }
20639     drag.filter = function(_3) {
20640       return arguments.length ? (filter2 = typeof _3 === "function" ? _3 : constant_default4(!!_3), drag) : filter2;
20641     };
20642     drag.container = function(_3) {
20643       return arguments.length ? (container = typeof _3 === "function" ? _3 : constant_default4(_3), drag) : container;
20644     };
20645     drag.subject = function(_3) {
20646       return arguments.length ? (subject = typeof _3 === "function" ? _3 : constant_default4(_3), drag) : subject;
20647     };
20648     drag.touchable = function(_3) {
20649       return arguments.length ? (touchable = typeof _3 === "function" ? _3 : constant_default4(!!_3), drag) : touchable;
20650     };
20651     drag.on = function() {
20652       var value = listeners.on.apply(listeners, arguments);
20653       return value === listeners ? drag : value;
20654     };
20655     drag.clickDistance = function(_3) {
20656       return arguments.length ? (clickDistance2 = (_3 = +_3) * _3, drag) : Math.sqrt(clickDistance2);
20657     };
20658     return drag;
20659   }
20660
20661   // node_modules/d3-color/src/define.js
20662   function define_default(constructor, factory, prototype4) {
20663     constructor.prototype = factory.prototype = prototype4;
20664     prototype4.constructor = constructor;
20665   }
20666   function extend(parent2, definition) {
20667     var prototype4 = Object.create(parent2.prototype);
20668     for (var key in definition) prototype4[key] = definition[key];
20669     return prototype4;
20670   }
20671
20672   // node_modules/d3-color/src/color.js
20673   function Color() {
20674   }
20675   var darker = 0.7;
20676   var brighter = 1 / darker;
20677   var reI = "\\s*([+-]?\\d+)\\s*";
20678   var reN = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*";
20679   var reP = "\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
20680   var reHex = /^#([0-9a-f]{3,8})$/;
20681   var reRgbInteger = new RegExp("^rgb\\(".concat(reI, ",").concat(reI, ",").concat(reI, "\\)$"));
20682   var reRgbPercent = new RegExp("^rgb\\(".concat(reP, ",").concat(reP, ",").concat(reP, "\\)$"));
20683   var reRgbaInteger = new RegExp("^rgba\\(".concat(reI, ",").concat(reI, ",").concat(reI, ",").concat(reN, "\\)$"));
20684   var reRgbaPercent = new RegExp("^rgba\\(".concat(reP, ",").concat(reP, ",").concat(reP, ",").concat(reN, "\\)$"));
20685   var reHslPercent = new RegExp("^hsl\\(".concat(reN, ",").concat(reP, ",").concat(reP, "\\)$"));
20686   var reHslaPercent = new RegExp("^hsla\\(".concat(reN, ",").concat(reP, ",").concat(reP, ",").concat(reN, "\\)$"));
20687   var named = {
20688     aliceblue: 15792383,
20689     antiquewhite: 16444375,
20690     aqua: 65535,
20691     aquamarine: 8388564,
20692     azure: 15794175,
20693     beige: 16119260,
20694     bisque: 16770244,
20695     black: 0,
20696     blanchedalmond: 16772045,
20697     blue: 255,
20698     blueviolet: 9055202,
20699     brown: 10824234,
20700     burlywood: 14596231,
20701     cadetblue: 6266528,
20702     chartreuse: 8388352,
20703     chocolate: 13789470,
20704     coral: 16744272,
20705     cornflowerblue: 6591981,
20706     cornsilk: 16775388,
20707     crimson: 14423100,
20708     cyan: 65535,
20709     darkblue: 139,
20710     darkcyan: 35723,
20711     darkgoldenrod: 12092939,
20712     darkgray: 11119017,
20713     darkgreen: 25600,
20714     darkgrey: 11119017,
20715     darkkhaki: 12433259,
20716     darkmagenta: 9109643,
20717     darkolivegreen: 5597999,
20718     darkorange: 16747520,
20719     darkorchid: 10040012,
20720     darkred: 9109504,
20721     darksalmon: 15308410,
20722     darkseagreen: 9419919,
20723     darkslateblue: 4734347,
20724     darkslategray: 3100495,
20725     darkslategrey: 3100495,
20726     darkturquoise: 52945,
20727     darkviolet: 9699539,
20728     deeppink: 16716947,
20729     deepskyblue: 49151,
20730     dimgray: 6908265,
20731     dimgrey: 6908265,
20732     dodgerblue: 2003199,
20733     firebrick: 11674146,
20734     floralwhite: 16775920,
20735     forestgreen: 2263842,
20736     fuchsia: 16711935,
20737     gainsboro: 14474460,
20738     ghostwhite: 16316671,
20739     gold: 16766720,
20740     goldenrod: 14329120,
20741     gray: 8421504,
20742     green: 32768,
20743     greenyellow: 11403055,
20744     grey: 8421504,
20745     honeydew: 15794160,
20746     hotpink: 16738740,
20747     indianred: 13458524,
20748     indigo: 4915330,
20749     ivory: 16777200,
20750     khaki: 15787660,
20751     lavender: 15132410,
20752     lavenderblush: 16773365,
20753     lawngreen: 8190976,
20754     lemonchiffon: 16775885,
20755     lightblue: 11393254,
20756     lightcoral: 15761536,
20757     lightcyan: 14745599,
20758     lightgoldenrodyellow: 16448210,
20759     lightgray: 13882323,
20760     lightgreen: 9498256,
20761     lightgrey: 13882323,
20762     lightpink: 16758465,
20763     lightsalmon: 16752762,
20764     lightseagreen: 2142890,
20765     lightskyblue: 8900346,
20766     lightslategray: 7833753,
20767     lightslategrey: 7833753,
20768     lightsteelblue: 11584734,
20769     lightyellow: 16777184,
20770     lime: 65280,
20771     limegreen: 3329330,
20772     linen: 16445670,
20773     magenta: 16711935,
20774     maroon: 8388608,
20775     mediumaquamarine: 6737322,
20776     mediumblue: 205,
20777     mediumorchid: 12211667,
20778     mediumpurple: 9662683,
20779     mediumseagreen: 3978097,
20780     mediumslateblue: 8087790,
20781     mediumspringgreen: 64154,
20782     mediumturquoise: 4772300,
20783     mediumvioletred: 13047173,
20784     midnightblue: 1644912,
20785     mintcream: 16121850,
20786     mistyrose: 16770273,
20787     moccasin: 16770229,
20788     navajowhite: 16768685,
20789     navy: 128,
20790     oldlace: 16643558,
20791     olive: 8421376,
20792     olivedrab: 7048739,
20793     orange: 16753920,
20794     orangered: 16729344,
20795     orchid: 14315734,
20796     palegoldenrod: 15657130,
20797     palegreen: 10025880,
20798     paleturquoise: 11529966,
20799     palevioletred: 14381203,
20800     papayawhip: 16773077,
20801     peachpuff: 16767673,
20802     peru: 13468991,
20803     pink: 16761035,
20804     plum: 14524637,
20805     powderblue: 11591910,
20806     purple: 8388736,
20807     rebeccapurple: 6697881,
20808     red: 16711680,
20809     rosybrown: 12357519,
20810     royalblue: 4286945,
20811     saddlebrown: 9127187,
20812     salmon: 16416882,
20813     sandybrown: 16032864,
20814     seagreen: 3050327,
20815     seashell: 16774638,
20816     sienna: 10506797,
20817     silver: 12632256,
20818     skyblue: 8900331,
20819     slateblue: 6970061,
20820     slategray: 7372944,
20821     slategrey: 7372944,
20822     snow: 16775930,
20823     springgreen: 65407,
20824     steelblue: 4620980,
20825     tan: 13808780,
20826     teal: 32896,
20827     thistle: 14204888,
20828     tomato: 16737095,
20829     turquoise: 4251856,
20830     violet: 15631086,
20831     wheat: 16113331,
20832     white: 16777215,
20833     whitesmoke: 16119285,
20834     yellow: 16776960,
20835     yellowgreen: 10145074
20836   };
20837   define_default(Color, color, {
20838     copy(channels) {
20839       return Object.assign(new this.constructor(), this, channels);
20840     },
20841     displayable() {
20842       return this.rgb().displayable();
20843     },
20844     hex: color_formatHex,
20845     // Deprecated! Use color.formatHex.
20846     formatHex: color_formatHex,
20847     formatHex8: color_formatHex8,
20848     formatHsl: color_formatHsl,
20849     formatRgb: color_formatRgb,
20850     toString: color_formatRgb
20851   });
20852   function color_formatHex() {
20853     return this.rgb().formatHex();
20854   }
20855   function color_formatHex8() {
20856     return this.rgb().formatHex8();
20857   }
20858   function color_formatHsl() {
20859     return hslConvert(this).formatHsl();
20860   }
20861   function color_formatRgb() {
20862     return this.rgb().formatRgb();
20863   }
20864   function color(format2) {
20865     var m3, l2;
20866     format2 = (format2 + "").trim().toLowerCase();
20867     return (m3 = reHex.exec(format2)) ? (l2 = m3[1].length, m3 = parseInt(m3[1], 16), l2 === 6 ? rgbn(m3) : l2 === 3 ? new Rgb(m3 >> 8 & 15 | m3 >> 4 & 240, m3 >> 4 & 15 | m3 & 240, (m3 & 15) << 4 | m3 & 15, 1) : l2 === 8 ? rgba(m3 >> 24 & 255, m3 >> 16 & 255, m3 >> 8 & 255, (m3 & 255) / 255) : l2 === 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;
20868   }
20869   function rgbn(n3) {
20870     return new Rgb(n3 >> 16 & 255, n3 >> 8 & 255, n3 & 255, 1);
20871   }
20872   function rgba(r2, g3, b3, a2) {
20873     if (a2 <= 0) r2 = g3 = b3 = NaN;
20874     return new Rgb(r2, g3, b3, a2);
20875   }
20876   function rgbConvert(o2) {
20877     if (!(o2 instanceof Color)) o2 = color(o2);
20878     if (!o2) return new Rgb();
20879     o2 = o2.rgb();
20880     return new Rgb(o2.r, o2.g, o2.b, o2.opacity);
20881   }
20882   function rgb(r2, g3, b3, opacity) {
20883     return arguments.length === 1 ? rgbConvert(r2) : new Rgb(r2, g3, b3, opacity == null ? 1 : opacity);
20884   }
20885   function Rgb(r2, g3, b3, opacity) {
20886     this.r = +r2;
20887     this.g = +g3;
20888     this.b = +b3;
20889     this.opacity = +opacity;
20890   }
20891   define_default(Rgb, rgb, extend(Color, {
20892     brighter(k3) {
20893       k3 = k3 == null ? brighter : Math.pow(brighter, k3);
20894       return new Rgb(this.r * k3, this.g * k3, this.b * k3, this.opacity);
20895     },
20896     darker(k3) {
20897       k3 = k3 == null ? darker : Math.pow(darker, k3);
20898       return new Rgb(this.r * k3, this.g * k3, this.b * k3, this.opacity);
20899     },
20900     rgb() {
20901       return this;
20902     },
20903     clamp() {
20904       return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));
20905     },
20906     displayable() {
20907       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);
20908     },
20909     hex: rgb_formatHex,
20910     // Deprecated! Use color.formatHex.
20911     formatHex: rgb_formatHex,
20912     formatHex8: rgb_formatHex8,
20913     formatRgb: rgb_formatRgb,
20914     toString: rgb_formatRgb
20915   }));
20916   function rgb_formatHex() {
20917     return "#".concat(hex(this.r)).concat(hex(this.g)).concat(hex(this.b));
20918   }
20919   function rgb_formatHex8() {
20920     return "#".concat(hex(this.r)).concat(hex(this.g)).concat(hex(this.b)).concat(hex((isNaN(this.opacity) ? 1 : this.opacity) * 255));
20921   }
20922   function rgb_formatRgb() {
20923     const a2 = clampa(this.opacity);
20924     return "".concat(a2 === 1 ? "rgb(" : "rgba(").concat(clampi(this.r), ", ").concat(clampi(this.g), ", ").concat(clampi(this.b)).concat(a2 === 1 ? ")" : ", ".concat(a2, ")"));
20925   }
20926   function clampa(opacity) {
20927     return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));
20928   }
20929   function clampi(value) {
20930     return Math.max(0, Math.min(255, Math.round(value) || 0));
20931   }
20932   function hex(value) {
20933     value = clampi(value);
20934     return (value < 16 ? "0" : "") + value.toString(16);
20935   }
20936   function hsla(h3, s2, l2, a2) {
20937     if (a2 <= 0) h3 = s2 = l2 = NaN;
20938     else if (l2 <= 0 || l2 >= 1) h3 = s2 = NaN;
20939     else if (s2 <= 0) h3 = NaN;
20940     return new Hsl(h3, s2, l2, a2);
20941   }
20942   function hslConvert(o2) {
20943     if (o2 instanceof Hsl) return new Hsl(o2.h, o2.s, o2.l, o2.opacity);
20944     if (!(o2 instanceof Color)) o2 = color(o2);
20945     if (!o2) return new Hsl();
20946     if (o2 instanceof Hsl) return o2;
20947     o2 = o2.rgb();
20948     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, l2 = (max3 + min3) / 2;
20949     if (s2) {
20950       if (r2 === max3) h3 = (g3 - b3) / s2 + (g3 < b3) * 6;
20951       else if (g3 === max3) h3 = (b3 - r2) / s2 + 2;
20952       else h3 = (r2 - g3) / s2 + 4;
20953       s2 /= l2 < 0.5 ? max3 + min3 : 2 - max3 - min3;
20954       h3 *= 60;
20955     } else {
20956       s2 = l2 > 0 && l2 < 1 ? 0 : h3;
20957     }
20958     return new Hsl(h3, s2, l2, o2.opacity);
20959   }
20960   function hsl(h3, s2, l2, opacity) {
20961     return arguments.length === 1 ? hslConvert(h3) : new Hsl(h3, s2, l2, opacity == null ? 1 : opacity);
20962   }
20963   function Hsl(h3, s2, l2, opacity) {
20964     this.h = +h3;
20965     this.s = +s2;
20966     this.l = +l2;
20967     this.opacity = +opacity;
20968   }
20969   define_default(Hsl, hsl, extend(Color, {
20970     brighter(k3) {
20971       k3 = k3 == null ? brighter : Math.pow(brighter, k3);
20972       return new Hsl(this.h, this.s, this.l * k3, this.opacity);
20973     },
20974     darker(k3) {
20975       k3 = k3 == null ? darker : Math.pow(darker, k3);
20976       return new Hsl(this.h, this.s, this.l * k3, this.opacity);
20977     },
20978     rgb() {
20979       var h3 = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h3) || isNaN(this.s) ? 0 : this.s, l2 = this.l, m22 = l2 + (l2 < 0.5 ? l2 : 1 - l2) * s2, m1 = 2 * l2 - m22;
20980       return new Rgb(
20981         hsl2rgb(h3 >= 240 ? h3 - 240 : h3 + 120, m1, m22),
20982         hsl2rgb(h3, m1, m22),
20983         hsl2rgb(h3 < 120 ? h3 + 240 : h3 - 120, m1, m22),
20984         this.opacity
20985       );
20986     },
20987     clamp() {
20988       return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));
20989     },
20990     displayable() {
20991       return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
20992     },
20993     formatHsl() {
20994       const a2 = clampa(this.opacity);
20995       return "".concat(a2 === 1 ? "hsl(" : "hsla(").concat(clamph(this.h), ", ").concat(clampt(this.s) * 100, "%, ").concat(clampt(this.l) * 100, "%").concat(a2 === 1 ? ")" : ", ".concat(a2, ")"));
20996     }
20997   }));
20998   function clamph(value) {
20999     value = (value || 0) % 360;
21000     return value < 0 ? value + 360 : value;
21001   }
21002   function clampt(value) {
21003     return Math.max(0, Math.min(1, value || 0));
21004   }
21005   function hsl2rgb(h3, m1, m22) {
21006     return (h3 < 60 ? m1 + (m22 - m1) * h3 / 60 : h3 < 180 ? m22 : h3 < 240 ? m1 + (m22 - m1) * (240 - h3) / 60 : m1) * 255;
21007   }
21008
21009   // node_modules/d3-interpolate/src/basis.js
21010   function basis(t1, v0, v1, v22, v3) {
21011     var t2 = t1 * t1, t3 = t2 * t1;
21012     return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v22 + t3 * v3) / 6;
21013   }
21014   function basis_default(values) {
21015     var n3 = values.length - 1;
21016     return function(t2) {
21017       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;
21018       return basis((t2 - i3 / n3) * n3, v0, v1, v22, v3);
21019     };
21020   }
21021
21022   // node_modules/d3-interpolate/src/basisClosed.js
21023   function basisClosed_default(values) {
21024     var n3 = values.length;
21025     return function(t2) {
21026       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];
21027       return basis((t2 - i3 / n3) * n3, v0, v1, v22, v3);
21028     };
21029   }
21030
21031   // node_modules/d3-interpolate/src/constant.js
21032   var constant_default5 = (x3) => () => x3;
21033
21034   // node_modules/d3-interpolate/src/color.js
21035   function linear(a2, d2) {
21036     return function(t2) {
21037       return a2 + t2 * d2;
21038     };
21039   }
21040   function exponential(a2, b3, y3) {
21041     return a2 = Math.pow(a2, y3), b3 = Math.pow(b3, y3) - a2, y3 = 1 / y3, function(t2) {
21042       return Math.pow(a2 + t2 * b3, y3);
21043     };
21044   }
21045   function gamma(y3) {
21046     return (y3 = +y3) === 1 ? nogamma : function(a2, b3) {
21047       return b3 - a2 ? exponential(a2, b3, y3) : constant_default5(isNaN(a2) ? b3 : a2);
21048     };
21049   }
21050   function nogamma(a2, b3) {
21051     var d2 = b3 - a2;
21052     return d2 ? linear(a2, d2) : constant_default5(isNaN(a2) ? b3 : a2);
21053   }
21054
21055   // node_modules/d3-interpolate/src/rgb.js
21056   var rgb_default = (function rgbGamma(y3) {
21057     var color2 = gamma(y3);
21058     function rgb2(start2, end) {
21059       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);
21060       return function(t2) {
21061         start2.r = r2(t2);
21062         start2.g = g3(t2);
21063         start2.b = b3(t2);
21064         start2.opacity = opacity(t2);
21065         return start2 + "";
21066       };
21067     }
21068     rgb2.gamma = rgbGamma;
21069     return rgb2;
21070   })(1);
21071   function rgbSpline(spline) {
21072     return function(colors) {
21073       var n3 = colors.length, r2 = new Array(n3), g3 = new Array(n3), b3 = new Array(n3), i3, color2;
21074       for (i3 = 0; i3 < n3; ++i3) {
21075         color2 = rgb(colors[i3]);
21076         r2[i3] = color2.r || 0;
21077         g3[i3] = color2.g || 0;
21078         b3[i3] = color2.b || 0;
21079       }
21080       r2 = spline(r2);
21081       g3 = spline(g3);
21082       b3 = spline(b3);
21083       color2.opacity = 1;
21084       return function(t2) {
21085         color2.r = r2(t2);
21086         color2.g = g3(t2);
21087         color2.b = b3(t2);
21088         return color2 + "";
21089       };
21090     };
21091   }
21092   var rgbBasis = rgbSpline(basis_default);
21093   var rgbBasisClosed = rgbSpline(basisClosed_default);
21094
21095   // node_modules/d3-interpolate/src/numberArray.js
21096   function numberArray_default(a2, b3) {
21097     if (!b3) b3 = [];
21098     var n3 = a2 ? Math.min(b3.length, a2.length) : 0, c2 = b3.slice(), i3;
21099     return function(t2) {
21100       for (i3 = 0; i3 < n3; ++i3) c2[i3] = a2[i3] * (1 - t2) + b3[i3] * t2;
21101       return c2;
21102     };
21103   }
21104   function isNumberArray(x3) {
21105     return ArrayBuffer.isView(x3) && !(x3 instanceof DataView);
21106   }
21107
21108   // node_modules/d3-interpolate/src/array.js
21109   function genericArray(a2, b3) {
21110     var nb = b3 ? b3.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x3 = new Array(na), c2 = new Array(nb), i3;
21111     for (i3 = 0; i3 < na; ++i3) x3[i3] = value_default(a2[i3], b3[i3]);
21112     for (; i3 < nb; ++i3) c2[i3] = b3[i3];
21113     return function(t2) {
21114       for (i3 = 0; i3 < na; ++i3) c2[i3] = x3[i3](t2);
21115       return c2;
21116     };
21117   }
21118
21119   // node_modules/d3-interpolate/src/date.js
21120   function date_default(a2, b3) {
21121     var d2 = /* @__PURE__ */ new Date();
21122     return a2 = +a2, b3 = +b3, function(t2) {
21123       return d2.setTime(a2 * (1 - t2) + b3 * t2), d2;
21124     };
21125   }
21126
21127   // node_modules/d3-interpolate/src/number.js
21128   function number_default(a2, b3) {
21129     return a2 = +a2, b3 = +b3, function(t2) {
21130       return a2 * (1 - t2) + b3 * t2;
21131     };
21132   }
21133
21134   // node_modules/d3-interpolate/src/object.js
21135   function object_default(a2, b3) {
21136     var i3 = {}, c2 = {}, k3;
21137     if (a2 === null || typeof a2 !== "object") a2 = {};
21138     if (b3 === null || typeof b3 !== "object") b3 = {};
21139     for (k3 in b3) {
21140       if (k3 in a2) {
21141         i3[k3] = value_default(a2[k3], b3[k3]);
21142       } else {
21143         c2[k3] = b3[k3];
21144       }
21145     }
21146     return function(t2) {
21147       for (k3 in i3) c2[k3] = i3[k3](t2);
21148       return c2;
21149     };
21150   }
21151
21152   // node_modules/d3-interpolate/src/string.js
21153   var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
21154   var reB = new RegExp(reA.source, "g");
21155   function zero2(b3) {
21156     return function() {
21157       return b3;
21158     };
21159   }
21160   function one(b3) {
21161     return function(t2) {
21162       return b3(t2) + "";
21163     };
21164   }
21165   function string_default(a2, b3) {
21166     var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i3 = -1, s2 = [], q3 = [];
21167     a2 = a2 + "", b3 = b3 + "";
21168     while ((am = reA.exec(a2)) && (bm = reB.exec(b3))) {
21169       if ((bs = bm.index) > bi) {
21170         bs = b3.slice(bi, bs);
21171         if (s2[i3]) s2[i3] += bs;
21172         else s2[++i3] = bs;
21173       }
21174       if ((am = am[0]) === (bm = bm[0])) {
21175         if (s2[i3]) s2[i3] += bm;
21176         else s2[++i3] = bm;
21177       } else {
21178         s2[++i3] = null;
21179         q3.push({ i: i3, x: number_default(am, bm) });
21180       }
21181       bi = reB.lastIndex;
21182     }
21183     if (bi < b3.length) {
21184       bs = b3.slice(bi);
21185       if (s2[i3]) s2[i3] += bs;
21186       else s2[++i3] = bs;
21187     }
21188     return s2.length < 2 ? q3[0] ? one(q3[0].x) : zero2(b3) : (b3 = q3.length, function(t2) {
21189       for (var i4 = 0, o2; i4 < b3; ++i4) s2[(o2 = q3[i4]).i] = o2.x(t2);
21190       return s2.join("");
21191     });
21192   }
21193
21194   // node_modules/d3-interpolate/src/value.js
21195   function value_default(a2, b3) {
21196     var t2 = typeof b3, c2;
21197     return b3 == null || t2 === "boolean" ? constant_default5(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);
21198   }
21199
21200   // node_modules/d3-interpolate/src/round.js
21201   function round_default(a2, b3) {
21202     return a2 = +a2, b3 = +b3, function(t2) {
21203       return Math.round(a2 * (1 - t2) + b3 * t2);
21204     };
21205   }
21206
21207   // node_modules/d3-interpolate/src/transform/decompose.js
21208   var degrees2 = 180 / Math.PI;
21209   var identity2 = {
21210     translateX: 0,
21211     translateY: 0,
21212     rotate: 0,
21213     skewX: 0,
21214     scaleX: 1,
21215     scaleY: 1
21216   };
21217   function decompose_default(a2, b3, c2, d2, e3, f2) {
21218     var scaleX, scaleY, skewX;
21219     if (scaleX = Math.sqrt(a2 * a2 + b3 * b3)) a2 /= scaleX, b3 /= scaleX;
21220     if (skewX = a2 * c2 + b3 * d2) c2 -= a2 * skewX, d2 -= b3 * skewX;
21221     if (scaleY = Math.sqrt(c2 * c2 + d2 * d2)) c2 /= scaleY, d2 /= scaleY, skewX /= scaleY;
21222     if (a2 * d2 < b3 * c2) a2 = -a2, b3 = -b3, skewX = -skewX, scaleX = -scaleX;
21223     return {
21224       translateX: e3,
21225       translateY: f2,
21226       rotate: Math.atan2(b3, a2) * degrees2,
21227       skewX: Math.atan(skewX) * degrees2,
21228       scaleX,
21229       scaleY
21230     };
21231   }
21232
21233   // node_modules/d3-interpolate/src/transform/parse.js
21234   var svgNode;
21235   function parseCss(value) {
21236     const m3 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
21237     return m3.isIdentity ? identity2 : decompose_default(m3.a, m3.b, m3.c, m3.d, m3.e, m3.f);
21238   }
21239   function parseSvg(value) {
21240     if (value == null) return identity2;
21241     if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
21242     svgNode.setAttribute("transform", value);
21243     if (!(value = svgNode.transform.baseVal.consolidate())) return identity2;
21244     value = value.matrix;
21245     return decompose_default(value.a, value.b, value.c, value.d, value.e, value.f);
21246   }
21247
21248   // node_modules/d3-interpolate/src/transform/index.js
21249   function interpolateTransform(parse, pxComma, pxParen, degParen) {
21250     function pop(s2) {
21251       return s2.length ? s2.pop() + " " : "";
21252     }
21253     function translate(xa, ya, xb, yb, s2, q3) {
21254       if (xa !== xb || ya !== yb) {
21255         var i3 = s2.push("translate(", null, pxComma, null, pxParen);
21256         q3.push({ i: i3 - 4, x: number_default(xa, xb) }, { i: i3 - 2, x: number_default(ya, yb) });
21257       } else if (xb || yb) {
21258         s2.push("translate(" + xb + pxComma + yb + pxParen);
21259       }
21260     }
21261     function rotate(a2, b3, s2, q3) {
21262       if (a2 !== b3) {
21263         if (a2 - b3 > 180) b3 += 360;
21264         else if (b3 - a2 > 180) a2 += 360;
21265         q3.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default(a2, b3) });
21266       } else if (b3) {
21267         s2.push(pop(s2) + "rotate(" + b3 + degParen);
21268       }
21269     }
21270     function skewX(a2, b3, s2, q3) {
21271       if (a2 !== b3) {
21272         q3.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default(a2, b3) });
21273       } else if (b3) {
21274         s2.push(pop(s2) + "skewX(" + b3 + degParen);
21275       }
21276     }
21277     function scale(xa, ya, xb, yb, s2, q3) {
21278       if (xa !== xb || ya !== yb) {
21279         var i3 = s2.push(pop(s2) + "scale(", null, ",", null, ")");
21280         q3.push({ i: i3 - 4, x: number_default(xa, xb) }, { i: i3 - 2, x: number_default(ya, yb) });
21281       } else if (xb !== 1 || yb !== 1) {
21282         s2.push(pop(s2) + "scale(" + xb + "," + yb + ")");
21283       }
21284     }
21285     return function(a2, b3) {
21286       var s2 = [], q3 = [];
21287       a2 = parse(a2), b3 = parse(b3);
21288       translate(a2.translateX, a2.translateY, b3.translateX, b3.translateY, s2, q3);
21289       rotate(a2.rotate, b3.rotate, s2, q3);
21290       skewX(a2.skewX, b3.skewX, s2, q3);
21291       scale(a2.scaleX, a2.scaleY, b3.scaleX, b3.scaleY, s2, q3);
21292       a2 = b3 = null;
21293       return function(t2) {
21294         var i3 = -1, n3 = q3.length, o2;
21295         while (++i3 < n3) s2[(o2 = q3[i3]).i] = o2.x(t2);
21296         return s2.join("");
21297       };
21298     };
21299   }
21300   var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
21301   var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
21302
21303   // node_modules/d3-interpolate/src/zoom.js
21304   var epsilon22 = 1e-12;
21305   function cosh(x3) {
21306     return ((x3 = Math.exp(x3)) + 1 / x3) / 2;
21307   }
21308   function sinh(x3) {
21309     return ((x3 = Math.exp(x3)) - 1 / x3) / 2;
21310   }
21311   function tanh(x3) {
21312     return ((x3 = Math.exp(2 * x3)) - 1) / (x3 + 1);
21313   }
21314   var zoom_default = (function zoomRho(rho, rho2, rho4) {
21315     function zoom(p02, p1) {
21316       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, d2 = dx * dx + dy * dy, i3, S3;
21317       if (d2 < epsilon22) {
21318         S3 = Math.log(w1 / w0) / rho;
21319         i3 = function(t2) {
21320           return [
21321             ux0 + t2 * dx,
21322             uy0 + t2 * dy,
21323             w0 * Math.exp(rho * t2 * S3)
21324           ];
21325         };
21326       } else {
21327         var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
21328         S3 = (r1 - r0) / rho;
21329         i3 = function(t2) {
21330           var s2 = t2 * S3, coshr0 = cosh(r0), u4 = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
21331           return [
21332             ux0 + u4 * dx,
21333             uy0 + u4 * dy,
21334             w0 * coshr0 / cosh(rho * s2 + r0)
21335           ];
21336         };
21337       }
21338       i3.duration = S3 * 1e3 * rho / Math.SQRT2;
21339       return i3;
21340     }
21341     zoom.rho = function(_3) {
21342       var _1 = Math.max(1e-3, +_3), _22 = _1 * _1, _4 = _22 * _22;
21343       return zoomRho(_1, _22, _4);
21344     };
21345     return zoom;
21346   })(Math.SQRT2, 2, 4);
21347
21348   // node_modules/d3-interpolate/src/quantize.js
21349   function quantize_default(interpolator, n3) {
21350     var samples = new Array(n3);
21351     for (var i3 = 0; i3 < n3; ++i3) samples[i3] = interpolator(i3 / (n3 - 1));
21352     return samples;
21353   }
21354
21355   // node_modules/d3-timer/src/timer.js
21356   var frame = 0;
21357   var timeout = 0;
21358   var interval = 0;
21359   var pokeDelay = 1e3;
21360   var taskHead;
21361   var taskTail;
21362   var clockLast = 0;
21363   var clockNow = 0;
21364   var clockSkew = 0;
21365   var clock = typeof performance === "object" && performance.now ? performance : Date;
21366   var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f2) {
21367     setTimeout(f2, 17);
21368   };
21369   function now2() {
21370     return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
21371   }
21372   function clearNow() {
21373     clockNow = 0;
21374   }
21375   function Timer() {
21376     this._call = this._time = this._next = null;
21377   }
21378   Timer.prototype = timer.prototype = {
21379     constructor: Timer,
21380     restart: function(callback, delay, time) {
21381       if (typeof callback !== "function") throw new TypeError("callback is not a function");
21382       time = (time == null ? now2() : +time) + (delay == null ? 0 : +delay);
21383       if (!this._next && taskTail !== this) {
21384         if (taskTail) taskTail._next = this;
21385         else taskHead = this;
21386         taskTail = this;
21387       }
21388       this._call = callback;
21389       this._time = time;
21390       sleep();
21391     },
21392     stop: function() {
21393       if (this._call) {
21394         this._call = null;
21395         this._time = Infinity;
21396         sleep();
21397       }
21398     }
21399   };
21400   function timer(callback, delay, time) {
21401     var t2 = new Timer();
21402     t2.restart(callback, delay, time);
21403     return t2;
21404   }
21405   function timerFlush() {
21406     now2();
21407     ++frame;
21408     var t2 = taskHead, e3;
21409     while (t2) {
21410       if ((e3 = clockNow - t2._time) >= 0) t2._call.call(void 0, e3);
21411       t2 = t2._next;
21412     }
21413     --frame;
21414   }
21415   function wake() {
21416     clockNow = (clockLast = clock.now()) + clockSkew;
21417     frame = timeout = 0;
21418     try {
21419       timerFlush();
21420     } finally {
21421       frame = 0;
21422       nap();
21423       clockNow = 0;
21424     }
21425   }
21426   function poke() {
21427     var now3 = clock.now(), delay = now3 - clockLast;
21428     if (delay > pokeDelay) clockSkew -= delay, clockLast = now3;
21429   }
21430   function nap() {
21431     var t0, t1 = taskHead, t2, time = Infinity;
21432     while (t1) {
21433       if (t1._call) {
21434         if (time > t1._time) time = t1._time;
21435         t0 = t1, t1 = t1._next;
21436       } else {
21437         t2 = t1._next, t1._next = null;
21438         t1 = t0 ? t0._next = t2 : taskHead = t2;
21439       }
21440     }
21441     taskTail = t0;
21442     sleep(time);
21443   }
21444   function sleep(time) {
21445     if (frame) return;
21446     if (timeout) timeout = clearTimeout(timeout);
21447     var delay = time - clockNow;
21448     if (delay > 24) {
21449       if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
21450       if (interval) interval = clearInterval(interval);
21451     } else {
21452       if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
21453       frame = 1, setFrame(wake);
21454     }
21455   }
21456
21457   // node_modules/d3-timer/src/timeout.js
21458   function timeout_default(callback, delay, time) {
21459     var t2 = new Timer();
21460     delay = delay == null ? 0 : +delay;
21461     t2.restart((elapsed) => {
21462       t2.stop();
21463       callback(elapsed + delay);
21464     }, delay, time);
21465     return t2;
21466   }
21467
21468   // node_modules/d3-transition/src/transition/schedule.js
21469   var emptyOn = dispatch_default("start", "end", "cancel", "interrupt");
21470   var emptyTween = [];
21471   var CREATED = 0;
21472   var SCHEDULED = 1;
21473   var STARTING = 2;
21474   var STARTED = 3;
21475   var RUNNING = 4;
21476   var ENDING = 5;
21477   var ENDED = 6;
21478   function schedule_default(node, name, id2, index, group, timing) {
21479     var schedules = node.__transition;
21480     if (!schedules) node.__transition = {};
21481     else if (id2 in schedules) return;
21482     create(node, id2, {
21483       name,
21484       index,
21485       // For context during callback.
21486       group,
21487       // For context during callback.
21488       on: emptyOn,
21489       tween: emptyTween,
21490       time: timing.time,
21491       delay: timing.delay,
21492       duration: timing.duration,
21493       ease: timing.ease,
21494       timer: null,
21495       state: CREATED
21496     });
21497   }
21498   function init(node, id2) {
21499     var schedule = get3(node, id2);
21500     if (schedule.state > CREATED) throw new Error("too late; already scheduled");
21501     return schedule;
21502   }
21503   function set4(node, id2) {
21504     var schedule = get3(node, id2);
21505     if (schedule.state > STARTED) throw new Error("too late; already running");
21506     return schedule;
21507   }
21508   function get3(node, id2) {
21509     var schedule = node.__transition;
21510     if (!schedule || !(schedule = schedule[id2])) throw new Error("transition not found");
21511     return schedule;
21512   }
21513   function create(node, id2, self2) {
21514     var schedules = node.__transition, tween;
21515     schedules[id2] = self2;
21516     self2.timer = timer(schedule, 0, self2.time);
21517     function schedule(elapsed) {
21518       self2.state = SCHEDULED;
21519       self2.timer.restart(start2, self2.delay, self2.time);
21520       if (self2.delay <= elapsed) start2(elapsed - self2.delay);
21521     }
21522     function start2(elapsed) {
21523       var i3, j3, n3, o2;
21524       if (self2.state !== SCHEDULED) return stop();
21525       for (i3 in schedules) {
21526         o2 = schedules[i3];
21527         if (o2.name !== self2.name) continue;
21528         if (o2.state === STARTED) return timeout_default(start2);
21529         if (o2.state === RUNNING) {
21530           o2.state = ENDED;
21531           o2.timer.stop();
21532           o2.on.call("interrupt", node, node.__data__, o2.index, o2.group);
21533           delete schedules[i3];
21534         } else if (+i3 < id2) {
21535           o2.state = ENDED;
21536           o2.timer.stop();
21537           o2.on.call("cancel", node, node.__data__, o2.index, o2.group);
21538           delete schedules[i3];
21539         }
21540       }
21541       timeout_default(function() {
21542         if (self2.state === STARTED) {
21543           self2.state = RUNNING;
21544           self2.timer.restart(tick, self2.delay, self2.time);
21545           tick(elapsed);
21546         }
21547       });
21548       self2.state = STARTING;
21549       self2.on.call("start", node, node.__data__, self2.index, self2.group);
21550       if (self2.state !== STARTING) return;
21551       self2.state = STARTED;
21552       tween = new Array(n3 = self2.tween.length);
21553       for (i3 = 0, j3 = -1; i3 < n3; ++i3) {
21554         if (o2 = self2.tween[i3].value.call(node, node.__data__, self2.index, self2.group)) {
21555           tween[++j3] = o2;
21556         }
21557       }
21558       tween.length = j3 + 1;
21559     }
21560     function tick(elapsed) {
21561       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;
21562       while (++i3 < n3) {
21563         tween[i3].call(node, t2);
21564       }
21565       if (self2.state === ENDING) {
21566         self2.on.call("end", node, node.__data__, self2.index, self2.group);
21567         stop();
21568       }
21569     }
21570     function stop() {
21571       self2.state = ENDED;
21572       self2.timer.stop();
21573       delete schedules[id2];
21574       for (var i3 in schedules) return;
21575       delete node.__transition;
21576     }
21577   }
21578
21579   // node_modules/d3-transition/src/interrupt.js
21580   function interrupt_default(node, name) {
21581     var schedules = node.__transition, schedule, active, empty2 = true, i3;
21582     if (!schedules) return;
21583     name = name == null ? null : name + "";
21584     for (i3 in schedules) {
21585       if ((schedule = schedules[i3]).name !== name) {
21586         empty2 = false;
21587         continue;
21588       }
21589       active = schedule.state > STARTING && schedule.state < ENDING;
21590       schedule.state = ENDED;
21591       schedule.timer.stop();
21592       schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
21593       delete schedules[i3];
21594     }
21595     if (empty2) delete node.__transition;
21596   }
21597
21598   // node_modules/d3-transition/src/selection/interrupt.js
21599   function interrupt_default2(name) {
21600     return this.each(function() {
21601       interrupt_default(this, name);
21602     });
21603   }
21604
21605   // node_modules/d3-transition/src/transition/tween.js
21606   function tweenRemove(id2, name) {
21607     var tween0, tween1;
21608     return function() {
21609       var schedule = set4(this, id2), tween = schedule.tween;
21610       if (tween !== tween0) {
21611         tween1 = tween0 = tween;
21612         for (var i3 = 0, n3 = tween1.length; i3 < n3; ++i3) {
21613           if (tween1[i3].name === name) {
21614             tween1 = tween1.slice();
21615             tween1.splice(i3, 1);
21616             break;
21617           }
21618         }
21619       }
21620       schedule.tween = tween1;
21621     };
21622   }
21623   function tweenFunction(id2, name, value) {
21624     var tween0, tween1;
21625     if (typeof value !== "function") throw new Error();
21626     return function() {
21627       var schedule = set4(this, id2), tween = schedule.tween;
21628       if (tween !== tween0) {
21629         tween1 = (tween0 = tween).slice();
21630         for (var t2 = { name, value }, i3 = 0, n3 = tween1.length; i3 < n3; ++i3) {
21631           if (tween1[i3].name === name) {
21632             tween1[i3] = t2;
21633             break;
21634           }
21635         }
21636         if (i3 === n3) tween1.push(t2);
21637       }
21638       schedule.tween = tween1;
21639     };
21640   }
21641   function tween_default(name, value) {
21642     var id2 = this._id;
21643     name += "";
21644     if (arguments.length < 2) {
21645       var tween = get3(this.node(), id2).tween;
21646       for (var i3 = 0, n3 = tween.length, t2; i3 < n3; ++i3) {
21647         if ((t2 = tween[i3]).name === name) {
21648           return t2.value;
21649         }
21650       }
21651       return null;
21652     }
21653     return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
21654   }
21655   function tweenValue(transition2, name, value) {
21656     var id2 = transition2._id;
21657     transition2.each(function() {
21658       var schedule = set4(this, id2);
21659       (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
21660     });
21661     return function(node) {
21662       return get3(node, id2).value[name];
21663     };
21664   }
21665
21666   // node_modules/d3-transition/src/transition/interpolate.js
21667   function interpolate_default(a2, b3) {
21668     var c2;
21669     return (typeof b3 === "number" ? number_default : b3 instanceof color ? rgb_default : (c2 = color(b3)) ? (b3 = c2, rgb_default) : string_default)(a2, b3);
21670   }
21671
21672   // node_modules/d3-transition/src/transition/attr.js
21673   function attrRemove2(name) {
21674     return function() {
21675       this.removeAttribute(name);
21676     };
21677   }
21678   function attrRemoveNS2(fullname) {
21679     return function() {
21680       this.removeAttributeNS(fullname.space, fullname.local);
21681     };
21682   }
21683   function attrConstant2(name, interpolate, value1) {
21684     var string00, string1 = value1 + "", interpolate0;
21685     return function() {
21686       var string0 = this.getAttribute(name);
21687       return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
21688     };
21689   }
21690   function attrConstantNS2(fullname, interpolate, value1) {
21691     var string00, string1 = value1 + "", interpolate0;
21692     return function() {
21693       var string0 = this.getAttributeNS(fullname.space, fullname.local);
21694       return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
21695     };
21696   }
21697   function attrFunction2(name, interpolate, value) {
21698     var string00, string10, interpolate0;
21699     return function() {
21700       var string0, value1 = value(this), string1;
21701       if (value1 == null) return void this.removeAttribute(name);
21702       string0 = this.getAttribute(name);
21703       string1 = value1 + "";
21704       return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
21705     };
21706   }
21707   function attrFunctionNS2(fullname, interpolate, value) {
21708     var string00, string10, interpolate0;
21709     return function() {
21710       var string0, value1 = value(this), string1;
21711       if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
21712       string0 = this.getAttributeNS(fullname.space, fullname.local);
21713       string1 = value1 + "";
21714       return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
21715     };
21716   }
21717   function attr_default2(name, value) {
21718     var fullname = namespace_default(name), i3 = fullname === "transform" ? interpolateTransformSvg : interpolate_default;
21719     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));
21720   }
21721
21722   // node_modules/d3-transition/src/transition/attrTween.js
21723   function attrInterpolate(name, i3) {
21724     return function(t2) {
21725       this.setAttribute(name, i3.call(this, t2));
21726     };
21727   }
21728   function attrInterpolateNS(fullname, i3) {
21729     return function(t2) {
21730       this.setAttributeNS(fullname.space, fullname.local, i3.call(this, t2));
21731     };
21732   }
21733   function attrTweenNS(fullname, value) {
21734     var t0, i0;
21735     function tween() {
21736       var i3 = value.apply(this, arguments);
21737       if (i3 !== i0) t0 = (i0 = i3) && attrInterpolateNS(fullname, i3);
21738       return t0;
21739     }
21740     tween._value = value;
21741     return tween;
21742   }
21743   function attrTween(name, value) {
21744     var t0, i0;
21745     function tween() {
21746       var i3 = value.apply(this, arguments);
21747       if (i3 !== i0) t0 = (i0 = i3) && attrInterpolate(name, i3);
21748       return t0;
21749     }
21750     tween._value = value;
21751     return tween;
21752   }
21753   function attrTween_default(name, value) {
21754     var key = "attr." + name;
21755     if (arguments.length < 2) return (key = this.tween(key)) && key._value;
21756     if (value == null) return this.tween(key, null);
21757     if (typeof value !== "function") throw new Error();
21758     var fullname = namespace_default(name);
21759     return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
21760   }
21761
21762   // node_modules/d3-transition/src/transition/delay.js
21763   function delayFunction(id2, value) {
21764     return function() {
21765       init(this, id2).delay = +value.apply(this, arguments);
21766     };
21767   }
21768   function delayConstant(id2, value) {
21769     return value = +value, function() {
21770       init(this, id2).delay = value;
21771     };
21772   }
21773   function delay_default(value) {
21774     var id2 = this._id;
21775     return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get3(this.node(), id2).delay;
21776   }
21777
21778   // node_modules/d3-transition/src/transition/duration.js
21779   function durationFunction(id2, value) {
21780     return function() {
21781       set4(this, id2).duration = +value.apply(this, arguments);
21782     };
21783   }
21784   function durationConstant(id2, value) {
21785     return value = +value, function() {
21786       set4(this, id2).duration = value;
21787     };
21788   }
21789   function duration_default(value) {
21790     var id2 = this._id;
21791     return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get3(this.node(), id2).duration;
21792   }
21793
21794   // node_modules/d3-transition/src/transition/ease.js
21795   function easeConstant(id2, value) {
21796     if (typeof value !== "function") throw new Error();
21797     return function() {
21798       set4(this, id2).ease = value;
21799     };
21800   }
21801   function ease_default(value) {
21802     var id2 = this._id;
21803     return arguments.length ? this.each(easeConstant(id2, value)) : get3(this.node(), id2).ease;
21804   }
21805
21806   // node_modules/d3-transition/src/transition/easeVarying.js
21807   function easeVarying(id2, value) {
21808     return function() {
21809       var v3 = value.apply(this, arguments);
21810       if (typeof v3 !== "function") throw new Error();
21811       set4(this, id2).ease = v3;
21812     };
21813   }
21814   function easeVarying_default(value) {
21815     if (typeof value !== "function") throw new Error();
21816     return this.each(easeVarying(this._id, value));
21817   }
21818
21819   // node_modules/d3-transition/src/transition/filter.js
21820   function filter_default2(match) {
21821     if (typeof match !== "function") match = matcher_default(match);
21822     for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
21823       for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = [], node, i3 = 0; i3 < n3; ++i3) {
21824         if ((node = group[i3]) && match.call(node, node.__data__, i3, group)) {
21825           subgroup.push(node);
21826         }
21827       }
21828     }
21829     return new Transition(subgroups, this._parents, this._name, this._id);
21830   }
21831
21832   // node_modules/d3-transition/src/transition/merge.js
21833   function merge_default3(transition2) {
21834     if (transition2._id !== this._id) throw new Error();
21835     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) {
21836       for (var group0 = groups0[j3], group1 = groups1[j3], n3 = group0.length, merge3 = merges[j3] = new Array(n3), node, i3 = 0; i3 < n3; ++i3) {
21837         if (node = group0[i3] || group1[i3]) {
21838           merge3[i3] = node;
21839         }
21840       }
21841     }
21842     for (; j3 < m0; ++j3) {
21843       merges[j3] = groups0[j3];
21844     }
21845     return new Transition(merges, this._parents, this._name, this._id);
21846   }
21847
21848   // node_modules/d3-transition/src/transition/on.js
21849   function start(name) {
21850     return (name + "").trim().split(/^|\s+/).every(function(t2) {
21851       var i3 = t2.indexOf(".");
21852       if (i3 >= 0) t2 = t2.slice(0, i3);
21853       return !t2 || t2 === "start";
21854     });
21855   }
21856   function onFunction(id2, name, listener) {
21857     var on0, on1, sit = start(name) ? init : set4;
21858     return function() {
21859       var schedule = sit(this, id2), on = schedule.on;
21860       if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
21861       schedule.on = on1;
21862     };
21863   }
21864   function on_default2(name, listener) {
21865     var id2 = this._id;
21866     return arguments.length < 2 ? get3(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
21867   }
21868
21869   // node_modules/d3-transition/src/transition/remove.js
21870   function removeFunction(id2) {
21871     return function() {
21872       var parent2 = this.parentNode;
21873       for (var i3 in this.__transition) if (+i3 !== id2) return;
21874       if (parent2) parent2.removeChild(this);
21875     };
21876   }
21877   function remove_default2() {
21878     return this.on("end.remove", removeFunction(this._id));
21879   }
21880
21881   // node_modules/d3-transition/src/transition/select.js
21882   function select_default3(select) {
21883     var name = this._name, id2 = this._id;
21884     if (typeof select !== "function") select = selector_default(select);
21885     for (var groups = this._groups, m3 = groups.length, subgroups = new Array(m3), j3 = 0; j3 < m3; ++j3) {
21886       for (var group = groups[j3], n3 = group.length, subgroup = subgroups[j3] = new Array(n3), node, subnode, i3 = 0; i3 < n3; ++i3) {
21887         if ((node = group[i3]) && (subnode = select.call(node, node.__data__, i3, group))) {
21888           if ("__data__" in node) subnode.__data__ = node.__data__;
21889           subgroup[i3] = subnode;
21890           schedule_default(subgroup[i3], name, id2, i3, subgroup, get3(node, id2));
21891         }
21892       }
21893     }
21894     return new Transition(subgroups, this._parents, name, id2);
21895   }
21896
21897   // node_modules/d3-transition/src/transition/selectAll.js
21898   function selectAll_default3(select) {
21899     var name = this._name, id2 = this._id;
21900     if (typeof select !== "function") select = selectorAll_default(select);
21901     for (var groups = this._groups, m3 = groups.length, subgroups = [], parents = [], j3 = 0; j3 < m3; ++j3) {
21902       for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
21903         if (node = group[i3]) {
21904           for (var children2 = select.call(node, node.__data__, i3, group), child, inherit2 = get3(node, id2), k3 = 0, l2 = children2.length; k3 < l2; ++k3) {
21905             if (child = children2[k3]) {
21906               schedule_default(child, name, id2, k3, children2, inherit2);
21907             }
21908           }
21909           subgroups.push(children2);
21910           parents.push(node);
21911         }
21912       }
21913     }
21914     return new Transition(subgroups, parents, name, id2);
21915   }
21916
21917   // node_modules/d3-transition/src/transition/selection.js
21918   var Selection2 = selection_default.prototype.constructor;
21919   function selection_default2() {
21920     return new Selection2(this._groups, this._parents);
21921   }
21922
21923   // node_modules/d3-transition/src/transition/style.js
21924   function styleNull(name, interpolate) {
21925     var string00, string10, interpolate0;
21926     return function() {
21927       var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
21928       return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
21929     };
21930   }
21931   function styleRemove2(name) {
21932     return function() {
21933       this.style.removeProperty(name);
21934     };
21935   }
21936   function styleConstant2(name, interpolate, value1) {
21937     var string00, string1 = value1 + "", interpolate0;
21938     return function() {
21939       var string0 = styleValue(this, name);
21940       return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
21941     };
21942   }
21943   function styleFunction2(name, interpolate, value) {
21944     var string00, string10, interpolate0;
21945     return function() {
21946       var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
21947       if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
21948       return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
21949     };
21950   }
21951   function styleMaybeRemove(id2, name) {
21952     var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
21953     return function() {
21954       var schedule = set4(this, id2), on = schedule.on, listener = schedule.value[key] == null ? remove2 || (remove2 = styleRemove2(name)) : void 0;
21955       if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);
21956       schedule.on = on1;
21957     };
21958   }
21959   function style_default2(name, value, priority) {
21960     var i3 = (name += "") === "transform" ? interpolateTransformCss : interpolate_default;
21961     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);
21962   }
21963
21964   // node_modules/d3-transition/src/transition/styleTween.js
21965   function styleInterpolate(name, i3, priority) {
21966     return function(t2) {
21967       this.style.setProperty(name, i3.call(this, t2), priority);
21968     };
21969   }
21970   function styleTween(name, value, priority) {
21971     var t2, i0;
21972     function tween() {
21973       var i3 = value.apply(this, arguments);
21974       if (i3 !== i0) t2 = (i0 = i3) && styleInterpolate(name, i3, priority);
21975       return t2;
21976     }
21977     tween._value = value;
21978     return tween;
21979   }
21980   function styleTween_default(name, value, priority) {
21981     var key = "style." + (name += "");
21982     if (arguments.length < 2) return (key = this.tween(key)) && key._value;
21983     if (value == null) return this.tween(key, null);
21984     if (typeof value !== "function") throw new Error();
21985     return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
21986   }
21987
21988   // node_modules/d3-transition/src/transition/text.js
21989   function textConstant2(value) {
21990     return function() {
21991       this.textContent = value;
21992     };
21993   }
21994   function textFunction2(value) {
21995     return function() {
21996       var value1 = value(this);
21997       this.textContent = value1 == null ? "" : value1;
21998     };
21999   }
22000   function text_default2(value) {
22001     return this.tween("text", typeof value === "function" ? textFunction2(tweenValue(this, "text", value)) : textConstant2(value == null ? "" : value + ""));
22002   }
22003
22004   // node_modules/d3-transition/src/transition/textTween.js
22005   function textInterpolate(i3) {
22006     return function(t2) {
22007       this.textContent = i3.call(this, t2);
22008     };
22009   }
22010   function textTween(value) {
22011     var t0, i0;
22012     function tween() {
22013       var i3 = value.apply(this, arguments);
22014       if (i3 !== i0) t0 = (i0 = i3) && textInterpolate(i3);
22015       return t0;
22016     }
22017     tween._value = value;
22018     return tween;
22019   }
22020   function textTween_default(value) {
22021     var key = "text";
22022     if (arguments.length < 1) return (key = this.tween(key)) && key._value;
22023     if (value == null) return this.tween(key, null);
22024     if (typeof value !== "function") throw new Error();
22025     return this.tween(key, textTween(value));
22026   }
22027
22028   // node_modules/d3-transition/src/transition/transition.js
22029   function transition_default() {
22030     var name = this._name, id0 = this._id, id1 = newId();
22031     for (var groups = this._groups, m3 = groups.length, j3 = 0; j3 < m3; ++j3) {
22032       for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
22033         if (node = group[i3]) {
22034           var inherit2 = get3(node, id0);
22035           schedule_default(node, name, id1, i3, group, {
22036             time: inherit2.time + inherit2.delay + inherit2.duration,
22037             delay: 0,
22038             duration: inherit2.duration,
22039             ease: inherit2.ease
22040           });
22041         }
22042       }
22043     }
22044     return new Transition(groups, this._parents, name, id1);
22045   }
22046
22047   // node_modules/d3-transition/src/transition/end.js
22048   function end_default() {
22049     var on0, on1, that = this, id2 = that._id, size = that.size();
22050     return new Promise(function(resolve, reject) {
22051       var cancel = { value: reject }, end = { value: function() {
22052         if (--size === 0) resolve();
22053       } };
22054       that.each(function() {
22055         var schedule = set4(this, id2), on = schedule.on;
22056         if (on !== on0) {
22057           on1 = (on0 = on).copy();
22058           on1._.cancel.push(cancel);
22059           on1._.interrupt.push(cancel);
22060           on1._.end.push(end);
22061         }
22062         schedule.on = on1;
22063       });
22064       if (size === 0) resolve();
22065     });
22066   }
22067
22068   // node_modules/d3-transition/src/transition/index.js
22069   var id = 0;
22070   function Transition(groups, parents, name, id2) {
22071     this._groups = groups;
22072     this._parents = parents;
22073     this._name = name;
22074     this._id = id2;
22075   }
22076   function transition(name) {
22077     return selection_default().transition(name);
22078   }
22079   function newId() {
22080     return ++id;
22081   }
22082   var selection_prototype = selection_default.prototype;
22083   Transition.prototype = transition.prototype = {
22084     constructor: Transition,
22085     select: select_default3,
22086     selectAll: selectAll_default3,
22087     selectChild: selection_prototype.selectChild,
22088     selectChildren: selection_prototype.selectChildren,
22089     filter: filter_default2,
22090     merge: merge_default3,
22091     selection: selection_default2,
22092     transition: transition_default,
22093     call: selection_prototype.call,
22094     nodes: selection_prototype.nodes,
22095     node: selection_prototype.node,
22096     size: selection_prototype.size,
22097     empty: selection_prototype.empty,
22098     each: selection_prototype.each,
22099     on: on_default2,
22100     attr: attr_default2,
22101     attrTween: attrTween_default,
22102     style: style_default2,
22103     styleTween: styleTween_default,
22104     text: text_default2,
22105     textTween: textTween_default,
22106     remove: remove_default2,
22107     tween: tween_default,
22108     delay: delay_default,
22109     duration: duration_default,
22110     ease: ease_default,
22111     easeVarying: easeVarying_default,
22112     end: end_default,
22113     [Symbol.iterator]: selection_prototype[Symbol.iterator]
22114   };
22115
22116   // node_modules/d3-ease/src/linear.js
22117   var linear2 = (t2) => +t2;
22118
22119   // node_modules/d3-ease/src/cubic.js
22120   function cubicInOut(t2) {
22121     return ((t2 *= 2) <= 1 ? t2 * t2 * t2 : (t2 -= 2) * t2 * t2 + 2) / 2;
22122   }
22123
22124   // node_modules/d3-transition/src/selection/transition.js
22125   var defaultTiming = {
22126     time: null,
22127     // Set on use.
22128     delay: 0,
22129     duration: 250,
22130     ease: cubicInOut
22131   };
22132   function inherit(node, id2) {
22133     var timing;
22134     while (!(timing = node.__transition) || !(timing = timing[id2])) {
22135       if (!(node = node.parentNode)) {
22136         throw new Error("transition ".concat(id2, " not found"));
22137       }
22138     }
22139     return timing;
22140   }
22141   function transition_default2(name) {
22142     var id2, timing;
22143     if (name instanceof Transition) {
22144       id2 = name._id, name = name._name;
22145     } else {
22146       id2 = newId(), (timing = defaultTiming).time = now2(), name = name == null ? null : name + "";
22147     }
22148     for (var groups = this._groups, m3 = groups.length, j3 = 0; j3 < m3; ++j3) {
22149       for (var group = groups[j3], n3 = group.length, node, i3 = 0; i3 < n3; ++i3) {
22150         if (node = group[i3]) {
22151           schedule_default(node, name, id2, i3, group, timing || inherit(node, id2));
22152         }
22153       }
22154     }
22155     return new Transition(groups, this._parents, name, id2);
22156   }
22157
22158   // node_modules/d3-transition/src/selection/index.js
22159   selection_default.prototype.interrupt = interrupt_default2;
22160   selection_default.prototype.transition = transition_default2;
22161
22162   // node_modules/d3-zoom/src/constant.js
22163   var constant_default6 = (x3) => () => x3;
22164
22165   // node_modules/d3-zoom/src/event.js
22166   function ZoomEvent(type2, {
22167     sourceEvent,
22168     target,
22169     transform: transform2,
22170     dispatch: dispatch12
22171   }) {
22172     Object.defineProperties(this, {
22173       type: { value: type2, enumerable: true, configurable: true },
22174       sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
22175       target: { value: target, enumerable: true, configurable: true },
22176       transform: { value: transform2, enumerable: true, configurable: true },
22177       _: { value: dispatch12 }
22178     });
22179   }
22180
22181   // node_modules/d3-zoom/src/transform.js
22182   function Transform(k3, x3, y3) {
22183     this.k = k3;
22184     this.x = x3;
22185     this.y = y3;
22186   }
22187   Transform.prototype = {
22188     constructor: Transform,
22189     scale: function(k3) {
22190       return k3 === 1 ? this : new Transform(this.k * k3, this.x, this.y);
22191     },
22192     translate: function(x3, y3) {
22193       return x3 === 0 & y3 === 0 ? this : new Transform(this.k, this.x + this.k * x3, this.y + this.k * y3);
22194     },
22195     apply: function(point) {
22196       return [point[0] * this.k + this.x, point[1] * this.k + this.y];
22197     },
22198     applyX: function(x3) {
22199       return x3 * this.k + this.x;
22200     },
22201     applyY: function(y3) {
22202       return y3 * this.k + this.y;
22203     },
22204     invert: function(location) {
22205       return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
22206     },
22207     invertX: function(x3) {
22208       return (x3 - this.x) / this.k;
22209     },
22210     invertY: function(y3) {
22211       return (y3 - this.y) / this.k;
22212     },
22213     rescaleX: function(x3) {
22214       return x3.copy().domain(x3.range().map(this.invertX, this).map(x3.invert, x3));
22215     },
22216     rescaleY: function(y3) {
22217       return y3.copy().domain(y3.range().map(this.invertY, this).map(y3.invert, y3));
22218     },
22219     toString: function() {
22220       return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
22221     }
22222   };
22223   var identity3 = new Transform(1, 0, 0);
22224   transform.prototype = Transform.prototype;
22225   function transform(node) {
22226     while (!node.__zoom) if (!(node = node.parentNode)) return identity3;
22227     return node.__zoom;
22228   }
22229
22230   // node_modules/d3-zoom/src/noevent.js
22231   function nopropagation2(event) {
22232     event.stopImmediatePropagation();
22233   }
22234   function noevent_default2(event) {
22235     event.preventDefault();
22236     event.stopImmediatePropagation();
22237   }
22238
22239   // node_modules/d3-zoom/src/zoom.js
22240   function defaultFilter2(event) {
22241     return (!event.ctrlKey || event.type === "wheel") && !event.button;
22242   }
22243   function defaultExtent() {
22244     var e3 = this;
22245     if (e3 instanceof SVGElement) {
22246       e3 = e3.ownerSVGElement || e3;
22247       if (e3.hasAttribute("viewBox")) {
22248         e3 = e3.viewBox.baseVal;
22249         return [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]];
22250       }
22251       return [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]];
22252     }
22253     return [[0, 0], [e3.clientWidth, e3.clientHeight]];
22254   }
22255   function defaultTransform() {
22256     return this.__zoom || identity3;
22257   }
22258   function defaultWheelDelta(event) {
22259     return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
22260   }
22261   function defaultTouchable2() {
22262     return navigator.maxTouchPoints || "ontouchstart" in this;
22263   }
22264   function defaultConstrain(transform2, extent, translateExtent) {
22265     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];
22266     return transform2.translate(
22267       dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
22268       dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
22269     );
22270   }
22271   function zoom_default2() {
22272     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;
22273     function zoom(selection2) {
22274       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)");
22275     }
22276     zoom.transform = function(collection, transform2, point, event) {
22277       var selection2 = collection.selection ? collection.selection() : collection;
22278       selection2.property("__zoom", defaultTransform);
22279       if (collection !== selection2) {
22280         schedule(collection, transform2, point, event);
22281       } else {
22282         selection2.interrupt().each(function() {
22283           gesture(this, arguments).event(event).start().zoom(null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end();
22284         });
22285       }
22286     };
22287     zoom.scaleBy = function(selection2, k3, p2, event) {
22288       zoom.scaleTo(selection2, function() {
22289         var k0 = this.__zoom.k, k1 = typeof k3 === "function" ? k3.apply(this, arguments) : k3;
22290         return k0 * k1;
22291       }, p2, event);
22292     };
22293     zoom.scaleTo = function(selection2, k3, p2, event) {
22294       zoom.transform(selection2, function() {
22295         var e3 = extent.apply(this, arguments), t0 = this.__zoom, p02 = p2 == null ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2, p1 = t0.invert(p02), k1 = typeof k3 === "function" ? k3.apply(this, arguments) : k3;
22296         return constrain(translate(scale(t0, k1), p02, p1), e3, translateExtent);
22297       }, p2, event);
22298     };
22299     zoom.translateBy = function(selection2, x3, y3, event) {
22300       zoom.transform(selection2, function() {
22301         return constrain(this.__zoom.translate(
22302           typeof x3 === "function" ? x3.apply(this, arguments) : x3,
22303           typeof y3 === "function" ? y3.apply(this, arguments) : y3
22304         ), extent.apply(this, arguments), translateExtent);
22305       }, null, event);
22306     };
22307     zoom.translateTo = function(selection2, x3, y3, p2, event) {
22308       zoom.transform(selection2, function() {
22309         var e3 = extent.apply(this, arguments), t2 = this.__zoom, p02 = p2 == null ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2;
22310         return constrain(identity3.translate(p02[0], p02[1]).scale(t2.k).translate(
22311           typeof x3 === "function" ? -x3.apply(this, arguments) : -x3,
22312           typeof y3 === "function" ? -y3.apply(this, arguments) : -y3
22313         ), e3, translateExtent);
22314       }, p2, event);
22315     };
22316     function scale(transform2, k3) {
22317       k3 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k3));
22318       return k3 === transform2.k ? transform2 : new Transform(k3, transform2.x, transform2.y);
22319     }
22320     function translate(transform2, p02, p1) {
22321       var x3 = p02[0] - p1[0] * transform2.k, y3 = p02[1] - p1[1] * transform2.k;
22322       return x3 === transform2.x && y3 === transform2.y ? transform2 : new Transform(transform2.k, x3, y3);
22323     }
22324     function centroid(extent2) {
22325       return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
22326     }
22327     function schedule(transition2, transform2, point, event) {
22328       transition2.on("start.zoom", function() {
22329         gesture(this, arguments).event(event).start();
22330       }).on("interrupt.zoom end.zoom", function() {
22331         gesture(this, arguments).event(event).end();
22332       }).tween("zoom", function() {
22333         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));
22334         return function(t2) {
22335           if (t2 === 1) t2 = b3;
22336           else {
22337             var l2 = i3(t2), k3 = w3 / l2[2];
22338             t2 = new Transform(k3, p2[0] - l2[0] * k3, p2[1] - l2[1] * k3);
22339           }
22340           g3.zoom(null, t2);
22341         };
22342       });
22343     }
22344     function gesture(that, args, clean2) {
22345       return !clean2 && that.__zooming || new Gesture(that, args);
22346     }
22347     function Gesture(that, args) {
22348       this.that = that;
22349       this.args = args;
22350       this.active = 0;
22351       this.sourceEvent = null;
22352       this.extent = extent.apply(that, args);
22353       this.taps = 0;
22354     }
22355     Gesture.prototype = {
22356       event: function(event) {
22357         if (event) this.sourceEvent = event;
22358         return this;
22359       },
22360       start: function() {
22361         if (++this.active === 1) {
22362           this.that.__zooming = this;
22363           this.emit("start");
22364         }
22365         return this;
22366       },
22367       zoom: function(key, transform2) {
22368         if (this.mouse && key !== "mouse") this.mouse[1] = transform2.invert(this.mouse[0]);
22369         if (this.touch0 && key !== "touch") this.touch0[1] = transform2.invert(this.touch0[0]);
22370         if (this.touch1 && key !== "touch") this.touch1[1] = transform2.invert(this.touch1[0]);
22371         this.that.__zoom = transform2;
22372         this.emit("zoom");
22373         return this;
22374       },
22375       end: function() {
22376         if (--this.active === 0) {
22377           delete this.that.__zooming;
22378           this.emit("end");
22379         }
22380         return this;
22381       },
22382       emit: function(type2) {
22383         var d2 = select_default2(this.that).datum();
22384         listeners.call(
22385           type2,
22386           this.that,
22387           new ZoomEvent(type2, {
22388             sourceEvent: this.sourceEvent,
22389             target: zoom,
22390             type: type2,
22391             transform: this.that.__zoom,
22392             dispatch: listeners
22393           }),
22394           d2
22395         );
22396       }
22397     };
22398     function wheeled(event, ...args) {
22399       if (!filter2.apply(this, arguments)) return;
22400       var g3 = gesture(this, args).event(event), t2 = this.__zoom, k3 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t2.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p2 = pointer_default(event);
22401       if (g3.wheel) {
22402         if (g3.mouse[0][0] !== p2[0] || g3.mouse[0][1] !== p2[1]) {
22403           g3.mouse[1] = t2.invert(g3.mouse[0] = p2);
22404         }
22405         clearTimeout(g3.wheel);
22406       } else if (t2.k === k3) return;
22407       else {
22408         g3.mouse = [p2, t2.invert(p2)];
22409         interrupt_default(this);
22410         g3.start();
22411       }
22412       noevent_default2(event);
22413       g3.wheel = setTimeout(wheelidled, wheelDelay);
22414       g3.zoom("mouse", constrain(translate(scale(t2, k3), g3.mouse[0], g3.mouse[1]), g3.extent, translateExtent));
22415       function wheelidled() {
22416         g3.wheel = null;
22417         g3.end();
22418       }
22419     }
22420     function mousedowned(event, ...args) {
22421       if (touchending || !filter2.apply(this, arguments)) return;
22422       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;
22423       nodrag_default(event.view);
22424       nopropagation2(event);
22425       g3.mouse = [p2, this.__zoom.invert(p2)];
22426       interrupt_default(this);
22427       g3.start();
22428       function mousemoved(event2) {
22429         noevent_default2(event2);
22430         if (!g3.moved) {
22431           var dx = event2.clientX - x05, dy = event2.clientY - y05;
22432           g3.moved = dx * dx + dy * dy > clickDistance2;
22433         }
22434         g3.event(event2).zoom("mouse", constrain(translate(g3.that.__zoom, g3.mouse[0] = pointer_default(event2, currentTarget), g3.mouse[1]), g3.extent, translateExtent));
22435       }
22436       function mouseupped(event2) {
22437         v3.on("mousemove.zoom mouseup.zoom", null);
22438         yesdrag(event2.view, g3.moved);
22439         noevent_default2(event2);
22440         g3.event(event2).end();
22441       }
22442     }
22443     function dblclicked(event, ...args) {
22444       if (!filter2.apply(this, arguments)) return;
22445       var t0 = this.__zoom, p02 = pointer_default(event.changedTouches ? event.changedTouches[0] : event, this), p1 = t0.invert(p02), k1 = t0.k * (event.shiftKey ? 0.5 : 2), t1 = constrain(translate(scale(t0, k1), p02, p1), extent.apply(this, args), translateExtent);
22446       noevent_default2(event);
22447       if (duration > 0) select_default2(this).transition().duration(duration).call(schedule, t1, p02, event);
22448       else select_default2(this).call(zoom.transform, t1, p02, event);
22449     }
22450     function touchstarted(event, ...args) {
22451       if (!filter2.apply(this, arguments)) return;
22452       var touches = event.touches, n3 = touches.length, g3 = gesture(this, args, event.changedTouches.length === n3).event(event), started, i3, t2, p2;
22453       nopropagation2(event);
22454       for (i3 = 0; i3 < n3; ++i3) {
22455         t2 = touches[i3], p2 = pointer_default(t2, this);
22456         p2 = [p2, this.__zoom.invert(p2), t2.identifier];
22457         if (!g3.touch0) g3.touch0 = p2, started = true, g3.taps = 1 + !!touchstarting;
22458         else if (!g3.touch1 && g3.touch0[2] !== p2[2]) g3.touch1 = p2, g3.taps = 0;
22459       }
22460       if (touchstarting) touchstarting = clearTimeout(touchstarting);
22461       if (started) {
22462         if (g3.taps < 2) touchfirst = p2[0], touchstarting = setTimeout(function() {
22463           touchstarting = null;
22464         }, touchDelay);
22465         interrupt_default(this);
22466         g3.start();
22467       }
22468     }
22469     function touchmoved(event, ...args) {
22470       if (!this.__zooming) return;
22471       var g3 = gesture(this, args).event(event), touches = event.changedTouches, n3 = touches.length, i3, t2, p2, l2;
22472       noevent_default2(event);
22473       for (i3 = 0; i3 < n3; ++i3) {
22474         t2 = touches[i3], p2 = pointer_default(t2, this);
22475         if (g3.touch0 && g3.touch0[2] === t2.identifier) g3.touch0[0] = p2;
22476         else if (g3.touch1 && g3.touch1[2] === t2.identifier) g3.touch1[0] = p2;
22477       }
22478       t2 = g3.that.__zoom;
22479       if (g3.touch1) {
22480         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;
22481         t2 = scale(t2, Math.sqrt(dp / dl));
22482         p2 = [(p02[0] + p1[0]) / 2, (p02[1] + p1[1]) / 2];
22483         l2 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
22484       } else if (g3.touch0) p2 = g3.touch0[0], l2 = g3.touch0[1];
22485       else return;
22486       g3.zoom("touch", constrain(translate(t2, p2, l2), g3.extent, translateExtent));
22487     }
22488     function touchended(event, ...args) {
22489       if (!this.__zooming) return;
22490       var g3 = gesture(this, args).event(event), touches = event.changedTouches, n3 = touches.length, i3, t2;
22491       nopropagation2(event);
22492       if (touchending) clearTimeout(touchending);
22493       touchending = setTimeout(function() {
22494         touchending = null;
22495       }, touchDelay);
22496       for (i3 = 0; i3 < n3; ++i3) {
22497         t2 = touches[i3];
22498         if (g3.touch0 && g3.touch0[2] === t2.identifier) delete g3.touch0;
22499         else if (g3.touch1 && g3.touch1[2] === t2.identifier) delete g3.touch1;
22500       }
22501       if (g3.touch1 && !g3.touch0) g3.touch0 = g3.touch1, delete g3.touch1;
22502       if (g3.touch0) g3.touch0[1] = this.__zoom.invert(g3.touch0[0]);
22503       else {
22504         g3.end();
22505         if (g3.taps === 2) {
22506           t2 = pointer_default(t2, this);
22507           if (Math.hypot(touchfirst[0] - t2[0], touchfirst[1] - t2[1]) < tapDistance) {
22508             var p2 = select_default2(this).on("dblclick.zoom");
22509             if (p2) p2.apply(this, arguments);
22510           }
22511         }
22512       }
22513     }
22514     zoom.wheelDelta = function(_3) {
22515       return arguments.length ? (wheelDelta = typeof _3 === "function" ? _3 : constant_default6(+_3), zoom) : wheelDelta;
22516     };
22517     zoom.filter = function(_3) {
22518       return arguments.length ? (filter2 = typeof _3 === "function" ? _3 : constant_default6(!!_3), zoom) : filter2;
22519     };
22520     zoom.touchable = function(_3) {
22521       return arguments.length ? (touchable = typeof _3 === "function" ? _3 : constant_default6(!!_3), zoom) : touchable;
22522     };
22523     zoom.extent = function(_3) {
22524       return arguments.length ? (extent = typeof _3 === "function" ? _3 : constant_default6([[+_3[0][0], +_3[0][1]], [+_3[1][0], +_3[1][1]]]), zoom) : extent;
22525     };
22526     zoom.scaleExtent = function(_3) {
22527       return arguments.length ? (scaleExtent[0] = +_3[0], scaleExtent[1] = +_3[1], zoom) : [scaleExtent[0], scaleExtent[1]];
22528     };
22529     zoom.translateExtent = function(_3) {
22530       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]]];
22531     };
22532     zoom.constrain = function(_3) {
22533       return arguments.length ? (constrain = _3, zoom) : constrain;
22534     };
22535     zoom.duration = function(_3) {
22536       return arguments.length ? (duration = +_3, zoom) : duration;
22537     };
22538     zoom.interpolate = function(_3) {
22539       return arguments.length ? (interpolate = _3, zoom) : interpolate;
22540     };
22541     zoom.on = function() {
22542       var value = listeners.on.apply(listeners, arguments);
22543       return value === listeners ? zoom : value;
22544     };
22545     zoom.clickDistance = function(_3) {
22546       return arguments.length ? (clickDistance2 = (_3 = +_3) * _3, zoom) : Math.sqrt(clickDistance2);
22547     };
22548     zoom.tapDistance = function(_3) {
22549       return arguments.length ? (tapDistance = +_3, zoom) : tapDistance;
22550     };
22551     return zoom;
22552   }
22553
22554   // modules/geo/raw_mercator.js
22555   function geoRawMercator() {
22556     const project = mercatorRaw;
22557     let k3 = 512 / Math.PI;
22558     let x3 = 0;
22559     let y3 = 0;
22560     let clipExtent = [[0, 0], [0, 0]];
22561     function projection2(point) {
22562       point = project(point[0] * Math.PI / 180, point[1] * Math.PI / 180);
22563       return [point[0] * k3 + x3, y3 - point[1] * k3];
22564     }
22565     projection2.invert = function(point) {
22566       point = project.invert((point[0] - x3) / k3, (y3 - point[1]) / k3);
22567       return point && [point[0] * 180 / Math.PI, point[1] * 180 / Math.PI];
22568     };
22569     projection2.scale = function(_3) {
22570       if (!arguments.length) return k3;
22571       k3 = +_3;
22572       return projection2;
22573     };
22574     projection2.translate = function(_3) {
22575       if (!arguments.length) return [x3, y3];
22576       x3 = +_3[0];
22577       y3 = +_3[1];
22578       return projection2;
22579     };
22580     projection2.clipExtent = function(_3) {
22581       if (!arguments.length) return clipExtent;
22582       clipExtent = _3;
22583       return projection2;
22584     };
22585     projection2.transform = function(obj) {
22586       if (!arguments.length) return identity3.translate(x3, y3).scale(k3);
22587       x3 = +obj.x;
22588       y3 = +obj.y;
22589       k3 = +obj.k;
22590       return projection2;
22591     };
22592     projection2.stream = transform_default({
22593       point: function(x4, y4) {
22594         const vec = projection2([x4, y4]);
22595         this.stream.point(vec[0], vec[1]);
22596       }
22597     }).stream;
22598     return projection2;
22599   }
22600
22601   // modules/geo/ortho.ts
22602   function geoOrthoNormalizedDotProduct(a2, b3, origin) {
22603     if (geoVecEqual(origin, a2) || geoVecEqual(origin, b3)) {
22604       return 1;
22605     }
22606     return geoVecNormalizedDot(a2, b3, origin);
22607   }
22608   function geoOrthoFilterDotProduct(dotp, epsilon3, lowerThreshold, upperThreshold, allowStraightAngles) {
22609     var val = Math.abs(dotp);
22610     if (val < epsilon3) {
22611       return 0;
22612     } else if (allowStraightAngles && Math.abs(val - 1) < epsilon3) {
22613       return 0;
22614     } else if (val < lowerThreshold || val > upperThreshold) {
22615       return dotp;
22616     } else {
22617       return null;
22618     }
22619   }
22620   function geoOrthoCalcScore(points, isClosed, epsilon3, threshold) {
22621     var score = 0;
22622     var first = isClosed ? 0 : 1;
22623     var last2 = isClosed ? points.length : points.length - 1;
22624     var coords = points.map(function(p2) {
22625       return p2.coord;
22626     });
22627     var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
22628     var upperThreshold = Math.cos(threshold * Math.PI / 180);
22629     for (var i3 = first; i3 < last2; i3++) {
22630       var a2 = coords[(i3 - 1 + coords.length) % coords.length];
22631       var origin = coords[i3];
22632       var b3 = coords[(i3 + 1) % coords.length];
22633       var dotp = geoOrthoFilterDotProduct(geoOrthoNormalizedDotProduct(a2, b3, origin), epsilon3, lowerThreshold, upperThreshold);
22634       if (dotp === null) continue;
22635       score = score + 2 * Math.min(Math.abs(dotp - 1), Math.min(Math.abs(dotp), Math.abs(dotp + 1)));
22636     }
22637     return score;
22638   }
22639   function geoOrthoMaxOffsetAngle(coords, isClosed, lessThan) {
22640     var max3 = -Infinity;
22641     var first = isClosed ? 0 : 1;
22642     var last2 = isClosed ? coords.length : coords.length - 1;
22643     for (var i3 = first; i3 < last2; i3++) {
22644       var a2 = coords[(i3 - 1 + coords.length) % coords.length];
22645       var origin = coords[i3];
22646       var b3 = coords[(i3 + 1) % coords.length];
22647       var normalizedDotP = geoOrthoNormalizedDotProduct(a2, b3, origin);
22648       var angle2 = Math.acos(Math.abs(normalizedDotP)) * 180 / Math.PI;
22649       if (angle2 > 45) angle2 = 90 - angle2;
22650       if (angle2 >= lessThan) continue;
22651       if (angle2 > max3) max3 = angle2;
22652     }
22653     if (max3 === -Infinity) return null;
22654     return max3;
22655   }
22656   function geoOrthoCanOrthogonalize(coords, isClosed, epsilon3, threshold, allowStraightAngles) {
22657     var score = null;
22658     var first = isClosed ? 0 : 1;
22659     var last2 = isClosed ? coords.length : coords.length - 1;
22660     var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
22661     var upperThreshold = Math.cos(threshold * Math.PI / 180);
22662     for (var i3 = first; i3 < last2; i3++) {
22663       var a2 = coords[(i3 - 1 + coords.length) % coords.length];
22664       var origin = coords[i3];
22665       var b3 = coords[(i3 + 1) % coords.length];
22666       var dotp = geoOrthoFilterDotProduct(geoOrthoNormalizedDotProduct(a2, b3, origin), epsilon3, lowerThreshold, upperThreshold, allowStraightAngles);
22667       if (dotp === null) continue;
22668       if (Math.abs(dotp) > 0) return 1;
22669       score = 0;
22670     }
22671     return score;
22672   }
22673
22674   // modules/util/tiler.js
22675   function utilTiler() {
22676     var _size = [256, 256];
22677     var _scale = 256;
22678     var _tileSize = 256;
22679     var _zoomExtent = [0, 20];
22680     var _translate = [_size[0] / 2, _size[1] / 2];
22681     var _margin = 0;
22682     var _skipNullIsland = false;
22683     function nearNullIsland(tile) {
22684       var x3 = tile[0];
22685       var y3 = tile[1];
22686       var z3 = tile[2];
22687       if (z3 >= 7) {
22688         var center = Math.pow(2, z3 - 1);
22689         var width = Math.pow(2, z3 - 6);
22690         var min3 = center - width / 2;
22691         var max3 = center + width / 2 - 1;
22692         return x3 >= min3 && x3 <= max3 && y3 >= min3 && y3 <= max3;
22693       }
22694       return false;
22695     }
22696     function tiler8() {
22697       var z3 = geoScaleToZoom(_scale / (2 * Math.PI), _tileSize);
22698       var z0 = clamp_default(Math.round(z3), _zoomExtent[0], _zoomExtent[1]);
22699       var tileMin = 0;
22700       var tileMax = Math.pow(2, z0) - 1;
22701       var log2ts = Math.log(_tileSize) * Math.LOG2E;
22702       var k3 = Math.pow(2, z3 - z0 + log2ts);
22703       var origin = [
22704         (_translate[0] - _scale / 2) / k3,
22705         (_translate[1] - _scale / 2) / k3
22706       ];
22707       var cols = range(
22708         clamp_default(Math.floor(-origin[0]) - _margin, tileMin, tileMax + 1),
22709         clamp_default(Math.ceil(_size[0] / k3 - origin[0]) + _margin, tileMin, tileMax + 1)
22710       );
22711       var rows = range(
22712         clamp_default(Math.floor(-origin[1]) - _margin, tileMin, tileMax + 1),
22713         clamp_default(Math.ceil(_size[1] / k3 - origin[1]) + _margin, tileMin, tileMax + 1)
22714       );
22715       var tiles = [];
22716       for (var i3 = 0; i3 < rows.length; i3++) {
22717         var y3 = rows[i3];
22718         for (var j3 = 0; j3 < cols.length; j3++) {
22719           var x3 = cols[j3];
22720           if (i3 >= _margin && i3 <= rows.length - _margin && j3 >= _margin && j3 <= cols.length - _margin) {
22721             tiles.unshift([x3, y3, z0]);
22722           } else {
22723             tiles.push([x3, y3, z0]);
22724           }
22725         }
22726       }
22727       tiles.translate = origin;
22728       tiles.scale = k3;
22729       return tiles;
22730     }
22731     tiler8.getTiles = function(projection2) {
22732       var origin = [
22733         projection2.scale() * Math.PI - projection2.translate()[0],
22734         projection2.scale() * Math.PI - projection2.translate()[1]
22735       ];
22736       this.size(projection2.clipExtent()[1]).scale(projection2.scale() * 2 * Math.PI).translate(projection2.translate());
22737       var tiles = tiler8();
22738       var ts = tiles.scale;
22739       return tiles.map(function(tile) {
22740         if (_skipNullIsland && nearNullIsland(tile)) {
22741           return false;
22742         }
22743         var x3 = tile[0] * ts - origin[0];
22744         var y3 = tile[1] * ts - origin[1];
22745         return {
22746           id: tile.toString(),
22747           xyz: tile,
22748           extent: geoExtent(
22749             projection2.invert([x3, y3 + ts]),
22750             projection2.invert([x3 + ts, y3])
22751           )
22752         };
22753       }).filter(Boolean);
22754     };
22755     tiler8.getGeoJSON = function(projection2) {
22756       var features = tiler8.getTiles(projection2).map(function(tile) {
22757         return {
22758           type: "Feature",
22759           properties: {
22760             id: tile.id,
22761             name: tile.id
22762           },
22763           geometry: {
22764             type: "Polygon",
22765             coordinates: [tile.extent.polygon()]
22766           }
22767         };
22768       });
22769       return {
22770         type: "FeatureCollection",
22771         features
22772       };
22773     };
22774     tiler8.tileSize = function(val) {
22775       if (!arguments.length) return _tileSize;
22776       _tileSize = val;
22777       return tiler8;
22778     };
22779     tiler8.zoomExtent = function(val) {
22780       if (!arguments.length) return _zoomExtent;
22781       _zoomExtent = val;
22782       return tiler8;
22783     };
22784     tiler8.size = function(val) {
22785       if (!arguments.length) return _size;
22786       _size = val;
22787       return tiler8;
22788     };
22789     tiler8.scale = function(val) {
22790       if (!arguments.length) return _scale;
22791       _scale = val;
22792       return tiler8;
22793     };
22794     tiler8.translate = function(val) {
22795       if (!arguments.length) return _translate;
22796       _translate = val;
22797       return tiler8;
22798     };
22799     tiler8.margin = function(val) {
22800       if (!arguments.length) return _margin;
22801       _margin = +val;
22802       return tiler8;
22803     };
22804     tiler8.skipNullIsland = function(val) {
22805       if (!arguments.length) return _skipNullIsland;
22806       _skipNullIsland = val;
22807       return tiler8;
22808     };
22809     return tiler8;
22810   }
22811
22812   // modules/util/trigger_event.js
22813   function utilTriggerEvent(target, type2, eventProperties) {
22814     target.each(function() {
22815       var evt = document.createEvent("HTMLEvents");
22816       evt.initEvent(type2, true, true);
22817       for (var prop in eventProperties) {
22818         evt[prop] = eventProperties[prop];
22819       }
22820       this.dispatchEvent(evt);
22821     });
22822   }
22823
22824   // modules/util/units.js
22825   var OSM_PRECISION = 7;
22826   function displayLength(m3, isImperial) {
22827     var d2 = m3 * (isImperial ? 3.28084 : 1);
22828     var unit2;
22829     if (isImperial) {
22830       if (d2 >= 5280) {
22831         d2 /= 5280;
22832         unit2 = "miles";
22833       } else {
22834         unit2 = "feet";
22835       }
22836     } else {
22837       if (d2 >= 1e3) {
22838         d2 /= 1e3;
22839         unit2 = "kilometers";
22840       } else {
22841         unit2 = "meters";
22842       }
22843     }
22844     return _t("units." + unit2, {
22845       quantity: d2.toLocaleString(_mainLocalizer.localeCode(), {
22846         maximumSignificantDigits: 4
22847       })
22848     });
22849   }
22850   function displayArea(m22, isImperial) {
22851     var locale2 = _mainLocalizer.localeCode();
22852     var d2 = m22 * (isImperial ? 10.7639111056 : 1);
22853     var d1, d22, area;
22854     var unit1 = "";
22855     var unit2 = "";
22856     if (isImperial) {
22857       if (d2 >= 6969600) {
22858         d1 = d2 / 27878400;
22859         unit1 = "square_miles";
22860       } else {
22861         d1 = d2;
22862         unit1 = "square_feet";
22863       }
22864       if (d2 > 4356 && d2 < 4356e4) {
22865         d22 = d2 / 43560;
22866         unit2 = "acres";
22867       }
22868     } else {
22869       if (d2 >= 25e4) {
22870         d1 = d2 / 1e6;
22871         unit1 = "square_kilometers";
22872       } else {
22873         d1 = d2;
22874         unit1 = "square_meters";
22875       }
22876       if (d2 > 1e3 && d2 < 1e7) {
22877         d22 = d2 / 1e4;
22878         unit2 = "hectares";
22879       }
22880     }
22881     area = _t("units." + unit1, {
22882       quantity: d1.toLocaleString(locale2, {
22883         maximumSignificantDigits: 4
22884       })
22885     });
22886     if (d22) {
22887       return _t("units.area_pair", {
22888         area1: area,
22889         area2: _t("units." + unit2, {
22890           quantity: d22.toLocaleString(locale2, {
22891             maximumSignificantDigits: 2
22892           })
22893         })
22894       });
22895     } else {
22896       return area;
22897     }
22898   }
22899   function wrap(x3, min3, max3) {
22900     var d2 = max3 - min3;
22901     return ((x3 - min3) % d2 + d2) % d2 + min3;
22902   }
22903   function roundToDecimal(target, decimalPlace) {
22904     target = Number(target);
22905     decimalPlace = Number(decimalPlace);
22906     const factor = Math.pow(10, decimalPlace);
22907     return Math.round(target * factor) / factor;
22908   }
22909   function displayCoordinate(deg, pos, neg) {
22910     var displayCoordinate2;
22911     var locale2 = _mainLocalizer.localeCode();
22912     var degreesFloor = Math.floor(Math.abs(deg));
22913     var min3 = (Math.abs(deg) - degreesFloor) * 60;
22914     var minFloor = Math.floor(min3);
22915     var sec = (min3 - minFloor) * 60;
22916     var fix = roundToDecimal(sec, 8);
22917     var secRounded = roundToDecimal(fix, 0);
22918     if (secRounded === 60) {
22919       secRounded = 0;
22920       minFloor += 1;
22921       if (minFloor === 60) {
22922         minFloor = 0;
22923         degreesFloor += 1;
22924       }
22925     }
22926     displayCoordinate2 = _t("units.arcdegrees", {
22927       quantity: degreesFloor.toLocaleString(locale2)
22928     }) + (minFloor !== 0 || secRounded !== 0 ? _t("units.arcminutes", {
22929       quantity: minFloor.toLocaleString(locale2)
22930     }) : "") + (secRounded !== 0 ? _t("units.arcseconds", {
22931       quantity: secRounded.toLocaleString(locale2)
22932     }) : "");
22933     if (deg === 0) {
22934       return displayCoordinate2;
22935     } else {
22936       return _t("units.coordinate", {
22937         coordinate: displayCoordinate2,
22938         direction: _t("units." + (deg > 0 ? pos : neg))
22939       });
22940     }
22941   }
22942   function dmsCoordinatePair(coord2) {
22943     return _t("units.coordinate_pair", {
22944       latitude: displayCoordinate(clamp_default(coord2[1], -90, 90), "north", "south"),
22945       longitude: displayCoordinate(wrap(coord2[0], -180, 180), "east", "west")
22946     });
22947   }
22948   function decimalCoordinatePair(coord2) {
22949     return _t("units.coordinate_pair", {
22950       latitude: clamp_default(coord2[1], -90, 90).toFixed(OSM_PRECISION),
22951       longitude: wrap(coord2[0], -180, 180).toFixed(OSM_PRECISION)
22952     });
22953   }
22954   function dmsMatcher(q3, _localeCode = void 0) {
22955     const matchers = [
22956       // D M SS , D M SS  ex: 35 11 10.1 , 136 49 53.8
22957       {
22958         condition: /^\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*$/,
22959         parser: function(q4) {
22960           const match = this.condition.exec(q4);
22961           const lat = +match[2] + +match[3] / 60 + +match[4] / 3600;
22962           const lng = +match[6] + +match[7] / 60 + +match[8] / 3600;
22963           const isNegLat = match[1] === "-" ? -lat : lat;
22964           const isNegLng = match[5] === "-" ? -lng : lng;
22965           return [isNegLat, isNegLng];
22966         }
22967       },
22968       // D MM , D MM ex: 35 11.1683 , 136 49.8966
22969       {
22970         condition: /^\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*$/,
22971         parser: function(q4) {
22972           const match = this.condition.exec(q4);
22973           const lat = +match[2] + +match[3] / 60;
22974           const lng = +match[5] + +match[6] / 60;
22975           const isNegLat = match[1] === "-" ? -lat : lat;
22976           const isNegLng = match[4] === "-" ? -lng : lng;
22977           return [isNegLat, isNegLng];
22978         }
22979       },
22980       // D/D ex: 46.112785/72.921033
22981       {
22982         condition: /^\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,
22983         parser: function(q4) {
22984           const match = this.condition.exec(q4);
22985           return [+match[1], +match[2]];
22986         }
22987       },
22988       // zoom/x/y ex: 2/1.23/34.44
22989       {
22990         condition: /^\s*(\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,
22991         parser: function(q4) {
22992           const match = this.condition.exec(q4);
22993           const lat = +match[2];
22994           const lng = +match[3];
22995           const zoom = +match[1];
22996           return [lat, lng, zoom];
22997         }
22998       },
22999       // x/y , x, y , x y  where x and y are localized floats, e.g. in German locale: 49,4109399, 8,7147086
23000       {
23001         condition: { test: (q4) => !!localizedNumberCoordsParser(q4) },
23002         parser: localizedNumberCoordsParser
23003       }
23004     ];
23005     function localizedNumberCoordsParser(q4) {
23006       const parseLocaleFloat = _mainLocalizer.floatParser(_localeCode || _mainLocalizer.localeCode());
23007       let parts = q4.split(/,?\s+|\s*[\/\\]\s*/);
23008       if (parts.length !== 2) return false;
23009       const lat = parseLocaleFloat(parts[0]);
23010       const lng = parseLocaleFloat(parts[1]);
23011       if (isNaN(lat) || isNaN(lng)) return false;
23012       return [lat, lng];
23013     }
23014     for (const matcher of matchers) {
23015       if (matcher.condition.test(q3)) {
23016         return matcher.parser(q3);
23017       }
23018     }
23019     return null;
23020   }
23021
23022   // modules/core/localizer.js
23023   var _mainLocalizer = coreLocalizer();
23024   var _t = _mainLocalizer.t;
23025   function coreLocalizer() {
23026     let localizer = {};
23027     let _dataLanguages = {};
23028     let _dataLocales = {};
23029     let _localeStrings = {};
23030     let _localeCode = "en-US";
23031     let _localeCodes = ["en-US", "en"];
23032     let _languageCode = "en";
23033     let _textDirection = "ltr";
23034     let _usesMetric = false;
23035     let _languageNames = {};
23036     let _scriptNames = {};
23037     localizer.localeCode = () => _localeCode;
23038     localizer.localeCodes = () => _localeCodes;
23039     localizer.languageCode = () => _languageCode;
23040     localizer.textDirection = () => _textDirection;
23041     localizer.usesMetric = () => _usesMetric;
23042     localizer.languageNames = () => _languageNames;
23043     localizer.scriptNames = () => _scriptNames;
23044     let _preferredLocaleCodes = [];
23045     localizer.preferredLocaleCodes = function(codes) {
23046       if (!arguments.length) return _preferredLocaleCodes;
23047       if (typeof codes === "string") {
23048         _preferredLocaleCodes = codes.split(/,|;| /gi).filter(Boolean);
23049       } else {
23050         _preferredLocaleCodes = codes;
23051       }
23052       _loadPromise = void 0;
23053       return localizer;
23054     };
23055     var _loadPromise;
23056     localizer.ensureLoaded = () => {
23057       if (_loadPromise) return _loadPromise;
23058       let filesToFetch = [
23059         "languages",
23060         // load the list of languages
23061         "locales"
23062         // load the list of supported locales
23063       ];
23064       const localeDirs = {
23065         general: "locales",
23066         tagging: presetsCdnUrl + "dist/translations"
23067       };
23068       let fileMap = _mainFileFetcher.fileMap();
23069       for (let scopeId in localeDirs) {
23070         const key = "locales_index_".concat(scopeId);
23071         if (!fileMap[key]) {
23072           fileMap[key] = localeDirs[scopeId] + "/index.min.json";
23073         }
23074         filesToFetch.push(key);
23075       }
23076       return _loadPromise = Promise.all(filesToFetch.map((key) => _mainFileFetcher.get(key))).then((results) => {
23077         _dataLanguages = results[0];
23078         _dataLocales = results[1];
23079         let indexes = results.slice(2);
23080         _localeCodes = localizer.localesToUseFrom(_dataLocales);
23081         _localeCode = _localeCodes[0];
23082         let loadStringsPromises = [];
23083         indexes.forEach((index, i3) => {
23084           const fullCoverageIndex = _localeCodes.findIndex(function(locale2) {
23085             return index[locale2] && index[locale2].pct === 1;
23086           });
23087           _localeCodes.slice(0, fullCoverageIndex + 1).forEach(function(code) {
23088             let scopeId = Object.keys(localeDirs)[i3];
23089             let directory = Object.values(localeDirs)[i3];
23090             if (index[code]) loadStringsPromises.push(localizer.loadLocale(code, scopeId, directory));
23091           });
23092         });
23093         return Promise.all(loadStringsPromises);
23094       }).then(() => {
23095         updateForCurrentLocale();
23096       }).catch((err) => console.error(err));
23097     };
23098     localizer.localesToUseFrom = (supportedLocales) => {
23099       const requestedLocales = [
23100         ..._preferredLocaleCodes || [],
23101         ...utilDetect().browserLocales,
23102         // List of locales preferred by the browser in priority order.
23103         "en"
23104         // fallback to English since it's the only guaranteed complete language
23105       ];
23106       let toUse = [];
23107       for (const locale2 of requestedLocales) {
23108         if (supportedLocales[locale2]) toUse.push(locale2);
23109         if ("Intl" in window && "Locale" in window.Intl) {
23110           const localeObj = new Intl.Locale(locale2);
23111           const withoutScript = "".concat(localeObj.language, "-").concat(localeObj.region);
23112           const base = localeObj.language;
23113           if (supportedLocales[withoutScript]) toUse.push(withoutScript);
23114           if (supportedLocales[base]) toUse.push(base);
23115         } else if (locale2.includes("-")) {
23116           let langPart = locale2.split("-")[0];
23117           if (supportedLocales[langPart]) toUse.push(langPart);
23118         }
23119       }
23120       return utilArrayUniq(toUse);
23121     };
23122     function updateForCurrentLocale() {
23123       if (!_localeCode) return;
23124       _languageCode = _localeCode.split("-")[0];
23125       const currentData = _dataLocales[_localeCode] || _dataLocales[_languageCode];
23126       const hash2 = utilStringQs(window.location.hash);
23127       if (hash2.rtl === "true") {
23128         _textDirection = "rtl";
23129       } else if (hash2.rtl === "false") {
23130         _textDirection = "ltr";
23131       } else {
23132         _textDirection = currentData && currentData.rtl ? "rtl" : "ltr";
23133       }
23134       let locale2 = _localeCode;
23135       if (locale2.toLowerCase() === "en-us") locale2 = "en";
23136       _languageNames = _localeStrings.general[locale2].languageNames || _localeStrings.general[_languageCode].languageNames;
23137       _scriptNames = _localeStrings.general[locale2].scriptNames || _localeStrings.general[_languageCode].scriptNames;
23138       _usesMetric = _localeCode.slice(-3).toLowerCase() !== "-us";
23139     }
23140     localizer.loadLocale = (locale2, scopeId, directory) => {
23141       if (locale2.toLowerCase() === "en-us") locale2 = "en";
23142       if (_localeStrings[scopeId] && _localeStrings[scopeId][locale2]) {
23143         return Promise.resolve(locale2);
23144       }
23145       let fileMap = _mainFileFetcher.fileMap();
23146       const key = "locale_".concat(scopeId, "_").concat(locale2);
23147       if (!fileMap[key]) {
23148         fileMap[key] = "".concat(directory, "/").concat(locale2, ".min.json");
23149       }
23150       return _mainFileFetcher.get(key).then((d2) => {
23151         if (!_localeStrings[scopeId]) _localeStrings[scopeId] = {};
23152         _localeStrings[scopeId][locale2] = d2[locale2];
23153         return locale2;
23154       });
23155     };
23156     localizer.pluralRule = function(number3) {
23157       return pluralRule(number3, _localeCode);
23158     };
23159     function pluralRule(number3, localeCode) {
23160       const rules = "Intl" in window && Intl.PluralRules && new Intl.PluralRules(localeCode);
23161       if (rules) {
23162         return rules.select(number3);
23163       }
23164       if (number3 === 1) return "one";
23165       return "other";
23166     }
23167     localizer.tInfo = function(origStringId, replacements, locale2) {
23168       let stringId = origStringId.trim();
23169       let scopeId = "general";
23170       if (stringId[0] === "_") {
23171         let split = stringId.split(".");
23172         scopeId = split[0].slice(1);
23173         stringId = split.slice(1).join(".");
23174       }
23175       locale2 = locale2 || _localeCode;
23176       let path = stringId.split(".").map((s2) => s2.replace(/<TX_DOT>/g, ".")).reverse();
23177       let stringsKey = locale2;
23178       if (stringsKey.toLowerCase() === "en-us") stringsKey = "en";
23179       let result = _localeStrings && _localeStrings[scopeId] && _localeStrings[scopeId][stringsKey];
23180       while (result !== void 0 && path.length) {
23181         result = result[path.pop()];
23182       }
23183       if (result !== void 0) {
23184         if (replacements) {
23185           if (typeof result === "object" && Object.keys(result).length) {
23186             const number3 = Object.values(replacements).find(function(value) {
23187               return typeof value === "number";
23188             });
23189             if (number3 !== void 0) {
23190               const rule = pluralRule(number3, locale2);
23191               if (result[rule]) {
23192                 result = result[rule];
23193               } else {
23194                 result = Object.values(result)[0];
23195               }
23196             }
23197           }
23198           if (typeof result === "string") {
23199             for (let key in replacements) {
23200               let value = replacements[key];
23201               if (typeof value === "number") {
23202                 if (value.toLocaleString) {
23203                   value = value.toLocaleString(locale2, {
23204                     style: "decimal",
23205                     useGrouping: true,
23206                     minimumFractionDigits: 0
23207                   });
23208                 } else {
23209                   value = value.toString();
23210                 }
23211               }
23212               const token = "{".concat(key, "}");
23213               const regex = new RegExp(token, "g");
23214               result = result.replace(regex, value);
23215             }
23216           }
23217         }
23218         if (typeof result === "string") {
23219           return {
23220             text: result,
23221             locale: locale2
23222           };
23223         }
23224       }
23225       let index = _localeCodes.indexOf(locale2);
23226       if (index >= 0 && index < _localeCodes.length - 1) {
23227         let fallback = _localeCodes[index + 1];
23228         return localizer.tInfo(origStringId, replacements, fallback);
23229       }
23230       if (replacements && "default" in replacements) {
23231         return {
23232           text: replacements.default,
23233           locale: null
23234         };
23235       }
23236       const missing = "Missing ".concat(locale2, " translation: ").concat(origStringId);
23237       if (typeof console !== "undefined") console.error(missing);
23238       return {
23239         text: missing,
23240         locale: "en"
23241       };
23242     };
23243     localizer.hasTextForStringId = function(stringId) {
23244       return !!localizer.tInfo(stringId, { default: "nothing found" }).locale;
23245     };
23246     localizer.t = function(stringId, replacements, locale2) {
23247       return localizer.tInfo(stringId, replacements, locale2).text;
23248     };
23249     localizer.t.html = function(stringId, replacements, locale2) {
23250       replacements = Object.assign({}, replacements);
23251       for (var k3 in replacements) {
23252         if (typeof replacements[k3] === "string") {
23253           replacements[k3] = escape_default(replacements[k3]);
23254         }
23255         if (typeof replacements[k3] === "object" && typeof replacements[k3].html === "string") {
23256           replacements[k3] = replacements[k3].html;
23257         }
23258       }
23259       const info = localizer.tInfo(stringId, replacements, locale2);
23260       if (info.text) {
23261         return '<span class="localized-text" lang="'.concat(info.locale || "und", '">').concat(info.text, "</span>");
23262       } else {
23263         return "";
23264       }
23265     };
23266     localizer.t.append = function(stringId, replacements, locale2) {
23267       const ret = function(selection2) {
23268         const info = localizer.tInfo(stringId, replacements, locale2);
23269         return selection2.append("span").attr("class", "localized-text").attr("lang", info.locale || "und").text((replacements && replacements.prefix || "") + info.text + (replacements && replacements.suffix || ""));
23270       };
23271       ret.stringId = stringId;
23272       return ret;
23273     };
23274     localizer.t.addOrUpdate = function(stringId, replacements, locale2) {
23275       const ret = function(selection2) {
23276         const info = localizer.tInfo(stringId, replacements, locale2);
23277         const span = selection2.selectAll("span.localized-text").data([info]);
23278         const enter = span.enter().append("span").classed("localized-text", true);
23279         span.merge(enter).attr("lang", info.locale || "und").text((replacements && replacements.prefix || "") + info.text + (replacements && replacements.suffix || ""));
23280       };
23281       ret.stringId = stringId;
23282       return ret;
23283     };
23284     localizer.languageName = (code, options) => {
23285       if (_languageNames && _languageNames[code]) {
23286         return _languageNames[code];
23287       }
23288       if (options && options.localOnly) return null;
23289       const langInfo = _dataLanguages[code];
23290       if (langInfo) {
23291         if (langInfo.nativeName) {
23292           return localizer.t("translate.language_and_code", { language: langInfo.nativeName, code });
23293         } else if (langInfo.base && langInfo.script) {
23294           const base = langInfo.base;
23295           if (_languageNames && _languageNames[base]) {
23296             const scriptCode = langInfo.script;
23297             const script = _scriptNames && _scriptNames[scriptCode] || scriptCode;
23298             return localizer.t("translate.language_and_code", { language: _languageNames[base], code: script });
23299           } else if (_dataLanguages[base] && _dataLanguages[base].nativeName) {
23300             return localizer.t("translate.language_and_code", { language: _dataLanguages[base].nativeName, code });
23301           }
23302         }
23303       }
23304       return code;
23305     };
23306     localizer.floatFormatter = (locale2) => {
23307       if (!("Intl" in window && "NumberFormat" in Intl && "formatToParts" in Intl.NumberFormat.prototype)) {
23308         return (number3, fractionDigits) => {
23309           return fractionDigits === void 0 ? number3.toString() : number3.toFixed(fractionDigits);
23310         };
23311       } else {
23312         return (number3, fractionDigits) => number3.toLocaleString(locale2, {
23313           minimumFractionDigits: fractionDigits,
23314           maximumFractionDigits: fractionDigits === void 0 ? 20 : fractionDigits
23315         });
23316       }
23317     };
23318     localizer.floatParser = (locale2) => {
23319       const polyfill = (string) => +string.trim();
23320       if (!("Intl" in window && "NumberFormat" in Intl)) return polyfill;
23321       const format2 = new Intl.NumberFormat(locale2, { maximumFractionDigits: 20 });
23322       if (!("formatToParts" in format2)) return polyfill;
23323       const parts = format2.formatToParts(-12345.6);
23324       const numerals = Array.from({ length: 10 }).map((_3, i3) => format2.format(i3));
23325       const index = new Map(numerals.map((d2, i3) => [d2, i3]));
23326       const literalPart = parts.find((d2) => d2.type === "literal");
23327       const literal = literalPart && new RegExp("[".concat(literalPart.value, "]"), "g");
23328       const groupPart = parts.find((d2) => d2.type === "group");
23329       const group = groupPart && new RegExp("[".concat(groupPart.value, "]"), "g");
23330       const decimalPart = parts.find((d2) => d2.type === "decimal");
23331       const decimal = decimalPart && new RegExp("[".concat(decimalPart.value, "]"));
23332       const numeral = new RegExp("[".concat(numerals.join(""), "]"), "g");
23333       const getIndex = (d2) => index.get(d2);
23334       return (string) => {
23335         string = string.trim();
23336         if (literal) string = string.replace(literal, "");
23337         if (group) string = string.replace(group, "");
23338         if (decimal) string = string.replace(decimal, ".");
23339         string = string.replace(numeral, getIndex);
23340         return string ? +string : NaN;
23341       };
23342     };
23343     localizer.decimalPlaceCounter = (locale2) => {
23344       var literal, group, decimal;
23345       if ("Intl" in window && "NumberFormat" in Intl) {
23346         const format2 = new Intl.NumberFormat(locale2, { maximumFractionDigits: 20 });
23347         if ("formatToParts" in format2) {
23348           const parts = format2.formatToParts(-12345.6);
23349           const literalPart = parts.find((d2) => d2.type === "literal");
23350           literal = literalPart && new RegExp("[".concat(literalPart.value, "]"), "g");
23351           const groupPart = parts.find((d2) => d2.type === "group");
23352           group = groupPart && new RegExp("[".concat(groupPart.value, "]"), "g");
23353           const decimalPart = parts.find((d2) => d2.type === "decimal");
23354           decimal = decimalPart && new RegExp("[".concat(decimalPart.value, "]"));
23355         }
23356       }
23357       return (string) => {
23358         string = string.trim();
23359         if (literal) string = string.replace(literal, "");
23360         if (group) string = string.replace(group, "");
23361         const parts = string.split(decimal || ".");
23362         return parts && parts[1] && parts[1].length || 0;
23363       };
23364     };
23365     return localizer;
23366   }
23367
23368   // modules/presets/collection.js
23369   function presetCollection(collection) {
23370     const MAXRESULTS = 50;
23371     let _this = {};
23372     let _memo = {};
23373     _this.collection = collection;
23374     _this.item = (id2) => {
23375       if (_memo[id2]) return _memo[id2];
23376       const found = _this.collection.find((d2) => d2.id === id2);
23377       if (found) _memo[id2] = found;
23378       return found;
23379     };
23380     _this.index = (id2) => _this.collection.findIndex((d2) => d2.id === id2);
23381     _this.matchGeometry = (geometry) => {
23382       return presetCollection(
23383         _this.collection.filter((d2) => d2.matchGeometry(geometry))
23384       );
23385     };
23386     _this.matchAllGeometry = (geometries) => {
23387       return presetCollection(
23388         _this.collection.filter((d2) => d2 && d2.matchAllGeometry(geometries))
23389       );
23390     };
23391     _this.matchAnyGeometry = (geometries) => {
23392       return presetCollection(
23393         _this.collection.filter((d2) => geometries.some((geom) => d2.matchGeometry(geom)))
23394       );
23395     };
23396     _this.fallback = (geometry) => {
23397       let id2 = geometry;
23398       if (id2 === "vertex") id2 = "point";
23399       return _this.item(id2);
23400     };
23401     _this.search = (value, geometry, loc) => {
23402       if (!value) return _this;
23403       value = value.toLowerCase().trim();
23404       function leading(a2) {
23405         const index = a2.indexOf(value);
23406         return index === 0 || a2[index - 1] === " ";
23407       }
23408       function leadingStrict(a2) {
23409         const index = a2.indexOf(value);
23410         return index === 0;
23411       }
23412       function sortPresets(nameProp, aliasesProp) {
23413         return function sortNames(a2, b3) {
23414           let aCompare = a2[nameProp]();
23415           let bCompare = b3[nameProp]();
23416           if (aliasesProp) {
23417             const findMatchingAlias = (strings) => {
23418               if (strings.some((s2) => s2 === value)) {
23419                 return strings.find((s2) => s2 === value);
23420               } else {
23421                 return strings.filter((s2) => s2.includes(value)).sort((a3, b4) => a3.length - b4.length)[0];
23422               }
23423             };
23424             aCompare = findMatchingAlias([aCompare].concat(a2[aliasesProp]()));
23425             bCompare = findMatchingAlias([bCompare].concat(b3[aliasesProp]()));
23426           }
23427           if (value === aCompare) return -1;
23428           if (value === bCompare) return 1;
23429           let i3 = b3.originalScore - a2.originalScore;
23430           if (i3 !== 0) return i3;
23431           i3 = aCompare.indexOf(value) - bCompare.indexOf(value);
23432           if (i3 !== 0) return i3;
23433           return aCompare.length - bCompare.length;
23434         };
23435       }
23436       let pool = _this.collection;
23437       if (Array.isArray(loc)) {
23438         const validHere = _sharedLocationManager.locationSetsAt(loc);
23439         pool = pool.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
23440       }
23441       const searchable = pool.filter((a2) => a2.searchable !== false && a2.suggestion !== true);
23442       const suggestions = pool.filter((a2) => a2.suggestion === true);
23443       const leadingNames = searchable.filter((a2) => leading(a2.searchName()) || a2.searchAliases().some(leading)).sort(sortPresets("searchName", "searchAliases"));
23444       const leadingSuggestions = suggestions.filter((a2) => leadingStrict(a2.searchName())).sort(sortPresets("searchName"));
23445       const leadingNamesStripped = searchable.filter((a2) => leading(a2.searchNameStripped()) || a2.searchAliasesStripped().some(leading)).sort(sortPresets("searchNameStripped", "searchAliasesStripped"));
23446       const leadingSuggestionsStripped = suggestions.filter((a2) => leadingStrict(a2.searchNameStripped())).sort(sortPresets("searchNameStripped"));
23447       const leadingTerms = searchable.filter((a2) => (a2.terms() || []).some(leading));
23448       const leadingSuggestionTerms = suggestions.filter((a2) => (a2.terms() || []).some(leading));
23449       const leadingTagValues = searchable.filter((a2) => Object.values(a2.tags || {}).filter((val) => val !== "*").some(leading));
23450       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);
23451       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);
23452       const similarTerms = searchable.filter((a2) => {
23453         return (a2.terms() || []).some((b3) => {
23454           return utilEditDistance(value, b3) + Math.min(value.length - b3.length, 0) < 3;
23455         });
23456       });
23457       let leadingTagKeyValues = [];
23458       if (value.includes("=")) {
23459         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]))));
23460       }
23461       let results = leadingNames.concat(
23462         leadingSuggestions,
23463         leadingNamesStripped,
23464         leadingSuggestionsStripped,
23465         leadingTerms,
23466         leadingSuggestionTerms,
23467         leadingTagValues,
23468         similarName,
23469         similarSuggestions,
23470         similarTerms,
23471         leadingTagKeyValues
23472       ).slice(0, MAXRESULTS - 1);
23473       if (geometry) {
23474         if (typeof geometry === "string") {
23475           results.push(_this.fallback(geometry));
23476         } else {
23477           geometry.forEach((geom) => results.push(_this.fallback(geom)));
23478         }
23479       }
23480       return presetCollection(utilArrayUniq(results));
23481     };
23482     return _this;
23483   }
23484
23485   // modules/presets/category.js
23486   function presetCategory(categoryID, category, allPresets) {
23487     let _this = Object.assign({}, category);
23488     let _searchName;
23489     let _searchNameStripped;
23490     _this.id = categoryID;
23491     _this.members = presetCollection(
23492       (category.members || []).map((presetID) => allPresets[presetID]).filter(Boolean)
23493     );
23494     _this.geometry = _this.members.collection.reduce((acc, preset) => {
23495       for (let i3 in preset.geometry) {
23496         const geometry = preset.geometry[i3];
23497         if (acc.indexOf(geometry) === -1) {
23498           acc.push(geometry);
23499         }
23500       }
23501       return acc;
23502     }, []);
23503     _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
23504     _this.matchAllGeometry = (geometries) => _this.members.collection.some((preset) => preset.matchAllGeometry(geometries));
23505     _this.matchScore = () => -1;
23506     _this.name = () => _t("_tagging.presets.categories.".concat(categoryID, ".name"), { "default": categoryID });
23507     _this.nameLabel = () => _t.append("_tagging.presets.categories.".concat(categoryID, ".name"), { "default": categoryID });
23508     _this.terms = () => [];
23509     _this.searchName = () => {
23510       if (!_searchName) {
23511         _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
23512       }
23513       return _searchName;
23514     };
23515     _this.searchNameStripped = () => {
23516       if (!_searchNameStripped) {
23517         _searchNameStripped = _this.searchName();
23518         if (_searchNameStripped.normalize) _searchNameStripped = _searchNameStripped.normalize("NFD");
23519         _searchNameStripped = _searchNameStripped.replace(/[\u0300-\u036f]/g, "");
23520       }
23521       return _searchNameStripped;
23522     };
23523     _this.searchAliases = () => [];
23524     _this.searchAliasesStripped = () => [];
23525     return _this;
23526   }
23527
23528   // modules/presets/field.js
23529   function presetField(fieldID, field, allFields) {
23530     allFields = allFields || {};
23531     let _this = Object.assign({}, field);
23532     _this.id = fieldID;
23533     _this.safeid = utilSafeClassName(fieldID);
23534     _this.matchGeometry = (geom) => !_this.geometry || _this.geometry.indexOf(geom) !== -1;
23535     _this.matchAllGeometry = (geometries) => {
23536       return !_this.geometry || geometries.every((geom) => _this.geometry.indexOf(geom) !== -1);
23537     };
23538     _this.t = (scope, options) => _t("_tagging.presets.fields.".concat(fieldID, ".").concat(scope), options);
23539     _this.t.html = (scope, options) => _t.html("_tagging.presets.fields.".concat(fieldID, ".").concat(scope), options);
23540     _this.t.append = (scope, options) => _t.append("_tagging.presets.fields.".concat(fieldID, ".").concat(scope), options);
23541     _this.hasTextForStringId = (scope) => _mainLocalizer.hasTextForStringId("_tagging.presets.fields.".concat(fieldID, ".").concat(scope));
23542     _this.resolveReference = (which) => {
23543       const referenceRegex = /^\{(.*)\}$/;
23544       const match = (field[which] || "").match(referenceRegex);
23545       if (match) {
23546         const field2 = allFields[match[1]];
23547         if (field2) {
23548           return field2;
23549         }
23550         console.error("Unable to resolve referenced field: ".concat(match[1]));
23551       }
23552       return _this;
23553     };
23554     _this.title = () => _this.overrideLabel || _this.resolveReference("label").t("label", { "default": fieldID });
23555     _this.label = () => _this.overrideLabel ? (selection2) => selection2.text(_this.overrideLabel) : _this.resolveReference("label").t.append("label", { "default": fieldID });
23556     _this.placeholder = () => _this.resolveReference("placeholder").t("placeholder", { "default": "" });
23557     _this.originalTerms = (_this.terms || []).join();
23558     _this.terms = () => _this.resolveReference("label").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
23559     _this.increment = _this.type === "number" || _this.type === "integer" ? _this.increment || 1 : void 0;
23560     return _this;
23561   }
23562
23563   // modules/presets/preset.js
23564   function presetPreset(presetID, preset, addable, allFields, allPresets) {
23565     allFields = allFields || {};
23566     allPresets = allPresets || {};
23567     let _this = Object.assign({}, preset);
23568     let _addable = addable || false;
23569     let _searchName;
23570     let _searchNameStripped;
23571     let _searchAliases;
23572     let _searchAliasesStripped;
23573     const referenceRegex = /^\{(.*)\}$/;
23574     _this.id = presetID;
23575     _this.safeid = utilSafeClassName(presetID);
23576     _this.originalTerms = (_this.terms || []).join();
23577     _this.originalName = _this.name || "";
23578     _this.originalAliases = (_this.aliases || []).join("\n");
23579     _this.originalScore = _this.matchScore || 1;
23580     _this.originalReference = _this.reference || {};
23581     _this.originalFields = _this.fields || [];
23582     _this.originalMoreFields = _this.moreFields || [];
23583     _this.fields = (loc) => resolveFields("fields", loc);
23584     _this.moreFields = (loc) => resolveFields("moreFields", loc);
23585     _this.tags = _this.tags || {};
23586     _this.addTags = _this.addTags || _this.tags;
23587     _this.removeTags = _this.removeTags || _this.addTags;
23588     _this.geometry = _this.geometry || [];
23589     _this.matchGeometry = (geom) => _this.geometry.indexOf(geom) >= 0;
23590     _this.matchAllGeometry = (geoms) => geoms.every(_this.matchGeometry);
23591     _this.matchScore = (entityTags) => {
23592       const tags = _this.tags;
23593       let seen = {};
23594       let score = 0;
23595       for (let k3 in tags) {
23596         seen[k3] = true;
23597         if (entityTags[k3] === tags[k3]) {
23598           score += _this.originalScore;
23599         } else if (tags[k3] === "*" && k3 in entityTags) {
23600           score += _this.originalScore / 2;
23601         } else {
23602           return -1;
23603         }
23604       }
23605       const addTags = _this.addTags;
23606       for (let k3 in addTags) {
23607         if (!seen[k3] && entityTags[k3] === addTags[k3]) {
23608           score += _this.originalScore;
23609         }
23610       }
23611       if (_this.searchable === false) {
23612         score *= 0.999;
23613       }
23614       return score;
23615     };
23616     _this.t = (scope, options) => {
23617       const textID = "_tagging.presets.presets.".concat(presetID, ".").concat(scope);
23618       return _t(textID, options);
23619     };
23620     _this.t.append = (scope, options) => {
23621       const textID = "_tagging.presets.presets.".concat(presetID, ".").concat(scope);
23622       return _t.append(textID, options);
23623     };
23624     function resolveReference(which) {
23625       const match = (_this[which] || "").match(referenceRegex);
23626       if (match) {
23627         const preset2 = allPresets[match[1]];
23628         if (preset2) {
23629           return preset2;
23630         }
23631         console.error("Unable to resolve referenced preset: ".concat(match[1]));
23632       }
23633       return _this;
23634     }
23635     _this.name = () => {
23636       return resolveReference("originalName").t("name", { "default": _this.originalName || presetID });
23637     };
23638     _this.nameLabel = () => {
23639       return resolveReference("originalName").t.append("name", { "default": _this.originalName || presetID });
23640     };
23641     _this.subtitle = () => {
23642       if (_this.suggestion) {
23643         let path = presetID.split("/");
23644         path.pop();
23645         const basePreset = allPresets[path.join("/")];
23646         return basePreset.name();
23647       }
23648       return null;
23649     };
23650     _this.subtitleLabel = () => {
23651       if (_this.suggestion) {
23652         let path = presetID.split("/");
23653         path.pop();
23654         const basePreset = allPresets[path.join("/")];
23655         return basePreset.nameLabel();
23656       }
23657       return null;
23658     };
23659     _this.aliases = () => {
23660       return resolveReference("originalName").t("aliases", { "default": _this.originalAliases }).trim().split(/\s*[\r\n]+\s*/).filter(Boolean);
23661     };
23662     _this.terms = () => {
23663       return resolveReference("originalName").t("terms", { "default": _this.originalTerms }).toLowerCase().trim().split(/\s*,+\s*/);
23664     };
23665     _this.searchName = () => {
23666       if (!_searchName) {
23667         _searchName = (_this.suggestion ? _this.originalName : _this.name()).toLowerCase();
23668       }
23669       return _searchName;
23670     };
23671     _this.searchNameStripped = () => {
23672       if (!_searchNameStripped) {
23673         _searchNameStripped = stripDiacritics(_this.searchName());
23674       }
23675       return _searchNameStripped;
23676     };
23677     _this.searchAliases = () => {
23678       if (!_searchAliases) {
23679         _searchAliases = _this.aliases().map((alias) => alias.toLowerCase());
23680       }
23681       return _searchAliases;
23682     };
23683     _this.searchAliasesStripped = () => {
23684       if (!_searchAliasesStripped) {
23685         _searchAliasesStripped = _this.searchAliases();
23686         _searchAliasesStripped = _searchAliasesStripped.map(stripDiacritics);
23687       }
23688       return _searchAliasesStripped;
23689     };
23690     _this.isFallback = () => {
23691       const tagCount = Object.keys(_this.tags).length;
23692       return tagCount === 0 || tagCount === 1 && _this.tags.hasOwnProperty("area");
23693     };
23694     _this.addable = function(val) {
23695       if (!arguments.length) return _addable;
23696       _addable = val;
23697       return _this;
23698     };
23699     _this.reference = () => {
23700       const qid = _this.tags.wikidata || _this.tags["flag:wikidata"] || _this.tags["brand:wikidata"] || _this.tags["network:wikidata"] || _this.tags["operator:wikidata"];
23701       if (qid) {
23702         return { qid };
23703       }
23704       let key = _this.originalReference.key || Object.keys(utilObjectOmit(_this.tags, "name"))[0];
23705       let value = _this.originalReference.value || _this.tags[key];
23706       if (value === "*") {
23707         return { key };
23708       } else {
23709         return { key, value };
23710       }
23711     };
23712     _this.unsetTags = (tags, geometry, ignoringKeys, skipFieldDefaults, loc) => {
23713       let removeTags = ignoringKeys ? utilObjectOmit(_this.removeTags, ignoringKeys) : _this.removeTags;
23714       tags = utilObjectOmit(tags, Object.keys(removeTags));
23715       if (geometry && !skipFieldDefaults) {
23716         _this.fields(loc).forEach((field) => {
23717           if (field.matchGeometry(geometry) && field.key && field.default === tags[field.key] && (!ignoringKeys || ignoringKeys.indexOf(field.key) === -1)) {
23718             delete tags[field.key];
23719           }
23720         });
23721       }
23722       delete tags.area;
23723       return tags;
23724     };
23725     _this.setTags = (tags, geometry, skipFieldDefaults, loc) => {
23726       const addTags = _this.addTags;
23727       tags = Object.assign({}, tags);
23728       for (let k3 in addTags) {
23729         if (addTags[k3] === "*") {
23730           if (_this.tags[k3] || !tags[k3]) {
23731             tags[k3] = "yes";
23732           }
23733         } else {
23734           tags[k3] = addTags[k3];
23735         }
23736       }
23737       if (!addTags.hasOwnProperty("area")) {
23738         delete tags.area;
23739         if (geometry === "area") {
23740           let needsAreaTag = true;
23741           for (let k3 in addTags) {
23742             if (_this.geometry.indexOf("line") === -1 && k3 in osmAreaKeys || k3 in osmAreaKeysExceptions && addTags[k3] in osmAreaKeysExceptions[k3]) {
23743               needsAreaTag = false;
23744               break;
23745             }
23746           }
23747           if (needsAreaTag) {
23748             tags.area = "yes";
23749           }
23750         }
23751       }
23752       if (geometry && !skipFieldDefaults) {
23753         _this.fields(loc).forEach((field) => {
23754           if (field.matchGeometry(geometry) && field.key && !tags[field.key] && field.default) {
23755             tags[field.key] = field.default;
23756           }
23757         });
23758       }
23759       return tags;
23760     };
23761     function resolveFields(which, loc) {
23762       const fieldIDs = which === "fields" ? _this.originalFields : _this.originalMoreFields;
23763       let resolved = [];
23764       fieldIDs.forEach((fieldID) => {
23765         const match = fieldID.match(referenceRegex);
23766         if (match !== null) {
23767           resolved = resolved.concat(inheritFields(allPresets[match[1]], which, loc));
23768         } else if (allFields[fieldID]) {
23769           resolved.push(allFields[fieldID]);
23770         } else {
23771           console.log('Cannot resolve "'.concat(fieldID, '" found in ').concat(_this.id, ".").concat(which));
23772         }
23773       });
23774       if (!resolved.length) {
23775         const endIndex = _this.id.lastIndexOf("/");
23776         const parentID = endIndex && _this.id.substring(0, endIndex);
23777         if (parentID) {
23778           let parent2 = allPresets[parentID];
23779           if (loc) {
23780             const validHere = _sharedLocationManager.locationSetsAt(loc);
23781             if ((parent2 == null ? void 0 : parent2.locationSetID) && !validHere[parent2.locationSetID]) {
23782               const candidateIDs = Object.keys(allPresets).filter((k3) => k3.startsWith(parentID));
23783               parent2 = allPresets[candidateIDs.find((candidateID) => {
23784                 const candidate = allPresets[candidateID];
23785                 return validHere[candidate.locationSetID] && isEqual_default(candidate.tags, parent2.tags);
23786               })];
23787             }
23788           }
23789           resolved = inheritFields(parent2, which, loc);
23790         }
23791       }
23792       if (loc) {
23793         const validHere = _sharedLocationManager.locationSetsAt(loc);
23794         resolved = resolved.filter((field) => !field.locationSetID || validHere[field.locationSetID]);
23795       }
23796       return resolved;
23797       function inheritFields(parent2, which2, loc2) {
23798         if (!parent2) return [];
23799         if (which2 === "fields") {
23800           return parent2.fields(loc2).filter(shouldInherit);
23801         } else if (which2 === "moreFields") {
23802           return parent2.moreFields(loc2).filter(shouldInherit);
23803         } else {
23804           return [];
23805         }
23806       }
23807       function shouldInherit(f2) {
23808         if (f2.key && _this.tags[f2.key] !== void 0 && // inherit anyway if multiple values are allowed or just a checkbox
23809         f2.type !== "multiCombo" && f2.type !== "semiCombo" && f2.type !== "manyCombo" && f2.type !== "check") return false;
23810         if (f2.key && (_this.originalFields.some((originalField) => {
23811           var _a5;
23812           return f2.key === ((_a5 = allFields[originalField]) == null ? void 0 : _a5.key);
23813         }) || _this.originalMoreFields.some((originalField) => {
23814           var _a5;
23815           return f2.key === ((_a5 = allFields[originalField]) == null ? void 0 : _a5.key);
23816         }))) {
23817           return false;
23818         }
23819         return true;
23820       }
23821     }
23822     function stripDiacritics(s2) {
23823       if (s2.normalize) s2 = s2.normalize("NFD");
23824       s2 = s2.replace(/[\u0300-\u036f]/g, "");
23825       return s2;
23826     }
23827     return _this;
23828   }
23829
23830   // modules/presets/index.js
23831   var _mainPresetIndex = presetIndex();
23832   function presetIndex() {
23833     const dispatch12 = dispatch_default("favoritePreset", "recentsChange");
23834     const MAXRECENTS = 30;
23835     const POINT = presetPreset("point", { name: "Point", tags: {}, geometry: ["point", "vertex"], matchScore: 0.1 });
23836     const LINE = presetPreset("line", { name: "Line", tags: {}, geometry: ["line"], matchScore: 0.1 });
23837     const AREA = presetPreset("area", { name: "Area", tags: { area: "yes" }, geometry: ["area"], matchScore: 0.1 });
23838     const RELATION = presetPreset("relation", { name: "Relation", tags: {}, geometry: ["relation"], matchScore: 0.1 });
23839     let _this = presetCollection([POINT, LINE, AREA, RELATION]);
23840     let _presets = { point: POINT, line: LINE, area: AREA, relation: RELATION };
23841     let _defaults = {
23842       point: presetCollection([POINT]),
23843       vertex: presetCollection([POINT]),
23844       line: presetCollection([LINE]),
23845       area: presetCollection([AREA]),
23846       relation: presetCollection([RELATION])
23847     };
23848     let _fields = {};
23849     let _categories = {};
23850     let _universal = [];
23851     let _addablePresetIDs = null;
23852     let _recents;
23853     let _favorites;
23854     let _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
23855     let _loadPromise;
23856     _this.ensureLoaded = (bypassCache) => {
23857       if (_loadPromise && !bypassCache) return _loadPromise;
23858       return _loadPromise = Promise.all([
23859         _mainFileFetcher.get("preset_categories"),
23860         _mainFileFetcher.get("preset_defaults"),
23861         _mainFileFetcher.get("preset_presets"),
23862         _mainFileFetcher.get("preset_fields")
23863       ]).then((vals) => {
23864         _this.merge({
23865           categories: vals[0],
23866           defaults: vals[1],
23867           presets: vals[2],
23868           fields: vals[3]
23869         });
23870         osmSetAreaKeys(_this.areaKeys());
23871         osmSetLineTags(_this.lineTags());
23872         osmSetPointTags(_this.pointTags());
23873         osmSetVertexTags(_this.vertexTags());
23874       });
23875     };
23876     _this.merge = (d2) => {
23877       let newLocationSets = [];
23878       if (d2.fields) {
23879         Object.keys(d2.fields).forEach((fieldID) => {
23880           let f2 = d2.fields[fieldID];
23881           if (f2) {
23882             f2 = presetField(fieldID, f2, _fields);
23883             if (f2.locationSet) newLocationSets.push(f2);
23884             _fields[fieldID] = f2;
23885           } else {
23886             delete _fields[fieldID];
23887           }
23888         });
23889       }
23890       if (d2.presets) {
23891         Object.keys(d2.presets).forEach((presetID) => {
23892           let p2 = d2.presets[presetID];
23893           if (p2) {
23894             const isAddable = !_addablePresetIDs || _addablePresetIDs.has(presetID);
23895             p2 = presetPreset(presetID, p2, isAddable, _fields, _presets);
23896             if (p2.locationSet) newLocationSets.push(p2);
23897             _presets[presetID] = p2;
23898           } else {
23899             const existing = _presets[presetID];
23900             if (existing && !existing.isFallback()) {
23901               delete _presets[presetID];
23902             }
23903           }
23904         });
23905       }
23906       if (d2.categories) {
23907         Object.keys(d2.categories).forEach((categoryID) => {
23908           let c2 = d2.categories[categoryID];
23909           if (c2) {
23910             c2 = presetCategory(categoryID, c2, _presets);
23911             if (c2.locationSet) newLocationSets.push(c2);
23912             _categories[categoryID] = c2;
23913           } else {
23914             delete _categories[categoryID];
23915           }
23916         });
23917       }
23918       _this.collection = Object.values(_presets).concat(Object.values(_categories));
23919       if (d2.defaults) {
23920         Object.keys(d2.defaults).forEach((geometry) => {
23921           const def = d2.defaults[geometry];
23922           if (Array.isArray(def)) {
23923             _defaults[geometry] = presetCollection(
23924               def.map((id2) => _presets[id2] || _categories[id2]).filter(Boolean)
23925             );
23926           } else {
23927             delete _defaults[geometry];
23928           }
23929         });
23930       }
23931       _universal = Object.values(_fields).filter((field) => field.universal);
23932       _geometryIndex = { point: {}, vertex: {}, line: {}, area: {}, relation: {} };
23933       _this.collection.forEach((preset) => {
23934         (preset.geometry || []).forEach((geometry) => {
23935           let g3 = _geometryIndex[geometry];
23936           for (let key in preset.tags) {
23937             g3[key] = g3[key] || {};
23938             let value = preset.tags[key];
23939             (g3[key][value] = g3[key][value] || []).push(preset);
23940           }
23941         });
23942       });
23943       if (d2.featureCollection && Array.isArray(d2.featureCollection.features)) {
23944         _sharedLocationManager.mergeCustomGeoJSON(d2.featureCollection);
23945       }
23946       if (newLocationSets.length) {
23947         _sharedLocationManager.mergeLocationSets(newLocationSets);
23948       }
23949       return _this;
23950     };
23951     _this.match = (entity, resolver) => {
23952       return resolver.transient(entity, "presetMatch", () => {
23953         let geometry = entity.geometry(resolver);
23954         if (geometry === "vertex" && entity.isOnAddressLine(resolver)) {
23955           geometry = "point";
23956         }
23957         const entityExtent = entity.extent(resolver);
23958         return _this.matchTags(entity.tags, geometry, entityExtent.center());
23959       });
23960     };
23961     _this.matchTags = (tags, geometry, loc) => {
23962       const keyIndex = _geometryIndex[geometry];
23963       let bestScore = -1;
23964       let bestMatch;
23965       let matchCandidates = [];
23966       for (let k3 in tags) {
23967         let indexMatches = [];
23968         let valueIndex = keyIndex[k3];
23969         if (!valueIndex) continue;
23970         let keyValueMatches = valueIndex[tags[k3]];
23971         if (keyValueMatches) indexMatches.push(...keyValueMatches);
23972         let keyStarMatches = valueIndex["*"];
23973         if (keyStarMatches) indexMatches.push(...keyStarMatches);
23974         if (indexMatches.length === 0) continue;
23975         for (let i3 = 0; i3 < indexMatches.length; i3++) {
23976           const candidate = indexMatches[i3];
23977           const score = candidate.matchScore(tags);
23978           if (score === -1) {
23979             continue;
23980           }
23981           matchCandidates.push({ score, candidate });
23982           if (score > bestScore) {
23983             bestScore = score;
23984             bestMatch = candidate;
23985           }
23986         }
23987       }
23988       if (bestMatch && bestMatch.locationSetID && bestMatch.locationSetID !== "+[Q2]" && Array.isArray(loc)) {
23989         const validHere = _sharedLocationManager.locationSetsAt(loc);
23990         if (!validHere[bestMatch.locationSetID]) {
23991           matchCandidates.sort((a2, b3) => a2.score < b3.score ? 1 : -1);
23992           for (let i3 = 0; i3 < matchCandidates.length; i3++) {
23993             const candidateScore = matchCandidates[i3];
23994             if (!candidateScore.candidate.locationSetID || validHere[candidateScore.candidate.locationSetID]) {
23995               bestMatch = candidateScore.candidate;
23996               bestScore = candidateScore.score;
23997               break;
23998             }
23999           }
24000         }
24001       }
24002       if (!bestMatch || bestMatch.isFallback()) {
24003         for (let k3 in tags) {
24004           if (/^addr:/.test(k3) && keyIndex["addr:*"] && keyIndex["addr:*"]["*"]) {
24005             bestMatch = keyIndex["addr:*"]["*"][0];
24006             break;
24007           }
24008         }
24009       }
24010       return bestMatch || _this.fallback(geometry);
24011     };
24012     _this.allowsVertex = (entity, resolver) => {
24013       if (entity.type !== "node") return false;
24014       if (Object.keys(entity.tags).length === 0) return true;
24015       return resolver.transient(entity, "vertexMatch", () => {
24016         if (entity.isOnAddressLine(resolver)) return true;
24017         const geometries = osmNodeGeometriesForTags(entity.tags);
24018         if (geometries.vertex) return true;
24019         if (geometries.point) return false;
24020         return true;
24021       });
24022     };
24023     _this.areaKeys = () => {
24024       const ignore = {
24025         barrier: true,
24026         highway: true,
24027         footway: true,
24028         railway: true,
24029         junction: true,
24030         type: true
24031       };
24032       let areaKeys = {};
24033       const presets = _this.collection.filter((p2) => !p2.suggestion && !p2.replacement);
24034       presets.forEach((p2) => {
24035         const keys2 = p2.tags && Object.keys(p2.tags);
24036         const key = keys2 && keys2.length && keys2[0];
24037         if (!key) return;
24038         if (ignore[key]) return;
24039         if (p2.geometry.indexOf("area") !== -1) {
24040           areaKeys[key] = areaKeys[key] || {};
24041         }
24042       });
24043       presets.forEach((p2) => {
24044         let key;
24045         for (key in p2.addTags) {
24046           const value = p2.addTags[key];
24047           if (key in areaKeys && // probably an area...
24048           p2.geometry.indexOf("line") !== -1 && // but sometimes a line
24049           value !== "*") {
24050             areaKeys[key][value] = true;
24051           }
24052         }
24053       });
24054       return areaKeys;
24055     };
24056     _this.lineTags = () => {
24057       return _this.collection.filter((lineTags, d2) => {
24058         if (d2.suggestion || d2.replacement || d2.searchable === false) return lineTags;
24059         const keys2 = d2.tags && Object.keys(d2.tags);
24060         const key = keys2 && keys2.length && keys2[0];
24061         if (!key) return lineTags;
24062         if (d2.geometry.indexOf("line") !== -1) {
24063           lineTags[key] = lineTags[key] || [];
24064           lineTags[key].push(d2.tags);
24065         }
24066         return lineTags;
24067       }, {});
24068     };
24069     _this.pointTags = () => {
24070       return _this.collection.reduce((pointTags, d2) => {
24071         if (d2.suggestion || d2.replacement || d2.searchable === false) return pointTags;
24072         const keys2 = d2.tags && Object.keys(d2.tags);
24073         const key = keys2 && keys2.length && keys2[0];
24074         if (!key) return pointTags;
24075         if (d2.geometry.indexOf("point") !== -1) {
24076           pointTags[key] = pointTags[key] || {};
24077           pointTags[key][d2.tags[key]] = true;
24078         }
24079         return pointTags;
24080       }, {});
24081     };
24082     _this.vertexTags = () => {
24083       return _this.collection.reduce((vertexTags, d2) => {
24084         if (d2.suggestion || d2.replacement || d2.searchable === false) return vertexTags;
24085         const keys2 = d2.tags && Object.keys(d2.tags);
24086         const key = keys2 && keys2.length && keys2[0];
24087         if (!key) return vertexTags;
24088         if (d2.geometry.indexOf("vertex") !== -1) {
24089           vertexTags[key] = vertexTags[key] || {};
24090           vertexTags[key][d2.tags[key]] = true;
24091         }
24092         return vertexTags;
24093       }, {});
24094     };
24095     _this.field = (id2) => _fields[id2];
24096     _this.universal = () => _universal;
24097     _this.defaults = (geometry, n3, startWithRecents, loc, extraPresets) => {
24098       let recents = [];
24099       if (startWithRecents) {
24100         recents = _this.recent().matchGeometry(geometry).collection.slice(0, 4);
24101       }
24102       let defaults;
24103       if (_addablePresetIDs) {
24104         defaults = Array.from(_addablePresetIDs).map(function(id2) {
24105           var preset = _this.item(id2);
24106           if (preset && preset.matchGeometry(geometry)) return preset;
24107           return null;
24108         }).filter(Boolean);
24109       } else {
24110         defaults = _defaults[geometry].collection.concat(_this.fallback(geometry));
24111       }
24112       let result = presetCollection(
24113         utilArrayUniq(recents.concat(defaults).concat(extraPresets || [])).slice(0, n3 - 1)
24114       );
24115       if (Array.isArray(loc)) {
24116         const validHere = _sharedLocationManager.locationSetsAt(loc);
24117         result.collection = result.collection.filter((a2) => !a2.locationSetID || validHere[a2.locationSetID]);
24118       }
24119       return result;
24120     };
24121     _this.addablePresetIDs = function(val) {
24122       if (!arguments.length) return _addablePresetIDs;
24123       if (Array.isArray(val)) val = new Set(val);
24124       _addablePresetIDs = val;
24125       if (_addablePresetIDs) {
24126         _this.collection.forEach((p2) => {
24127           if (p2.addable) p2.addable(_addablePresetIDs.has(p2.id));
24128         });
24129       } else {
24130         _this.collection.forEach((p2) => {
24131           if (p2.addable) p2.addable(true);
24132         });
24133       }
24134       return _this;
24135     };
24136     _this.recent = () => {
24137       return presetCollection(
24138         utilArrayUniq(_this.getRecents().map((d2) => d2.preset).filter((d2) => d2.searchable !== false))
24139       );
24140     };
24141     function RibbonItem(preset, source) {
24142       let item = {};
24143       item.preset = preset;
24144       item.source = source;
24145       item.isFavorite = () => item.source === "favorite";
24146       item.isRecent = () => item.source === "recent";
24147       item.matches = (preset2) => item.preset.id === preset2.id;
24148       item.minified = () => ({ pID: item.preset.id });
24149       return item;
24150     }
24151     function ribbonItemForMinified(d2, source) {
24152       if (d2 && d2.pID) {
24153         const preset = _this.item(d2.pID);
24154         if (!preset) return null;
24155         return RibbonItem(preset, source);
24156       }
24157       return null;
24158     }
24159     _this.getGenericRibbonItems = () => {
24160       return ["point", "line", "area"].map((id2) => RibbonItem(_this.item(id2), "generic"));
24161     };
24162     _this.getAddable = () => {
24163       if (!_addablePresetIDs) return [];
24164       return _addablePresetIDs.map((id2) => {
24165         const preset = _this.item(id2);
24166         if (preset) return RibbonItem(preset, "addable");
24167         return null;
24168       }).filter(Boolean);
24169     };
24170     function setRecents(items) {
24171       _recents = items;
24172       const minifiedItems = items.map((d2) => d2.minified());
24173       corePreferences("preset_recents", JSON.stringify(minifiedItems));
24174       dispatch12.call("recentsChange");
24175     }
24176     _this.getRecents = () => {
24177       if (!_recents) {
24178         _recents = (JSON.parse(corePreferences("preset_recents")) || []).reduce((acc, d2) => {
24179           let item = ribbonItemForMinified(d2, "recent");
24180           if (item && item.preset.addable()) acc.push(item);
24181           return acc;
24182         }, []);
24183       }
24184       return _recents;
24185     };
24186     _this.addRecent = (preset, besidePreset, after) => {
24187       const recents = _this.getRecents();
24188       const beforeItem = _this.recentMatching(besidePreset);
24189       let toIndex = recents.indexOf(beforeItem);
24190       if (after) toIndex += 1;
24191       const newItem = RibbonItem(preset, "recent");
24192       recents.splice(toIndex, 0, newItem);
24193       setRecents(recents);
24194     };
24195     _this.removeRecent = (preset) => {
24196       const item = _this.recentMatching(preset);
24197       if (item) {
24198         let items = _this.getRecents();
24199         items.splice(items.indexOf(item), 1);
24200         setRecents(items);
24201       }
24202     };
24203     _this.recentMatching = (preset) => {
24204       const items = _this.getRecents();
24205       for (let i3 in items) {
24206         if (items[i3].matches(preset)) {
24207           return items[i3];
24208         }
24209       }
24210       return null;
24211     };
24212     _this.moveItem = (items, fromIndex, toIndex) => {
24213       if (fromIndex === toIndex || fromIndex < 0 || toIndex < 0 || fromIndex >= items.length || toIndex >= items.length) return null;
24214       items.splice(toIndex, 0, items.splice(fromIndex, 1)[0]);
24215       return items;
24216     };
24217     _this.moveRecent = (item, beforeItem) => {
24218       const recents = _this.getRecents();
24219       const fromIndex = recents.indexOf(item);
24220       const toIndex = recents.indexOf(beforeItem);
24221       const items = _this.moveItem(recents, fromIndex, toIndex);
24222       if (items) setRecents(items);
24223     };
24224     _this.setMostRecent = (preset) => {
24225       if (preset.searchable === false) return;
24226       let items = _this.getRecents();
24227       let item = _this.recentMatching(preset);
24228       if (item) {
24229         items.splice(items.indexOf(item), 1);
24230       } else {
24231         item = RibbonItem(preset, "recent");
24232       }
24233       while (items.length >= MAXRECENTS) {
24234         items.pop();
24235       }
24236       items.unshift(item);
24237       setRecents(items);
24238     };
24239     function setFavorites(items) {
24240       _favorites = items;
24241       const minifiedItems = items.map((d2) => d2.minified());
24242       corePreferences("preset_favorites", JSON.stringify(minifiedItems));
24243       dispatch12.call("favoritePreset");
24244     }
24245     _this.addFavorite = (preset, besidePreset, after) => {
24246       const favorites = _this.getFavorites();
24247       const beforeItem = _this.favoriteMatching(besidePreset);
24248       let toIndex = favorites.indexOf(beforeItem);
24249       if (after) toIndex += 1;
24250       const newItem = RibbonItem(preset, "favorite");
24251       favorites.splice(toIndex, 0, newItem);
24252       setFavorites(favorites);
24253     };
24254     _this.toggleFavorite = (preset) => {
24255       const favs = _this.getFavorites();
24256       const favorite = _this.favoriteMatching(preset);
24257       if (favorite) {
24258         favs.splice(favs.indexOf(favorite), 1);
24259       } else {
24260         if (favs.length === 10) {
24261           favs.pop();
24262         }
24263         favs.push(RibbonItem(preset, "favorite"));
24264       }
24265       setFavorites(favs);
24266     };
24267     _this.removeFavorite = (preset) => {
24268       const item = _this.favoriteMatching(preset);
24269       if (item) {
24270         const items = _this.getFavorites();
24271         items.splice(items.indexOf(item), 1);
24272         setFavorites(items);
24273       }
24274     };
24275     _this.getFavorites = () => {
24276       if (!_favorites) {
24277         let rawFavorites = JSON.parse(corePreferences("preset_favorites"));
24278         if (!rawFavorites) {
24279           rawFavorites = [];
24280           corePreferences("preset_favorites", JSON.stringify(rawFavorites));
24281         }
24282         _favorites = rawFavorites.reduce((output, d2) => {
24283           const item = ribbonItemForMinified(d2, "favorite");
24284           if (item && item.preset.addable()) output.push(item);
24285           return output;
24286         }, []);
24287       }
24288       return _favorites;
24289     };
24290     _this.favoriteMatching = (preset) => {
24291       const favs = _this.getFavorites();
24292       for (let index in favs) {
24293         if (favs[index].matches(preset)) {
24294           return favs[index];
24295         }
24296       }
24297       return null;
24298     };
24299     return utilRebind(_this, dispatch12, "on");
24300   }
24301
24302   // modules/actions/reverse.js
24303   function actionReverse(entityID, options) {
24304     var numeric = /^([+\-]?)(?=[\d.])/;
24305     var directionKey = /direction$/;
24306     var keyReplacements = [
24307       [/:right$/, ":left"],
24308       [/:left$/, ":right"],
24309       [/:forward$/, ":backward"],
24310       [/:backward$/, ":forward"],
24311       [/:right:/, ":left:"],
24312       [/:left:/, ":right:"],
24313       [/:forward:/, ":backward:"],
24314       [/:backward:/, ":forward:"]
24315     ];
24316     var valueReplacements = {
24317       left: "right",
24318       right: "left",
24319       up: "down",
24320       down: "up",
24321       forward: "backward",
24322       backward: "forward",
24323       forwards: "backward",
24324       backwards: "forward"
24325     };
24326     const keysToKeepUnchanged = [
24327       // https://github.com/openstreetmap/iD/issues/10736
24328       /^red_turn:(right|left):?/
24329     ];
24330     const keyValuesToKeepUnchanged = [
24331       {
24332         keyRegex: /^.*(_|:)?(description|name|note|website|ref|source|comment|watch|attribution)(_|:)?/,
24333         prerequisiteTags: [{}]
24334       },
24335       {
24336         // Turn lanes are left/right to key (not way) direction - #5674
24337         keyRegex: /^turn:lanes:?/,
24338         prerequisiteTags: [{}]
24339       },
24340       {
24341         // https://github.com/openstreetmap/iD/issues/10128
24342         keyRegex: /^side$/,
24343         prerequisiteTags: [{ highway: "cyclist_waiting_aid" }]
24344       }
24345     ];
24346     var roleReplacements = {
24347       forward: "backward",
24348       backward: "forward",
24349       forwards: "backward",
24350       backwards: "forward"
24351     };
24352     var onewayReplacements = {
24353       yes: "-1",
24354       "1": "-1",
24355       "-1": "yes"
24356     };
24357     var compassReplacements = {
24358       N: "S",
24359       NNE: "SSW",
24360       NE: "SW",
24361       ENE: "WSW",
24362       E: "W",
24363       ESE: "WNW",
24364       SE: "NW",
24365       SSE: "NNW",
24366       S: "N",
24367       SSW: "NNE",
24368       SW: "NE",
24369       WSW: "ENE",
24370       W: "E",
24371       WNW: "ESE",
24372       NW: "SE",
24373       NNW: "SSE"
24374     };
24375     function reverseKey(key) {
24376       if (keysToKeepUnchanged.some((keyRegex) => keyRegex.test(key))) {
24377         return key;
24378       }
24379       for (var i3 = 0; i3 < keyReplacements.length; ++i3) {
24380         var replacement = keyReplacements[i3];
24381         if (replacement[0].test(key)) {
24382           return key.replace(replacement[0], replacement[1]);
24383         }
24384       }
24385       return key;
24386     }
24387     function reverseValue(key, value, includeAbsolute, allTags) {
24388       for (let { keyRegex, prerequisiteTags } of keyValuesToKeepUnchanged) {
24389         if (keyRegex.test(key) && prerequisiteTags.some(
24390           (expectedTags) => Object.entries(expectedTags).every(([k3, v3]) => {
24391             return allTags[k3] && (v3 === "*" || allTags[k3] === v3);
24392           })
24393         )) {
24394           return value;
24395         }
24396       }
24397       if (key === "incline" && numeric.test(value)) {
24398         return value.replace(numeric, function(_3, sign2) {
24399           return sign2 === "-" ? "" : "-";
24400         });
24401       } else if (options && options.reverseOneway && key === "oneway") {
24402         return onewayReplacements[value] || value;
24403       } else if (includeAbsolute && directionKey.test(key)) {
24404         return value.split(";").map((value2) => {
24405           if (compassReplacements[value2]) return compassReplacements[value2];
24406           var degrees3 = Number(value2);
24407           if (isFinite(degrees3)) {
24408             if (degrees3 < 180) {
24409               degrees3 += 180;
24410             } else {
24411               degrees3 -= 180;
24412             }
24413             return degrees3.toString();
24414           } else {
24415             return valueReplacements[value2] || value2;
24416           }
24417         }).join(";");
24418       }
24419       return valueReplacements[value] || value;
24420     }
24421     function supportsDirectionField(node, graph) {
24422       const preset = _mainPresetIndex.match(node, graph);
24423       const loc = node.extent(graph).center();
24424       const geometry = node.geometry(graph);
24425       const fields = [...preset.fields(loc), ...preset.moreFields(loc)];
24426       const maybeDirectionField = fields.find((field) => {
24427         const isDirectionField = field.key && (field.key === "direction" || field.key.endsWith(":direction"));
24428         const isRelativeDirection = field.type === "combo";
24429         const isGeometryValid = !field.geometry || field.geometry.includes(geometry);
24430         return isDirectionField && isRelativeDirection && isGeometryValid;
24431       });
24432       return (maybeDirectionField == null ? void 0 : maybeDirectionField.key) || false;
24433     }
24434     function reverseNodeTags(graph, nodeIDs) {
24435       for (var i3 = 0; i3 < nodeIDs.length; i3++) {
24436         var node = graph.hasEntity(nodeIDs[i3]);
24437         if (!node || !Object.keys(node.tags).length) continue;
24438         let anyChanges = false;
24439         var tags = {};
24440         for (var key in node.tags) {
24441           const value = node.tags[key];
24442           const newKey = reverseKey(key);
24443           const newValue = reverseValue(key, value, node.id === entityID, node.tags);
24444           tags[newKey] = newValue;
24445           if (key !== newKey || value !== newValue) {
24446             anyChanges = true;
24447           }
24448         }
24449         const directionKey2 = supportsDirectionField(node, graph);
24450         if (node.id === entityID && !anyChanges && directionKey2) {
24451           tags[directionKey2] = "forward";
24452         }
24453         graph = graph.replace(node.update({ tags }));
24454       }
24455       return graph;
24456     }
24457     function reverseWay(graph, way) {
24458       var nodes = way.nodes.slice().reverse();
24459       var tags = {};
24460       var role;
24461       for (var key in way.tags) {
24462         tags[reverseKey(key)] = reverseValue(key, way.tags[key], false, way.tags);
24463       }
24464       graph.parentRelations(way).forEach(function(relation) {
24465         relation.members.forEach(function(member, index) {
24466           if (member.id === way.id && (role = roleReplacements[member.role])) {
24467             relation = relation.updateMember({ role }, index);
24468             graph = graph.replace(relation);
24469           }
24470         });
24471       });
24472       return reverseNodeTags(graph, nodes).replace(way.update({ nodes, tags }));
24473     }
24474     var action = function(graph) {
24475       var entity = graph.entity(entityID);
24476       if (entity.type === "way") {
24477         return reverseWay(graph, entity);
24478       }
24479       return reverseNodeTags(graph, [entityID]);
24480     };
24481     action.disabled = function(graph) {
24482       var entity = graph.hasEntity(entityID);
24483       if (!entity || entity.type === "way") return false;
24484       for (var key in entity.tags) {
24485         var value = entity.tags[key];
24486         if (reverseKey(key) !== key || reverseValue(key, value, true, entity.tags) !== value) {
24487           return false;
24488         }
24489       }
24490       if (supportsDirectionField(entity, graph)) return false;
24491       return "nondirectional_node";
24492     };
24493     action.entityID = function() {
24494       return entityID;
24495     };
24496     return action;
24497   }
24498
24499   // modules/osm/entity.js
24500   function osmEntity(attrs) {
24501     if (this instanceof osmEntity) return;
24502     if (attrs && attrs.type) {
24503       return osmEntity[attrs.type].apply(this, arguments);
24504     } else if (attrs && attrs.id) {
24505       return osmEntity[osmEntity.id.type(attrs.id)].apply(this, arguments);
24506     }
24507     return new osmEntity().initialize(arguments);
24508   }
24509   osmEntity.id = function(type2) {
24510     return osmEntity.id.fromOSM(type2, osmEntity.id.next[type2]--);
24511   };
24512   osmEntity.id.next = {
24513     changeset: -1,
24514     node: -1,
24515     way: -1,
24516     relation: -1
24517   };
24518   osmEntity.id.fromOSM = function(type2, id2) {
24519     return type2[0] + id2;
24520   };
24521   osmEntity.id.toOSM = function(id2) {
24522     var match = id2.match(/^[cnwr](-?\d+)$/);
24523     if (match) {
24524       return match[1];
24525     }
24526     return "";
24527   };
24528   osmEntity.id.type = function(id2) {
24529     return { "c": "changeset", "n": "node", "w": "way", "r": "relation" }[id2[0]];
24530   };
24531   osmEntity.key = function(entity) {
24532     return entity.id + "v" + (entity.v || 0);
24533   };
24534   osmEntity.prototype = {
24535     /** @type {Tags} */
24536     tags: {},
24537     /** @type {String} */
24538     id: void 0,
24539     initialize: function(sources) {
24540       for (var i3 = 0; i3 < sources.length; ++i3) {
24541         var source = sources[i3];
24542         for (var prop in source) {
24543           if (Object.prototype.hasOwnProperty.call(source, prop)) {
24544             if (source[prop] === void 0) {
24545               delete this[prop];
24546             } else {
24547               this[prop] = source[prop];
24548             }
24549           }
24550         }
24551       }
24552       if (!this.id && this.type) {
24553         this.id = osmEntity.id(this.type);
24554       }
24555       if (!this.hasOwnProperty("visible")) {
24556         this.visible = true;
24557       }
24558       if (debug) {
24559         Object.freeze(this);
24560         Object.freeze(this.tags);
24561         if (this.loc) Object.freeze(this.loc);
24562         if (this.nodes) Object.freeze(this.nodes);
24563         if (this.members) Object.freeze(this.members);
24564       }
24565       return this;
24566     },
24567     copy: function(resolver, copies) {
24568       if (copies[this.id]) return copies[this.id];
24569       var copy2 = osmEntity(this, { id: void 0, user: void 0, version: void 0 });
24570       copies[this.id] = copy2;
24571       return copy2;
24572     },
24573     osmId: function() {
24574       return osmEntity.id.toOSM(this.id);
24575     },
24576     isNew: function() {
24577       var osmId = osmEntity.id.toOSM(this.id);
24578       return osmId.length === 0 || osmId[0] === "-";
24579     },
24580     update: function(attrs) {
24581       return osmEntity(this, attrs, { v: 1 + (this.v || 0) });
24582     },
24583     /**
24584      *
24585      * @param {Tags} tags tags to merge into this entity's tags
24586      * @param {Tags} setTags (optional) a set of tags to overwrite in this entity's tags
24587      * @returns {iD.OsmEntity}
24588      */
24589     mergeTags: function(tags, setTags = {}) {
24590       const merged = Object.assign({}, this.tags);
24591       let changed = false;
24592       for (const k3 in tags) {
24593         if (setTags.hasOwnProperty(k3)) continue;
24594         const t1 = this.tags[k3];
24595         const t2 = tags[k3];
24596         if (!t1) {
24597           changed = true;
24598           merged[k3] = t2;
24599         } else if (t1 !== t2) {
24600           changed = true;
24601           merged[k3] = utilUnicodeCharsTruncated(
24602             utilArrayUnion(t1.split(/;\s*/), t2.split(/;\s*/)).join(";"),
24603             255
24604             // avoid exceeding character limit; see also context.maxCharsForTagValue()
24605           );
24606         }
24607       }
24608       for (const k3 in setTags) {
24609         if (this.tags[k3] !== setTags[k3]) {
24610           changed = true;
24611           merged[k3] = setTags[k3];
24612         }
24613       }
24614       return changed ? this.update({ tags: merged }) : this;
24615     },
24616     intersects: function(extent, resolver) {
24617       return this.extent(resolver).intersects(extent);
24618     },
24619     hasNonGeometryTags: function() {
24620       return Object.keys(this.tags).some(function(k3) {
24621         return k3 !== "area";
24622       });
24623     },
24624     hasParentRelations: function(resolver) {
24625       return resolver.parentRelations(this).length > 0;
24626     },
24627     hasInterestingTags: function() {
24628       return Object.keys(this.tags).some(osmIsInterestingTag);
24629     },
24630     isDegenerate: function() {
24631       return true;
24632     }
24633   };
24634
24635   // modules/osm/lanes.js
24636   function osmLanes(entity) {
24637     if (entity.type !== "way") return null;
24638     if (!entity.tags.highway) return null;
24639     var tags = entity.tags;
24640     var isOneWay = entity.isOneWay();
24641     var laneCount = getLaneCount(tags, isOneWay);
24642     var maxspeed = parseMaxspeed(tags);
24643     var laneDirections = parseLaneDirections(tags, isOneWay, laneCount);
24644     var forward = laneDirections.forward;
24645     var backward = laneDirections.backward;
24646     var bothways = laneDirections.bothways;
24647     var turnLanes = {};
24648     turnLanes.unspecified = parseTurnLanes(tags["turn:lanes"]);
24649     turnLanes.forward = parseTurnLanes(tags["turn:lanes:forward"]);
24650     turnLanes.backward = parseTurnLanes(tags["turn:lanes:backward"]);
24651     var maxspeedLanes = {};
24652     maxspeedLanes.unspecified = parseMaxspeedLanes(tags["maxspeed:lanes"], maxspeed);
24653     maxspeedLanes.forward = parseMaxspeedLanes(tags["maxspeed:lanes:forward"], maxspeed);
24654     maxspeedLanes.backward = parseMaxspeedLanes(tags["maxspeed:lanes:backward"], maxspeed);
24655     var psvLanes = {};
24656     psvLanes.unspecified = parseMiscLanes(tags["psv:lanes"]);
24657     psvLanes.forward = parseMiscLanes(tags["psv:lanes:forward"]);
24658     psvLanes.backward = parseMiscLanes(tags["psv:lanes:backward"]);
24659     var busLanes = {};
24660     busLanes.unspecified = parseMiscLanes(tags["bus:lanes"]);
24661     busLanes.forward = parseMiscLanes(tags["bus:lanes:forward"]);
24662     busLanes.backward = parseMiscLanes(tags["bus:lanes:backward"]);
24663     var taxiLanes = {};
24664     taxiLanes.unspecified = parseMiscLanes(tags["taxi:lanes"]);
24665     taxiLanes.forward = parseMiscLanes(tags["taxi:lanes:forward"]);
24666     taxiLanes.backward = parseMiscLanes(tags["taxi:lanes:backward"]);
24667     var hovLanes = {};
24668     hovLanes.unspecified = parseMiscLanes(tags["hov:lanes"]);
24669     hovLanes.forward = parseMiscLanes(tags["hov:lanes:forward"]);
24670     hovLanes.backward = parseMiscLanes(tags["hov:lanes:backward"]);
24671     var hgvLanes = {};
24672     hgvLanes.unspecified = parseMiscLanes(tags["hgv:lanes"]);
24673     hgvLanes.forward = parseMiscLanes(tags["hgv:lanes:forward"]);
24674     hgvLanes.backward = parseMiscLanes(tags["hgv:lanes:backward"]);
24675     var bicyclewayLanes = {};
24676     bicyclewayLanes.unspecified = parseBicycleWay(tags["bicycleway:lanes"]);
24677     bicyclewayLanes.forward = parseBicycleWay(tags["bicycleway:lanes:forward"]);
24678     bicyclewayLanes.backward = parseBicycleWay(tags["bicycleway:lanes:backward"]);
24679     var lanesObj = {
24680       forward: [],
24681       backward: [],
24682       unspecified: []
24683     };
24684     mapToLanesObj(lanesObj, turnLanes, "turnLane");
24685     mapToLanesObj(lanesObj, maxspeedLanes, "maxspeed");
24686     mapToLanesObj(lanesObj, psvLanes, "psv");
24687     mapToLanesObj(lanesObj, busLanes, "bus");
24688     mapToLanesObj(lanesObj, taxiLanes, "taxi");
24689     mapToLanesObj(lanesObj, hovLanes, "hov");
24690     mapToLanesObj(lanesObj, hgvLanes, "hgv");
24691     mapToLanesObj(lanesObj, bicyclewayLanes, "bicycleway");
24692     return {
24693       metadata: {
24694         count: laneCount,
24695         oneway: isOneWay,
24696         forward,
24697         backward,
24698         bothways,
24699         turnLanes,
24700         maxspeed,
24701         maxspeedLanes,
24702         psvLanes,
24703         busLanes,
24704         taxiLanes,
24705         hovLanes,
24706         hgvLanes,
24707         bicyclewayLanes
24708       },
24709       lanes: lanesObj
24710     };
24711   }
24712   function getLaneCount(tags, isOneWay) {
24713     var count;
24714     if (tags.lanes) {
24715       count = parseInt(tags.lanes, 10);
24716       if (count > 0) {
24717         return count;
24718       }
24719     }
24720     switch (tags.highway) {
24721       case "trunk":
24722       case "motorway":
24723         count = isOneWay ? 2 : 4;
24724         break;
24725       default:
24726         count = isOneWay ? 1 : 2;
24727         break;
24728     }
24729     return count;
24730   }
24731   function parseMaxspeed(tags) {
24732     var maxspeed = tags.maxspeed;
24733     if (!maxspeed) return;
24734     var maxspeedRegex = /^([0-9][\.0-9]+?)(?:[ ]?(?:km\/h|kmh|kph|mph|knots))?$/;
24735     if (!maxspeedRegex.test(maxspeed)) return;
24736     return parseInt(maxspeed, 10);
24737   }
24738   function parseLaneDirections(tags, isOneWay, laneCount) {
24739     var forward = parseInt(tags["lanes:forward"], 10);
24740     var backward = parseInt(tags["lanes:backward"], 10);
24741     var bothways = parseInt(tags["lanes:both_ways"], 10) > 0 ? 1 : 0;
24742     if (parseInt(tags.oneway, 10) === -1) {
24743       forward = 0;
24744       bothways = 0;
24745       backward = laneCount;
24746     } else if (isOneWay) {
24747       forward = laneCount;
24748       bothways = 0;
24749       backward = 0;
24750     } else if (isNaN(forward) && isNaN(backward)) {
24751       backward = Math.floor((laneCount - bothways) / 2);
24752       forward = laneCount - bothways - backward;
24753     } else if (isNaN(forward)) {
24754       if (backward > laneCount - bothways) {
24755         backward = laneCount - bothways;
24756       }
24757       forward = laneCount - bothways - backward;
24758     } else if (isNaN(backward)) {
24759       if (forward > laneCount - bothways) {
24760         forward = laneCount - bothways;
24761       }
24762       backward = laneCount - bothways - forward;
24763     }
24764     return {
24765       forward,
24766       backward,
24767       bothways
24768     };
24769   }
24770   function parseTurnLanes(tag) {
24771     if (!tag) return;
24772     var validValues = [
24773       "left",
24774       "slight_left",
24775       "sharp_left",
24776       "through",
24777       "right",
24778       "slight_right",
24779       "sharp_right",
24780       "reverse",
24781       "merge_to_left",
24782       "merge_to_right",
24783       "none"
24784     ];
24785     return tag.split("|").map(function(s2) {
24786       if (s2 === "") s2 = "none";
24787       return s2.split(";").map(function(d2) {
24788         return validValues.indexOf(d2) === -1 ? "unknown" : d2;
24789       });
24790     });
24791   }
24792   function parseMaxspeedLanes(tag, maxspeed) {
24793     if (!tag) return;
24794     return tag.split("|").map(function(s2) {
24795       if (s2 === "none") return s2;
24796       var m3 = parseInt(s2, 10);
24797       if (s2 === "" || m3 === maxspeed) return null;
24798       return isNaN(m3) ? "unknown" : m3;
24799     });
24800   }
24801   function parseMiscLanes(tag) {
24802     if (!tag) return;
24803     var validValues = [
24804       "yes",
24805       "no",
24806       "designated"
24807     ];
24808     return tag.split("|").map(function(s2) {
24809       if (s2 === "") s2 = "no";
24810       return validValues.indexOf(s2) === -1 ? "unknown" : s2;
24811     });
24812   }
24813   function parseBicycleWay(tag) {
24814     if (!tag) return;
24815     var validValues = [
24816       "yes",
24817       "no",
24818       "designated",
24819       "lane"
24820     ];
24821     return tag.split("|").map(function(s2) {
24822       if (s2 === "") s2 = "no";
24823       return validValues.indexOf(s2) === -1 ? "unknown" : s2;
24824     });
24825   }
24826   function mapToLanesObj(lanesObj, data, key) {
24827     if (data.forward) {
24828       data.forward.forEach(function(l2, i3) {
24829         if (!lanesObj.forward[i3]) lanesObj.forward[i3] = {};
24830         lanesObj.forward[i3][key] = l2;
24831       });
24832     }
24833     if (data.backward) {
24834       data.backward.forEach(function(l2, i3) {
24835         if (!lanesObj.backward[i3]) lanesObj.backward[i3] = {};
24836         lanesObj.backward[i3][key] = l2;
24837       });
24838     }
24839     if (data.unspecified) {
24840       data.unspecified.forEach(function(l2, i3) {
24841         if (!lanesObj.unspecified[i3]) lanesObj.unspecified[i3] = {};
24842         lanesObj.unspecified[i3][key] = l2;
24843       });
24844     }
24845   }
24846
24847   // modules/osm/way.js
24848   function osmWay() {
24849     if (!(this instanceof osmWay)) {
24850       return new osmWay().initialize(arguments);
24851     } else if (arguments.length) {
24852       this.initialize(arguments);
24853     }
24854   }
24855   osmEntity.way = osmWay;
24856   osmWay.prototype = Object.create(osmEntity.prototype);
24857   var prototype = {
24858     type: "way",
24859     nodes: [],
24860     copy: function(resolver, copies) {
24861       if (copies[this.id]) return copies[this.id];
24862       var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
24863       var nodes = this.nodes.map(function(id2) {
24864         return resolver.entity(id2).copy(resolver, copies).id;
24865       });
24866       copy2 = copy2.update({ nodes });
24867       copies[this.id] = copy2;
24868       return copy2;
24869     },
24870     extent: function(resolver) {
24871       return resolver.transient(this, "extent", function() {
24872         var extent = geoExtent();
24873         for (var i3 = 0; i3 < this.nodes.length; i3++) {
24874           var node = resolver.hasEntity(this.nodes[i3]);
24875           if (node) {
24876             extent._extend(node.extent());
24877           }
24878         }
24879         return extent;
24880       });
24881     },
24882     first: function() {
24883       return this.nodes[0];
24884     },
24885     last: function() {
24886       return this.nodes[this.nodes.length - 1];
24887     },
24888     contains: function(node) {
24889       return this.nodes.indexOf(node) >= 0;
24890     },
24891     affix: function(node) {
24892       if (this.nodes[0] === node) return "prefix";
24893       if (this.nodes[this.nodes.length - 1] === node) return "suffix";
24894     },
24895     layer: function() {
24896       if (isFinite(this.tags.layer)) {
24897         return Math.max(-10, Math.min(+this.tags.layer, 10));
24898       }
24899       if (this.tags.covered === "yes") return -1;
24900       if (this.tags.location === "overground") return 1;
24901       if (this.tags.location === "underground") return -1;
24902       if (this.tags.location === "underwater") return -10;
24903       if (this.tags.power === "line") return 10;
24904       if (this.tags.power === "minor_line") return 10;
24905       if (this.tags.aerialway) return 10;
24906       if (this.tags.bridge) return 1;
24907       if (this.tags.cutting) return -1;
24908       if (this.tags.tunnel) return -1;
24909       if (this.tags.waterway) return -1;
24910       if (this.tags.man_made === "pipeline") return -10;
24911       if (this.tags.boundary) return -10;
24912       return 0;
24913     },
24914     // the approximate width of the line based on its tags except its `width` tag
24915     impliedLineWidthMeters: function() {
24916       var averageWidths = {
24917         highway: {
24918           // width is for single lane
24919           motorway: 5,
24920           motorway_link: 5,
24921           trunk: 4.5,
24922           trunk_link: 4.5,
24923           primary: 4,
24924           secondary: 4,
24925           tertiary: 4,
24926           primary_link: 4,
24927           secondary_link: 4,
24928           tertiary_link: 4,
24929           unclassified: 4,
24930           road: 4,
24931           living_street: 4,
24932           bus_guideway: 4,
24933           busway: 4,
24934           pedestrian: 4,
24935           residential: 3.5,
24936           service: 3.5,
24937           track: 3,
24938           cycleway: 2.5,
24939           bridleway: 2,
24940           corridor: 2,
24941           steps: 2,
24942           path: 1.5,
24943           footway: 1.5,
24944           ladder: 0.5
24945         },
24946         railway: {
24947           // width includes ties and rail bed, not just track gauge
24948           rail: 2.5,
24949           light_rail: 2.5,
24950           tram: 2.5,
24951           subway: 2.5,
24952           monorail: 2.5,
24953           funicular: 2.5,
24954           disused: 2.5,
24955           preserved: 2.5,
24956           miniature: 1.5,
24957           narrow_gauge: 1.5
24958         },
24959         waterway: {
24960           river: 50,
24961           canal: 25,
24962           stream: 5,
24963           tidal_channel: 5,
24964           fish_pass: 2.5,
24965           drain: 2.5,
24966           ditch: 1.5
24967         }
24968       };
24969       for (var key in averageWidths) {
24970         if (this.tags[key] && averageWidths[key][this.tags[key]]) {
24971           var width = averageWidths[key][this.tags[key]];
24972           if (key === "highway") {
24973             var laneCount = this.tags.lanes && parseInt(this.tags.lanes, 10);
24974             if (!laneCount) laneCount = this.isOneWay() ? 1 : 2;
24975             return width * laneCount;
24976           }
24977           return width;
24978         }
24979       }
24980       return null;
24981     },
24982     /** @returns {boolean} for example, if `oneway=yes` */
24983     isOneWayForwards() {
24984       if (this.tags.oneway === "no") return false;
24985       return !!utilCheckTagDictionary(this.tags, osmOneWayForwardTags);
24986     },
24987     /** @returns {boolean} for example, if `oneway=-1` */
24988     isOneWayBackwards() {
24989       if (this.tags.oneway === "no") return false;
24990       return !!utilCheckTagDictionary(this.tags, osmOneWayBackwardTags);
24991     },
24992     /** @returns {boolean} for example, if `oneway=alternating` */
24993     isBiDirectional() {
24994       if (this.tags.oneway === "no") return false;
24995       return !!utilCheckTagDictionary(this.tags, osmOneWayBiDirectionalTags);
24996     },
24997     /** @returns {boolean} */
24998     isOneWay() {
24999       if (this.tags.oneway === "no") return false;
25000       return !!utilCheckTagDictionary(this.tags, osmOneWayTags);
25001     },
25002     // Some identifier for tag that implies that this way is "sided",
25003     // i.e. the right side is the 'inside' (e.g. the right side of a
25004     // natural=cliff is lower).
25005     sidednessIdentifier: function() {
25006       for (const realKey in this.tags) {
25007         const value = this.tags[realKey];
25008         const key = osmRemoveLifecyclePrefix(realKey);
25009         if (key in osmRightSideIsInsideTags && value in osmRightSideIsInsideTags[key]) {
25010           if (osmRightSideIsInsideTags[key][value] === true) {
25011             return key;
25012           } else {
25013             return osmRightSideIsInsideTags[key][value];
25014           }
25015         }
25016       }
25017       return null;
25018     },
25019     isSided: function() {
25020       if (this.tags.two_sided === "yes") {
25021         return false;
25022       }
25023       return this.sidednessIdentifier() !== null;
25024     },
25025     lanes: function() {
25026       return osmLanes(this);
25027     },
25028     isClosed: function() {
25029       return this.nodes.length > 1 && this.first() === this.last();
25030     },
25031     isConvex: function(resolver) {
25032       if (!this.isClosed() || this.isDegenerate()) return null;
25033       var nodes = utilArrayUniq(resolver.childNodes(this));
25034       var coords = nodes.map(function(n3) {
25035         return n3.loc;
25036       });
25037       var curr = 0;
25038       var prev = 0;
25039       for (var i3 = 0; i3 < coords.length; i3++) {
25040         var o2 = coords[(i3 + 1) % coords.length];
25041         var a2 = coords[i3];
25042         var b3 = coords[(i3 + 2) % coords.length];
25043         var res = geoVecCross(a2, b3, o2);
25044         curr = res > 0 ? 1 : res < 0 ? -1 : 0;
25045         if (curr === 0) {
25046           continue;
25047         } else if (prev && curr !== prev) {
25048           return false;
25049         }
25050         prev = curr;
25051       }
25052       return true;
25053     },
25054     // returns an object with the tag that implies this is an area, if any
25055     tagSuggestingArea: function() {
25056       return osmTagSuggestingArea(this.tags);
25057     },
25058     isArea: function() {
25059       if (this.tags.area === "yes") return true;
25060       if (!this.isClosed() || this.tags.area === "no") return false;
25061       return this.tagSuggestingArea() !== null;
25062     },
25063     isDegenerate: function() {
25064       return new Set(this.nodes).size < (this.isClosed() ? 3 : 2);
25065     },
25066     areAdjacent: function(n1, n22) {
25067       for (var i3 = 0; i3 < this.nodes.length; i3++) {
25068         if (this.nodes[i3] === n1) {
25069           if (this.nodes[i3 - 1] === n22) return true;
25070           if (this.nodes[i3 + 1] === n22) return true;
25071         }
25072       }
25073       return false;
25074     },
25075     geometry: function(graph) {
25076       return graph.transient(this, "geometry", function() {
25077         return this.isArea() ? "area" : "line";
25078       });
25079     },
25080     // returns an array of objects representing the segments between the nodes in this way
25081     segments: function(graph) {
25082       function segmentExtent(graph2) {
25083         var n1 = graph2.hasEntity(this.nodes[0]);
25084         var n22 = graph2.hasEntity(this.nodes[1]);
25085         return n1 && n22 && geoExtent([
25086           [
25087             Math.min(n1.loc[0], n22.loc[0]),
25088             Math.min(n1.loc[1], n22.loc[1])
25089           ],
25090           [
25091             Math.max(n1.loc[0], n22.loc[0]),
25092             Math.max(n1.loc[1], n22.loc[1])
25093           ]
25094         ]);
25095       }
25096       return graph.transient(this, "segments", function() {
25097         var segments = [];
25098         for (var i3 = 0; i3 < this.nodes.length - 1; i3++) {
25099           segments.push({
25100             id: this.id + "-" + i3,
25101             wayId: this.id,
25102             index: i3,
25103             nodes: [this.nodes[i3], this.nodes[i3 + 1]],
25104             extent: segmentExtent
25105           });
25106         }
25107         return segments;
25108       });
25109     },
25110     // If this way is not closed, append the beginning node to the end of the nodelist to close it.
25111     close: function() {
25112       if (this.isClosed() || !this.nodes.length) return this;
25113       var nodes = this.nodes.slice();
25114       nodes = nodes.filter(noRepeatNodes);
25115       nodes.push(nodes[0]);
25116       return this.update({ nodes });
25117     },
25118     // If this way is closed, remove any connector nodes from the end of the nodelist to unclose it.
25119     unclose: function() {
25120       if (!this.isClosed()) return this;
25121       var nodes = this.nodes.slice();
25122       var connector = this.first();
25123       var i3 = nodes.length - 1;
25124       while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
25125         nodes.splice(i3, 1);
25126         i3 = nodes.length - 1;
25127       }
25128       nodes = nodes.filter(noRepeatNodes);
25129       return this.update({ nodes });
25130     },
25131     // Adds a node (id) in front of the node which is currently at position index.
25132     // If index is undefined, the node will be added to the end of the way for linear ways,
25133     //   or just before the final connecting node for circular ways.
25134     // Consecutive duplicates are eliminated including existing ones.
25135     // Circularity is always preserved when adding a node.
25136     addNode: function(id2, index) {
25137       var nodes = this.nodes.slice();
25138       var isClosed = this.isClosed();
25139       var max3 = isClosed ? nodes.length - 1 : nodes.length;
25140       if (index === void 0) {
25141         index = max3;
25142       }
25143       if (index < 0 || index > max3) {
25144         throw new RangeError("index " + index + " out of range 0.." + max3);
25145       }
25146       if (isClosed) {
25147         var connector = this.first();
25148         var i3 = 1;
25149         while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
25150           nodes.splice(i3, 1);
25151           if (index > i3) index--;
25152         }
25153         i3 = nodes.length - 1;
25154         while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
25155           nodes.splice(i3, 1);
25156           if (index > i3) index--;
25157           i3 = nodes.length - 1;
25158         }
25159       }
25160       nodes.splice(index, 0, id2);
25161       nodes = nodes.filter(noRepeatNodes);
25162       if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
25163         nodes.push(nodes[0]);
25164       }
25165       return this.update({ nodes });
25166     },
25167     // Replaces the node which is currently at position index with the given node (id).
25168     // Consecutive duplicates are eliminated including existing ones.
25169     // Circularity is preserved when updating a node.
25170     updateNode: function(id2, index) {
25171       var nodes = this.nodes.slice();
25172       var isClosed = this.isClosed();
25173       var max3 = nodes.length - 1;
25174       if (index === void 0 || index < 0 || index > max3) {
25175         throw new RangeError("index " + index + " out of range 0.." + max3);
25176       }
25177       if (isClosed) {
25178         var connector = this.first();
25179         var i3 = 1;
25180         while (i3 < nodes.length && nodes.length > 2 && nodes[i3] === connector) {
25181           nodes.splice(i3, 1);
25182           if (index > i3) index--;
25183         }
25184         i3 = nodes.length - 1;
25185         while (i3 > 0 && nodes.length > 1 && nodes[i3] === connector) {
25186           nodes.splice(i3, 1);
25187           if (index === i3) index = 0;
25188           i3 = nodes.length - 1;
25189         }
25190       }
25191       nodes.splice(index, 1, id2);
25192       nodes = nodes.filter(noRepeatNodes);
25193       if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
25194         nodes.push(nodes[0]);
25195       }
25196       return this.update({ nodes });
25197     },
25198     // Replaces each occurrence of node id needle with replacement.
25199     // Consecutive duplicates are eliminated including existing ones.
25200     // Circularity is preserved.
25201     replaceNode: function(needleID, replacementID) {
25202       var nodes = this.nodes.slice();
25203       var isClosed = this.isClosed();
25204       for (var i3 = 0; i3 < nodes.length; i3++) {
25205         if (nodes[i3] === needleID) {
25206           nodes[i3] = replacementID;
25207         }
25208       }
25209       nodes = nodes.filter(noRepeatNodes);
25210       if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
25211         nodes.push(nodes[0]);
25212       }
25213       return this.update({ nodes });
25214     },
25215     // Removes each occurrence of node id.
25216     // Consecutive duplicates are eliminated including existing ones.
25217     // Circularity is preserved.
25218     removeNode: function(id2) {
25219       var nodes = this.nodes.slice();
25220       var isClosed = this.isClosed();
25221       nodes = nodes.filter(function(node) {
25222         return node !== id2;
25223       }).filter(noRepeatNodes);
25224       if (isClosed && (nodes.length === 1 || nodes[0] !== nodes[nodes.length - 1])) {
25225         nodes.push(nodes[0]);
25226       }
25227       return this.update({ nodes });
25228     },
25229     asJXON: function(changeset_id) {
25230       var r2 = {
25231         way: {
25232           "@id": this.osmId(),
25233           "@version": this.version || 0,
25234           nd: this.nodes.map(function(id2) {
25235             return { keyAttributes: { ref: osmEntity.id.toOSM(id2) } };
25236           }, this),
25237           tag: Object.keys(this.tags).map(function(k3) {
25238             return { keyAttributes: { k: k3, v: this.tags[k3] } };
25239           }, this)
25240         }
25241       };
25242       if (changeset_id) {
25243         r2.way["@changeset"] = changeset_id;
25244       }
25245       return r2;
25246     },
25247     asGeoJSON: function(resolver) {
25248       return resolver.transient(this, "GeoJSON", function() {
25249         var coordinates = resolver.childNodes(this).map(function(n3) {
25250           return n3.loc;
25251         });
25252         if (this.isArea() && this.isClosed()) {
25253           return {
25254             type: "Polygon",
25255             coordinates: [coordinates]
25256           };
25257         } else {
25258           return {
25259             type: "LineString",
25260             coordinates
25261           };
25262         }
25263       });
25264     },
25265     area: function(resolver) {
25266       return resolver.transient(this, "area", function() {
25267         var nodes = resolver.childNodes(this);
25268         var json = {
25269           type: "Polygon",
25270           coordinates: [nodes.map(function(n3) {
25271             return n3.loc;
25272           })]
25273         };
25274         if (!this.isClosed() && nodes.length) {
25275           json.coordinates[0].push(nodes[0].loc);
25276         }
25277         var area = area_default2(json);
25278         if (area > 2 * Math.PI) {
25279           json.coordinates[0] = json.coordinates[0].reverse();
25280           area = area_default2(json);
25281         }
25282         return isNaN(area) ? 0 : area;
25283       });
25284     }
25285   };
25286   Object.assign(osmWay.prototype, prototype);
25287   function noRepeatNodes(node, i3, arr) {
25288     return i3 === 0 || node !== arr[i3 - 1];
25289   }
25290
25291   // modules/osm/multipolygon.js
25292   function osmJoinWays(toJoin, graph) {
25293     function resolve(member) {
25294       return graph.childNodes(graph.entity(member.id));
25295     }
25296     function reverse(item2) {
25297       var action = actionReverse(item2.id, { reverseOneway: true });
25298       sequences.actions.push(action);
25299       return item2 instanceof osmWay ? action(graph).entity(item2.id) : item2;
25300     }
25301     toJoin = toJoin.filter(function(member) {
25302       return member.type === "way" && graph.hasEntity(member.id);
25303     });
25304     var i3;
25305     var joinAsMembers = true;
25306     for (i3 = 0; i3 < toJoin.length; i3++) {
25307       if (toJoin[i3] instanceof osmWay) {
25308         joinAsMembers = false;
25309         break;
25310       }
25311     }
25312     var sequences = [];
25313     sequences.actions = [];
25314     while (toJoin.length) {
25315       var item = toJoin.shift();
25316       var currWays = [item];
25317       var currNodes = resolve(item).slice();
25318       while (toJoin.length) {
25319         var start2 = currNodes[0];
25320         var end = currNodes[currNodes.length - 1];
25321         var fn = null;
25322         var nodes = null;
25323         for (i3 = 0; i3 < toJoin.length; i3++) {
25324           item = toJoin[i3];
25325           nodes = resolve(item);
25326           if (joinAsMembers && currWays.length === 1 && nodes[0] !== end && nodes[nodes.length - 1] !== end && (nodes[nodes.length - 1] === start2 || nodes[0] === start2)) {
25327             currWays[0] = reverse(currWays[0]);
25328             currNodes.reverse();
25329             start2 = currNodes[0];
25330             end = currNodes[currNodes.length - 1];
25331           }
25332           if (nodes[0] === end) {
25333             fn = currNodes.push;
25334             nodes = nodes.slice(1);
25335             break;
25336           } else if (nodes[nodes.length - 1] === end) {
25337             fn = currNodes.push;
25338             nodes = nodes.slice(0, -1).reverse();
25339             item = reverse(item);
25340             break;
25341           } else if (nodes[nodes.length - 1] === start2) {
25342             fn = currNodes.unshift;
25343             nodes = nodes.slice(0, -1);
25344             break;
25345           } else if (nodes[0] === start2) {
25346             fn = currNodes.unshift;
25347             nodes = nodes.slice(1).reverse();
25348             item = reverse(item);
25349             break;
25350           } else {
25351             fn = nodes = null;
25352           }
25353         }
25354         if (!nodes) {
25355           break;
25356         }
25357         fn.apply(currWays, [item]);
25358         fn.apply(currNodes, nodes);
25359         toJoin.splice(i3, 1);
25360       }
25361       currWays.nodes = currNodes;
25362       sequences.push(currWays);
25363     }
25364     return sequences;
25365   }
25366
25367   // modules/actions/add_member.js
25368   function actionAddMember(relationId, member, memberIndex) {
25369     return function action(graph) {
25370       var relation = graph.entity(relationId);
25371       var isPTv2 = /stop|platform/.test(member.role);
25372       if (member.type === "way" && !isPTv2) {
25373         graph = addWayMember(relation, graph);
25374       } else {
25375         if (isPTv2 && isNaN(memberIndex)) {
25376           memberIndex = 0;
25377         }
25378         graph = graph.replace(relation.addMember(member, memberIndex));
25379       }
25380       return graph;
25381     };
25382     function addWayMember(relation, graph) {
25383       var groups, item, i3, j3, k3;
25384       var PTv2members = [];
25385       var members = [];
25386       for (i3 = 0; i3 < relation.members.length; i3++) {
25387         var m3 = relation.members[i3];
25388         if (/stop|platform/.test(m3.role)) {
25389           PTv2members.push(m3);
25390         } else {
25391           members.push(m3);
25392         }
25393       }
25394       relation = relation.update({ members });
25395       groups = utilArrayGroupBy(relation.members, "type");
25396       groups.way = groups.way || [];
25397       groups.way.push(member);
25398       members = withIndex(groups.way);
25399       var joined = osmJoinWays(members, graph);
25400       for (i3 = 0; i3 < joined.length; i3++) {
25401         var segment = joined[i3];
25402         var nodes = segment.nodes.slice();
25403         var startIndex = segment[0].index;
25404         for (j3 = 0; j3 < members.length; j3++) {
25405           if (members[j3].index === startIndex) {
25406             break;
25407           }
25408         }
25409         for (k3 = 0; k3 < segment.length; k3++) {
25410           item = segment[k3];
25411           var way = graph.entity(item.id);
25412           if (k3 > 0) {
25413             if (j3 + k3 >= members.length || item.index !== members[j3 + k3].index) {
25414               moveMember(members, item.index, j3 + k3);
25415             }
25416           }
25417           nodes.splice(0, way.nodes.length - 1);
25418         }
25419       }
25420       var wayMembers = [];
25421       for (i3 = 0; i3 < members.length; i3++) {
25422         item = members[i3];
25423         if (item.index === -1) continue;
25424         wayMembers.push(utilObjectOmit(item, ["index"]));
25425       }
25426       var newMembers = PTv2members.concat(groups.node || [], wayMembers, groups.relation || []);
25427       return graph.replace(relation.update({ members: newMembers }));
25428       function moveMember(arr, findIndex, toIndex) {
25429         var i4;
25430         for (i4 = 0; i4 < arr.length; i4++) {
25431           if (arr[i4].index === findIndex) {
25432             break;
25433           }
25434         }
25435         var item2 = Object.assign({}, arr[i4]);
25436         arr[i4].index = -1;
25437         delete item2.index;
25438         arr.splice(toIndex, 0, item2);
25439       }
25440       function withIndex(arr) {
25441         var result = new Array(arr.length);
25442         for (var i4 = 0; i4 < arr.length; i4++) {
25443           result[i4] = Object.assign({}, arr[i4]);
25444           result[i4].index = i4;
25445         }
25446         return result;
25447       }
25448     }
25449   }
25450
25451   // modules/actions/add_midpoint.js
25452   function actionAddMidpoint(midpoint, node) {
25453     return function(graph) {
25454       graph = graph.replace(node.move(midpoint.loc));
25455       var parents = utilArrayIntersection(
25456         graph.parentWays(graph.entity(midpoint.edge[0])),
25457         graph.parentWays(graph.entity(midpoint.edge[1]))
25458       );
25459       parents.forEach(function(way) {
25460         for (var i3 = 0; i3 < way.nodes.length - 1; i3++) {
25461           if (geoEdgeEqual([way.nodes[i3], way.nodes[i3 + 1]], midpoint.edge)) {
25462             graph = graph.replace(graph.entity(way.id).addNode(node.id, i3 + 1));
25463             return;
25464           }
25465         }
25466       });
25467       return graph;
25468     };
25469   }
25470
25471   // modules/actions/add_vertex.js
25472   function actionAddVertex(wayId, nodeId, index) {
25473     return function(graph) {
25474       return graph.replace(graph.entity(wayId).addNode(nodeId, index));
25475     };
25476   }
25477
25478   // modules/actions/change_member.js
25479   function actionChangeMember(relationId, member, memberIndex) {
25480     return function(graph) {
25481       return graph.replace(graph.entity(relationId).updateMember(member, memberIndex));
25482     };
25483   }
25484
25485   // modules/actions/change_preset.js
25486   function actionChangePreset(entityID, oldPreset, newPreset, skipFieldDefaults) {
25487     return function action(graph) {
25488       var entity = graph.entity(entityID);
25489       var geometry = entity.geometry(graph);
25490       var tags = entity.tags;
25491       const loc = entity.extent(graph).center();
25492       var preserveKeys;
25493       if (newPreset) {
25494         preserveKeys = [];
25495         if (newPreset.addTags) {
25496           preserveKeys = preserveKeys.concat(Object.keys(newPreset.addTags));
25497         }
25498         if (oldPreset && !oldPreset.id.startsWith(newPreset.id)) {
25499           newPreset.fields(loc).concat(newPreset.moreFields(loc)).filter((f2) => f2.matchGeometry(geometry)).map((f2) => f2.key).filter(Boolean).forEach((key) => preserveKeys.push(key));
25500         }
25501       }
25502       if (oldPreset) tags = oldPreset.unsetTags(tags, geometry, preserveKeys, false, loc);
25503       if (newPreset) tags = newPreset.setTags(tags, geometry, skipFieldDefaults, loc);
25504       return graph.replace(entity.update({ tags }));
25505     };
25506   }
25507
25508   // modules/actions/change_tags.js
25509   function actionChangeTags(entityId, tags) {
25510     return function(graph) {
25511       var entity = graph.entity(entityId);
25512       return graph.replace(entity.update({ tags }));
25513     };
25514   }
25515
25516   // modules/osm/node.js
25517   var cardinal = {
25518     north: 0,
25519     n: 0,
25520     northnortheast: 22,
25521     nne: 22,
25522     northeast: 45,
25523     ne: 45,
25524     eastnortheast: 67,
25525     ene: 67,
25526     east: 90,
25527     e: 90,
25528     eastsoutheast: 112,
25529     ese: 112,
25530     southeast: 135,
25531     se: 135,
25532     southsoutheast: 157,
25533     sse: 157,
25534     south: 180,
25535     s: 180,
25536     southsouthwest: 202,
25537     ssw: 202,
25538     southwest: 225,
25539     sw: 225,
25540     westsouthwest: 247,
25541     wsw: 247,
25542     west: 270,
25543     w: 270,
25544     westnorthwest: 292,
25545     wnw: 292,
25546     northwest: 315,
25547     nw: 315,
25548     northnorthwest: 337,
25549     nnw: 337
25550   };
25551   var SIDE_TAGS = [
25552     "side",
25553     "railway:signal:position"
25554     // railway:turnout_side can't be included, since it's not relative to the way direction
25555   ];
25556   var SIDES = /* @__PURE__ */ new Set(["left", "right", "both"]);
25557   function osmNode() {
25558     if (!(this instanceof osmNode)) {
25559       return new osmNode().initialize(arguments);
25560     } else if (arguments.length) {
25561       this.initialize(arguments);
25562     }
25563   }
25564   osmEntity.node = osmNode;
25565   osmNode.prototype = Object.create(osmEntity.prototype);
25566   var prototype2 = {
25567     type: "node",
25568     loc: (
25569       /** @type {Vec2} */
25570       [9999, 9999]
25571     ),
25572     extent: function() {
25573       return new geoExtent(this.loc);
25574     },
25575     geometry: function(graph) {
25576       return graph.transient(this, "geometry", function() {
25577         return graph.isPoi(this) ? "point" : "vertex";
25578       });
25579     },
25580     move: function(loc) {
25581       return this.update({ loc });
25582     },
25583     isDegenerate: function() {
25584       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);
25585     },
25586     // Inspect tags and geometry to determine which direction(s) this node/vertex points
25587     directions: function(resolver, projection2) {
25588       const rawValues = [];
25589       var i3;
25590       if (this.isHighwayIntersection(resolver) && (this.tags.stop || "").toLowerCase() === "all") {
25591         rawValues.push({
25592           type: "direction",
25593           value: "all"
25594         });
25595       } else {
25596         const hideSideTag = this.tags.highway === "cyclist_waiting_aid" && resolver.parentWays(this).some((way) => !way.isOneWayForwards());
25597         const sideTag = SIDE_TAGS.map((key) => this.tags[key]).find(Boolean);
25598         if (SIDES.has(sideTag == null ? void 0 : sideTag.toLowerCase()) && !hideSideTag) {
25599           rawValues.push({
25600             type: "side",
25601             value: sideTag == null ? void 0 : sideTag.toLowerCase()
25602           });
25603         }
25604         let val = (this.tags.direction || "").toLowerCase();
25605         var re4 = /:direction$/i;
25606         var keys2 = Object.keys(this.tags);
25607         for (i3 = 0; i3 < keys2.length; i3++) {
25608           if (re4.test(keys2[i3])) {
25609             val = this.tags[keys2[i3]].toLowerCase();
25610             break;
25611           }
25612         }
25613         for (const value of val.split(";")) {
25614           rawValues.push({ type: "direction", value });
25615         }
25616       }
25617       if (!rawValues.length) return [];
25618       var results = [];
25619       rawValues.forEach(({ type: type2, value: v3 }) => {
25620         if (cardinal[v3] !== void 0) {
25621           v3 = cardinal[v3];
25622         }
25623         if (v3 !== "" && !isNaN(+v3)) {
25624           results.push({ type: "direction", angle: +v3 });
25625           return;
25626         }
25627         const isSide = type2 === "side" && SIDES.has(v3);
25628         var lookBackward = this.tags["traffic_sign:backward"] || v3 === (isSide ? "left" : "backward") || v3 === "both" || v3 === "all";
25629         var lookForward = this.tags["traffic_sign:forward"] || v3 === (isSide ? "right" : "forward") || v3 === "both" || v3 === "all";
25630         if (!lookForward && !lookBackward) return;
25631         var nodeIds = {};
25632         resolver.parentWays(this).filter((way) => osmShouldRenderDirection(this.tags, way.tags)).forEach(function(parent2) {
25633           var nodes = parent2.nodes;
25634           for (i3 = 0; i3 < nodes.length; i3++) {
25635             if (nodes[i3] === this.id) {
25636               if (lookForward && i3 > 0) {
25637                 nodeIds[nodes[i3 - 1]] = true;
25638               }
25639               if (lookBackward && i3 < nodes.length - 1) {
25640                 nodeIds[nodes[i3 + 1]] = true;
25641               }
25642             }
25643           }
25644         }, this);
25645         Object.keys(nodeIds).forEach(function(nodeId) {
25646           results.push({
25647             type: isSide ? "side" : "direction",
25648             angle: geoAngle(this, resolver.entity(nodeId), projection2) * (180 / Math.PI) + (isSide ? 0 : 90)
25649           });
25650         }, this);
25651       }, this);
25652       return utilArrayUniqBy(results, (item) => item.type + item.angle);
25653     },
25654     isCrossing: function() {
25655       return this.tags.highway === "crossing" || this.tags.railway && this.tags.railway.indexOf("crossing") !== -1;
25656     },
25657     isEndpoint: function(resolver) {
25658       return resolver.transient(this, "isEndpoint", function() {
25659         var id2 = this.id;
25660         return resolver.parentWays(this).filter(function(parent2) {
25661           return !parent2.isClosed() && !!parent2.affix(id2);
25662         }).length > 0;
25663       });
25664     },
25665     isConnected: function(resolver) {
25666       return resolver.transient(this, "isConnected", function() {
25667         var parents = resolver.parentWays(this);
25668         if (parents.length > 1) {
25669           for (var i3 in parents) {
25670             if (parents[i3].geometry(resolver) === "line" && parents[i3].hasInterestingTags()) return true;
25671           }
25672         } else if (parents.length === 1) {
25673           var way = parents[0];
25674           var nodes = way.nodes.slice();
25675           if (way.isClosed()) {
25676             nodes.pop();
25677           }
25678           return nodes.indexOf(this.id) !== nodes.lastIndexOf(this.id);
25679         }
25680         return false;
25681       });
25682     },
25683     parentIntersectionWays: function(resolver) {
25684       return resolver.transient(this, "parentIntersectionWays", function() {
25685         return resolver.parentWays(this).filter(function(parent2) {
25686           return (parent2.tags.highway || parent2.tags.waterway || parent2.tags.railway || parent2.tags.aeroway) && parent2.geometry(resolver) === "line";
25687         });
25688       });
25689     },
25690     isIntersection: function(resolver) {
25691       return this.parentIntersectionWays(resolver).length > 1;
25692     },
25693     isHighwayIntersection: function(resolver) {
25694       return resolver.transient(this, "isHighwayIntersection", function() {
25695         return resolver.parentWays(this).filter(function(parent2) {
25696           return parent2.tags.highway && parent2.geometry(resolver) === "line";
25697         }).length > 1;
25698       });
25699     },
25700     isOnAddressLine: function(resolver) {
25701       return resolver.transient(this, "isOnAddressLine", function() {
25702         return resolver.parentWays(this).filter(function(parent2) {
25703           return parent2.tags.hasOwnProperty("addr:interpolation") && parent2.geometry(resolver) === "line";
25704         }).length > 0;
25705       });
25706     },
25707     asJXON: function(changeset_id) {
25708       var r2 = {
25709         node: {
25710           "@id": this.osmId(),
25711           "@lon": this.loc[0],
25712           "@lat": this.loc[1],
25713           "@version": this.version || 0,
25714           tag: Object.keys(this.tags).map(function(k3) {
25715             return { keyAttributes: { k: k3, v: this.tags[k3] } };
25716           }, this)
25717         }
25718       };
25719       if (changeset_id) r2.node["@changeset"] = changeset_id;
25720       return r2;
25721     },
25722     asGeoJSON: function() {
25723       return {
25724         type: "Point",
25725         coordinates: this.loc
25726       };
25727     }
25728   };
25729   Object.assign(osmNode.prototype, prototype2);
25730
25731   // modules/actions/circularize.js
25732   function actionCircularize(wayId, projection2, maxAngle) {
25733     maxAngle = (maxAngle || 20) * Math.PI / 180;
25734     var action = function(graph, t2) {
25735       if (t2 === null || !isFinite(t2)) t2 = 1;
25736       t2 = Math.min(Math.max(+t2, 0), 1);
25737       var way = graph.entity(wayId);
25738       var origNodes = {};
25739       graph.childNodes(way).forEach(function(node2) {
25740         if (!origNodes[node2.id]) origNodes[node2.id] = node2;
25741       });
25742       if (!way.isConvex(graph)) {
25743         graph = action.makeConvex(graph);
25744       }
25745       var nodes = utilArrayUniq(graph.childNodes(way));
25746       var keyNodes = nodes.filter(function(n3) {
25747         return graph.parentWays(n3).length !== 1;
25748       });
25749       var points = nodes.map(function(n3) {
25750         return projection2(n3.loc);
25751       });
25752       var keyPoints = keyNodes.map(function(n3) {
25753         return projection2(n3.loc);
25754       });
25755       var centroid = points.length === 2 ? geoVecInterp(points[0], points[1], 0.5) : centroid_default(points);
25756       var radius = median(points, function(p2) {
25757         return geoVecLength(centroid, p2);
25758       });
25759       var sign2 = area_default(points) > 0 ? 1 : -1;
25760       var ids, i3, j3, k3;
25761       if (!keyNodes.length) {
25762         keyNodes = [nodes[0]];
25763         keyPoints = [points[0]];
25764       }
25765       if (keyNodes.length === 1) {
25766         var index = nodes.indexOf(keyNodes[0]);
25767         var oppositeIndex = Math.floor((index + nodes.length / 2) % nodes.length);
25768         keyNodes.push(nodes[oppositeIndex]);
25769         keyPoints.push(points[oppositeIndex]);
25770       }
25771       for (i3 = 0; i3 < keyPoints.length; i3++) {
25772         var nextKeyNodeIndex = (i3 + 1) % keyNodes.length;
25773         var startNode = keyNodes[i3];
25774         var endNode = keyNodes[nextKeyNodeIndex];
25775         var startNodeIndex = nodes.indexOf(startNode);
25776         var endNodeIndex = nodes.indexOf(endNode);
25777         var numberNewPoints = -1;
25778         var indexRange = endNodeIndex - startNodeIndex;
25779         var nearNodes = {};
25780         var inBetweenNodes = [];
25781         var startAngle, endAngle, totalAngle, eachAngle;
25782         var angle2, loc, node, origNode;
25783         if (indexRange < 0) {
25784           indexRange += nodes.length;
25785         }
25786         var distance = geoVecLength(centroid, keyPoints[i3]) || 1e-4;
25787         keyPoints[i3] = [
25788           centroid[0] + (keyPoints[i3][0] - centroid[0]) / distance * radius,
25789           centroid[1] + (keyPoints[i3][1] - centroid[1]) / distance * radius
25790         ];
25791         loc = projection2.invert(keyPoints[i3]);
25792         node = keyNodes[i3];
25793         origNode = origNodes[node.id];
25794         node = node.move(geoVecInterp(origNode.loc, loc, t2));
25795         graph = graph.replace(node);
25796         startAngle = Math.atan2(keyPoints[i3][1] - centroid[1], keyPoints[i3][0] - centroid[0]);
25797         endAngle = Math.atan2(keyPoints[nextKeyNodeIndex][1] - centroid[1], keyPoints[nextKeyNodeIndex][0] - centroid[0]);
25798         totalAngle = endAngle - startAngle;
25799         if (totalAngle * sign2 > 0) {
25800           totalAngle = -sign2 * (2 * Math.PI - Math.abs(totalAngle));
25801         }
25802         do {
25803           numberNewPoints++;
25804           eachAngle = totalAngle / (indexRange + numberNewPoints);
25805         } while (Math.abs(eachAngle) > maxAngle);
25806         for (j3 = 1; j3 < indexRange; j3++) {
25807           angle2 = startAngle + j3 * eachAngle;
25808           loc = projection2.invert([
25809             centroid[0] + Math.cos(angle2) * radius,
25810             centroid[1] + Math.sin(angle2) * radius
25811           ]);
25812           node = nodes[(j3 + startNodeIndex) % nodes.length];
25813           origNode = origNodes[node.id];
25814           nearNodes[node.id] = angle2;
25815           node = node.move(geoVecInterp(origNode.loc, loc, t2));
25816           graph = graph.replace(node);
25817         }
25818         for (j3 = 0; j3 < numberNewPoints; j3++) {
25819           angle2 = startAngle + (indexRange + j3) * eachAngle;
25820           loc = projection2.invert([
25821             centroid[0] + Math.cos(angle2) * radius,
25822             centroid[1] + Math.sin(angle2) * radius
25823           ]);
25824           var min3 = Infinity;
25825           for (var nodeId in nearNodes) {
25826             var nearAngle = nearNodes[nodeId];
25827             var dist = Math.abs(nearAngle - angle2);
25828             if (dist < min3) {
25829               min3 = dist;
25830               origNode = origNodes[nodeId];
25831             }
25832           }
25833           node = osmNode({ loc: geoVecInterp(origNode.loc, loc, t2) });
25834           graph = graph.replace(node);
25835           nodes.splice(endNodeIndex + j3, 0, node);
25836           inBetweenNodes.push(node.id);
25837         }
25838         if (indexRange === 1 && inBetweenNodes.length) {
25839           var startIndex1 = way.nodes.lastIndexOf(startNode.id);
25840           var endIndex1 = way.nodes.lastIndexOf(endNode.id);
25841           var wayDirection1 = endIndex1 - startIndex1;
25842           if (wayDirection1 < -1) {
25843             wayDirection1 = 1;
25844           }
25845           var parentWays = graph.parentWays(keyNodes[i3]);
25846           for (j3 = 0; j3 < parentWays.length; j3++) {
25847             var sharedWay = parentWays[j3];
25848             if (sharedWay === way) continue;
25849             if (sharedWay.areAdjacent(startNode.id, endNode.id)) {
25850               var startIndex2 = sharedWay.nodes.lastIndexOf(startNode.id);
25851               var endIndex2 = sharedWay.nodes.lastIndexOf(endNode.id);
25852               var wayDirection2 = endIndex2 - startIndex2;
25853               var insertAt = endIndex2;
25854               if (wayDirection2 < -1) {
25855                 wayDirection2 = 1;
25856               }
25857               if (wayDirection1 !== wayDirection2) {
25858                 inBetweenNodes.reverse();
25859                 insertAt = startIndex2;
25860               }
25861               for (k3 = 0; k3 < inBetweenNodes.length; k3++) {
25862                 sharedWay = sharedWay.addNode(inBetweenNodes[k3], insertAt + k3);
25863               }
25864               graph = graph.replace(sharedWay);
25865             }
25866           }
25867         }
25868       }
25869       ids = nodes.map(function(n3) {
25870         return n3.id;
25871       });
25872       ids.push(ids[0]);
25873       way = way.update({ nodes: ids });
25874       graph = graph.replace(way);
25875       return graph;
25876     };
25877     action.makeConvex = function(graph) {
25878       var way = graph.entity(wayId);
25879       var nodes = utilArrayUniq(graph.childNodes(way));
25880       var points = nodes.map(function(n3) {
25881         return projection2(n3.loc);
25882       });
25883       var sign2 = area_default(points) > 0 ? 1 : -1;
25884       var hull = hull_default(points);
25885       var i3, j3;
25886       if (sign2 === -1) {
25887         nodes.reverse();
25888         points.reverse();
25889       }
25890       for (i3 = 0; i3 < hull.length - 1; i3++) {
25891         var startIndex = points.indexOf(hull[i3]);
25892         var endIndex = points.indexOf(hull[i3 + 1]);
25893         var indexRange = endIndex - startIndex;
25894         if (indexRange < 0) {
25895           indexRange += nodes.length;
25896         }
25897         for (j3 = 1; j3 < indexRange; j3++) {
25898           var point = geoVecInterp(hull[i3], hull[i3 + 1], j3 / indexRange);
25899           var node = nodes[(j3 + startIndex) % nodes.length].move(projection2.invert(point));
25900           graph = graph.replace(node);
25901         }
25902       }
25903       return graph;
25904     };
25905     action.disabled = function(graph) {
25906       if (!graph.entity(wayId).isClosed()) {
25907         return "not_closed";
25908       }
25909       var way = graph.entity(wayId);
25910       var nodes = utilArrayUniq(graph.childNodes(way));
25911       var points = nodes.map(function(n3) {
25912         return projection2(n3.loc);
25913       });
25914       var hull = hull_default(points);
25915       var epsilonAngle = Math.PI / 180;
25916       if (hull.length !== points.length || hull.length < 3) {
25917         return false;
25918       }
25919       var centroid = centroid_default(points);
25920       var radius = geoVecLengthSquare(centroid, points[0]);
25921       var i3, actualPoint;
25922       for (i3 = 0; i3 < hull.length; i3++) {
25923         actualPoint = hull[i3];
25924         var actualDist = geoVecLengthSquare(actualPoint, centroid);
25925         var diff = Math.abs(actualDist - radius);
25926         if (diff > 0.05 * radius) {
25927           return false;
25928         }
25929       }
25930       for (i3 = 0; i3 < hull.length; i3++) {
25931         actualPoint = hull[i3];
25932         var nextPoint = hull[(i3 + 1) % hull.length];
25933         var startAngle = Math.atan2(actualPoint[1] - centroid[1], actualPoint[0] - centroid[0]);
25934         var endAngle = Math.atan2(nextPoint[1] - centroid[1], nextPoint[0] - centroid[0]);
25935         var angle2 = endAngle - startAngle;
25936         if (angle2 < 0) {
25937           angle2 = -angle2;
25938         }
25939         if (angle2 > Math.PI) {
25940           angle2 = 2 * Math.PI - angle2;
25941         }
25942         if (angle2 > maxAngle + epsilonAngle) {
25943           return false;
25944         }
25945       }
25946       return "already_circular";
25947     };
25948     action.transitionable = true;
25949     return action;
25950   }
25951
25952   // modules/actions/delete_way.js
25953   function actionDeleteWay(wayID) {
25954     function canDeleteNode(node, graph) {
25955       if (graph.parentWays(node).length || graph.parentRelations(node).length) return false;
25956       var geometries = osmNodeGeometriesForTags(node.tags);
25957       if (geometries.point) return false;
25958       if (geometries.vertex) return true;
25959       return !node.hasInterestingTags();
25960     }
25961     var action = function(graph) {
25962       var way = graph.entity(wayID);
25963       graph.parentRelations(way).forEach(function(parent2) {
25964         parent2 = parent2.removeMembersWithID(wayID);
25965         graph = graph.replace(parent2);
25966         if (parent2.isDegenerate()) {
25967           graph = actionDeleteRelation(parent2.id)(graph);
25968         }
25969       });
25970       new Set(way.nodes).forEach(function(nodeID) {
25971         graph = graph.replace(way.removeNode(nodeID));
25972         var node = graph.entity(nodeID);
25973         if (canDeleteNode(node, graph)) {
25974           graph = graph.remove(node);
25975         }
25976       });
25977       return graph.remove(way);
25978     };
25979     return action;
25980   }
25981
25982   // modules/actions/delete_multiple.js
25983   function actionDeleteMultiple(ids) {
25984     var actions = {
25985       way: actionDeleteWay,
25986       node: actionDeleteNode,
25987       relation: actionDeleteRelation
25988     };
25989     var action = function(graph) {
25990       ids.forEach(function(id2) {
25991         if (graph.hasEntity(id2)) {
25992           graph = actions[graph.entity(id2).type](id2)(graph);
25993         }
25994       });
25995       return graph;
25996     };
25997     return action;
25998   }
25999
26000   // modules/actions/delete_relation.js
26001   function actionDeleteRelation(relationID, allowUntaggedMembers) {
26002     function canDeleteEntity(entity, graph) {
26003       return !graph.parentWays(entity).length && !graph.parentRelations(entity).length && (!entity.hasInterestingTags() && !allowUntaggedMembers);
26004     }
26005     var action = function(graph) {
26006       var relation = graph.entity(relationID);
26007       graph.parentRelations(relation).forEach(function(parent2) {
26008         parent2 = parent2.removeMembersWithID(relationID);
26009         graph = graph.replace(parent2);
26010         if (parent2.isDegenerate()) {
26011           graph = actionDeleteRelation(parent2.id)(graph);
26012         }
26013       });
26014       var memberIDs = utilArrayUniq(relation.members.map(function(m3) {
26015         return m3.id;
26016       }));
26017       memberIDs.forEach(function(memberID) {
26018         graph = graph.replace(relation.removeMembersWithID(memberID));
26019         var entity = graph.entity(memberID);
26020         if (canDeleteEntity(entity, graph)) {
26021           graph = actionDeleteMultiple([memberID])(graph);
26022         }
26023       });
26024       return graph.remove(relation);
26025     };
26026     return action;
26027   }
26028
26029   // modules/actions/delete_node.js
26030   function actionDeleteNode(nodeId) {
26031     var action = function(graph) {
26032       var node = graph.entity(nodeId);
26033       graph.parentWays(node).forEach(function(parent2) {
26034         parent2 = parent2.removeNode(nodeId);
26035         graph = graph.replace(parent2);
26036         if (parent2.isDegenerate()) {
26037           graph = actionDeleteWay(parent2.id)(graph);
26038         }
26039       });
26040       graph.parentRelations(node).forEach(function(parent2) {
26041         parent2 = parent2.removeMembersWithID(nodeId);
26042         graph = graph.replace(parent2);
26043         if (parent2.isDegenerate()) {
26044           graph = actionDeleteRelation(parent2.id)(graph);
26045         }
26046       });
26047       return graph.remove(node);
26048     };
26049     return action;
26050   }
26051
26052   // modules/actions/connect.js
26053   function actionConnect(nodeIDs) {
26054     var action = function(graph) {
26055       var survivor;
26056       var node;
26057       var parents;
26058       var i3, j3;
26059       nodeIDs.reverse();
26060       var interestingIDs = [];
26061       for (i3 = 0; i3 < nodeIDs.length; i3++) {
26062         node = graph.entity(nodeIDs[i3]);
26063         if (node.hasInterestingTags()) {
26064           if (!node.isNew()) {
26065             interestingIDs.push(node.id);
26066           }
26067         }
26068       }
26069       survivor = graph.entity(utilOldestID(interestingIDs.length > 0 ? interestingIDs : nodeIDs));
26070       for (i3 = 0; i3 < nodeIDs.length; i3++) {
26071         node = graph.entity(nodeIDs[i3]);
26072         if (node.id === survivor.id) continue;
26073         parents = graph.parentWays(node);
26074         for (j3 = 0; j3 < parents.length; j3++) {
26075           graph = graph.replace(parents[j3].replaceNode(node.id, survivor.id));
26076         }
26077         parents = graph.parentRelations(node);
26078         for (j3 = 0; j3 < parents.length; j3++) {
26079           graph = graph.replace(parents[j3].replaceMember(node, survivor));
26080         }
26081         survivor = survivor.mergeTags(node.tags);
26082         graph = actionDeleteNode(node.id)(graph);
26083       }
26084       graph = graph.replace(survivor);
26085       parents = graph.parentWays(survivor);
26086       for (i3 = 0; i3 < parents.length; i3++) {
26087         if (parents[i3].isDegenerate()) {
26088           graph = actionDeleteWay(parents[i3].id)(graph);
26089         }
26090       }
26091       return graph;
26092     };
26093     action.disabled = function(graph) {
26094       var seen = {};
26095       var restrictionIDs = [];
26096       var survivor;
26097       var node, way;
26098       var relations, relation, role;
26099       var i3, j3, k3;
26100       survivor = graph.entity(utilOldestID(nodeIDs));
26101       for (i3 = 0; i3 < nodeIDs.length; i3++) {
26102         node = graph.entity(nodeIDs[i3]);
26103         relations = graph.parentRelations(node);
26104         for (j3 = 0; j3 < relations.length; j3++) {
26105           relation = relations[j3];
26106           role = relation.memberById(node.id).role || "";
26107           if (relation.hasFromViaTo()) {
26108             restrictionIDs.push(relation.id);
26109           }
26110           if (seen[relation.id] !== void 0 && seen[relation.id] !== role) {
26111             return "relation";
26112           } else {
26113             seen[relation.id] = role;
26114           }
26115         }
26116       }
26117       for (i3 = 0; i3 < nodeIDs.length; i3++) {
26118         node = graph.entity(nodeIDs[i3]);
26119         var parents = graph.parentWays(node);
26120         for (j3 = 0; j3 < parents.length; j3++) {
26121           var parent2 = parents[j3];
26122           relations = graph.parentRelations(parent2);
26123           for (k3 = 0; k3 < relations.length; k3++) {
26124             relation = relations[k3];
26125             if (relation.hasFromViaTo()) {
26126               restrictionIDs.push(relation.id);
26127             }
26128           }
26129         }
26130       }
26131       restrictionIDs = utilArrayUniq(restrictionIDs);
26132       for (i3 = 0; i3 < restrictionIDs.length; i3++) {
26133         relation = graph.entity(restrictionIDs[i3]);
26134         if (!relation.isComplete(graph)) continue;
26135         var memberWays = relation.members.filter(function(m3) {
26136           return m3.type === "way";
26137         }).map(function(m3) {
26138           return graph.entity(m3.id);
26139         });
26140         memberWays = utilArrayUniq(memberWays);
26141         var f2 = relation.memberByRole("from");
26142         var t2 = relation.memberByRole("to");
26143         var isUturn = f2.id === t2.id;
26144         var nodes = { from: [], via: [], to: [], keyfrom: [], keyto: [] };
26145         for (j3 = 0; j3 < relation.members.length; j3++) {
26146           collectNodes(relation.members[j3], nodes);
26147         }
26148         nodes.keyfrom = utilArrayUniq(nodes.keyfrom.filter(hasDuplicates));
26149         nodes.keyto = utilArrayUniq(nodes.keyto.filter(hasDuplicates));
26150         var filter2 = keyNodeFilter(nodes.keyfrom, nodes.keyto);
26151         nodes.from = nodes.from.filter(filter2);
26152         nodes.via = nodes.via.filter(filter2);
26153         nodes.to = nodes.to.filter(filter2);
26154         var connectFrom = false;
26155         var connectVia = false;
26156         var connectTo = false;
26157         var connectKeyFrom = false;
26158         var connectKeyTo = false;
26159         for (j3 = 0; j3 < nodeIDs.length; j3++) {
26160           var n3 = nodeIDs[j3];
26161           if (nodes.from.indexOf(n3) !== -1) {
26162             connectFrom = true;
26163           }
26164           if (nodes.via.indexOf(n3) !== -1) {
26165             connectVia = true;
26166           }
26167           if (nodes.to.indexOf(n3) !== -1) {
26168             connectTo = true;
26169           }
26170           if (nodes.keyfrom.indexOf(n3) !== -1) {
26171             connectKeyFrom = true;
26172           }
26173           if (nodes.keyto.indexOf(n3) !== -1) {
26174             connectKeyTo = true;
26175           }
26176         }
26177         if (connectFrom && connectTo && !isUturn) {
26178           return "restriction";
26179         }
26180         if (connectFrom && connectVia) {
26181           return "restriction";
26182         }
26183         if (connectTo && connectVia) {
26184           return "restriction";
26185         }
26186         if (connectKeyFrom || connectKeyTo) {
26187           if (nodeIDs.length !== 2) {
26188             return "restriction";
26189           }
26190           var n0 = null;
26191           var n1 = null;
26192           for (j3 = 0; j3 < memberWays.length; j3++) {
26193             way = memberWays[j3];
26194             if (way.contains(nodeIDs[0])) {
26195               n0 = nodeIDs[0];
26196             }
26197             if (way.contains(nodeIDs[1])) {
26198               n1 = nodeIDs[1];
26199             }
26200           }
26201           if (n0 && n1) {
26202             var ok = false;
26203             for (j3 = 0; j3 < memberWays.length; j3++) {
26204               way = memberWays[j3];
26205               if (way.areAdjacent(n0, n1)) {
26206                 ok = true;
26207                 break;
26208               }
26209             }
26210             if (!ok) {
26211               return "restriction";
26212             }
26213           }
26214         }
26215         for (j3 = 0; j3 < memberWays.length; j3++) {
26216           way = memberWays[j3].update({});
26217           for (k3 = 0; k3 < nodeIDs.length; k3++) {
26218             if (nodeIDs[k3] === survivor.id) continue;
26219             if (way.areAdjacent(nodeIDs[k3], survivor.id)) {
26220               way = way.removeNode(nodeIDs[k3]);
26221             } else {
26222               way = way.replaceNode(nodeIDs[k3], survivor.id);
26223             }
26224           }
26225           if (way.isDegenerate()) {
26226             return "restriction";
26227           }
26228         }
26229       }
26230       return false;
26231       function hasDuplicates(n4, i4, arr) {
26232         return arr.indexOf(n4) !== arr.lastIndexOf(n4);
26233       }
26234       function keyNodeFilter(froms, tos) {
26235         return function(n4) {
26236           return froms.indexOf(n4) === -1 && tos.indexOf(n4) === -1;
26237         };
26238       }
26239       function collectNodes(member, collection) {
26240         var entity = graph.hasEntity(member.id);
26241         if (!entity) return;
26242         var role2 = member.role || "";
26243         if (!collection[role2]) {
26244           collection[role2] = [];
26245         }
26246         if (member.type === "node") {
26247           collection[role2].push(member.id);
26248           if (role2 === "via") {
26249             collection.keyfrom.push(member.id);
26250             collection.keyto.push(member.id);
26251           }
26252         } else if (member.type === "way") {
26253           collection[role2].push.apply(collection[role2], entity.nodes);
26254           if (role2 === "from" || role2 === "via") {
26255             collection.keyfrom.push(entity.first());
26256             collection.keyfrom.push(entity.last());
26257           }
26258           if (role2 === "to" || role2 === "via") {
26259             collection.keyto.push(entity.first());
26260             collection.keyto.push(entity.last());
26261           }
26262         }
26263       }
26264     };
26265     return action;
26266   }
26267
26268   // modules/actions/copy_entities.js
26269   function actionCopyEntities(ids, fromGraph) {
26270     var _copies = {};
26271     var action = function(graph) {
26272       ids.forEach(function(id3) {
26273         fromGraph.entity(id3).copy(fromGraph, _copies);
26274       });
26275       for (var id2 in _copies) {
26276         graph = graph.replace(_copies[id2]);
26277       }
26278       return graph;
26279     };
26280     action.copies = function() {
26281       return _copies;
26282     };
26283     return action;
26284   }
26285
26286   // modules/actions/delete_member.js
26287   function actionDeleteMember(relationId, memberIndex) {
26288     return function(graph) {
26289       var relation = graph.entity(relationId).removeMember(memberIndex);
26290       graph = graph.replace(relation);
26291       if (relation.isDegenerate()) {
26292         graph = actionDeleteRelation(relation.id)(graph);
26293       }
26294       return graph;
26295     };
26296   }
26297
26298   // modules/actions/discard_tags.js
26299   function actionDiscardTags(difference2, discardTags) {
26300     discardTags = discardTags || {};
26301     return (graph) => {
26302       difference2.modified().forEach(checkTags);
26303       difference2.created().forEach(checkTags);
26304       return graph;
26305       function checkTags(entity) {
26306         const keys2 = Object.keys(entity.tags);
26307         let didDiscard = false;
26308         let tags = {};
26309         for (let i3 = 0; i3 < keys2.length; i3++) {
26310           const k3 = keys2[i3];
26311           const v3 = entity.tags[k3];
26312           if (discardTags[k3] === true || typeof discardTags[k3] === "object" && discardTags[k3][v3] || !entity.tags[k3]) {
26313             didDiscard = true;
26314           } else {
26315             tags[k3] = entity.tags[k3];
26316           }
26317         }
26318         if (didDiscard) {
26319           graph = graph.replace(entity.update({ tags }));
26320         }
26321       }
26322     };
26323   }
26324
26325   // modules/actions/disconnect.js
26326   function actionDisconnect(nodeId, newNodeId) {
26327     var wayIds;
26328     var disconnectableRelationTypes = {
26329       "associatedStreet": true,
26330       "enforcement": true,
26331       "site": true
26332     };
26333     var action = function(graph) {
26334       var node = graph.entity(nodeId);
26335       var connections = action.connections(graph);
26336       connections.forEach(function(connection) {
26337         var way = graph.entity(connection.wayID);
26338         var newNode = osmNode({ id: newNodeId, loc: node.loc, tags: node.tags });
26339         graph = graph.replace(newNode);
26340         if (connection.index === 0 && way.isArea()) {
26341           graph = graph.replace(way.replaceNode(way.nodes[0], newNode.id));
26342         } else if (way.isClosed() && connection.index === way.nodes.length - 1) {
26343           graph = graph.replace(way.unclose().addNode(newNode.id));
26344         } else {
26345           graph = graph.replace(way.updateNode(newNode.id, connection.index));
26346         }
26347       });
26348       return graph;
26349     };
26350     action.connections = function(graph) {
26351       var candidates = [];
26352       var keeping = false;
26353       var parentWays = graph.parentWays(graph.entity(nodeId));
26354       var way, waynode;
26355       for (var i3 = 0; i3 < parentWays.length; i3++) {
26356         way = parentWays[i3];
26357         if (wayIds && wayIds.indexOf(way.id) === -1) {
26358           keeping = true;
26359           continue;
26360         }
26361         if (way.isArea() && way.nodes[0] === nodeId) {
26362           candidates.push({ wayID: way.id, index: 0 });
26363         } else {
26364           for (var j3 = 0; j3 < way.nodes.length; j3++) {
26365             waynode = way.nodes[j3];
26366             if (waynode === nodeId) {
26367               if (way.isClosed() && parentWays.length > 1 && wayIds && wayIds.indexOf(way.id) !== -1 && j3 === way.nodes.length - 1) {
26368                 continue;
26369               }
26370               candidates.push({ wayID: way.id, index: j3 });
26371             }
26372           }
26373         }
26374       }
26375       return keeping ? candidates : candidates.slice(1);
26376     };
26377     action.disabled = function(graph) {
26378       var connections = action.connections(graph);
26379       if (connections.length === 0) return "not_connected";
26380       var parentWays = graph.parentWays(graph.entity(nodeId));
26381       var seenRelationIds = {};
26382       var sharedRelation;
26383       parentWays.forEach(function(way) {
26384         var relations = graph.parentRelations(way);
26385         relations.filter((relation) => !disconnectableRelationTypes[relation.tags.type]).forEach(function(relation) {
26386           if (relation.id in seenRelationIds) {
26387             if (wayIds) {
26388               if (wayIds.indexOf(way.id) !== -1 || wayIds.indexOf(seenRelationIds[relation.id]) !== -1) {
26389                 sharedRelation = relation;
26390               }
26391             } else {
26392               sharedRelation = relation;
26393             }
26394           } else {
26395             seenRelationIds[relation.id] = way.id;
26396           }
26397         });
26398       });
26399       if (sharedRelation) return "relation";
26400     };
26401     action.limitWays = function(val) {
26402       if (!arguments.length) return wayIds;
26403       wayIds = val;
26404       return action;
26405     };
26406     return action;
26407   }
26408
26409   // modules/actions/extract.js
26410   function actionExtract(entityID, projection2) {
26411     var extractedNodeID;
26412     var action = function(graph, shiftKeyPressed) {
26413       var entity = graph.entity(entityID);
26414       if (entity.type === "node") {
26415         return extractFromNode(entity, graph, shiftKeyPressed);
26416       }
26417       return extractFromWayOrRelation(entity, graph);
26418     };
26419     function extractFromNode(node, graph, shiftKeyPressed) {
26420       extractedNodeID = node.id;
26421       var replacement = osmNode({ loc: node.loc });
26422       graph = graph.replace(replacement);
26423       graph = graph.parentWays(node).reduce(function(accGraph, parentWay) {
26424         return accGraph.replace(parentWay.replaceNode(entityID, replacement.id));
26425       }, graph);
26426       if (!shiftKeyPressed) return graph;
26427       return graph.parentRelations(node).reduce(function(accGraph, parentRel) {
26428         return accGraph.replace(parentRel.replaceMember(node, replacement));
26429       }, graph);
26430     }
26431     function extractFromWayOrRelation(entity, graph) {
26432       var fromGeometry = entity.geometry(graph);
26433       var keysToCopyAndRetain = ["source", "wheelchair"];
26434       var keysToRetain = ["area"];
26435       var buildingKeysToRetain = ["architect", "building", "height", "layer", "nycdoitt:bin", "ref:GB:uprn", "ref:linz:building_id"];
26436       var extractedLoc = path_default(projection2).centroid(entity.asGeoJSON(graph));
26437       extractedLoc = extractedLoc && projection2.invert(extractedLoc);
26438       if (!extractedLoc || !isFinite(extractedLoc[0]) || !isFinite(extractedLoc[1])) {
26439         extractedLoc = entity.extent(graph).center();
26440       }
26441       var indoorAreaValues = {
26442         area: true,
26443         corridor: true,
26444         elevator: true,
26445         level: true,
26446         room: true
26447       };
26448       var isBuilding = entity.tags.building && entity.tags.building !== "no" || entity.tags["building:part"] && entity.tags["building:part"] !== "no";
26449       var isIndoorArea = fromGeometry === "area" && entity.tags.indoor && indoorAreaValues[entity.tags.indoor];
26450       var entityTags = Object.assign({}, entity.tags);
26451       var pointTags = {};
26452       for (var key in entityTags) {
26453         if (entity.type === "relation" && key === "type") {
26454           continue;
26455         }
26456         if (keysToRetain.indexOf(key) !== -1) {
26457           continue;
26458         }
26459         if (isBuilding) {
26460           if (buildingKeysToRetain.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/)) continue;
26461         }
26462         if (isIndoorArea && key === "indoor") {
26463           continue;
26464         }
26465         pointTags[key] = entityTags[key];
26466         if (keysToCopyAndRetain.indexOf(key) !== -1 || key.match(/^addr:.{1,}/)) {
26467           continue;
26468         } else if (isIndoorArea && key === "level") {
26469           continue;
26470         }
26471         delete entityTags[key];
26472       }
26473       if (!isBuilding && !isIndoorArea && fromGeometry === "area") {
26474         entityTags.area = "yes";
26475       }
26476       var replacement = osmNode({ loc: extractedLoc, tags: pointTags });
26477       graph = graph.replace(replacement);
26478       extractedNodeID = replacement.id;
26479       return graph.replace(entity.update({ tags: entityTags }));
26480     }
26481     action.getExtractedNodeID = function() {
26482       return extractedNodeID;
26483     };
26484     return action;
26485   }
26486
26487   // modules/actions/join.js
26488   function actionJoin(ids) {
26489     function groupEntitiesByGeometry(graph) {
26490       var entities = ids.map(function(id2) {
26491         return graph.entity(id2);
26492       });
26493       return Object.assign(
26494         { line: [] },
26495         utilArrayGroupBy(entities, function(entity) {
26496           return entity.geometry(graph);
26497         })
26498       );
26499     }
26500     var action = function(graph) {
26501       var ways = ids.map(graph.entity, graph);
26502       var survivorID = utilOldestID(ways.map((way) => way.id));
26503       ways.sort(function(a2, b3) {
26504         var aSided = a2.isSided();
26505         var bSided = b3.isSided();
26506         return aSided && !bSided ? -1 : bSided && !aSided ? 1 : 0;
26507       });
26508       var sequences = osmJoinWays(ways, graph);
26509       var joined = sequences[0];
26510       graph = sequences.actions.reduce(function(g3, action2) {
26511         return action2(g3);
26512       }, graph);
26513       var survivor = graph.entity(survivorID);
26514       survivor = survivor.update({ nodes: joined.nodes.map(function(n3) {
26515         return n3.id;
26516       }) });
26517       graph = graph.replace(survivor);
26518       joined.forEach(function(way) {
26519         if (way.id === survivorID) return;
26520         graph.parentRelations(way).forEach(function(parent2) {
26521           graph = graph.replace(parent2.replaceMember(way, survivor));
26522         });
26523         const summedTags = {};
26524         for (const key in way.tags) {
26525           if (!canSumTags(key, way.tags, survivor.tags)) continue;
26526           summedTags[key] = (+way.tags[key] + +survivor.tags[key]).toString();
26527         }
26528         survivor = survivor.mergeTags(way.tags, summedTags);
26529         graph = graph.replace(survivor);
26530         graph = actionDeleteWay(way.id)(graph);
26531       });
26532       function checkForSimpleMultipolygon() {
26533         if (!survivor.isClosed()) return;
26534         var multipolygons = graph.parentMultipolygons(survivor).filter(function(multipolygon2) {
26535           return multipolygon2.members.length === 1;
26536         });
26537         if (multipolygons.length !== 1) return;
26538         var multipolygon = multipolygons[0];
26539         for (var key in survivor.tags) {
26540           if (multipolygon.tags[key] && // don't collapse if tags cannot be cleanly merged
26541           multipolygon.tags[key] !== survivor.tags[key]) return;
26542         }
26543         survivor = survivor.mergeTags(multipolygon.tags);
26544         graph = graph.replace(survivor);
26545         graph = actionDeleteRelation(
26546           multipolygon.id,
26547           true
26548           /* allow untagged members */
26549         )(graph);
26550         var tags = Object.assign({}, survivor.tags);
26551         if (survivor.geometry(graph) !== "area") {
26552           tags.area = "yes";
26553         }
26554         delete tags.type;
26555         survivor = survivor.update({ tags });
26556         graph = graph.replace(survivor);
26557       }
26558       checkForSimpleMultipolygon();
26559       return graph;
26560     };
26561     action.resultingWayNodesLength = function(graph) {
26562       return ids.reduce(function(count, id2) {
26563         return count + graph.entity(id2).nodes.length;
26564       }, 0) - ids.length - 1;
26565     };
26566     action.disabled = function(graph) {
26567       var geometries = groupEntitiesByGeometry(graph);
26568       if (ids.length < 2 || ids.length !== geometries.line.length) {
26569         return "not_eligible";
26570       }
26571       var joined = osmJoinWays(ids.map(graph.entity, graph), graph);
26572       if (joined.length > 1) {
26573         return "not_adjacent";
26574       }
26575       var i3;
26576       var sortedParentRelations = function(id2) {
26577         return graph.parentRelations(graph.entity(id2)).filter((rel) => !rel.isRestriction() && !rel.isConnectivity()).sort((a2, b3) => a2.id.localeCompare(b3.id));
26578       };
26579       var relsA = sortedParentRelations(ids[0]);
26580       for (i3 = 1; i3 < ids.length; i3++) {
26581         var relsB = sortedParentRelations(ids[i3]);
26582         if (!utilArrayIdentical(relsA, relsB)) {
26583           return "conflicting_relations";
26584         }
26585       }
26586       for (i3 = 0; i3 < ids.length - 1; i3++) {
26587         for (var j3 = i3 + 1; j3 < ids.length; j3++) {
26588           var path1 = graph.childNodes(graph.entity(ids[i3])).map(function(e3) {
26589             return e3.loc;
26590           });
26591           var path2 = graph.childNodes(graph.entity(ids[j3])).map(function(e3) {
26592             return e3.loc;
26593           });
26594           var intersections = geoPathIntersections(path1, path2);
26595           var common = utilArrayIntersection(
26596             joined[0].nodes.map(function(n3) {
26597               return n3.loc.toString();
26598             }),
26599             intersections.map(function(n3) {
26600               return n3.toString();
26601             })
26602           );
26603           if (common.length !== intersections.length) {
26604             return "paths_intersect";
26605           }
26606         }
26607       }
26608       var nodeIds = joined[0].nodes.map(function(n3) {
26609         return n3.id;
26610       }).slice(1, -1);
26611       var relation;
26612       var tags = {};
26613       var conflicting = false;
26614       joined[0].forEach(function(way) {
26615         var parents = graph.parentRelations(way);
26616         parents.forEach(function(parent2) {
26617           if ((parent2.isRestriction() || parent2.isConnectivity()) && parent2.members.some(function(m3) {
26618             return nodeIds.indexOf(m3.id) >= 0;
26619           })) {
26620             relation = parent2;
26621           }
26622         });
26623         for (var k3 in way.tags) {
26624           if (!(k3 in tags)) {
26625             tags[k3] = way.tags[k3];
26626           } else if (canSumTags(k3, tags, way.tags)) {
26627             tags[k3] = (+tags[k3] + +way.tags[k3]).toString();
26628           } else if (tags[k3] && osmIsInterestingTag(k3) && tags[k3] !== way.tags[k3]) {
26629             conflicting = true;
26630           }
26631         }
26632       });
26633       if (relation) {
26634         return relation.isRestriction() ? "restriction" : "connectivity";
26635       }
26636       if (conflicting) {
26637         return "conflicting_tags";
26638       }
26639     };
26640     function canSumTags(key, tagsA, tagsB) {
26641       return osmSummableTags.has(key) && isFinite(tagsA[key] && isFinite(tagsB[key]));
26642     }
26643     return action;
26644   }
26645
26646   // modules/actions/merge.js
26647   function actionMerge(ids) {
26648     function groupEntitiesByGeometry(graph) {
26649       var entities = ids.map(function(id2) {
26650         return graph.entity(id2);
26651       });
26652       return Object.assign(
26653         { point: [], area: [], line: [], relation: [] },
26654         utilArrayGroupBy(entities, function(entity) {
26655           return entity.geometry(graph);
26656         })
26657       );
26658     }
26659     var action = function(graph) {
26660       var geometries = groupEntitiesByGeometry(graph);
26661       var target = geometries.area[0] || geometries.line[0];
26662       var points = geometries.point;
26663       points.forEach(function(point) {
26664         target = target.mergeTags(point.tags);
26665         graph = graph.replace(target);
26666         graph.parentRelations(point).forEach(function(parent2) {
26667           graph = graph.replace(parent2.replaceMember(point, target));
26668         });
26669         var nodes = utilArrayUniq(graph.childNodes(target));
26670         var removeNode = point;
26671         if (!point.isNew()) {
26672           var inserted = false;
26673           var canBeReplaced = function(node2) {
26674             return !(graph.parentWays(node2).length > 1 || graph.parentRelations(node2).length);
26675           };
26676           var replaceNode = function(node2) {
26677             graph = graph.replace(point.update({ tags: node2.tags, loc: node2.loc }));
26678             target = target.replaceNode(node2.id, point.id);
26679             graph = graph.replace(target);
26680             removeNode = node2;
26681             inserted = true;
26682           };
26683           var i3;
26684           var node;
26685           for (i3 = 0; i3 < nodes.length; i3++) {
26686             node = nodes[i3];
26687             if (canBeReplaced(node) && node.isNew()) {
26688               replaceNode(node);
26689               break;
26690             }
26691           }
26692           if (!inserted && point.hasInterestingTags()) {
26693             for (i3 = 0; i3 < nodes.length; i3++) {
26694               node = nodes[i3];
26695               if (canBeReplaced(node) && !node.hasInterestingTags()) {
26696                 replaceNode(node);
26697                 break;
26698               }
26699             }
26700             if (!inserted) {
26701               for (i3 = 0; i3 < nodes.length; i3++) {
26702                 node = nodes[i3];
26703                 if (canBeReplaced(node) && utilCompareIDs(point.id, node.id) < 0) {
26704                   replaceNode(node);
26705                   break;
26706                 }
26707               }
26708             }
26709           }
26710         }
26711         graph = graph.remove(removeNode);
26712       });
26713       if (target.tags.area === "yes") {
26714         var tags = Object.assign({}, target.tags);
26715         delete tags.area;
26716         if (osmTagSuggestingArea(tags)) {
26717           target = target.update({ tags });
26718           graph = graph.replace(target);
26719         }
26720       }
26721       return graph;
26722     };
26723     action.disabled = function(graph) {
26724       var geometries = groupEntitiesByGeometry(graph);
26725       if (geometries.point.length === 0 || geometries.area.length + geometries.line.length !== 1 || geometries.relation.length !== 0) {
26726         return "not_eligible";
26727       }
26728     };
26729     return action;
26730   }
26731
26732   // modules/actions/merge_nodes.js
26733   function actionMergeNodes(nodeIDs, loc) {
26734     function chooseLoc(graph) {
26735       if (!nodeIDs.length) return null;
26736       var sum = [0, 0];
26737       var interestingCount = 0;
26738       var interestingLoc;
26739       for (var i3 = 0; i3 < nodeIDs.length; i3++) {
26740         var node = graph.entity(nodeIDs[i3]);
26741         if (node.hasInterestingTags()) {
26742           interestingLoc = ++interestingCount === 1 ? node.loc : null;
26743         }
26744         sum = geoVecAdd(sum, node.loc);
26745       }
26746       return interestingLoc || geoVecScale(sum, 1 / nodeIDs.length);
26747     }
26748     var action = function(graph) {
26749       if (nodeIDs.length < 2) return graph;
26750       var toLoc = loc;
26751       if (!toLoc) {
26752         toLoc = chooseLoc(graph);
26753       }
26754       for (var i3 = 0; i3 < nodeIDs.length; i3++) {
26755         var node = graph.entity(nodeIDs[i3]);
26756         if (node.loc !== toLoc) {
26757           graph = graph.replace(node.move(toLoc));
26758         }
26759       }
26760       return actionConnect(nodeIDs)(graph);
26761     };
26762     action.disabled = function(graph) {
26763       if (nodeIDs.length < 2) return "not_eligible";
26764       for (var i3 = 0; i3 < nodeIDs.length; i3++) {
26765         var entity = graph.entity(nodeIDs[i3]);
26766         if (entity.type !== "node") return "not_eligible";
26767       }
26768       return actionConnect(nodeIDs).disabled(graph);
26769     };
26770     return action;
26771   }
26772
26773   // modules/osm/changeset.js
26774   function osmChangeset() {
26775     if (!(this instanceof osmChangeset)) {
26776       return new osmChangeset().initialize(arguments);
26777     } else if (arguments.length) {
26778       this.initialize(arguments);
26779     }
26780   }
26781   osmEntity.changeset = osmChangeset;
26782   osmChangeset.prototype = Object.create(osmEntity.prototype);
26783   Object.assign(osmChangeset.prototype, {
26784     type: "changeset",
26785     extent: function() {
26786       return new geoExtent();
26787     },
26788     geometry: function() {
26789       return "changeset";
26790     },
26791     asJXON: function() {
26792       return {
26793         osm: {
26794           changeset: {
26795             tag: Object.keys(this.tags).map(function(k3) {
26796               return { "@k": k3, "@v": this.tags[k3] };
26797             }, this),
26798             "@version": 0.6,
26799             "@generator": "iD"
26800           }
26801         }
26802       };
26803     },
26804     // Generate [osmChange](http://wiki.openstreetmap.org/wiki/OsmChange)
26805     // XML. Returns a string.
26806     osmChangeJXON: function(changes) {
26807       var changeset_id = this.id;
26808       function nest(x3, order) {
26809         var groups = {};
26810         for (var i3 = 0; i3 < x3.length; i3++) {
26811           var tagName = Object.keys(x3[i3])[0];
26812           if (!groups[tagName]) groups[tagName] = [];
26813           groups[tagName].push(x3[i3][tagName]);
26814         }
26815         var ordered = {};
26816         order.forEach(function(o2) {
26817           if (groups[o2]) ordered[o2] = groups[o2];
26818         });
26819         return ordered;
26820       }
26821       function sort(changes2) {
26822         function resolve(item) {
26823           return relations.find(function(relation2) {
26824             return item.keyAttributes.type === "relation" && item.keyAttributes.ref === relation2["@id"];
26825           });
26826         }
26827         function isNew(item) {
26828           return !sorted[item["@id"]] && !processing.find(function(proc) {
26829             return proc["@id"] === item["@id"];
26830           });
26831         }
26832         var processing = [];
26833         var sorted = {};
26834         var relations = changes2.relation;
26835         if (!relations) return changes2;
26836         for (var i3 = 0; i3 < relations.length; i3++) {
26837           var relation = relations[i3];
26838           if (!sorted[relation["@id"]]) {
26839             processing.push(relation);
26840           }
26841           while (processing.length > 0) {
26842             var next = processing[0], deps = next.member.map(resolve).filter(Boolean).filter(isNew);
26843             if (deps.length === 0) {
26844               sorted[next["@id"]] = next;
26845               processing.shift();
26846             } else {
26847               processing = deps.concat(processing);
26848             }
26849           }
26850         }
26851         changes2.relation = Object.values(sorted);
26852         return changes2;
26853       }
26854       function rep(entity) {
26855         return entity.asJXON(changeset_id);
26856       }
26857       return {
26858         osmChange: {
26859           "@version": 0.6,
26860           "@generator": "iD",
26861           "create": sort(nest(changes.created.map(rep), ["node", "way", "relation"])),
26862           "modify": nest(changes.modified.map(rep), ["node", "way", "relation"]),
26863           "delete": Object.assign(nest(changes.deleted.map(rep), ["relation", "way", "node"]), { "@if-unused": true })
26864         }
26865       };
26866     },
26867     asGeoJSON: function() {
26868       return {};
26869     }
26870   });
26871
26872   // modules/osm/note.js
26873   function osmNote() {
26874     if (!(this instanceof osmNote)) {
26875       return new osmNote().initialize(arguments);
26876     } else if (arguments.length) {
26877       this.initialize(arguments);
26878     }
26879   }
26880   osmNote.id = function() {
26881     return osmNote.id.next--;
26882   };
26883   osmNote.id.next = -1;
26884   Object.assign(osmNote.prototype, {
26885     type: "note",
26886     initialize: function(sources) {
26887       for (var i3 = 0; i3 < sources.length; ++i3) {
26888         var source = sources[i3];
26889         for (var prop in source) {
26890           if (Object.prototype.hasOwnProperty.call(source, prop)) {
26891             if (source[prop] === void 0) {
26892               delete this[prop];
26893             } else {
26894               this[prop] = source[prop];
26895             }
26896           }
26897         }
26898       }
26899       if (!this.id) {
26900         this.id = osmNote.id().toString();
26901       }
26902       return this;
26903     },
26904     extent: function() {
26905       return new geoExtent(this.loc);
26906     },
26907     update: function(attrs) {
26908       return osmNote(this, attrs);
26909     },
26910     isNew: function() {
26911       return this.id < 0;
26912     },
26913     move: function(loc) {
26914       return this.update({ loc });
26915     }
26916   });
26917
26918   // modules/osm/relation.js
26919   function osmRelation() {
26920     if (!(this instanceof osmRelation)) {
26921       return new osmRelation().initialize(arguments);
26922     } else if (arguments.length) {
26923       this.initialize(arguments);
26924     }
26925   }
26926   osmEntity.relation = osmRelation;
26927   osmRelation.prototype = Object.create(osmEntity.prototype);
26928   osmRelation.creationOrder = function(a2, b3) {
26929     var aId = parseInt(osmEntity.id.toOSM(a2.id), 10);
26930     var bId = parseInt(osmEntity.id.toOSM(b3.id), 10);
26931     if (aId < 0 || bId < 0) return aId - bId;
26932     return bId - aId;
26933   };
26934   var prototype3 = {
26935     type: "relation",
26936     members: [],
26937     copy: function(resolver, copies) {
26938       if (copies[this.id]) return copies[this.id];
26939       var copy2 = osmEntity.prototype.copy.call(this, resolver, copies);
26940       var members = this.members.map(function(member) {
26941         return Object.assign({}, member, { id: resolver.entity(member.id).copy(resolver, copies).id });
26942       });
26943       copy2 = copy2.update({ members });
26944       copies[this.id] = copy2;
26945       return copy2;
26946     },
26947     extent: function(resolver, memo) {
26948       return resolver.transient(this, "extent", function() {
26949         if (memo && memo[this.id]) return geoExtent();
26950         memo = memo || {};
26951         memo[this.id] = true;
26952         var extent = geoExtent();
26953         for (var i3 = 0; i3 < this.members.length; i3++) {
26954           var member = resolver.hasEntity(this.members[i3].id);
26955           if (member) {
26956             extent._extend(member.extent(resolver, memo));
26957           }
26958         }
26959         return extent;
26960       });
26961     },
26962     geometry: function(graph) {
26963       return graph.transient(this, "geometry", function() {
26964         return this.isMultipolygon() ? "area" : "relation";
26965       });
26966     },
26967     isDegenerate: function() {
26968       return this.members.length === 0;
26969     },
26970     // Return an array of members, each extended with an 'index' property whose value
26971     // is the member index.
26972     indexedMembers: function() {
26973       var result = new Array(this.members.length);
26974       for (var i3 = 0; i3 < this.members.length; i3++) {
26975         result[i3] = Object.assign({}, this.members[i3], { index: i3 });
26976       }
26977       return result;
26978     },
26979     // Return the first member with the given role. A copy of the member object
26980     // is returned, extended with an 'index' property whose value is the member index.
26981     memberByRole: function(role) {
26982       for (var i3 = 0; i3 < this.members.length; i3++) {
26983         if (this.members[i3].role === role) {
26984           return Object.assign({}, this.members[i3], { index: i3 });
26985         }
26986       }
26987     },
26988     // Same as memberByRole, but returns all members with the given role
26989     membersByRole: function(role) {
26990       var result = [];
26991       for (var i3 = 0; i3 < this.members.length; i3++) {
26992         if (this.members[i3].role === role) {
26993           result.push(Object.assign({}, this.members[i3], { index: i3 }));
26994         }
26995       }
26996       return result;
26997     },
26998     // Return the first member with the given id. A copy of the member object
26999     // is returned, extended with an 'index' property whose value is the member index.
27000     memberById: function(id2) {
27001       for (var i3 = 0; i3 < this.members.length; i3++) {
27002         if (this.members[i3].id === id2) {
27003           return Object.assign({}, this.members[i3], { index: i3 });
27004         }
27005       }
27006     },
27007     // Return the first member with the given id and role. A copy of the member object
27008     // is returned, extended with an 'index' property whose value is the member index.
27009     memberByIdAndRole: function(id2, role) {
27010       for (var i3 = 0; i3 < this.members.length; i3++) {
27011         if (this.members[i3].id === id2 && this.members[i3].role === role) {
27012           return Object.assign({}, this.members[i3], { index: i3 });
27013         }
27014       }
27015     },
27016     addMember: function(member, index) {
27017       var members = this.members.slice();
27018       members.splice(index === void 0 ? members.length : index, 0, member);
27019       return this.update({ members });
27020     },
27021     updateMember: function(member, index) {
27022       var members = this.members.slice();
27023       members.splice(index, 1, Object.assign({}, members[index], member));
27024       return this.update({ members });
27025     },
27026     removeMember: function(index) {
27027       var members = this.members.slice();
27028       members.splice(index, 1);
27029       return this.update({ members });
27030     },
27031     removeMembersWithID: function(id2) {
27032       var members = this.members.filter(function(m3) {
27033         return m3.id !== id2;
27034       });
27035       return this.update({ members });
27036     },
27037     moveMember: function(fromIndex, toIndex) {
27038       var members = this.members.slice();
27039       members.splice(toIndex, 0, members.splice(fromIndex, 1)[0]);
27040       return this.update({ members });
27041     },
27042     // Wherever a member appears with id `needle.id`, replace it with a member
27043     // with id `replacement.id`, type `replacement.type`, and the original role,
27044     // By default, adding a duplicate member (by id and role) is prevented.
27045     // Return an updated relation.
27046     replaceMember: function(needle, replacement, keepDuplicates) {
27047       if (!this.memberById(needle.id)) return this;
27048       var members = [];
27049       for (var i3 = 0; i3 < this.members.length; i3++) {
27050         var member = this.members[i3];
27051         if (member.id !== needle.id) {
27052           members.push(member);
27053         } else if (keepDuplicates || !this.memberByIdAndRole(replacement.id, member.role)) {
27054           members.push({ id: replacement.id, type: replacement.type, role: member.role });
27055         }
27056       }
27057       return this.update({ members });
27058     },
27059     asJXON: function(changeset_id) {
27060       var r2 = {
27061         relation: {
27062           "@id": this.osmId(),
27063           "@version": this.version || 0,
27064           member: this.members.map(function(member) {
27065             return {
27066               keyAttributes: {
27067                 type: member.type,
27068                 role: member.role,
27069                 ref: osmEntity.id.toOSM(member.id)
27070               }
27071             };
27072           }, this),
27073           tag: Object.keys(this.tags).map(function(k3) {
27074             return { keyAttributes: { k: k3, v: this.tags[k3] } };
27075           }, this)
27076         }
27077       };
27078       if (changeset_id) {
27079         r2.relation["@changeset"] = changeset_id;
27080       }
27081       return r2;
27082     },
27083     asGeoJSON: function(resolver) {
27084       return resolver.transient(this, "GeoJSON", function() {
27085         if (this.isMultipolygon()) {
27086           return {
27087             type: "MultiPolygon",
27088             coordinates: this.multipolygon(resolver)
27089           };
27090         } else {
27091           return {
27092             type: "FeatureCollection",
27093             properties: this.tags,
27094             features: this.members.map(function(member) {
27095               return Object.assign({ role: member.role }, resolver.entity(member.id).asGeoJSON(resolver));
27096             })
27097           };
27098         }
27099       });
27100     },
27101     area: function(resolver) {
27102       return resolver.transient(this, "area", function() {
27103         return area_default2(this.asGeoJSON(resolver));
27104       });
27105     },
27106     isMultipolygon: function() {
27107       return this.tags.type === "multipolygon";
27108     },
27109     isComplete: function(resolver) {
27110       for (var i3 = 0; i3 < this.members.length; i3++) {
27111         if (!resolver.hasEntity(this.members[i3].id)) {
27112           return false;
27113         }
27114       }
27115       return true;
27116     },
27117     hasFromViaTo: function() {
27118       return this.members.some(function(m3) {
27119         return m3.role === "from";
27120       }) && this.members.some(
27121         (m3) => m3.role === "via" || m3.role === "intersection" && this.tags.type === "destination_sign"
27122       ) && this.members.some(function(m3) {
27123         return m3.role === "to";
27124       });
27125     },
27126     isRestriction: function() {
27127       return !!(this.tags.type && this.tags.type.match(/^restriction:?/));
27128     },
27129     isValidRestriction: function() {
27130       if (!this.isRestriction()) return false;
27131       var froms = this.members.filter(function(m3) {
27132         return m3.role === "from";
27133       });
27134       var vias = this.members.filter(function(m3) {
27135         return m3.role === "via";
27136       });
27137       var tos = this.members.filter(function(m3) {
27138         return m3.role === "to";
27139       });
27140       if (froms.length !== 1 && this.tags.restriction !== "no_entry") return false;
27141       if (froms.some(function(m3) {
27142         return m3.type !== "way";
27143       })) return false;
27144       if (tos.length !== 1 && this.tags.restriction !== "no_exit") return false;
27145       if (tos.some(function(m3) {
27146         return m3.type !== "way";
27147       })) return false;
27148       if (vias.length === 0) return false;
27149       if (vias.length > 1 && vias.some(function(m3) {
27150         return m3.type !== "way";
27151       })) return false;
27152       return true;
27153     },
27154     isConnectivity: function() {
27155       return !!(this.tags.type && this.tags.type.match(/^connectivity:?/));
27156     },
27157     // Returns an array [A0, ... An], each Ai being an array of node arrays [Nds0, ... Ndsm],
27158     // where Nds0 is an outer ring and subsequent Ndsi's (if any i > 0) being inner rings.
27159     //
27160     // This corresponds to the structure needed for rendering a multipolygon path using a
27161     // `evenodd` fill rule, as well as the structure of a GeoJSON MultiPolygon geometry.
27162     //
27163     // In the case of invalid geometries, this function will still return a result which
27164     // includes the nodes of all way members, but some Nds may be unclosed and some inner
27165     // rings not matched with the intended outer ring.
27166     //
27167     multipolygon: function(resolver) {
27168       var outers = this.members.filter(function(m3) {
27169         return "outer" === (m3.role || "outer");
27170       });
27171       var inners = this.members.filter(function(m3) {
27172         return "inner" === m3.role;
27173       });
27174       outers = osmJoinWays(outers, resolver);
27175       inners = osmJoinWays(inners, resolver);
27176       var sequenceToLineString = function(sequence) {
27177         if (sequence.nodes.length > 2 && sequence.nodes[0] !== sequence.nodes[sequence.nodes.length - 1]) {
27178           sequence.nodes.push(sequence.nodes[0]);
27179         }
27180         return sequence.nodes.map(function(node) {
27181           return node.loc;
27182         });
27183       };
27184       outers = outers.map(sequenceToLineString);
27185       inners = inners.map(sequenceToLineString);
27186       var result = outers.map(function(o3) {
27187         return [area_default2({ type: "Polygon", coordinates: [o3] }) > 2 * Math.PI ? o3.reverse() : o3];
27188       });
27189       function findOuter(inner2) {
27190         var o3, outer;
27191         for (o3 = 0; o3 < outers.length; o3++) {
27192           outer = outers[o3];
27193           if (geoPolygonContainsPolygon(outer, inner2)) {
27194             return o3;
27195           }
27196         }
27197         for (o3 = 0; o3 < outers.length; o3++) {
27198           outer = outers[o3];
27199           if (geoPolygonIntersectsPolygon(outer, inner2, false)) {
27200             return o3;
27201           }
27202         }
27203       }
27204       for (var i3 = 0; i3 < inners.length; i3++) {
27205         var inner = inners[i3];
27206         if (area_default2({ type: "Polygon", coordinates: [inner] }) < 2 * Math.PI) {
27207           inner = inner.reverse();
27208         }
27209         var o2 = findOuter(inners[i3]);
27210         if (o2 !== void 0) {
27211           result[o2].push(inners[i3]);
27212         } else {
27213           result.push([inners[i3]]);
27214         }
27215       }
27216       return result;
27217     }
27218   };
27219   Object.assign(osmRelation.prototype, prototype3);
27220
27221   // modules/osm/qa_item.js
27222   var QAItem = class _QAItem {
27223     constructor(loc, service, itemType, id2, props) {
27224       this.loc = loc;
27225       this.service = service.title;
27226       this.itemType = itemType;
27227       this.id = id2 ? id2 : "".concat(_QAItem.id());
27228       this.update(props);
27229       if (service && typeof service.getIcon === "function") {
27230         this.icon = service.getIcon(itemType);
27231       }
27232     }
27233     update(props) {
27234       const { loc, service, itemType, id: id2 } = this;
27235       Object.keys(props).forEach((prop) => this[prop] = props[prop]);
27236       this.loc = loc;
27237       this.service = service;
27238       this.itemType = itemType;
27239       this.id = id2;
27240       return this;
27241     }
27242     // Generic handling for newly created QAItems
27243     static id() {
27244       return this.nextId--;
27245     }
27246   };
27247   QAItem.nextId = -1;
27248
27249   // modules/actions/split.js
27250   function actionSplit(nodeIds, newWayIds) {
27251     if (typeof nodeIds === "string") nodeIds = [nodeIds];
27252     var _wayIDs;
27253     var _keepHistoryOn = "longest";
27254     const circularJunctions = ["roundabout", "circular"];
27255     var _createdWayIDs = [];
27256     function dist(graph, nA, nB) {
27257       var locA = graph.entity(nA).loc;
27258       var locB = graph.entity(nB).loc;
27259       var epsilon3 = 1e-6;
27260       return locA && locB ? geoSphericalDistance(locA, locB) : epsilon3;
27261     }
27262     function splitArea(nodes, idxA, graph) {
27263       var lengths = new Array(nodes.length);
27264       var length2;
27265       var i3;
27266       var best = 0;
27267       var idxB;
27268       function wrap2(index) {
27269         return utilWrap(index, nodes.length);
27270       }
27271       length2 = 0;
27272       for (i3 = wrap2(idxA + 1); i3 !== idxA; i3 = wrap2(i3 + 1)) {
27273         length2 += dist(graph, nodes[i3], nodes[wrap2(i3 - 1)]);
27274         lengths[i3] = length2;
27275       }
27276       length2 = 0;
27277       for (i3 = wrap2(idxA - 1); i3 !== idxA; i3 = wrap2(i3 - 1)) {
27278         length2 += dist(graph, nodes[i3], nodes[wrap2(i3 + 1)]);
27279         if (length2 < lengths[i3]) {
27280           lengths[i3] = length2;
27281         }
27282       }
27283       for (i3 = 0; i3 < nodes.length; i3++) {
27284         var cost = lengths[i3] / dist(graph, nodes[idxA], nodes[i3]);
27285         if (cost > best) {
27286           idxB = i3;
27287           best = cost;
27288         }
27289       }
27290       return idxB;
27291     }
27292     function totalLengthBetweenNodes(graph, nodes) {
27293       var totalLength = 0;
27294       for (var i3 = 0; i3 < nodes.length - 1; i3++) {
27295         totalLength += dist(graph, nodes[i3], nodes[i3 + 1]);
27296       }
27297       return totalLength;
27298     }
27299     function split(graph, nodeId, wayA, newWayId, otherNodeIds) {
27300       var wayB = osmWay({ id: newWayId, tags: wayA.tags });
27301       var nodesA;
27302       var nodesB;
27303       var isArea = wayA.isArea();
27304       if (wayA.isClosed()) {
27305         var nodes = wayA.nodes.slice(0, -1);
27306         var idxA = nodes.indexOf(nodeId);
27307         var idxB = otherNodeIds.length > 0 ? nodes.indexOf(otherNodeIds[0]) : splitArea(nodes, idxA, graph);
27308         if (idxB < idxA) {
27309           nodesA = nodes.slice(idxA).concat(nodes.slice(0, idxB + 1));
27310           nodesB = nodes.slice(idxB, idxA + 1);
27311         } else {
27312           nodesA = nodes.slice(idxA, idxB + 1);
27313           nodesB = nodes.slice(idxB).concat(nodes.slice(0, idxA + 1));
27314         }
27315       } else {
27316         var idx = wayA.nodes.indexOf(nodeId, 1);
27317         nodesA = wayA.nodes.slice(0, idx + 1);
27318         nodesB = wayA.nodes.slice(idx);
27319       }
27320       var lengthA = totalLengthBetweenNodes(graph, nodesA);
27321       var lengthB = totalLengthBetweenNodes(graph, nodesB);
27322       if (_keepHistoryOn === "longest" && lengthB > lengthA) {
27323         wayA = wayA.update({ nodes: nodesB });
27324         wayB = wayB.update({ nodes: nodesA });
27325         var temp = lengthA;
27326         lengthA = lengthB;
27327         lengthB = temp;
27328       } else {
27329         wayA = wayA.update({ nodes: nodesA });
27330         wayB = wayB.update({ nodes: nodesB });
27331       }
27332       for (const key in wayA.tags) {
27333         if (!osmSummableTags.has(key)) continue;
27334         var count = Number(wayA.tags[key]);
27335         if (count && // ensure a number
27336         isFinite(count) && // ensure positive
27337         count > 0 && // ensure integer
27338         Math.round(count) === count) {
27339           var tagsA = Object.assign({}, wayA.tags);
27340           var tagsB = Object.assign({}, wayB.tags);
27341           var ratioA = lengthA / (lengthA + lengthB);
27342           var countA = Math.round(count * ratioA);
27343           tagsA[key] = countA.toString();
27344           tagsB[key] = (count - countA).toString();
27345           wayA = wayA.update({ tags: tagsA });
27346           wayB = wayB.update({ tags: tagsB });
27347         }
27348       }
27349       graph = graph.replace(wayA);
27350       graph = graph.replace(wayB);
27351       graph.parentRelations(wayA).forEach(function(relation) {
27352         if (relation.hasFromViaTo()) {
27353           var f2 = relation.memberByRole("from");
27354           var v3 = [
27355             ...relation.membersByRole("via"),
27356             ...relation.membersByRole("intersection")
27357           ];
27358           var t2 = relation.memberByRole("to");
27359           var i3;
27360           if (f2.id === wayA.id || t2.id === wayA.id) {
27361             var keepB = false;
27362             if (v3.length === 1 && v3[0].type === "node") {
27363               keepB = wayB.contains(v3[0].id);
27364             } else {
27365               for (i3 = 0; i3 < v3.length; i3++) {
27366                 if (v3[i3].type === "way") {
27367                   var wayVia = graph.hasEntity(v3[i3].id);
27368                   if (wayVia && utilArrayIntersection(wayB.nodes, wayVia.nodes).length) {
27369                     keepB = true;
27370                     break;
27371                   }
27372                 }
27373               }
27374             }
27375             if (keepB) {
27376               relation = relation.replaceMember(wayA, wayB);
27377               graph = graph.replace(relation);
27378             }
27379           } else {
27380             for (i3 = 0; i3 < v3.length; i3++) {
27381               if (v3[i3].type === "way" && v3[i3].id === wayA.id) {
27382                 graph = splitWayMember(graph, relation.id, wayA, wayB);
27383               }
27384             }
27385           }
27386         } else {
27387           graph = splitWayMember(graph, relation.id, wayA, wayB);
27388         }
27389       });
27390       if (isArea) {
27391         const areaTags = __spreadProps(__spreadValues({}, wayA.tags), {
27392           type: "multipolygon"
27393         });
27394         const lineTags = {};
27395         if (areaTags.natural === "coastline") {
27396           delete areaTags.natural;
27397           lineTags.natural = "coastline";
27398         }
27399         const multipolygon = osmRelation({
27400           tags: areaTags,
27401           members: [
27402             { id: wayA.id, role: "outer", type: "way" },
27403             { id: wayB.id, role: "outer", type: "way" }
27404           ]
27405         });
27406         graph = graph.replace(multipolygon);
27407         graph = graph.replace(wayA.update({ tags: lineTags }));
27408         graph = graph.replace(wayB.update({ tags: lineTags }));
27409       }
27410       _createdWayIDs.push(wayB.id);
27411       return graph;
27412     }
27413     function splitWayMember(graph, relationId, wayA, wayB) {
27414       function connects(way1, way2) {
27415         if (way1.nodes.length < 2 || way2.nodes.length < 2) return false;
27416         if (circularJunctions.includes(way1.tags.junction) && way1.isClosed()) {
27417           return way1.nodes.some((nodeId) => nodeId === way2.nodes[0] || nodeId === way2.nodes[way2.nodes.length - 1]);
27418         } else if (circularJunctions.includes(way2.tags.junction) && way2.isClosed()) {
27419           return way2.nodes.some((nodeId) => nodeId === way1.nodes[0] || nodeId === way1.nodes[way1.nodes.length - 1]);
27420         }
27421         if (way1.nodes[0] === way2.nodes[0]) return true;
27422         if (way1.nodes[0] === way2.nodes[way2.nodes.length - 1]) return true;
27423         if (way1.nodes[way1.nodes.length - 1] === way2.nodes[way2.nodes.length - 1]) return true;
27424         if (way1.nodes[way1.nodes.length - 1] === way2.nodes[0]) return true;
27425         return false;
27426       }
27427       let relation = graph.entity(relationId);
27428       const insertMembers = [];
27429       const members = relation.members;
27430       for (let i3 = 0; i3 < members.length; i3++) {
27431         const member = members[i3];
27432         if (member.id === wayA.id) {
27433           let wayAconnectsPrev = false;
27434           let wayAconnectsNext = false;
27435           let wayBconnectsPrev = false;
27436           let wayBconnectsNext = false;
27437           if (i3 > 0 && graph.hasEntity(members[i3 - 1].id)) {
27438             const prevEntity = graph.entity(members[i3 - 1].id);
27439             if (prevEntity.type === "way") {
27440               wayAconnectsPrev = connects(prevEntity, wayA);
27441               wayBconnectsPrev = connects(prevEntity, wayB);
27442             }
27443           }
27444           if (i3 < members.length - 1 && graph.hasEntity(members[i3 + 1].id)) {
27445             const nextEntity = graph.entity(members[i3 + 1].id);
27446             if (nextEntity.type === "way") {
27447               wayAconnectsNext = connects(nextEntity, wayA);
27448               wayBconnectsNext = connects(nextEntity, wayB);
27449             }
27450           }
27451           if (wayAconnectsPrev && !wayAconnectsNext || !wayBconnectsPrev && wayBconnectsNext && !(!wayAconnectsPrev && wayAconnectsNext)) {
27452             insertMembers.push({ at: i3 + 1, role: member.role });
27453             continue;
27454           }
27455           if (!wayAconnectsPrev && wayAconnectsNext || wayBconnectsPrev && !wayBconnectsNext && !(wayAconnectsPrev && !wayAconnectsNext)) {
27456             insertMembers.push({ at: i3, role: member.role });
27457             continue;
27458           }
27459           if (wayAconnectsPrev && wayBconnectsPrev && wayAconnectsNext && wayBconnectsNext) {
27460             if (i3 > 2 && graph.hasEntity(members[i3 - 2].id)) {
27461               const prev2Entity = graph.entity(members[i3 - 2].id);
27462               if (connects(prev2Entity, wayA) && !connects(prev2Entity, wayB)) {
27463                 insertMembers.push({ at: i3, role: member.role });
27464                 continue;
27465               }
27466               if (connects(prev2Entity, wayB) && !connects(prev2Entity, wayA)) {
27467                 insertMembers.push({ at: i3 + 1, role: member.role });
27468                 continue;
27469               }
27470             }
27471             if (i3 < members.length - 2 && graph.hasEntity(members[i3 + 2].id)) {
27472               const next2Entity = graph.entity(members[i3 + 2].id);
27473               if (connects(next2Entity, wayA) && !connects(next2Entity, wayB)) {
27474                 insertMembers.push({ at: i3 + 1, role: member.role });
27475                 continue;
27476               }
27477               if (connects(next2Entity, wayB) && !connects(next2Entity, wayA)) {
27478                 insertMembers.push({ at: i3, role: member.role });
27479                 continue;
27480               }
27481             }
27482           }
27483           if (wayA.nodes[wayA.nodes.length - 1] === wayB.nodes[0]) {
27484             insertMembers.push({ at: i3 + 1, role: member.role });
27485           } else {
27486             insertMembers.push({ at: i3, role: member.role });
27487           }
27488         }
27489       }
27490       insertMembers.reverse().forEach((item) => {
27491         graph = graph.replace(relation.addMember({
27492           id: wayB.id,
27493           type: "way",
27494           role: item.role
27495         }, item.at));
27496         relation = graph.entity(relation.id);
27497       });
27498       return graph;
27499     }
27500     const action = function(graph) {
27501       _createdWayIDs = [];
27502       let newWayIndex = 0;
27503       for (const i3 in nodeIds) {
27504         const nodeId = nodeIds[i3];
27505         const candidates = waysForNodes(nodeIds.slice(i3), graph);
27506         for (const candidate of candidates) {
27507           graph = split(graph, nodeId, candidate, newWayIds && newWayIds[newWayIndex], nodeIds.slice(i3 + 1));
27508           newWayIndex += 1;
27509         }
27510       }
27511       return graph;
27512     };
27513     action.getCreatedWayIDs = function() {
27514       return _createdWayIDs;
27515     };
27516     function waysForNodes(nodeIds2, graph) {
27517       const splittableWays = nodeIds2.map((nodeId) => waysForNode(nodeId, graph)).reduce((cur, acc) => utilArrayIntersection(cur, acc));
27518       if (!_wayIDs) {
27519         const hasLine = splittableWays.some((way) => way.geometry(graph) === "line");
27520         if (hasLine) {
27521           return splittableWays.filter((way) => way.geometry(graph) === "line");
27522         }
27523       }
27524       return splittableWays;
27525     }
27526     function waysForNode(nodeId, graph) {
27527       const node = graph.entity(nodeId);
27528       return graph.parentWays(node).filter(isSplittable);
27529       function isSplittable(way) {
27530         if (_wayIDs && _wayIDs.indexOf(way.id) === -1) return false;
27531         if (way.isClosed()) return true;
27532         for (let i3 = 1; i3 < way.nodes.length - 1; i3++) {
27533           if (way.nodes[i3] === nodeId) return true;
27534         }
27535         return false;
27536       }
27537     }
27538     ;
27539     action.ways = function(graph) {
27540       return waysForNodes(nodeIds, graph);
27541     };
27542     action.disabled = function(graph) {
27543       const candidates = waysForNodes(nodeIds, graph);
27544       if (candidates.length === 0 || _wayIDs && _wayIDs.length !== candidates.length) {
27545         return "not_eligible";
27546       }
27547       for (const way of candidates) {
27548         const parentRelations = graph.parentRelations(way);
27549         for (const parentRelation of parentRelations) {
27550           if (parentRelation.hasFromViaTo()) {
27551             const vias = [
27552               ...parentRelation.membersByRole("via"),
27553               ...parentRelation.membersByRole("intersection")
27554             ];
27555             if (!vias.every((via) => graph.hasEntity(via.id))) {
27556               return "parent_incomplete";
27557             }
27558           } else {
27559             for (let i3 = 0; i3 < parentRelation.members.length; i3++) {
27560               if (parentRelation.members[i3].id === way.id) {
27561                 const memberBeforePresent = i3 > 0 && graph.hasEntity(parentRelation.members[i3 - 1].id);
27562                 const memberAfterPresent = i3 < parentRelation.members.length - 1 && graph.hasEntity(parentRelation.members[i3 + 1].id);
27563                 if (!memberBeforePresent && !memberAfterPresent && parentRelation.members.length > 1) {
27564                   return "parent_incomplete";
27565                 }
27566               }
27567             }
27568           }
27569           const relTypesExceptions = ["junction", "enforcement"];
27570           if (circularJunctions.includes(way.tags.junction) && way.isClosed() && !relTypesExceptions.includes(parentRelation.tags.type)) {
27571             return "simple_roundabout";
27572           }
27573         }
27574       }
27575     };
27576     action.limitWays = function(val) {
27577       if (!arguments.length) return _wayIDs;
27578       _wayIDs = val;
27579       return action;
27580     };
27581     action.keepHistoryOn = function(val) {
27582       if (!arguments.length) return _keepHistoryOn;
27583       _keepHistoryOn = val;
27584       return action;
27585     };
27586     return action;
27587   }
27588
27589   // modules/core/graph.js
27590   function coreGraph(other, mutable) {
27591     if (!(this instanceof coreGraph)) return new coreGraph(other, mutable);
27592     if (other instanceof coreGraph) {
27593       var base = other.base();
27594       this.entities = Object.assign(Object.create(base.entities), other.entities);
27595       this._parentWays = Object.assign(Object.create(base.parentWays), other._parentWays);
27596       this._parentRels = Object.assign(Object.create(base.parentRels), other._parentRels);
27597     } else {
27598       this.entities = /* @__PURE__ */ Object.create({});
27599       this._parentWays = /* @__PURE__ */ Object.create({});
27600       this._parentRels = /* @__PURE__ */ Object.create({});
27601       this.rebase(other || [], [this]);
27602     }
27603     this.transients = {};
27604     this._childNodes = {};
27605     this.frozen = !mutable;
27606   }
27607   coreGraph.prototype = {
27608     hasEntity: function(id2) {
27609       return this.entities[id2];
27610     },
27611     entity: function(id2) {
27612       var entity = this.entities[id2];
27613       if (!entity) {
27614         throw new Error("entity " + id2 + " not found");
27615       }
27616       return entity;
27617     },
27618     geometry: function(id2) {
27619       return this.entity(id2).geometry(this);
27620     },
27621     transient: function(entity, key, fn) {
27622       var id2 = entity.id;
27623       var transients = this.transients[id2] || (this.transients[id2] = {});
27624       if (transients[key] !== void 0) {
27625         return transients[key];
27626       }
27627       transients[key] = fn.call(entity);
27628       return transients[key];
27629     },
27630     parentWays: function(entity) {
27631       var parents = this._parentWays[entity.id];
27632       var result = [];
27633       if (parents) {
27634         parents.forEach(function(id2) {
27635           result.push(this.entity(id2));
27636         }, this);
27637       }
27638       return result;
27639     },
27640     isPoi: function(entity) {
27641       var parents = this._parentWays[entity.id];
27642       return !parents || parents.size === 0;
27643     },
27644     isShared: function(entity) {
27645       var parents = this._parentWays[entity.id];
27646       return parents && parents.size > 1;
27647     },
27648     parentRelations: function(entity) {
27649       var parents = this._parentRels[entity.id];
27650       var result = [];
27651       if (parents) {
27652         parents.forEach(function(id2) {
27653           result.push(this.entity(id2));
27654         }, this);
27655       }
27656       return result;
27657     },
27658     parentMultipolygons: function(entity) {
27659       return this.parentRelations(entity).filter(function(relation) {
27660         return relation.isMultipolygon();
27661       });
27662     },
27663     childNodes: function(entity) {
27664       if (this._childNodes[entity.id]) return this._childNodes[entity.id];
27665       if (!entity.nodes) return [];
27666       var nodes = [];
27667       for (var i3 = 0; i3 < entity.nodes.length; i3++) {
27668         nodes[i3] = this.entity(entity.nodes[i3]);
27669       }
27670       if (debug) Object.freeze(nodes);
27671       this._childNodes[entity.id] = nodes;
27672       return this._childNodes[entity.id];
27673     },
27674     base: function() {
27675       return {
27676         "entities": Object.getPrototypeOf(this.entities),
27677         "parentWays": Object.getPrototypeOf(this._parentWays),
27678         "parentRels": Object.getPrototypeOf(this._parentRels)
27679       };
27680     },
27681     // Unlike other graph methods, rebase mutates in place. This is because it
27682     // is used only during the history operation that merges newly downloaded
27683     // data into each state. To external consumers, it should appear as if the
27684     // graph always contained the newly downloaded data.
27685     rebase: function(entities, stack, force) {
27686       var base = this.base();
27687       var i3, j3, k3, id2;
27688       for (i3 = 0; i3 < entities.length; i3++) {
27689         var entity = entities[i3];
27690         if (!entity.visible || !force && base.entities[entity.id]) continue;
27691         base.entities[entity.id] = entity;
27692         this._updateCalculated(void 0, entity, base.parentWays, base.parentRels);
27693         if (entity.type === "way") {
27694           for (j3 = 0; j3 < entity.nodes.length; j3++) {
27695             id2 = entity.nodes[j3];
27696             for (k3 = 1; k3 < stack.length; k3++) {
27697               var ents = stack[k3].entities;
27698               if (ents.hasOwnProperty(id2) && ents[id2] === void 0) {
27699                 delete ents[id2];
27700               }
27701             }
27702           }
27703         }
27704       }
27705       for (i3 = 0; i3 < stack.length; i3++) {
27706         stack[i3]._updateRebased();
27707       }
27708     },
27709     _updateRebased: function() {
27710       var base = this.base();
27711       Object.keys(this._parentWays).forEach(function(child) {
27712         if (base.parentWays[child]) {
27713           base.parentWays[child].forEach(function(id2) {
27714             if (!this.entities.hasOwnProperty(id2)) {
27715               this._parentWays[child].add(id2);
27716             }
27717           }, this);
27718         }
27719       }, this);
27720       Object.keys(this._parentRels).forEach(function(child) {
27721         if (base.parentRels[child]) {
27722           base.parentRels[child].forEach(function(id2) {
27723             if (!this.entities.hasOwnProperty(id2)) {
27724               this._parentRels[child].add(id2);
27725             }
27726           }, this);
27727         }
27728       }, this);
27729       this.transients = {};
27730     },
27731     // Updates calculated properties (parentWays, parentRels) for the specified change
27732     _updateCalculated: function(oldentity, entity, parentWays, parentRels) {
27733       parentWays = parentWays || this._parentWays;
27734       parentRels = parentRels || this._parentRels;
27735       var type2 = entity && entity.type || oldentity && oldentity.type;
27736       var removed, added, i3;
27737       if (type2 === "way") {
27738         if (oldentity && entity) {
27739           removed = utilArrayDifference(oldentity.nodes, entity.nodes);
27740           added = utilArrayDifference(entity.nodes, oldentity.nodes);
27741         } else if (oldentity) {
27742           removed = oldentity.nodes;
27743           added = [];
27744         } else if (entity) {
27745           removed = [];
27746           added = entity.nodes;
27747         }
27748         for (i3 = 0; i3 < removed.length; i3++) {
27749           parentWays[removed[i3]] = new Set(parentWays[removed[i3]]);
27750           parentWays[removed[i3]].delete(oldentity.id);
27751         }
27752         for (i3 = 0; i3 < added.length; i3++) {
27753           parentWays[added[i3]] = new Set(parentWays[added[i3]]);
27754           parentWays[added[i3]].add(entity.id);
27755         }
27756       } else if (type2 === "relation") {
27757         var oldentityMemberIDs = oldentity ? oldentity.members.map(function(m3) {
27758           return m3.id;
27759         }) : [];
27760         var entityMemberIDs = entity ? entity.members.map(function(m3) {
27761           return m3.id;
27762         }) : [];
27763         if (oldentity && entity) {
27764           removed = utilArrayDifference(oldentityMemberIDs, entityMemberIDs);
27765           added = utilArrayDifference(entityMemberIDs, oldentityMemberIDs);
27766         } else if (oldentity) {
27767           removed = oldentityMemberIDs;
27768           added = [];
27769         } else if (entity) {
27770           removed = [];
27771           added = entityMemberIDs;
27772         }
27773         for (i3 = 0; i3 < removed.length; i3++) {
27774           parentRels[removed[i3]] = new Set(parentRels[removed[i3]]);
27775           parentRels[removed[i3]].delete(oldentity.id);
27776         }
27777         for (i3 = 0; i3 < added.length; i3++) {
27778           parentRels[added[i3]] = new Set(parentRels[added[i3]]);
27779           parentRels[added[i3]].add(entity.id);
27780         }
27781       }
27782     },
27783     replace: function(entity) {
27784       if (this.entities[entity.id] === entity) return this;
27785       return this.update(function() {
27786         this._updateCalculated(this.entities[entity.id], entity);
27787         this.entities[entity.id] = entity;
27788       });
27789     },
27790     remove: function(entity) {
27791       return this.update(function() {
27792         this._updateCalculated(entity, void 0);
27793         this.entities[entity.id] = void 0;
27794       });
27795     },
27796     revert: function(id2) {
27797       var baseEntity = this.base().entities[id2];
27798       var headEntity = this.entities[id2];
27799       if (headEntity === baseEntity) return this;
27800       return this.update(function() {
27801         this._updateCalculated(headEntity, baseEntity);
27802         delete this.entities[id2];
27803       });
27804     },
27805     update: function() {
27806       var graph = this.frozen ? coreGraph(this, true) : this;
27807       for (var i3 = 0; i3 < arguments.length; i3++) {
27808         arguments[i3].call(graph, graph);
27809       }
27810       if (this.frozen) graph.frozen = true;
27811       return graph;
27812     },
27813     // Obliterates any existing entities
27814     load: function(entities) {
27815       var base = this.base();
27816       this.entities = Object.create(base.entities);
27817       for (var i3 in entities) {
27818         this.entities[i3] = entities[i3];
27819         this._updateCalculated(base.entities[i3], this.entities[i3]);
27820       }
27821       return this;
27822     }
27823   };
27824
27825   // modules/osm/intersection.js
27826   function osmTurn(turn) {
27827     if (!(this instanceof osmTurn)) {
27828       return new osmTurn(turn);
27829     }
27830     Object.assign(this, turn);
27831   }
27832   function osmIntersection(graph, startVertexId, maxDistance) {
27833     maxDistance = maxDistance || 30;
27834     var vgraph = coreGraph();
27835     var i3, j3, k3;
27836     function memberOfRestriction(entity) {
27837       return graph.parentRelations(entity).some(function(r2) {
27838         return r2.isRestriction();
27839       });
27840     }
27841     function isRoad(way2) {
27842       if (way2.isArea() || way2.isDegenerate()) return false;
27843       var roads = {
27844         "motorway": true,
27845         "motorway_link": true,
27846         "trunk": true,
27847         "trunk_link": true,
27848         "primary": true,
27849         "primary_link": true,
27850         "secondary": true,
27851         "secondary_link": true,
27852         "tertiary": true,
27853         "tertiary_link": true,
27854         "residential": true,
27855         "unclassified": true,
27856         "living_street": true,
27857         "service": true,
27858         "busway": true,
27859         "road": true,
27860         "track": true
27861       };
27862       return roads[way2.tags.highway];
27863     }
27864     var startNode = graph.entity(startVertexId);
27865     var checkVertices = [startNode];
27866     var checkWays;
27867     var vertices = [];
27868     var vertexIds = [];
27869     var vertex;
27870     var ways = [];
27871     var wayIds = [];
27872     var way;
27873     var nodes = [];
27874     var node;
27875     var parents = [];
27876     var parent2;
27877     var actions = [];
27878     while (checkVertices.length) {
27879       vertex = checkVertices.pop();
27880       checkWays = graph.parentWays(vertex);
27881       var hasWays = false;
27882       for (i3 = 0; i3 < checkWays.length; i3++) {
27883         way = checkWays[i3];
27884         if (!isRoad(way) && !memberOfRestriction(way)) continue;
27885         ways.push(way);
27886         hasWays = true;
27887         nodes = utilArrayUniq(graph.childNodes(way));
27888         for (j3 = 0; j3 < nodes.length; j3++) {
27889           node = nodes[j3];
27890           if (node === vertex) continue;
27891           if (vertices.indexOf(node) !== -1) continue;
27892           if (geoSphericalDistance(node.loc, startNode.loc) > maxDistance) continue;
27893           var hasParents = false;
27894           parents = graph.parentWays(node);
27895           for (k3 = 0; k3 < parents.length; k3++) {
27896             parent2 = parents[k3];
27897             if (parent2 === way) continue;
27898             if (ways.indexOf(parent2) !== -1) continue;
27899             if (!isRoad(parent2)) continue;
27900             hasParents = true;
27901             break;
27902           }
27903           if (hasParents) {
27904             checkVertices.push(node);
27905           }
27906         }
27907       }
27908       if (hasWays) {
27909         vertices.push(vertex);
27910       }
27911     }
27912     vertices = utilArrayUniq(vertices);
27913     ways = utilArrayUniq(ways);
27914     ways.forEach(function(way2) {
27915       graph.childNodes(way2).forEach(function(node2) {
27916         vgraph = vgraph.replace(node2);
27917       });
27918       vgraph = vgraph.replace(way2);
27919       graph.parentRelations(way2).forEach(function(relation) {
27920         if (relation.isRestriction()) {
27921           if (relation.isValidRestriction(graph)) {
27922             vgraph = vgraph.replace(relation);
27923           } else if (relation.isComplete(graph)) {
27924             actions.push(actionDeleteRelation(relation.id));
27925           }
27926         }
27927       });
27928     });
27929     ways.forEach(function(w3) {
27930       var way2 = vgraph.entity(w3.id);
27931       if (way2.tags.oneway === "-1") {
27932         var action = actionReverse(way2.id, { reverseOneway: true });
27933         actions.push(action);
27934         vgraph = action(vgraph);
27935       }
27936     });
27937     var origCount = osmEntity.id.next.way;
27938     vertices.forEach(function(v3) {
27939       var splitAll = actionSplit([v3.id]).keepHistoryOn("first");
27940       if (!splitAll.disabled(vgraph)) {
27941         splitAll.ways(vgraph).forEach(function(way2) {
27942           var splitOne = actionSplit([v3.id]).limitWays([way2.id]).keepHistoryOn("first");
27943           actions.push(splitOne);
27944           vgraph = splitOne(vgraph);
27945         });
27946       }
27947     });
27948     osmEntity.id.next.way = origCount;
27949     vertexIds = vertices.map(function(v3) {
27950       return v3.id;
27951     });
27952     vertices = [];
27953     ways = [];
27954     vertexIds.forEach(function(id2) {
27955       var vertex2 = vgraph.entity(id2);
27956       var parents2 = vgraph.parentWays(vertex2);
27957       vertices.push(vertex2);
27958       ways = ways.concat(parents2);
27959     });
27960     vertices = utilArrayUniq(vertices);
27961     ways = utilArrayUniq(ways);
27962     vertexIds = vertices.map(function(v3) {
27963       return v3.id;
27964     });
27965     wayIds = ways.map(function(w3) {
27966       return w3.id;
27967     });
27968     function withMetadata(way2, vertexIds2) {
27969       var __oneWay = way2.isOneWay() && !way2.isBiDirectional();
27970       var __first = vertexIds2.indexOf(way2.first()) !== -1;
27971       var __last = vertexIds2.indexOf(way2.last()) !== -1;
27972       var __via = __first && __last;
27973       var __from = __first && !__oneWay || __last;
27974       var __to = __first || __last && !__oneWay;
27975       return way2.update({
27976         __first,
27977         __last,
27978         __from,
27979         __via,
27980         __to,
27981         __oneWay
27982       });
27983     }
27984     ways = [];
27985     wayIds.forEach(function(id2) {
27986       var way2 = withMetadata(vgraph.entity(id2), vertexIds);
27987       vgraph = vgraph.replace(way2);
27988       ways.push(way2);
27989     });
27990     var keepGoing;
27991     var removeWayIds = [];
27992     var removeVertexIds = [];
27993     do {
27994       keepGoing = false;
27995       checkVertices = vertexIds.slice();
27996       for (i3 = 0; i3 < checkVertices.length; i3++) {
27997         var vertexId = checkVertices[i3];
27998         vertex = vgraph.hasEntity(vertexId);
27999         if (!vertex) {
28000           if (vertexIds.indexOf(vertexId) !== -1) {
28001             vertexIds.splice(vertexIds.indexOf(vertexId), 1);
28002           }
28003           removeVertexIds.push(vertexId);
28004           continue;
28005         }
28006         parents = vgraph.parentWays(vertex);
28007         if (parents.length < 3) {
28008           if (vertexIds.indexOf(vertexId) !== -1) {
28009             vertexIds.splice(vertexIds.indexOf(vertexId), 1);
28010           }
28011         }
28012         if (parents.length === 2) {
28013           var a2 = parents[0];
28014           var b3 = parents[1];
28015           var aIsLeaf = a2 && !a2.__via;
28016           var bIsLeaf = b3 && !b3.__via;
28017           var leaf, survivor;
28018           if (aIsLeaf && !bIsLeaf) {
28019             leaf = a2;
28020             survivor = b3;
28021           } else if (!aIsLeaf && bIsLeaf) {
28022             leaf = b3;
28023             survivor = a2;
28024           }
28025           if (leaf && survivor) {
28026             survivor = withMetadata(survivor, vertexIds);
28027             vgraph = vgraph.replace(survivor).remove(leaf);
28028             removeWayIds.push(leaf.id);
28029             keepGoing = true;
28030           }
28031         }
28032         parents = vgraph.parentWays(vertex);
28033         if (parents.length < 2) {
28034           if (vertexIds.indexOf(vertexId) !== -1) {
28035             vertexIds.splice(vertexIds.indexOf(vertexId), 1);
28036           }
28037           removeVertexIds.push(vertexId);
28038           keepGoing = true;
28039         }
28040         if (parents.length < 1) {
28041           vgraph = vgraph.remove(vertex);
28042         }
28043       }
28044     } while (keepGoing);
28045     vertices = vertices.filter(function(vertex2) {
28046       return removeVertexIds.indexOf(vertex2.id) === -1;
28047     }).map(function(vertex2) {
28048       return vgraph.entity(vertex2.id);
28049     });
28050     ways = ways.filter(function(way2) {
28051       return removeWayIds.indexOf(way2.id) === -1;
28052     }).map(function(way2) {
28053       return vgraph.entity(way2.id);
28054     });
28055     var intersection2 = {
28056       graph: vgraph,
28057       actions,
28058       vertices,
28059       ways
28060     };
28061     intersection2.turns = function(fromWayId, maxViaWay) {
28062       if (!fromWayId) return [];
28063       if (!maxViaWay) maxViaWay = 0;
28064       var vgraph2 = intersection2.graph;
28065       var keyVertexIds = intersection2.vertices.map(function(v3) {
28066         return v3.id;
28067       });
28068       var start2 = vgraph2.entity(fromWayId);
28069       if (!start2 || !(start2.__from || start2.__via)) return [];
28070       var maxPathLength = maxViaWay * 2 + 3;
28071       var turns = [];
28072       step(start2);
28073       return turns;
28074       function step(entity, currPath, currRestrictions, matchedRestriction) {
28075         currPath = (currPath || []).slice();
28076         if (currPath.length >= maxPathLength) return;
28077         currPath.push(entity.id);
28078         currRestrictions = (currRestrictions || []).slice();
28079         if (entity.type === "node") {
28080           stepNode(entity, currPath, currRestrictions);
28081         } else {
28082           stepWay(entity, currPath, currRestrictions, matchedRestriction);
28083         }
28084       }
28085       function stepNode(entity, currPath, currRestrictions) {
28086         var i4, j4;
28087         var parents2 = vgraph2.parentWays(entity);
28088         var nextWays = [];
28089         for (i4 = 0; i4 < parents2.length; i4++) {
28090           var way2 = parents2[i4];
28091           if (way2.__oneWay && way2.nodes[0] !== entity.id) continue;
28092           if (currPath.indexOf(way2.id) !== -1 && currPath.length >= 3) continue;
28093           var restrict = null;
28094           for (j4 = 0; j4 < currRestrictions.length; j4++) {
28095             var restriction = currRestrictions[j4];
28096             var f2 = restriction.memberByRole("from");
28097             var v3 = restriction.membersByRole("via");
28098             var t2 = restriction.memberByRole("to");
28099             var isNo = /^no_/.test(restriction.tags.restriction);
28100             var isOnly = /^only_/.test(restriction.tags.restriction);
28101             if (!(isNo || isOnly)) {
28102               continue;
28103             }
28104             var matchesFrom = f2.id === fromWayId;
28105             var matchesViaTo = false;
28106             var isAlongOnlyPath = false;
28107             if (t2.id === way2.id) {
28108               if (v3.length === 1 && v3[0].type === "node") {
28109                 matchesViaTo = v3[0].id === entity.id && (matchesFrom && currPath.length === 2 || !matchesFrom && currPath.length > 2);
28110               } else {
28111                 var pathVias = [];
28112                 for (k3 = 2; k3 < currPath.length; k3 += 2) {
28113                   pathVias.push(currPath[k3]);
28114                 }
28115                 var restrictionVias = [];
28116                 for (k3 = 0; k3 < v3.length; k3++) {
28117                   if (v3[k3].type === "way") {
28118                     restrictionVias.push(v3[k3].id);
28119                   }
28120                 }
28121                 var diff = utilArrayDifference(pathVias, restrictionVias);
28122                 matchesViaTo = !diff.length;
28123               }
28124             } else if (isOnly) {
28125               for (k3 = 0; k3 < v3.length; k3++) {
28126                 if (v3[k3].type === "way" && v3[k3].id === way2.id) {
28127                   isAlongOnlyPath = true;
28128                   break;
28129                 }
28130               }
28131             }
28132             if (matchesViaTo) {
28133               if (isOnly) {
28134                 restrict = { id: restriction.id, direct: matchesFrom, from: f2.id, only: true, end: true };
28135               } else {
28136                 restrict = { id: restriction.id, direct: matchesFrom, from: f2.id, no: true, end: true };
28137               }
28138             } else {
28139               if (isAlongOnlyPath) {
28140                 restrict = { id: restriction.id, direct: false, from: f2.id, only: true, end: false };
28141               } else if (isOnly) {
28142                 restrict = { id: restriction.id, direct: false, from: f2.id, no: true, end: true };
28143               }
28144             }
28145             if (restrict && restrict.direct) break;
28146           }
28147           nextWays.push({ way: way2, restrict });
28148         }
28149         nextWays.forEach(function(nextWay) {
28150           step(nextWay.way, currPath, currRestrictions, nextWay.restrict);
28151         });
28152       }
28153       function stepWay(entity, currPath, currRestrictions, matchedRestriction) {
28154         var i4;
28155         if (currPath.length >= 3) {
28156           var turnPath = currPath.slice();
28157           if (matchedRestriction && matchedRestriction.direct === false) {
28158             for (i4 = 0; i4 < turnPath.length; i4++) {
28159               if (turnPath[i4] === matchedRestriction.from) {
28160                 turnPath = turnPath.slice(i4);
28161                 break;
28162               }
28163             }
28164           }
28165           var turn = pathToTurn(turnPath);
28166           if (turn) {
28167             if (matchedRestriction) {
28168               turn.restrictionID = matchedRestriction.id;
28169               turn.no = matchedRestriction.no;
28170               turn.only = matchedRestriction.only;
28171               turn.direct = matchedRestriction.direct;
28172             }
28173             turns.push(osmTurn(turn));
28174           }
28175           if (currPath[0] === currPath[2]) return;
28176         }
28177         if (matchedRestriction && matchedRestriction.end) return;
28178         var n1 = vgraph2.entity(entity.first());
28179         var n22 = vgraph2.entity(entity.last());
28180         var dist = geoSphericalDistance(n1.loc, n22.loc);
28181         var nextNodes = [];
28182         if (currPath.length > 1) {
28183           if (dist > maxDistance) return;
28184           if (!entity.__via) return;
28185         }
28186         if (!entity.__oneWay && // bidirectional..
28187         keyVertexIds.indexOf(n1.id) !== -1 && // key vertex..
28188         currPath.indexOf(n1.id) === -1) {
28189           nextNodes.push(n1);
28190         }
28191         if (keyVertexIds.indexOf(n22.id) !== -1 && // key vertex..
28192         currPath.indexOf(n22.id) === -1) {
28193           nextNodes.push(n22);
28194         }
28195         nextNodes.forEach(function(nextNode) {
28196           var fromRestrictions = vgraph2.parentRelations(entity).filter(function(r2) {
28197             if (!r2.isRestriction()) return false;
28198             var f2 = r2.memberByRole("from");
28199             if (!f2 || f2.id !== entity.id) return false;
28200             var isOnly = /^only_/.test(r2.tags.restriction);
28201             if (!isOnly) return true;
28202             var isOnlyVia = false;
28203             var v3 = r2.membersByRole("via");
28204             if (v3.length === 1 && v3[0].type === "node") {
28205               isOnlyVia = v3[0].id === nextNode.id;
28206             } else {
28207               for (var i5 = 0; i5 < v3.length; i5++) {
28208                 if (v3[i5].type !== "way") continue;
28209                 var viaWay = vgraph2.entity(v3[i5].id);
28210                 if (viaWay.first() === nextNode.id || viaWay.last() === nextNode.id) {
28211                   isOnlyVia = true;
28212                   break;
28213                 }
28214               }
28215             }
28216             return isOnlyVia;
28217           });
28218           step(nextNode, currPath, currRestrictions.concat(fromRestrictions), false);
28219         });
28220       }
28221       function pathToTurn(path) {
28222         if (path.length < 3) return;
28223         var fromWayId2, fromNodeId, fromVertexId;
28224         var toWayId, toNodeId, toVertexId;
28225         var viaWayIds, viaNodeId, isUturn;
28226         fromWayId2 = path[0];
28227         toWayId = path[path.length - 1];
28228         if (path.length === 3 && fromWayId2 === toWayId) {
28229           var way2 = vgraph2.entity(fromWayId2);
28230           if (way2.__oneWay) return null;
28231           isUturn = true;
28232           viaNodeId = fromVertexId = toVertexId = path[1];
28233           fromNodeId = toNodeId = adjacentNode(fromWayId2, viaNodeId);
28234         } else {
28235           isUturn = false;
28236           fromVertexId = path[1];
28237           fromNodeId = adjacentNode(fromWayId2, fromVertexId);
28238           toVertexId = path[path.length - 2];
28239           toNodeId = adjacentNode(toWayId, toVertexId);
28240           if (path.length === 3) {
28241             viaNodeId = path[1];
28242           } else {
28243             viaWayIds = path.filter(function(entityId) {
28244               return entityId[0] === "w";
28245             });
28246             viaWayIds = viaWayIds.slice(1, viaWayIds.length - 1);
28247           }
28248         }
28249         return {
28250           key: path.join("_"),
28251           path,
28252           from: { node: fromNodeId, way: fromWayId2, vertex: fromVertexId },
28253           via: { node: viaNodeId, ways: viaWayIds },
28254           to: { node: toNodeId, way: toWayId, vertex: toVertexId },
28255           u: isUturn
28256         };
28257         function adjacentNode(wayId, affixId) {
28258           var nodes2 = vgraph2.entity(wayId).nodes;
28259           return affixId === nodes2[0] ? nodes2[1] : nodes2[nodes2.length - 2];
28260         }
28261       }
28262     };
28263     return intersection2;
28264   }
28265   function osmInferRestriction(graph, turn, projection2) {
28266     var fromWay = graph.entity(turn.from.way);
28267     var fromNode = graph.entity(turn.from.node);
28268     var fromVertex = graph.entity(turn.from.vertex);
28269     var toWay = graph.entity(turn.to.way);
28270     var toNode = graph.entity(turn.to.node);
28271     var toVertex = graph.entity(turn.to.vertex);
28272     var fromOneWay = fromWay.tags.oneway === "yes";
28273     var toOneWay = toWay.tags.oneway === "yes";
28274     var angle2 = (geoAngle(fromVertex, fromNode, projection2) - geoAngle(toVertex, toNode, projection2)) * 180 / Math.PI;
28275     while (angle2 < 0) {
28276       angle2 += 360;
28277     }
28278     if (fromNode === toNode) {
28279       return "no_u_turn";
28280     }
28281     if ((angle2 < 23 || angle2 > 336) && fromOneWay && toOneWay) {
28282       return "no_u_turn";
28283     }
28284     if ((angle2 < 40 || angle2 > 319) && fromOneWay && toOneWay && turn.from.vertex !== turn.to.vertex) {
28285       return "no_u_turn";
28286     }
28287     if (angle2 < 158) {
28288       return "no_right_turn";
28289     }
28290     if (angle2 > 202) {
28291       return "no_left_turn";
28292     }
28293     return "no_straight_on";
28294   }
28295
28296   // modules/actions/merge_polygon.js
28297   function actionMergePolygon(ids, newRelationId) {
28298     function groupEntities(graph) {
28299       var entities = ids.map(function(id2) {
28300         return graph.entity(id2);
28301       });
28302       var geometryGroups = utilArrayGroupBy(entities, function(entity) {
28303         if (entity.type === "way" && entity.isClosed()) {
28304           return "closedWay";
28305         } else if (entity.type === "relation" && entity.isMultipolygon()) {
28306           return "multipolygon";
28307         } else {
28308           return "other";
28309         }
28310       });
28311       return Object.assign(
28312         { closedWay: [], multipolygon: [], other: [] },
28313         geometryGroups
28314       );
28315     }
28316     var action = function(graph) {
28317       var entities = groupEntities(graph);
28318       var polygons = entities.multipolygon.reduce(function(polygons2, m3) {
28319         return polygons2.concat(osmJoinWays(m3.members, graph));
28320       }, []).concat(entities.closedWay.map(function(d2) {
28321         var member = [{ id: d2.id }];
28322         member.nodes = graph.childNodes(d2);
28323         return member;
28324       }));
28325       var contained = polygons.map(function(w3, i3) {
28326         return polygons.map(function(d2, n3) {
28327           if (i3 === n3) return null;
28328           return geoPolygonContainsPolygon(
28329             d2.nodes.map(function(n4) {
28330               return n4.loc;
28331             }),
28332             w3.nodes.map(function(n4) {
28333               return n4.loc;
28334             })
28335           );
28336         });
28337       });
28338       var members = [];
28339       var outer = true;
28340       while (polygons.length) {
28341         extractUncontained(polygons);
28342         polygons = polygons.filter(isContained);
28343         contained = contained.filter(isContained).map(filterContained);
28344       }
28345       function isContained(d2, i3) {
28346         return contained[i3].some(function(val) {
28347           return val;
28348         });
28349       }
28350       function filterContained(d2) {
28351         return d2.filter(isContained);
28352       }
28353       function extractUncontained(polygons2) {
28354         polygons2.forEach(function(d2, i3) {
28355           if (!isContained(d2, i3)) {
28356             d2.forEach(function(member) {
28357               members.push({
28358                 type: "way",
28359                 id: member.id,
28360                 role: outer ? "outer" : "inner"
28361               });
28362             });
28363           }
28364         });
28365         outer = !outer;
28366       }
28367       var relation;
28368       if (entities.multipolygon.length > 0) {
28369         var oldestID = utilOldestID(entities.multipolygon.map((entity) => entity.id));
28370         relation = entities.multipolygon.find((entity) => entity.id === oldestID);
28371       } else {
28372         relation = osmRelation({ id: newRelationId, tags: { type: "multipolygon" } });
28373       }
28374       entities.multipolygon.forEach(function(m3) {
28375         if (m3.id !== relation.id) {
28376           relation = relation.mergeTags(m3.tags);
28377           graph = graph.remove(m3);
28378         }
28379       });
28380       entities.closedWay.forEach(function(way) {
28381         function isThisOuter(m3) {
28382           return m3.id === way.id && m3.role !== "inner";
28383         }
28384         if (members.some(isThisOuter)) {
28385           relation = relation.mergeTags(way.tags);
28386           graph = graph.replace(way.update({ tags: {} }));
28387         }
28388       });
28389       return graph.replace(relation.update({
28390         members,
28391         tags: utilObjectOmit(relation.tags, ["area"])
28392       }));
28393     };
28394     action.disabled = function(graph) {
28395       var entities = groupEntities(graph);
28396       if (entities.other.length > 0 || entities.closedWay.length + entities.multipolygon.length < 2) {
28397         return "not_eligible";
28398       }
28399       if (!entities.multipolygon.every(function(r2) {
28400         return r2.isComplete(graph);
28401       })) {
28402         return "incomplete_relation";
28403       }
28404       if (!entities.multipolygon.length) {
28405         var sharedMultipolygons = [];
28406         entities.closedWay.forEach(function(way, i3) {
28407           if (i3 === 0) {
28408             sharedMultipolygons = graph.parentMultipolygons(way);
28409           } else {
28410             sharedMultipolygons = utilArrayIntersection(sharedMultipolygons, graph.parentMultipolygons(way));
28411           }
28412         });
28413         sharedMultipolygons = sharedMultipolygons.filter(function(relation) {
28414           return relation.members.length === entities.closedWay.length;
28415         });
28416         if (sharedMultipolygons.length) {
28417           return "not_eligible";
28418         }
28419       } else if (entities.closedWay.some(function(way) {
28420         return utilArrayIntersection(graph.parentMultipolygons(way), entities.multipolygon).length;
28421       })) {
28422         return "not_eligible";
28423       }
28424     };
28425     return action;
28426   }
28427
28428   // modules/actions/merge_remote_changes.js
28429   var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
28430
28431   // node_modules/node-diff3/dist/diff3.mjs
28432   function LCS(buffer1, buffer2) {
28433     let equivalenceClasses = {};
28434     for (let j3 = 0; j3 < buffer2.length; j3++) {
28435       const item = buffer2[j3];
28436       if (equivalenceClasses[item]) {
28437         equivalenceClasses[item].push(j3);
28438       } else {
28439         equivalenceClasses[item] = [j3];
28440       }
28441     }
28442     const NULLRESULT = { buffer1index: -1, buffer2index: -1, chain: null };
28443     let candidates = [NULLRESULT];
28444     for (let i3 = 0; i3 < buffer1.length; i3++) {
28445       const item = buffer1[i3];
28446       const buffer2indices = equivalenceClasses[item] || [];
28447       let r2 = 0;
28448       let c2 = candidates[0];
28449       for (let jx = 0; jx < buffer2indices.length; jx++) {
28450         const j3 = buffer2indices[jx];
28451         let s2;
28452         for (s2 = r2; s2 < candidates.length; s2++) {
28453           if (candidates[s2].buffer2index < j3 && (s2 === candidates.length - 1 || candidates[s2 + 1].buffer2index > j3)) {
28454             break;
28455           }
28456         }
28457         if (s2 < candidates.length) {
28458           const newCandidate = { buffer1index: i3, buffer2index: j3, chain: candidates[s2] };
28459           if (r2 === candidates.length) {
28460             candidates.push(c2);
28461           } else {
28462             candidates[r2] = c2;
28463           }
28464           r2 = s2 + 1;
28465           c2 = newCandidate;
28466           if (r2 === candidates.length) {
28467             break;
28468           }
28469         }
28470       }
28471       candidates[r2] = c2;
28472     }
28473     return candidates[candidates.length - 1];
28474   }
28475   function diffIndices(buffer1, buffer2) {
28476     const lcs = LCS(buffer1, buffer2);
28477     let result = [];
28478     let tail1 = buffer1.length;
28479     let tail2 = buffer2.length;
28480     for (let candidate = lcs; candidate !== null; candidate = candidate.chain) {
28481       const mismatchLength1 = tail1 - candidate.buffer1index - 1;
28482       const mismatchLength2 = tail2 - candidate.buffer2index - 1;
28483       tail1 = candidate.buffer1index;
28484       tail2 = candidate.buffer2index;
28485       if (mismatchLength1 || mismatchLength2) {
28486         result.push({
28487           buffer1: [tail1 + 1, mismatchLength1],
28488           buffer1Content: buffer1.slice(tail1 + 1, tail1 + 1 + mismatchLength1),
28489           buffer2: [tail2 + 1, mismatchLength2],
28490           buffer2Content: buffer2.slice(tail2 + 1, tail2 + 1 + mismatchLength2)
28491         });
28492       }
28493     }
28494     result.reverse();
28495     return result;
28496   }
28497   function diff3MergeRegions(a2, o2, b3) {
28498     let hunks = [];
28499     function addHunk(h3, ab) {
28500       hunks.push({
28501         ab,
28502         oStart: h3.buffer1[0],
28503         oLength: h3.buffer1[1],
28504         abStart: h3.buffer2[0],
28505         abLength: h3.buffer2[1]
28506       });
28507     }
28508     diffIndices(o2, a2).forEach((item) => addHunk(item, "a"));
28509     diffIndices(o2, b3).forEach((item) => addHunk(item, "b"));
28510     hunks.sort((x3, y3) => x3.oStart - y3.oStart);
28511     let results = [];
28512     let currOffset = 0;
28513     function advanceTo(endOffset) {
28514       if (endOffset > currOffset) {
28515         results.push({
28516           stable: true,
28517           buffer: "o",
28518           bufferStart: currOffset,
28519           bufferLength: endOffset - currOffset,
28520           bufferContent: o2.slice(currOffset, endOffset)
28521         });
28522         currOffset = endOffset;
28523       }
28524     }
28525     while (hunks.length) {
28526       let hunk = hunks.shift();
28527       let regionStart = hunk.oStart;
28528       let regionEnd = hunk.oStart + hunk.oLength;
28529       let regionHunks = [hunk];
28530       advanceTo(regionStart);
28531       while (hunks.length) {
28532         const nextHunk = hunks[0];
28533         const nextHunkStart = nextHunk.oStart;
28534         if (nextHunkStart > regionEnd)
28535           break;
28536         regionEnd = Math.max(regionEnd, nextHunkStart + nextHunk.oLength);
28537         regionHunks.push(hunks.shift());
28538       }
28539       if (regionHunks.length === 1) {
28540         if (hunk.abLength > 0) {
28541           const buffer = hunk.ab === "a" ? a2 : b3;
28542           results.push({
28543             stable: true,
28544             buffer: hunk.ab,
28545             bufferStart: hunk.abStart,
28546             bufferLength: hunk.abLength,
28547             bufferContent: buffer.slice(hunk.abStart, hunk.abStart + hunk.abLength)
28548           });
28549         }
28550       } else {
28551         let bounds = {
28552           a: [a2.length, -1, o2.length, -1],
28553           b: [b3.length, -1, o2.length, -1]
28554         };
28555         while (regionHunks.length) {
28556           hunk = regionHunks.shift();
28557           const oStart = hunk.oStart;
28558           const oEnd = oStart + hunk.oLength;
28559           const abStart = hunk.abStart;
28560           const abEnd = abStart + hunk.abLength;
28561           let b22 = bounds[hunk.ab];
28562           b22[0] = Math.min(abStart, b22[0]);
28563           b22[1] = Math.max(abEnd, b22[1]);
28564           b22[2] = Math.min(oStart, b22[2]);
28565           b22[3] = Math.max(oEnd, b22[3]);
28566         }
28567         const aStart = bounds.a[0] + (regionStart - bounds.a[2]);
28568         const aEnd = bounds.a[1] + (regionEnd - bounds.a[3]);
28569         const bStart = bounds.b[0] + (regionStart - bounds.b[2]);
28570         const bEnd = bounds.b[1] + (regionEnd - bounds.b[3]);
28571         let result = {
28572           stable: false,
28573           aStart,
28574           aLength: aEnd - aStart,
28575           aContent: a2.slice(aStart, aEnd),
28576           oStart: regionStart,
28577           oLength: regionEnd - regionStart,
28578           oContent: o2.slice(regionStart, regionEnd),
28579           bStart,
28580           bLength: bEnd - bStart,
28581           bContent: b3.slice(bStart, bEnd)
28582         };
28583         results.push(result);
28584       }
28585       currOffset = regionEnd;
28586     }
28587     advanceTo(o2.length);
28588     return results;
28589   }
28590   function diff3Merge(a2, o2, b3, options) {
28591     let defaults = {
28592       excludeFalseConflicts: true,
28593       stringSeparator: /\s+/
28594     };
28595     options = Object.assign(defaults, options);
28596     if (typeof a2 === "string")
28597       a2 = a2.split(options.stringSeparator);
28598     if (typeof o2 === "string")
28599       o2 = o2.split(options.stringSeparator);
28600     if (typeof b3 === "string")
28601       b3 = b3.split(options.stringSeparator);
28602     let results = [];
28603     const regions = diff3MergeRegions(a2, o2, b3);
28604     let okBuffer = [];
28605     function flushOk() {
28606       if (okBuffer.length) {
28607         results.push({ ok: okBuffer });
28608       }
28609       okBuffer = [];
28610     }
28611     function isFalseConflict(a22, b22) {
28612       if (a22.length !== b22.length)
28613         return false;
28614       for (let i3 = 0; i3 < a22.length; i3++) {
28615         if (a22[i3] !== b22[i3])
28616           return false;
28617       }
28618       return true;
28619     }
28620     regions.forEach((region) => {
28621       if (region.stable) {
28622         okBuffer.push(...region.bufferContent);
28623       } else {
28624         if (options.excludeFalseConflicts && isFalseConflict(region.aContent, region.bContent)) {
28625           okBuffer.push(...region.aContent);
28626         } else {
28627           flushOk();
28628           results.push({
28629             conflict: {
28630               a: region.aContent,
28631               aIndex: region.aStart,
28632               o: region.oContent,
28633               oIndex: region.oStart,
28634               b: region.bContent,
28635               bIndex: region.bStart
28636             }
28637           });
28638         }
28639       }
28640     });
28641     flushOk();
28642     return results;
28643   }
28644
28645   // modules/actions/merge_remote_changes.js
28646   function actionMergeRemoteChanges(id2, localGraph, remoteGraph, discardTags, formatUser) {
28647     discardTags = discardTags || {};
28648     var _option = "safe";
28649     var _conflicts = [];
28650     function user(d2) {
28651       return typeof formatUser === "function" ? formatUser(d2) : escape_default(d2);
28652     }
28653     function mergeLocation(remote, target) {
28654       function pointEqual(a2, b3) {
28655         var epsilon3 = 1e-6;
28656         return Math.abs(a2[0] - b3[0]) < epsilon3 && Math.abs(a2[1] - b3[1]) < epsilon3;
28657       }
28658       if (_option === "force_local" || pointEqual(target.loc, remote.loc)) {
28659         return target;
28660       }
28661       if (_option === "force_remote") {
28662         return target.update({ loc: remote.loc });
28663       }
28664       _conflicts.push(_t.html("merge_remote_changes.conflict.location", { user: { html: user(remote.user) } }));
28665       return target;
28666     }
28667     function mergeNodes(base, remote, target) {
28668       if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.nodes, remote.nodes)) {
28669         return target;
28670       }
28671       if (_option === "force_remote") {
28672         return target.update({ nodes: remote.nodes });
28673       }
28674       var ccount = _conflicts.length;
28675       var o2 = base.nodes || [];
28676       var a2 = target.nodes || [];
28677       var b3 = remote.nodes || [];
28678       var nodes = [];
28679       var hunks = diff3Merge(a2, o2, b3, { excludeFalseConflicts: true });
28680       for (var i3 = 0; i3 < hunks.length; i3++) {
28681         var hunk = hunks[i3];
28682         if (hunk.ok) {
28683           nodes.push.apply(nodes, hunk.ok);
28684         } else {
28685           var c2 = hunk.conflict;
28686           if ((0, import_fast_deep_equal.default)(c2.o, c2.a)) {
28687             nodes.push.apply(nodes, c2.b);
28688           } else if ((0, import_fast_deep_equal.default)(c2.o, c2.b)) {
28689             nodes.push.apply(nodes, c2.a);
28690           } else {
28691             _conflicts.push(_t.html("merge_remote_changes.conflict.nodelist", { user: { html: user(remote.user) } }));
28692             break;
28693           }
28694         }
28695       }
28696       return _conflicts.length === ccount ? target.update({ nodes }) : target;
28697     }
28698     function mergeChildren(targetWay, children2, updates, graph) {
28699       function isUsed(node2, targetWay2) {
28700         var hasInterestingParent = graph.parentWays(node2).some(function(way) {
28701           return way.id !== targetWay2.id;
28702         });
28703         return node2.hasInterestingTags() || hasInterestingParent || graph.parentRelations(node2).length > 0;
28704       }
28705       var ccount = _conflicts.length;
28706       for (var i3 = 0; i3 < children2.length; i3++) {
28707         var id3 = children2[i3];
28708         var node = graph.hasEntity(id3);
28709         if (targetWay.nodes.indexOf(id3) === -1) {
28710           if (node && !isUsed(node, targetWay)) {
28711             updates.removeIds.push(id3);
28712           }
28713           continue;
28714         }
28715         var local = localGraph.hasEntity(id3);
28716         var remote = remoteGraph.hasEntity(id3);
28717         var target;
28718         if (_option === "force_remote" && remote && remote.visible) {
28719           updates.replacements.push(remote);
28720         } else if (_option === "force_local" && local) {
28721           target = osmEntity(local);
28722           if (remote) {
28723             target = target.update({ version: remote.version });
28724           }
28725           updates.replacements.push(target);
28726         } else if (_option === "safe" && local && remote && local.version !== remote.version) {
28727           target = osmEntity(local, { version: remote.version });
28728           if (remote.visible) {
28729             target = mergeLocation(remote, target);
28730           } else {
28731             _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
28732           }
28733           if (_conflicts.length !== ccount) break;
28734           updates.replacements.push(target);
28735         }
28736       }
28737       return targetWay;
28738     }
28739     function updateChildren(updates, graph) {
28740       for (var i3 = 0; i3 < updates.replacements.length; i3++) {
28741         graph = graph.replace(updates.replacements[i3]);
28742       }
28743       if (updates.removeIds.length) {
28744         graph = actionDeleteMultiple(updates.removeIds)(graph);
28745       }
28746       return graph;
28747     }
28748     function mergeMembers(remote, target) {
28749       if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.members, remote.members)) {
28750         return target;
28751       }
28752       if (_option === "force_remote") {
28753         return target.update({ members: remote.members });
28754       }
28755       _conflicts.push(_t.html("merge_remote_changes.conflict.memberlist", { user: { html: user(remote.user) } }));
28756       return target;
28757     }
28758     function mergeTags(base, remote, target) {
28759       if (_option === "force_local" || (0, import_fast_deep_equal.default)(target.tags, remote.tags)) {
28760         return target;
28761       }
28762       if (_option === "force_remote") {
28763         return target.update({ tags: remote.tags });
28764       }
28765       var ccount = _conflicts.length;
28766       var o2 = base.tags || {};
28767       var a2 = target.tags || {};
28768       var b3 = remote.tags || {};
28769       var keys2 = utilArrayUnion(utilArrayUnion(Object.keys(o2), Object.keys(a2)), Object.keys(b3)).filter(function(k4) {
28770         return !discardTags[k4];
28771       });
28772       var tags = Object.assign({}, a2);
28773       var changed = false;
28774       for (var i3 = 0; i3 < keys2.length; i3++) {
28775         var k3 = keys2[i3];
28776         if (o2[k3] !== b3[k3] && a2[k3] !== b3[k3]) {
28777           if (o2[k3] !== a2[k3]) {
28778             _conflicts.push(_t.html(
28779               "merge_remote_changes.conflict.tags",
28780               { tag: k3, local: a2[k3], remote: b3[k3], user: { html: user(remote.user) } }
28781             ));
28782           } else {
28783             if (b3.hasOwnProperty(k3)) {
28784               tags[k3] = b3[k3];
28785             } else {
28786               delete tags[k3];
28787             }
28788             changed = true;
28789           }
28790         }
28791       }
28792       return changed && _conflicts.length === ccount ? target.update({ tags }) : target;
28793     }
28794     var action = function(graph) {
28795       var updates = { replacements: [], removeIds: [] };
28796       var base = graph.base().entities[id2];
28797       var local = localGraph.entity(id2);
28798       var remote = remoteGraph.entity(id2);
28799       var target = osmEntity(local, { version: remote.version });
28800       if (!remote.visible) {
28801         if (_option === "force_remote") {
28802           return actionDeleteMultiple([id2])(graph);
28803         } else if (_option === "force_local") {
28804           if (target.type === "way") {
28805             target = mergeChildren(target, utilArrayUniq(local.nodes), updates, graph);
28806             graph = updateChildren(updates, graph);
28807           }
28808           return graph.replace(target);
28809         } else {
28810           _conflicts.push(_t.html("merge_remote_changes.conflict.deleted", { user: { html: user(remote.user) } }));
28811           return graph;
28812         }
28813       }
28814       if (target.type === "node") {
28815         target = mergeLocation(remote, target);
28816       } else if (target.type === "way") {
28817         graph.rebase(remoteGraph.childNodes(remote), [graph], false);
28818         target = mergeNodes(base, remote, target);
28819         target = mergeChildren(target, utilArrayUnion(local.nodes, remote.nodes), updates, graph);
28820       } else if (target.type === "relation") {
28821         target = mergeMembers(remote, target);
28822       }
28823       target = mergeTags(base, remote, target);
28824       if (!_conflicts.length) {
28825         graph = updateChildren(updates, graph).replace(target);
28826       }
28827       return graph;
28828     };
28829     action.withOption = function(opt) {
28830       _option = opt;
28831       return action;
28832     };
28833     action.conflicts = function() {
28834       return _conflicts;
28835     };
28836     return action;
28837   }
28838
28839   // modules/actions/move.js
28840   function actionMove(moveIDs, tryDelta, projection2, cache) {
28841     var _delta = tryDelta;
28842     function setupCache(graph) {
28843       function canMove(nodeID) {
28844         if (moveIDs.indexOf(nodeID) !== -1) return true;
28845         var parents = graph.parentWays(graph.entity(nodeID));
28846         if (parents.length < 3) return true;
28847         var parentsMoving = parents.every(function(way) {
28848           return cache.moving[way.id];
28849         });
28850         if (!parentsMoving) delete cache.moving[nodeID];
28851         return parentsMoving;
28852       }
28853       function cacheEntities(ids) {
28854         for (var i3 = 0; i3 < ids.length; i3++) {
28855           var id2 = ids[i3];
28856           if (cache.moving[id2]) continue;
28857           cache.moving[id2] = true;
28858           var entity = graph.hasEntity(id2);
28859           if (!entity) continue;
28860           if (entity.type === "node") {
28861             cache.nodes.push(id2);
28862             cache.startLoc[id2] = entity.loc;
28863           } else if (entity.type === "way") {
28864             cache.ways.push(id2);
28865             cacheEntities(entity.nodes);
28866           } else {
28867             cacheEntities(entity.members.map(function(member) {
28868               return member.id;
28869             }));
28870           }
28871         }
28872       }
28873       function cacheIntersections(ids) {
28874         function isEndpoint(way2, id3) {
28875           return !way2.isClosed() && !!way2.affix(id3);
28876         }
28877         for (var i3 = 0; i3 < ids.length; i3++) {
28878           var id2 = ids[i3];
28879           var childNodes = graph.childNodes(graph.entity(id2));
28880           for (var j3 = 0; j3 < childNodes.length; j3++) {
28881             var node = childNodes[j3];
28882             var parents = graph.parentWays(node);
28883             if (parents.length !== 2) continue;
28884             var moved = graph.entity(id2);
28885             var unmoved = null;
28886             for (var k3 = 0; k3 < parents.length; k3++) {
28887               var way = parents[k3];
28888               if (!cache.moving[way.id]) {
28889                 unmoved = way;
28890                 break;
28891               }
28892             }
28893             if (!unmoved) continue;
28894             if (utilArrayIntersection(moved.nodes, unmoved.nodes).length > 2) continue;
28895             if (moved.isArea() || unmoved.isArea()) continue;
28896             cache.intersections.push({
28897               nodeId: node.id,
28898               movedId: moved.id,
28899               unmovedId: unmoved.id,
28900               movedIsEP: isEndpoint(moved, node.id),
28901               unmovedIsEP: isEndpoint(unmoved, node.id)
28902             });
28903           }
28904         }
28905       }
28906       if (!cache) {
28907         cache = {};
28908       }
28909       if (!cache.ok) {
28910         cache.moving = {};
28911         cache.intersections = [];
28912         cache.replacedVertex = {};
28913         cache.startLoc = {};
28914         cache.nodes = [];
28915         cache.ways = [];
28916         cacheEntities(moveIDs);
28917         cacheIntersections(cache.ways);
28918         cache.nodes = cache.nodes.filter(canMove);
28919         cache.ok = true;
28920       }
28921     }
28922     function replaceMovedVertex(nodeId, wayId, graph, delta) {
28923       var way = graph.entity(wayId);
28924       var moved = graph.entity(nodeId);
28925       var movedIndex = way.nodes.indexOf(nodeId);
28926       var len, prevIndex, nextIndex;
28927       if (way.isClosed()) {
28928         len = way.nodes.length - 1;
28929         prevIndex = (movedIndex + len - 1) % len;
28930         nextIndex = (movedIndex + len + 1) % len;
28931       } else {
28932         len = way.nodes.length;
28933         prevIndex = movedIndex - 1;
28934         nextIndex = movedIndex + 1;
28935       }
28936       var prev = graph.hasEntity(way.nodes[prevIndex]);
28937       var next = graph.hasEntity(way.nodes[nextIndex]);
28938       if (!prev || !next) return graph;
28939       var key = wayId + "_" + nodeId;
28940       var orig = cache.replacedVertex[key];
28941       if (!orig) {
28942         orig = osmNode();
28943         cache.replacedVertex[key] = orig;
28944         cache.startLoc[orig.id] = cache.startLoc[nodeId];
28945       }
28946       var start2, end;
28947       if (delta) {
28948         start2 = projection2(cache.startLoc[nodeId]);
28949         end = projection2.invert(geoVecAdd(start2, delta));
28950       } else {
28951         end = cache.startLoc[nodeId];
28952       }
28953       orig = orig.move(end);
28954       var angle2 = Math.abs(geoAngle(orig, prev, projection2) - geoAngle(orig, next, projection2)) * 180 / Math.PI;
28955       if (angle2 > 175 && angle2 < 185) return graph;
28956       var p1 = [prev.loc, orig.loc, moved.loc, next.loc].map(projection2);
28957       var p2 = [prev.loc, moved.loc, orig.loc, next.loc].map(projection2);
28958       var d1 = geoPathLength(p1);
28959       var d2 = geoPathLength(p2);
28960       var insertAt = d1 <= d2 ? movedIndex : nextIndex;
28961       if (way.isClosed() && insertAt === 0) insertAt = len;
28962       way = way.addNode(orig.id, insertAt);
28963       return graph.replace(orig).replace(way);
28964     }
28965     function removeDuplicateVertices(wayId, graph) {
28966       var way = graph.entity(wayId);
28967       var epsilon3 = 1e-6;
28968       var prev, curr;
28969       function isInteresting(node, graph2) {
28970         return graph2.parentWays(node).length > 1 || graph2.parentRelations(node).length || node.hasInterestingTags();
28971       }
28972       for (var i3 = 0; i3 < way.nodes.length; i3++) {
28973         curr = graph.entity(way.nodes[i3]);
28974         if (prev && curr && geoVecEqual(prev.loc, curr.loc, epsilon3)) {
28975           if (!isInteresting(prev, graph)) {
28976             way = way.removeNode(prev.id);
28977             graph = graph.replace(way).remove(prev);
28978           } else if (!isInteresting(curr, graph)) {
28979             way = way.removeNode(curr.id);
28980             graph = graph.replace(way).remove(curr);
28981           }
28982         }
28983         prev = curr;
28984       }
28985       return graph;
28986     }
28987     function unZorroIntersection(intersection2, graph) {
28988       var vertex = graph.entity(intersection2.nodeId);
28989       var way1 = graph.entity(intersection2.movedId);
28990       var way2 = graph.entity(intersection2.unmovedId);
28991       var isEP1 = intersection2.movedIsEP;
28992       var isEP2 = intersection2.unmovedIsEP;
28993       if (isEP1 && isEP2) return graph;
28994       var nodes1 = graph.childNodes(way1).filter(function(n3) {
28995         return n3 !== vertex;
28996       });
28997       var nodes2 = graph.childNodes(way2).filter(function(n3) {
28998         return n3 !== vertex;
28999       });
29000       if (way1.isClosed() && way1.first() === vertex.id) nodes1.push(nodes1[0]);
29001       if (way2.isClosed() && way2.first() === vertex.id) nodes2.push(nodes2[0]);
29002       var edge1 = !isEP1 && geoChooseEdge(nodes1, projection2(vertex.loc), projection2);
29003       var edge2 = !isEP2 && geoChooseEdge(nodes2, projection2(vertex.loc), projection2);
29004       var loc;
29005       if (!isEP1 && !isEP2) {
29006         var epsilon3 = 1e-6, maxIter = 10;
29007         for (var i3 = 0; i3 < maxIter; i3++) {
29008           loc = geoVecInterp(edge1.loc, edge2.loc, 0.5);
29009           edge1 = geoChooseEdge(nodes1, projection2(loc), projection2);
29010           edge2 = geoChooseEdge(nodes2, projection2(loc), projection2);
29011           if (Math.abs(edge1.distance - edge2.distance) < epsilon3) break;
29012         }
29013       } else if (!isEP1) {
29014         loc = edge1.loc;
29015       } else {
29016         loc = edge2.loc;
29017       }
29018       graph = graph.replace(vertex.move(loc));
29019       if (!isEP1 && edge1.index !== way1.nodes.indexOf(vertex.id)) {
29020         way1 = way1.removeNode(vertex.id).addNode(vertex.id, edge1.index);
29021         graph = graph.replace(way1);
29022       }
29023       if (!isEP2 && edge2.index !== way2.nodes.indexOf(vertex.id)) {
29024         way2 = way2.removeNode(vertex.id).addNode(vertex.id, edge2.index);
29025         graph = graph.replace(way2);
29026       }
29027       return graph;
29028     }
29029     function cleanupIntersections(graph) {
29030       for (var i3 = 0; i3 < cache.intersections.length; i3++) {
29031         var obj = cache.intersections[i3];
29032         graph = replaceMovedVertex(obj.nodeId, obj.movedId, graph, _delta);
29033         graph = replaceMovedVertex(obj.nodeId, obj.unmovedId, graph, null);
29034         graph = unZorroIntersection(obj, graph);
29035         graph = removeDuplicateVertices(obj.movedId, graph);
29036         graph = removeDuplicateVertices(obj.unmovedId, graph);
29037       }
29038       return graph;
29039     }
29040     function limitDelta(graph) {
29041       function moveNode(loc) {
29042         return geoVecAdd(projection2(loc), _delta);
29043       }
29044       for (var i3 = 0; i3 < cache.intersections.length; i3++) {
29045         var obj = cache.intersections[i3];
29046         if (obj.movedIsEP && obj.unmovedIsEP) continue;
29047         if (!obj.movedIsEP) continue;
29048         var node = graph.entity(obj.nodeId);
29049         var start2 = projection2(node.loc);
29050         var end = geoVecAdd(start2, _delta);
29051         var movedNodes = graph.childNodes(graph.entity(obj.movedId));
29052         var movedPath = movedNodes.map(function(n3) {
29053           return moveNode(n3.loc);
29054         });
29055         var unmovedNodes = graph.childNodes(graph.entity(obj.unmovedId));
29056         var unmovedPath = unmovedNodes.map(function(n3) {
29057           return projection2(n3.loc);
29058         });
29059         var hits = geoPathIntersections(movedPath, unmovedPath);
29060         for (var j3 = 0; i3 < hits.length; i3++) {
29061           if (geoVecEqual(hits[j3], end)) continue;
29062           var edge = geoChooseEdge(unmovedNodes, end, projection2);
29063           _delta = geoVecSubtract(projection2(edge.loc), start2);
29064         }
29065       }
29066     }
29067     var action = function(graph) {
29068       if (_delta[0] === 0 && _delta[1] === 0) return graph;
29069       setupCache(graph);
29070       if (cache.intersections.length) {
29071         limitDelta(graph);
29072       }
29073       for (var i3 = 0; i3 < cache.nodes.length; i3++) {
29074         var node = graph.entity(cache.nodes[i3]);
29075         var start2 = projection2(node.loc);
29076         var end = geoVecAdd(start2, _delta);
29077         graph = graph.replace(node.move(projection2.invert(end)));
29078       }
29079       if (cache.intersections.length) {
29080         graph = cleanupIntersections(graph);
29081       }
29082       return graph;
29083     };
29084     action.delta = function() {
29085       return _delta;
29086     };
29087     return action;
29088   }
29089
29090   // modules/actions/move_member.js
29091   function actionMoveMember(relationId, fromIndex, toIndex) {
29092     return function(graph) {
29093       return graph.replace(graph.entity(relationId).moveMember(fromIndex, toIndex));
29094     };
29095   }
29096
29097   // modules/actions/move_node.js
29098   function actionMoveNode(nodeID, toLoc) {
29099     var action = function(graph, t2) {
29100       if (t2 === null || !isFinite(t2)) t2 = 1;
29101       t2 = Math.min(Math.max(+t2, 0), 1);
29102       var node = graph.entity(nodeID);
29103       return graph.replace(
29104         node.move(geoVecInterp(node.loc, toLoc, t2))
29105       );
29106     };
29107     action.transitionable = true;
29108     return action;
29109   }
29110
29111   // modules/actions/noop.js
29112   function actionNoop() {
29113     return function(graph) {
29114       return graph;
29115     };
29116   }
29117
29118   // modules/actions/orthogonalize.js
29119   function actionOrthogonalize(wayID, projection2, vertexID, degThresh, ep) {
29120     var epsilon3 = ep || 1e-4;
29121     var threshold = degThresh || 13;
29122     var lowerThreshold = Math.cos((90 - threshold) * Math.PI / 180);
29123     var upperThreshold = Math.cos(threshold * Math.PI / 180);
29124     var action = function(graph, t2) {
29125       if (t2 === null || !isFinite(t2)) t2 = 1;
29126       t2 = Math.min(Math.max(+t2, 0), 1);
29127       var way = graph.entity(wayID);
29128       way = way.removeNode("");
29129       if (way.tags.nonsquare) {
29130         var tags = Object.assign({}, way.tags);
29131         delete tags.nonsquare;
29132         way = way.update({ tags });
29133       }
29134       graph = graph.replace(way);
29135       var isClosed = way.isClosed();
29136       var nodes = graph.childNodes(way).slice();
29137       if (isClosed) nodes.pop();
29138       if (vertexID !== void 0) {
29139         nodes = nodeSubset(nodes, vertexID, isClosed);
29140         if (nodes.length !== 3) return graph;
29141       }
29142       var nodeCount = {};
29143       var points = [];
29144       var corner = { i: 0, dotp: 1 };
29145       var node, point, loc, score, motions, i3, j3;
29146       for (i3 = 0; i3 < nodes.length; i3++) {
29147         node = nodes[i3];
29148         nodeCount[node.id] = (nodeCount[node.id] || 0) + 1;
29149         points.push({ id: node.id, coord: projection2(node.loc) });
29150       }
29151       if (points.length === 3) {
29152         for (i3 = 0; i3 < 1e3; i3++) {
29153           const motion = calcMotion(points[1], 1, points);
29154           points[corner.i].coord = geoVecAdd(points[corner.i].coord, motion);
29155           score = corner.dotp;
29156           if (score < epsilon3) {
29157             break;
29158           }
29159         }
29160         node = graph.entity(nodes[corner.i].id);
29161         loc = projection2.invert(points[corner.i].coord);
29162         graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
29163       } else {
29164         var straights = [];
29165         var simplified = [];
29166         for (i3 = 0; i3 < points.length; i3++) {
29167           point = points[i3];
29168           var dotp = 0;
29169           if (isClosed || i3 > 0 && i3 < points.length - 1) {
29170             var a2 = points[(i3 - 1 + points.length) % points.length];
29171             var b3 = points[(i3 + 1) % points.length];
29172             dotp = Math.abs(geoOrthoNormalizedDotProduct(a2.coord, b3.coord, point.coord));
29173           }
29174           if (dotp > upperThreshold) {
29175             straights.push(point);
29176           } else {
29177             simplified.push(point);
29178           }
29179         }
29180         var bestPoints = clonePoints(simplified);
29181         var originalPoints = clonePoints(simplified);
29182         score = Infinity;
29183         for (i3 = 0; i3 < 1e3; i3++) {
29184           motions = simplified.map(calcMotion);
29185           for (j3 = 0; j3 < motions.length; j3++) {
29186             simplified[j3].coord = geoVecAdd(simplified[j3].coord, motions[j3]);
29187           }
29188           var newScore = geoOrthoCalcScore(simplified, isClosed, epsilon3, threshold);
29189           if (newScore < score) {
29190             bestPoints = clonePoints(simplified);
29191             score = newScore;
29192           }
29193           if (score < epsilon3) {
29194             break;
29195           }
29196         }
29197         var bestCoords = bestPoints.map(function(p2) {
29198           return p2.coord;
29199         });
29200         if (isClosed) bestCoords.push(bestCoords[0]);
29201         for (i3 = 0; i3 < bestPoints.length; i3++) {
29202           point = bestPoints[i3];
29203           if (!geoVecEqual(originalPoints[i3].coord, point.coord)) {
29204             node = graph.entity(point.id);
29205             loc = projection2.invert(point.coord);
29206             graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
29207           }
29208         }
29209         for (i3 = 0; i3 < straights.length; i3++) {
29210           point = straights[i3];
29211           if (nodeCount[point.id] > 1) continue;
29212           node = graph.entity(point.id);
29213           if (t2 === 1 && graph.parentWays(node).length === 1 && graph.parentRelations(node).length === 0 && !node.hasInterestingTags()) {
29214             graph = actionDeleteNode(node.id)(graph);
29215           } else {
29216             var choice = geoVecProject(point.coord, bestCoords);
29217             if (choice) {
29218               loc = projection2.invert(choice.target);
29219               graph = graph.replace(node.move(geoVecInterp(node.loc, loc, t2)));
29220             }
29221           }
29222         }
29223       }
29224       return graph;
29225       function clonePoints(array2) {
29226         return array2.map(function(p2) {
29227           return { id: p2.id, coord: [p2.coord[0], p2.coord[1]] };
29228         });
29229       }
29230       function calcMotion(point2, i4, array2) {
29231         if (!isClosed && (i4 === 0 || i4 === array2.length - 1)) return [0, 0];
29232         if (nodeCount[array2[i4].id] > 1) return [0, 0];
29233         var a3 = array2[(i4 - 1 + array2.length) % array2.length].coord;
29234         var origin = point2.coord;
29235         var b4 = array2[(i4 + 1) % array2.length].coord;
29236         var p2 = geoVecSubtract(a3, origin);
29237         var q3 = geoVecSubtract(b4, origin);
29238         var scale = 2 * Math.min(geoVecLength(p2), geoVecLength(q3));
29239         p2 = geoVecNormalize(p2);
29240         q3 = geoVecNormalize(q3);
29241         var dotp2 = p2[0] * q3[0] + p2[1] * q3[1];
29242         var val = Math.abs(dotp2);
29243         if (val < lowerThreshold) {
29244           corner.i = i4;
29245           corner.dotp = val;
29246           var vec = geoVecNormalize(geoVecAdd(p2, q3));
29247           return geoVecScale(vec, 0.1 * dotp2 * scale);
29248         }
29249         return [0, 0];
29250       }
29251     };
29252     function nodeSubset(nodes, vertexID2, isClosed) {
29253       var first = isClosed ? 0 : 1;
29254       var last2 = isClosed ? nodes.length : nodes.length - 1;
29255       for (var i3 = first; i3 < last2; i3++) {
29256         if (nodes[i3].id === vertexID2) {
29257           return [
29258             nodes[(i3 - 1 + nodes.length) % nodes.length],
29259             nodes[i3],
29260             nodes[(i3 + 1) % nodes.length]
29261           ];
29262         }
29263       }
29264       return [];
29265     }
29266     action.disabled = function(graph) {
29267       var way = graph.entity(wayID);
29268       way = way.removeNode("");
29269       graph = graph.replace(way);
29270       let isClosed = way.isClosed();
29271       var nodes = graph.childNodes(way).slice();
29272       if (isClosed) nodes.pop();
29273       var allowStraightAngles = false;
29274       if (vertexID !== void 0) {
29275         allowStraightAngles = true;
29276         nodes = nodeSubset(nodes, vertexID, isClosed);
29277         if (nodes.length !== 3) return "end_vertex";
29278         isClosed = false;
29279       }
29280       var coords = nodes.map(function(n3) {
29281         return projection2(n3.loc);
29282       });
29283       var score = geoOrthoCanOrthogonalize(coords, isClosed, epsilon3, threshold, allowStraightAngles);
29284       if (score === null) {
29285         return "not_squarish";
29286       } else if (score === 0) {
29287         return "square_enough";
29288       } else {
29289         return false;
29290       }
29291     };
29292     action.transitionable = true;
29293     return action;
29294   }
29295
29296   // modules/actions/restrict_turn.js
29297   function actionRestrictTurn(turn, restrictionType, restrictionID) {
29298     return function(graph) {
29299       var fromWay = graph.entity(turn.from.way);
29300       var toWay = graph.entity(turn.to.way);
29301       var viaNode = turn.via.node && graph.entity(turn.via.node);
29302       var viaWays = turn.via.ways && turn.via.ways.map(function(id2) {
29303         return graph.entity(id2);
29304       });
29305       var members = [];
29306       members.push({ id: fromWay.id, type: "way", role: "from" });
29307       if (viaNode) {
29308         members.push({ id: viaNode.id, type: "node", role: "via" });
29309       } else if (viaWays) {
29310         viaWays.forEach(function(viaWay) {
29311           members.push({ id: viaWay.id, type: "way", role: "via" });
29312         });
29313       }
29314       members.push({ id: toWay.id, type: "way", role: "to" });
29315       return graph.replace(osmRelation({
29316         id: restrictionID,
29317         tags: {
29318           type: "restriction",
29319           restriction: restrictionType
29320         },
29321         members
29322       }));
29323     };
29324   }
29325
29326   // modules/actions/revert.js
29327   function actionRevert(id2) {
29328     var action = function(graph) {
29329       var entity = graph.hasEntity(id2), base = graph.base().entities[id2];
29330       if (entity && !base) {
29331         if (entity.type === "node") {
29332           graph.parentWays(entity).forEach(function(parent2) {
29333             parent2 = parent2.removeNode(id2);
29334             graph = graph.replace(parent2);
29335             if (parent2.isDegenerate()) {
29336               graph = actionDeleteWay(parent2.id)(graph);
29337             }
29338           });
29339         }
29340         graph.parentRelations(entity).forEach(function(parent2) {
29341           parent2 = parent2.removeMembersWithID(id2);
29342           graph = graph.replace(parent2);
29343           if (parent2.isDegenerate()) {
29344             graph = actionDeleteRelation(parent2.id)(graph);
29345           }
29346         });
29347       }
29348       return graph.revert(id2);
29349     };
29350     return action;
29351   }
29352
29353   // modules/actions/rotate.js
29354   function actionRotate(rotateIds, pivot, angle2, projection2) {
29355     var action = function(graph) {
29356       return graph.update(function(graph2) {
29357         utilGetAllNodes(rotateIds, graph2).forEach(function(node) {
29358           var point = geoRotate([projection2(node.loc)], angle2, pivot)[0];
29359           graph2 = graph2.replace(node.move(projection2.invert(point)));
29360         });
29361       });
29362     };
29363     return action;
29364   }
29365
29366   // modules/actions/scale.js
29367   function actionScale(ids, pivotLoc, scaleFactor, projection2) {
29368     return function(graph) {
29369       return graph.update(function(graph2) {
29370         let point, radial;
29371         utilGetAllNodes(ids, graph2).forEach(function(node) {
29372           point = projection2(node.loc);
29373           radial = [
29374             point[0] - pivotLoc[0],
29375             point[1] - pivotLoc[1]
29376           ];
29377           point = [
29378             pivotLoc[0] + scaleFactor * radial[0],
29379             pivotLoc[1] + scaleFactor * radial[1]
29380           ];
29381           graph2 = graph2.replace(node.move(projection2.invert(point)));
29382         });
29383       });
29384     };
29385   }
29386
29387   // modules/actions/straighten_nodes.js
29388   function actionStraightenNodes(nodeIDs, projection2) {
29389     function positionAlongWay(a2, o2, b3) {
29390       return geoVecDot(a2, b3, o2) / geoVecDot(b3, b3, o2);
29391     }
29392     function getEndpoints(points) {
29393       var ssr = geoGetSmallestSurroundingRectangle(points);
29394       var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
29395       var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
29396       var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
29397       var q22 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
29398       var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q22);
29399       if (isLong) {
29400         return [p1, q1];
29401       }
29402       return [p2, q22];
29403     }
29404     var action = function(graph, t2) {
29405       if (t2 === null || !isFinite(t2)) t2 = 1;
29406       t2 = Math.min(Math.max(+t2, 0), 1);
29407       var nodes = nodeIDs.map(function(id2) {
29408         return graph.entity(id2);
29409       });
29410       var points = nodes.map(function(n3) {
29411         return projection2(n3.loc);
29412       });
29413       var endpoints = getEndpoints(points);
29414       var startPoint = endpoints[0];
29415       var endPoint = endpoints[1];
29416       for (var i3 = 0; i3 < points.length; i3++) {
29417         var node = nodes[i3];
29418         var point = points[i3];
29419         var u4 = positionAlongWay(point, startPoint, endPoint);
29420         var point2 = geoVecInterp(startPoint, endPoint, u4);
29421         var loc2 = projection2.invert(point2);
29422         graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
29423       }
29424       return graph;
29425     };
29426     action.disabled = function(graph) {
29427       var nodes = nodeIDs.map(function(id2) {
29428         return graph.entity(id2);
29429       });
29430       var points = nodes.map(function(n3) {
29431         return projection2(n3.loc);
29432       });
29433       var endpoints = getEndpoints(points);
29434       var startPoint = endpoints[0];
29435       var endPoint = endpoints[1];
29436       var maxDistance = 0;
29437       for (var i3 = 0; i3 < points.length; i3++) {
29438         var point = points[i3];
29439         var u4 = positionAlongWay(point, startPoint, endPoint);
29440         var p2 = geoVecInterp(startPoint, endPoint, u4);
29441         var dist = geoVecLength(p2, point);
29442         if (!isNaN(dist) && dist > maxDistance) {
29443           maxDistance = dist;
29444         }
29445       }
29446       if (maxDistance < 1e-4) {
29447         return "straight_enough";
29448       }
29449     };
29450     action.transitionable = true;
29451     return action;
29452   }
29453
29454   // modules/actions/straighten_way.js
29455   function actionStraightenWay(selectedIDs, projection2) {
29456     function positionAlongWay(a2, o2, b3) {
29457       return geoVecDot(a2, b3, o2) / geoVecDot(b3, b3, o2);
29458     }
29459     function allNodes(graph) {
29460       var nodes = [];
29461       var startNodes = [];
29462       var endNodes = [];
29463       var remainingWays = [];
29464       var selectedWays = selectedIDs.filter(function(w3) {
29465         return graph.entity(w3).type === "way";
29466       });
29467       var selectedNodes = selectedIDs.filter(function(n3) {
29468         return graph.entity(n3).type === "node";
29469       });
29470       for (var i3 = 0; i3 < selectedWays.length; i3++) {
29471         var way = graph.entity(selectedWays[i3]);
29472         nodes = way.nodes.slice(0);
29473         remainingWays.push(nodes);
29474         startNodes.push(nodes[0]);
29475         endNodes.push(nodes[nodes.length - 1]);
29476       }
29477       startNodes = startNodes.filter(function(n3) {
29478         return startNodes.indexOf(n3) === startNodes.lastIndexOf(n3);
29479       });
29480       endNodes = endNodes.filter(function(n3) {
29481         return endNodes.indexOf(n3) === endNodes.lastIndexOf(n3);
29482       });
29483       var currNode = utilArrayDifference(startNodes, endNodes).concat(utilArrayDifference(endNodes, startNodes))[0];
29484       var nextWay = [];
29485       nodes = [];
29486       var getNextWay = function(currNode2, remainingWays2) {
29487         return remainingWays2.filter(function(way2) {
29488           return way2[0] === currNode2 || way2[way2.length - 1] === currNode2;
29489         })[0];
29490       };
29491       while (remainingWays.length) {
29492         nextWay = getNextWay(currNode, remainingWays);
29493         remainingWays = utilArrayDifference(remainingWays, [nextWay]);
29494         if (nextWay[0] !== currNode) {
29495           nextWay.reverse();
29496         }
29497         nodes = nodes.concat(nextWay);
29498         currNode = nodes[nodes.length - 1];
29499       }
29500       if (selectedNodes.length === 2) {
29501         var startNodeIdx = nodes.indexOf(selectedNodes[0]);
29502         var endNodeIdx = nodes.indexOf(selectedNodes[1]);
29503         var sortedStartEnd = [startNodeIdx, endNodeIdx];
29504         sortedStartEnd.sort(function(a2, b3) {
29505           return a2 - b3;
29506         });
29507         nodes = nodes.slice(sortedStartEnd[0], sortedStartEnd[1] + 1);
29508       }
29509       return nodes.map(function(n3) {
29510         return graph.entity(n3);
29511       });
29512     }
29513     function shouldKeepNode(node, graph) {
29514       return graph.parentWays(node).length > 1 || graph.parentRelations(node).length || node.hasInterestingTags();
29515     }
29516     var action = function(graph, t2) {
29517       if (t2 === null || !isFinite(t2)) t2 = 1;
29518       t2 = Math.min(Math.max(+t2, 0), 1);
29519       var nodes = allNodes(graph);
29520       var points = nodes.map(function(n3) {
29521         return projection2(n3.loc);
29522       });
29523       var startPoint = points[0];
29524       var endPoint = points[points.length - 1];
29525       var toDelete = [];
29526       var i3;
29527       for (i3 = 1; i3 < points.length - 1; i3++) {
29528         var node = nodes[i3];
29529         var point = points[i3];
29530         if (t2 < 1 || shouldKeepNode(node, graph)) {
29531           var u4 = positionAlongWay(point, startPoint, endPoint);
29532           var p2 = geoVecInterp(startPoint, endPoint, u4);
29533           var loc2 = projection2.invert(p2);
29534           graph = graph.replace(node.move(geoVecInterp(node.loc, loc2, t2)));
29535         } else {
29536           if (toDelete.indexOf(node) === -1) {
29537             toDelete.push(node);
29538           }
29539         }
29540       }
29541       for (i3 = 0; i3 < toDelete.length; i3++) {
29542         graph = actionDeleteNode(toDelete[i3].id)(graph);
29543       }
29544       return graph;
29545     };
29546     action.disabled = function(graph) {
29547       var nodes = allNodes(graph);
29548       var points = nodes.map(function(n3) {
29549         return projection2(n3.loc);
29550       });
29551       var startPoint = points[0];
29552       var endPoint = points[points.length - 1];
29553       var threshold = 0.2 * geoVecLength(startPoint, endPoint);
29554       var i3;
29555       if (threshold === 0) {
29556         return "too_bendy";
29557       }
29558       var maxDistance = 0;
29559       for (i3 = 1; i3 < points.length - 1; i3++) {
29560         var point = points[i3];
29561         var u4 = positionAlongWay(point, startPoint, endPoint);
29562         var p2 = geoVecInterp(startPoint, endPoint, u4);
29563         var dist = geoVecLength(p2, point);
29564         if (isNaN(dist) || dist > threshold) {
29565           return "too_bendy";
29566         } else if (dist > maxDistance) {
29567           maxDistance = dist;
29568         }
29569       }
29570       var keepingAllNodes = nodes.every(function(node, i4) {
29571         return i4 === 0 || i4 === nodes.length - 1 || shouldKeepNode(node, graph);
29572       });
29573       if (maxDistance < 1e-4 && // Allow straightening even if already straight in order to remove extraneous nodes
29574       keepingAllNodes) {
29575         return "straight_enough";
29576       }
29577     };
29578     action.transitionable = true;
29579     return action;
29580   }
29581
29582   // modules/actions/unrestrict_turn.js
29583   function actionUnrestrictTurn(turn) {
29584     return function(graph) {
29585       return actionDeleteRelation(turn.restrictionID)(graph);
29586     };
29587   }
29588
29589   // modules/actions/reflect.js
29590   function actionReflect(reflectIds, projection2) {
29591     var _useLongAxis = true;
29592     var action = function(graph, t2) {
29593       if (t2 === null || !isFinite(t2)) t2 = 1;
29594       t2 = Math.min(Math.max(+t2, 0), 1);
29595       var nodes = utilGetAllNodes(reflectIds, graph);
29596       var points = nodes.map(function(n3) {
29597         return projection2(n3.loc);
29598       });
29599       var ssr = geoGetSmallestSurroundingRectangle(points);
29600       var p1 = [(ssr.poly[0][0] + ssr.poly[1][0]) / 2, (ssr.poly[0][1] + ssr.poly[1][1]) / 2];
29601       var q1 = [(ssr.poly[2][0] + ssr.poly[3][0]) / 2, (ssr.poly[2][1] + ssr.poly[3][1]) / 2];
29602       var p2 = [(ssr.poly[3][0] + ssr.poly[4][0]) / 2, (ssr.poly[3][1] + ssr.poly[4][1]) / 2];
29603       var q22 = [(ssr.poly[1][0] + ssr.poly[2][0]) / 2, (ssr.poly[1][1] + ssr.poly[2][1]) / 2];
29604       var p3, q3;
29605       var isLong = geoVecLength(p1, q1) > geoVecLength(p2, q22);
29606       if (_useLongAxis && isLong || !_useLongAxis && !isLong) {
29607         p3 = p1;
29608         q3 = q1;
29609       } else {
29610         p3 = p2;
29611         q3 = q22;
29612       }
29613       var dx = q3[0] - p3[0];
29614       var dy = q3[1] - p3[1];
29615       var a2 = (dx * dx - dy * dy) / (dx * dx + dy * dy);
29616       var b3 = 2 * dx * dy / (dx * dx + dy * dy);
29617       for (var i3 = 0; i3 < nodes.length; i3++) {
29618         var node = nodes[i3];
29619         var c2 = projection2(node.loc);
29620         var c22 = [
29621           a2 * (c2[0] - p3[0]) + b3 * (c2[1] - p3[1]) + p3[0],
29622           b3 * (c2[0] - p3[0]) - a2 * (c2[1] - p3[1]) + p3[1]
29623         ];
29624         var loc2 = projection2.invert(c22);
29625         node = node.move(geoVecInterp(node.loc, loc2, t2));
29626         graph = graph.replace(node);
29627       }
29628       return graph;
29629     };
29630     action.useLongAxis = function(val) {
29631       if (!arguments.length) return _useLongAxis;
29632       _useLongAxis = val;
29633       return action;
29634     };
29635     action.transitionable = true;
29636     return action;
29637   }
29638
29639   // modules/actions/upgrade_tags.js
29640   function actionUpgradeTags(entityId, oldTags, replaceTags) {
29641     return function(graph) {
29642       var entity = graph.entity(entityId);
29643       var tags = Object.assign({}, entity.tags);
29644       var transferValue;
29645       var semiIndex;
29646       for (var oldTagKey in oldTags) {
29647         if (!(oldTagKey in tags)) continue;
29648         if (oldTags[oldTagKey] === "*") {
29649           transferValue = tags[oldTagKey];
29650           delete tags[oldTagKey];
29651         } else if (oldTags[oldTagKey] === tags[oldTagKey]) {
29652           delete tags[oldTagKey];
29653         } else {
29654           var vals = tags[oldTagKey].split(";").filter(Boolean);
29655           var oldIndex = vals.indexOf(oldTags[oldTagKey]);
29656           if (vals.length === 1 || oldIndex === -1) {
29657             delete tags[oldTagKey];
29658           } else {
29659             if (replaceTags && replaceTags[oldTagKey]) {
29660               semiIndex = oldIndex;
29661             }
29662             vals.splice(oldIndex, 1);
29663             tags[oldTagKey] = vals.join(";");
29664           }
29665         }
29666       }
29667       if (replaceTags) {
29668         for (var replaceKey in replaceTags) {
29669           var replaceValue = replaceTags[replaceKey];
29670           if (replaceValue === "*") {
29671             if (tags[replaceKey] && tags[replaceKey] !== "no") {
29672               continue;
29673             } else {
29674               tags[replaceKey] = "yes";
29675             }
29676           } else if (replaceValue === "$1") {
29677             tags[replaceKey] = transferValue;
29678           } else {
29679             if (tags[replaceKey] && oldTags[replaceKey] && semiIndex !== void 0) {
29680               var existingVals = tags[replaceKey].split(";").filter(Boolean);
29681               if (existingVals.indexOf(replaceValue) === -1) {
29682                 existingVals.splice(semiIndex, 0, replaceValue);
29683                 tags[replaceKey] = existingVals.join(";");
29684               }
29685             } else {
29686               tags[replaceKey] = replaceValue;
29687             }
29688           }
29689         }
29690       }
29691       return graph.replace(entity.update({ tags }));
29692     };
29693   }
29694
29695   // modules/behavior/edit.js
29696   function behaviorEdit(context) {
29697     function behavior() {
29698       context.map().minzoom(context.minEditableZoom());
29699     }
29700     behavior.off = function() {
29701       context.map().minzoom(0);
29702     };
29703     return behavior;
29704   }
29705
29706   // modules/behavior/hover.js
29707   function behaviorHover(context) {
29708     var dispatch12 = dispatch_default("hover");
29709     var _selection = select_default2(null);
29710     var _newNodeId = null;
29711     var _initialNodeID = null;
29712     var _altDisables;
29713     var _ignoreVertex;
29714     var _targets = [];
29715     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
29716     function keydown(d3_event) {
29717       if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
29718         _selection.selectAll(".hover").classed("hover-suppressed", true).classed("hover", false);
29719         _selection.classed("hover-disabled", true);
29720         dispatch12.call("hover", this, null);
29721       }
29722     }
29723     function keyup(d3_event) {
29724       if (_altDisables && d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
29725         _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false).classed("hover", true);
29726         _selection.classed("hover-disabled", false);
29727         dispatch12.call("hover", this, _targets);
29728       }
29729     }
29730     function behavior(selection2) {
29731       _selection = selection2;
29732       _targets = [];
29733       if (_initialNodeID) {
29734         _newNodeId = _initialNodeID;
29735         _initialNodeID = null;
29736       } else {
29737         _newNodeId = null;
29738       }
29739       _selection.on(_pointerPrefix + "over.hover", pointerover).on(_pointerPrefix + "out.hover", pointerout).on(_pointerPrefix + "down.hover", pointerover);
29740       select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", pointerout, true).on("keydown.hover", keydown).on("keyup.hover", keyup);
29741       function eventTarget(d3_event) {
29742         var datum2 = d3_event.target && d3_event.target.__data__;
29743         if (typeof datum2 !== "object") return null;
29744         if (!(datum2 instanceof osmEntity) && datum2.properties && datum2.properties.entity instanceof osmEntity) {
29745           return datum2.properties.entity;
29746         }
29747         return datum2;
29748       }
29749       function pointerover(d3_event) {
29750         if (context.mode().id.indexOf("drag") === -1 && (!d3_event.pointerType || d3_event.pointerType === "mouse") && d3_event.buttons) return;
29751         var target = eventTarget(d3_event);
29752         if (target && _targets.indexOf(target) === -1) {
29753           _targets.push(target);
29754           updateHover(d3_event, _targets);
29755         }
29756       }
29757       function pointerout(d3_event) {
29758         var target = eventTarget(d3_event);
29759         var index = _targets.indexOf(target);
29760         if (index !== -1) {
29761           _targets.splice(index);
29762           updateHover(d3_event, _targets);
29763         }
29764       }
29765       function allowsVertex(d2) {
29766         return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
29767       }
29768       function modeAllowsHover(target) {
29769         var mode = context.mode();
29770         if (mode.id === "add-point") {
29771           return mode.preset.matchGeometry("vertex") || target.type !== "way" && target.geometry(context.graph()) !== "vertex";
29772         }
29773         return true;
29774       }
29775       function updateHover(d3_event, targets) {
29776         _selection.selectAll(".hover").classed("hover", false);
29777         _selection.selectAll(".hover-suppressed").classed("hover-suppressed", false);
29778         var mode = context.mode();
29779         if (!_newNodeId && (mode.id === "draw-line" || mode.id === "draw-area")) {
29780           var node = targets.find(function(target) {
29781             return target instanceof osmEntity && target.type === "node";
29782           });
29783           _newNodeId = node && node.id;
29784         }
29785         targets = targets.filter(function(datum3) {
29786           if (datum3 instanceof osmEntity) {
29787             return datum3.id !== _newNodeId && (datum3.type !== "node" || !_ignoreVertex || allowsVertex(datum3)) && modeAllowsHover(datum3);
29788           }
29789           return true;
29790         });
29791         var selector = "";
29792         for (var i3 in targets) {
29793           var datum2 = targets[i3];
29794           if (datum2.__featurehash__) {
29795             selector += ", .data" + datum2.__featurehash__;
29796           } else if (datum2 instanceof QAItem) {
29797             selector += ", ." + datum2.service + ".itemId-" + datum2.id;
29798           } else if (datum2 instanceof osmNote) {
29799             selector += ", .note-" + datum2.id;
29800           } else if (datum2 instanceof osmEntity) {
29801             selector += ", ." + datum2.id;
29802             if (datum2.type === "relation") {
29803               for (var j3 in datum2.members) {
29804                 selector += ", ." + datum2.members[j3].id;
29805               }
29806             }
29807           }
29808         }
29809         var suppressed = _altDisables && d3_event && d3_event.altKey;
29810         if (selector.trim().length) {
29811           selector = selector.slice(1);
29812           _selection.selectAll(selector).classed(suppressed ? "hover-suppressed" : "hover", true);
29813         }
29814         dispatch12.call("hover", this, !suppressed && targets);
29815       }
29816     }
29817     behavior.off = function(selection2) {
29818       selection2.selectAll(".hover").classed("hover", false);
29819       selection2.selectAll(".hover-suppressed").classed("hover-suppressed", false);
29820       selection2.classed("hover-disabled", false);
29821       selection2.on(_pointerPrefix + "over.hover", null).on(_pointerPrefix + "out.hover", null).on(_pointerPrefix + "down.hover", null);
29822       select_default2(window).on(_pointerPrefix + "up.hover pointercancel.hover", null, true).on("keydown.hover", null).on("keyup.hover", null);
29823     };
29824     behavior.altDisables = function(val) {
29825       if (!arguments.length) return _altDisables;
29826       _altDisables = val;
29827       return behavior;
29828     };
29829     behavior.ignoreVertex = function(val) {
29830       if (!arguments.length) return _ignoreVertex;
29831       _ignoreVertex = val;
29832       return behavior;
29833     };
29834     behavior.initialNodeID = function(nodeId) {
29835       _initialNodeID = nodeId;
29836       return behavior;
29837     };
29838     return utilRebind(behavior, dispatch12, "on");
29839   }
29840
29841   // modules/behavior/draw.js
29842   var _disableSpace = false;
29843   var _lastSpace = null;
29844   function behaviorDraw(context) {
29845     var dispatch12 = dispatch_default(
29846       "move",
29847       "down",
29848       "downcancel",
29849       "click",
29850       "clickWay",
29851       "clickNode",
29852       "undo",
29853       "cancel",
29854       "finish"
29855     );
29856     var keybinding = utilKeybinding("draw");
29857     var _hover = behaviorHover(context).altDisables(true).ignoreVertex(true).on("hover", context.ui().sidebar.hover);
29858     var _edit = behaviorEdit(context);
29859     var _closeTolerance = 4;
29860     var _tolerance = 12;
29861     var _mouseLeave = false;
29862     var _lastMouse = null;
29863     var _lastPointerUpEvent;
29864     var _downPointer;
29865     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
29866     function datum2(d3_event) {
29867       var mode = context.mode();
29868       var isNote = mode && mode.id.indexOf("note") !== -1;
29869       if (d3_event.altKey || isNote) return {};
29870       var element;
29871       if (d3_event.type === "keydown") {
29872         element = _lastMouse && _lastMouse.target;
29873       } else {
29874         element = d3_event.target;
29875       }
29876       var d2 = element.__data__;
29877       return d2 && d2.properties && d2.properties.target ? d2 : {};
29878     }
29879     function pointerdown(d3_event) {
29880       if (_downPointer) return;
29881       var pointerLocGetter = utilFastMouse(this);
29882       _downPointer = {
29883         id: d3_event.pointerId || "mouse",
29884         pointerLocGetter,
29885         downTime: +/* @__PURE__ */ new Date(),
29886         downLoc: pointerLocGetter(d3_event)
29887       };
29888       dispatch12.call("down", this, d3_event, datum2(d3_event));
29889     }
29890     function pointerup(d3_event) {
29891       if (!_downPointer || _downPointer.id !== (d3_event.pointerId || "mouse")) return;
29892       var downPointer = _downPointer;
29893       _downPointer = null;
29894       _lastPointerUpEvent = d3_event;
29895       if (downPointer.isCancelled) return;
29896       var t2 = +/* @__PURE__ */ new Date();
29897       var p2 = downPointer.pointerLocGetter(d3_event);
29898       var dist = geoVecLength(downPointer.downLoc, p2);
29899       if (dist < _closeTolerance || dist < _tolerance && t2 - downPointer.downTime < 500) {
29900         select_default2(window).on("click.draw-block", function() {
29901           d3_event.stopPropagation();
29902         }, true);
29903         context.map().dblclickZoomEnable(false);
29904         window.setTimeout(function() {
29905           context.map().dblclickZoomEnable(true);
29906           select_default2(window).on("click.draw-block", null);
29907         }, 500);
29908         click(d3_event, p2);
29909       }
29910     }
29911     function pointermove(d3_event) {
29912       if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse") && !_downPointer.isCancelled) {
29913         var p2 = _downPointer.pointerLocGetter(d3_event);
29914         var dist = geoVecLength(_downPointer.downLoc, p2);
29915         if (dist >= _closeTolerance) {
29916           _downPointer.isCancelled = true;
29917           dispatch12.call("downcancel", this);
29918         }
29919       }
29920       if (d3_event.pointerType && d3_event.pointerType !== "mouse" || d3_event.buttons || _downPointer) return;
29921       if (_lastPointerUpEvent && _lastPointerUpEvent.pointerType !== "mouse" && d3_event.timeStamp - _lastPointerUpEvent.timeStamp < 100) return;
29922       _lastMouse = d3_event;
29923       dispatch12.call("move", this, d3_event, datum2(d3_event));
29924     }
29925     function pointercancel(d3_event) {
29926       if (_downPointer && _downPointer.id === (d3_event.pointerId || "mouse")) {
29927         if (!_downPointer.isCancelled) {
29928           dispatch12.call("downcancel", this);
29929         }
29930         _downPointer = null;
29931       }
29932     }
29933     function mouseenter() {
29934       _mouseLeave = false;
29935     }
29936     function mouseleave() {
29937       _mouseLeave = true;
29938     }
29939     function allowsVertex(d2) {
29940       return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
29941     }
29942     function click(d3_event, loc) {
29943       var d2 = datum2(d3_event);
29944       var target = d2 && d2.properties && d2.properties.entity;
29945       var mode = context.mode();
29946       if (target && target.type === "node" && allowsVertex(target)) {
29947         dispatch12.call("clickNode", this, target, d2);
29948         return;
29949       } else if (target && target.type === "way" && (mode.id !== "add-point" || mode.preset.matchGeometry("vertex"))) {
29950         var choice = geoChooseEdge(
29951           context.graph().childNodes(target),
29952           loc,
29953           context.projection,
29954           context.activeID()
29955         );
29956         if (choice) {
29957           var edge = [target.nodes[choice.index - 1], target.nodes[choice.index]];
29958           dispatch12.call("clickWay", this, choice.loc, edge, d2);
29959           return;
29960         }
29961       } else if (mode.id !== "add-point" || mode.preset.matchGeometry("point")) {
29962         var locLatLng = context.projection.invert(loc);
29963         dispatch12.call("click", this, locLatLng, d2);
29964       }
29965     }
29966     function space(d3_event) {
29967       d3_event.preventDefault();
29968       d3_event.stopPropagation();
29969       var currSpace = context.map().mouse();
29970       if (_disableSpace && _lastSpace) {
29971         var dist = geoVecLength(_lastSpace, currSpace);
29972         if (dist > _tolerance) {
29973           _disableSpace = false;
29974         }
29975       }
29976       if (_disableSpace || _mouseLeave || !_lastMouse) return;
29977       _lastSpace = currSpace;
29978       _disableSpace = true;
29979       select_default2(window).on("keyup.space-block", function() {
29980         d3_event.preventDefault();
29981         d3_event.stopPropagation();
29982         _disableSpace = false;
29983         select_default2(window).on("keyup.space-block", null);
29984       });
29985       var loc = context.map().mouse() || // or the map center if the mouse has never entered the map
29986       context.projection(context.map().center());
29987       click(d3_event, loc);
29988     }
29989     function backspace(d3_event) {
29990       d3_event.preventDefault();
29991       dispatch12.call("undo");
29992     }
29993     function del2(d3_event) {
29994       d3_event.preventDefault();
29995       dispatch12.call("cancel");
29996     }
29997     function ret(d3_event) {
29998       d3_event.preventDefault();
29999       dispatch12.call("finish");
30000     }
30001     function behavior(selection2) {
30002       context.install(_hover);
30003       context.install(_edit);
30004       _downPointer = null;
30005       keybinding.on("\u232B", backspace).on("\u2326", del2).on("\u238B", ret).on("\u21A9", ret).on("space", space).on("\u2325space", space);
30006       selection2.on("mouseenter.draw", mouseenter).on("mouseleave.draw", mouseleave).on(_pointerPrefix + "down.draw", pointerdown).on(_pointerPrefix + "move.draw", pointermove);
30007       select_default2(window).on(_pointerPrefix + "up.draw", pointerup, true).on("pointercancel.draw", pointercancel, true);
30008       select_default2(document).call(keybinding);
30009       return behavior;
30010     }
30011     behavior.off = function(selection2) {
30012       context.ui().sidebar.hover.cancel();
30013       context.uninstall(_hover);
30014       context.uninstall(_edit);
30015       selection2.on("mouseenter.draw", null).on("mouseleave.draw", null).on(_pointerPrefix + "down.draw", null).on(_pointerPrefix + "move.draw", null);
30016       select_default2(window).on(_pointerPrefix + "up.draw", null).on("pointercancel.draw", null);
30017       select_default2(document).call(keybinding.unbind);
30018     };
30019     behavior.hover = function() {
30020       return _hover;
30021     };
30022     return utilRebind(behavior, dispatch12, "on");
30023   }
30024
30025   // modules/behavior/breathe.js
30026   var import_fast_deep_equal2 = __toESM(require_fast_deep_equal(), 1);
30027
30028   // node_modules/d3-scale/src/init.js
30029   function initRange(domain, range3) {
30030     switch (arguments.length) {
30031       case 0:
30032         break;
30033       case 1:
30034         this.range(domain);
30035         break;
30036       default:
30037         this.range(range3).domain(domain);
30038         break;
30039     }
30040     return this;
30041   }
30042
30043   // node_modules/d3-scale/src/constant.js
30044   function constants(x3) {
30045     return function() {
30046       return x3;
30047     };
30048   }
30049
30050   // node_modules/d3-scale/src/number.js
30051   function number2(x3) {
30052     return +x3;
30053   }
30054
30055   // node_modules/d3-scale/src/continuous.js
30056   var unit = [0, 1];
30057   function identity4(x3) {
30058     return x3;
30059   }
30060   function normalize(a2, b3) {
30061     return (b3 -= a2 = +a2) ? function(x3) {
30062       return (x3 - a2) / b3;
30063     } : constants(isNaN(b3) ? NaN : 0.5);
30064   }
30065   function clamper(a2, b3) {
30066     var t2;
30067     if (a2 > b3) t2 = a2, a2 = b3, b3 = t2;
30068     return function(x3) {
30069       return Math.max(a2, Math.min(b3, x3));
30070     };
30071   }
30072   function bimap(domain, range3, interpolate) {
30073     var d0 = domain[0], d1 = domain[1], r0 = range3[0], r1 = range3[1];
30074     if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
30075     else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
30076     return function(x3) {
30077       return r0(d0(x3));
30078     };
30079   }
30080   function polymap(domain, range3, interpolate) {
30081     var j3 = Math.min(domain.length, range3.length) - 1, d2 = new Array(j3), r2 = new Array(j3), i3 = -1;
30082     if (domain[j3] < domain[0]) {
30083       domain = domain.slice().reverse();
30084       range3 = range3.slice().reverse();
30085     }
30086     while (++i3 < j3) {
30087       d2[i3] = normalize(domain[i3], domain[i3 + 1]);
30088       r2[i3] = interpolate(range3[i3], range3[i3 + 1]);
30089     }
30090     return function(x3) {
30091       var i4 = bisect_default(domain, x3, 1, j3) - 1;
30092       return r2[i4](d2[i4](x3));
30093     };
30094   }
30095   function copy(source, target) {
30096     return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
30097   }
30098   function transformer2() {
30099     var domain = unit, range3 = unit, interpolate = value_default, transform2, untransform, unknown, clamp2 = identity4, piecewise, output, input;
30100     function rescale() {
30101       var n3 = Math.min(domain.length, range3.length);
30102       if (clamp2 !== identity4) clamp2 = clamper(domain[0], domain[n3 - 1]);
30103       piecewise = n3 > 2 ? polymap : bimap;
30104       output = input = null;
30105       return scale;
30106     }
30107     function scale(x3) {
30108       return x3 == null || isNaN(x3 = +x3) ? unknown : (output || (output = piecewise(domain.map(transform2), range3, interpolate)))(transform2(clamp2(x3)));
30109     }
30110     scale.invert = function(y3) {
30111       return clamp2(untransform((input || (input = piecewise(range3, domain.map(transform2), number_default)))(y3)));
30112     };
30113     scale.domain = function(_3) {
30114       return arguments.length ? (domain = Array.from(_3, number2), rescale()) : domain.slice();
30115     };
30116     scale.range = function(_3) {
30117       return arguments.length ? (range3 = Array.from(_3), rescale()) : range3.slice();
30118     };
30119     scale.rangeRound = function(_3) {
30120       return range3 = Array.from(_3), interpolate = round_default, rescale();
30121     };
30122     scale.clamp = function(_3) {
30123       return arguments.length ? (clamp2 = _3 ? true : identity4, rescale()) : clamp2 !== identity4;
30124     };
30125     scale.interpolate = function(_3) {
30126       return arguments.length ? (interpolate = _3, rescale()) : interpolate;
30127     };
30128     scale.unknown = function(_3) {
30129       return arguments.length ? (unknown = _3, scale) : unknown;
30130     };
30131     return function(t2, u4) {
30132       transform2 = t2, untransform = u4;
30133       return rescale();
30134     };
30135   }
30136   function continuous() {
30137     return transformer2()(identity4, identity4);
30138   }
30139
30140   // node_modules/d3-format/src/formatDecimal.js
30141   function formatDecimal_default(x3) {
30142     return Math.abs(x3 = Math.round(x3)) >= 1e21 ? x3.toLocaleString("en").replace(/,/g, "") : x3.toString(10);
30143   }
30144   function formatDecimalParts(x3, p2) {
30145     if ((i3 = (x3 = p2 ? x3.toExponential(p2 - 1) : x3.toExponential()).indexOf("e")) < 0) return null;
30146     var i3, coefficient = x3.slice(0, i3);
30147     return [
30148       coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
30149       +x3.slice(i3 + 1)
30150     ];
30151   }
30152
30153   // node_modules/d3-format/src/exponent.js
30154   function exponent_default(x3) {
30155     return x3 = formatDecimalParts(Math.abs(x3)), x3 ? x3[1] : NaN;
30156   }
30157
30158   // node_modules/d3-format/src/formatGroup.js
30159   function formatGroup_default(grouping, thousands) {
30160     return function(value, width) {
30161       var i3 = value.length, t2 = [], j3 = 0, g3 = grouping[0], length2 = 0;
30162       while (i3 > 0 && g3 > 0) {
30163         if (length2 + g3 + 1 > width) g3 = Math.max(1, width - length2);
30164         t2.push(value.substring(i3 -= g3, i3 + g3));
30165         if ((length2 += g3 + 1) > width) break;
30166         g3 = grouping[j3 = (j3 + 1) % grouping.length];
30167       }
30168       return t2.reverse().join(thousands);
30169     };
30170   }
30171
30172   // node_modules/d3-format/src/formatNumerals.js
30173   function formatNumerals_default(numerals) {
30174     return function(value) {
30175       return value.replace(/[0-9]/g, function(i3) {
30176         return numerals[+i3];
30177       });
30178     };
30179   }
30180
30181   // node_modules/d3-format/src/formatSpecifier.js
30182   var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
30183   function formatSpecifier(specifier) {
30184     if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
30185     var match;
30186     return new FormatSpecifier({
30187       fill: match[1],
30188       align: match[2],
30189       sign: match[3],
30190       symbol: match[4],
30191       zero: match[5],
30192       width: match[6],
30193       comma: match[7],
30194       precision: match[8] && match[8].slice(1),
30195       trim: match[9],
30196       type: match[10]
30197     });
30198   }
30199   formatSpecifier.prototype = FormatSpecifier.prototype;
30200   function FormatSpecifier(specifier) {
30201     this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
30202     this.align = specifier.align === void 0 ? ">" : specifier.align + "";
30203     this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
30204     this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
30205     this.zero = !!specifier.zero;
30206     this.width = specifier.width === void 0 ? void 0 : +specifier.width;
30207     this.comma = !!specifier.comma;
30208     this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
30209     this.trim = !!specifier.trim;
30210     this.type = specifier.type === void 0 ? "" : specifier.type + "";
30211   }
30212   FormatSpecifier.prototype.toString = function() {
30213     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;
30214   };
30215
30216   // node_modules/d3-format/src/formatTrim.js
30217   function formatTrim_default(s2) {
30218     out: for (var n3 = s2.length, i3 = 1, i0 = -1, i1; i3 < n3; ++i3) {
30219       switch (s2[i3]) {
30220         case ".":
30221           i0 = i1 = i3;
30222           break;
30223         case "0":
30224           if (i0 === 0) i0 = i3;
30225           i1 = i3;
30226           break;
30227         default:
30228           if (!+s2[i3]) break out;
30229           if (i0 > 0) i0 = 0;
30230           break;
30231       }
30232     }
30233     return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
30234   }
30235
30236   // node_modules/d3-format/src/formatPrefixAuto.js
30237   var prefixExponent;
30238   function formatPrefixAuto_default(x3, p2) {
30239     var d2 = formatDecimalParts(x3, p2);
30240     if (!d2) return x3 + "";
30241     var coefficient = d2[0], exponent = d2[1], i3 = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n3 = coefficient.length;
30242     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(x3, Math.max(0, p2 + i3 - 1))[0];
30243   }
30244
30245   // node_modules/d3-format/src/formatRounded.js
30246   function formatRounded_default(x3, p2) {
30247     var d2 = formatDecimalParts(x3, p2);
30248     if (!d2) return x3 + "";
30249     var coefficient = d2[0], exponent = d2[1];
30250     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");
30251   }
30252
30253   // node_modules/d3-format/src/formatTypes.js
30254   var formatTypes_default = {
30255     "%": (x3, p2) => (x3 * 100).toFixed(p2),
30256     "b": (x3) => Math.round(x3).toString(2),
30257     "c": (x3) => x3 + "",
30258     "d": formatDecimal_default,
30259     "e": (x3, p2) => x3.toExponential(p2),
30260     "f": (x3, p2) => x3.toFixed(p2),
30261     "g": (x3, p2) => x3.toPrecision(p2),
30262     "o": (x3) => Math.round(x3).toString(8),
30263     "p": (x3, p2) => formatRounded_default(x3 * 100, p2),
30264     "r": formatRounded_default,
30265     "s": formatPrefixAuto_default,
30266     "X": (x3) => Math.round(x3).toString(16).toUpperCase(),
30267     "x": (x3) => Math.round(x3).toString(16)
30268   };
30269
30270   // node_modules/d3-format/src/identity.js
30271   function identity_default5(x3) {
30272     return x3;
30273   }
30274
30275   // node_modules/d3-format/src/locale.js
30276   var map = Array.prototype.map;
30277   var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
30278   function locale_default(locale2) {
30279     var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity_default5 : formatGroup_default(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity_default5 : formatNumerals_default(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "\u2212" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
30280     function newFormat(specifier) {
30281       specifier = formatSpecifier(specifier);
30282       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;
30283       if (type2 === "n") comma = true, type2 = "g";
30284       else if (!formatTypes_default[type2]) precision3 === void 0 && (precision3 = 12), trim = true, type2 = "g";
30285       if (zero3 || fill === "0" && align === "=") zero3 = true, fill = "0", align = "=";
30286       var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : "";
30287       var formatType = formatTypes_default[type2], maybeSuffix = /[defgprs%]/.test(type2);
30288       precision3 = precision3 === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision3)) : Math.max(0, Math.min(20, precision3));
30289       function format2(value) {
30290         var valuePrefix = prefix, valueSuffix = suffix, i3, n3, c2;
30291         if (type2 === "c") {
30292           valueSuffix = formatType(value) + valueSuffix;
30293           value = "";
30294         } else {
30295           value = +value;
30296           var valueNegative = value < 0 || 1 / value < 0;
30297           value = isNaN(value) ? nan : formatType(Math.abs(value), precision3);
30298           if (trim) value = formatTrim_default(value);
30299           if (valueNegative && +value === 0 && sign2 !== "+") valueNegative = false;
30300           valuePrefix = (valueNegative ? sign2 === "(" ? sign2 : minus : sign2 === "-" || sign2 === "(" ? "" : sign2) + valuePrefix;
30301           valueSuffix = (type2 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign2 === "(" ? ")" : "");
30302           if (maybeSuffix) {
30303             i3 = -1, n3 = value.length;
30304             while (++i3 < n3) {
30305               if (c2 = value.charCodeAt(i3), 48 > c2 || c2 > 57) {
30306                 valueSuffix = (c2 === 46 ? decimal + value.slice(i3 + 1) : value.slice(i3)) + valueSuffix;
30307                 value = value.slice(0, i3);
30308                 break;
30309               }
30310             }
30311           }
30312         }
30313         if (comma && !zero3) value = group(value, Infinity);
30314         var length2 = valuePrefix.length + value.length + valueSuffix.length, padding = length2 < width ? new Array(width - length2 + 1).join(fill) : "";
30315         if (comma && zero3) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
30316         switch (align) {
30317           case "<":
30318             value = valuePrefix + value + valueSuffix + padding;
30319             break;
30320           case "=":
30321             value = valuePrefix + padding + value + valueSuffix;
30322             break;
30323           case "^":
30324             value = padding.slice(0, length2 = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length2);
30325             break;
30326           default:
30327             value = padding + valuePrefix + value + valueSuffix;
30328             break;
30329         }
30330         return numerals(value);
30331       }
30332       format2.toString = function() {
30333         return specifier + "";
30334       };
30335       return format2;
30336     }
30337     function formatPrefix2(specifier, value) {
30338       var f2 = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e3 = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k3 = Math.pow(10, -e3), prefix = prefixes[8 + e3 / 3];
30339       return function(value2) {
30340         return f2(k3 * value2) + prefix;
30341       };
30342     }
30343     return {
30344       format: newFormat,
30345       formatPrefix: formatPrefix2
30346     };
30347   }
30348
30349   // node_modules/d3-format/src/defaultLocale.js
30350   var locale;
30351   var format;
30352   var formatPrefix;
30353   defaultLocale({
30354     thousands: ",",
30355     grouping: [3],
30356     currency: ["$", ""]
30357   });
30358   function defaultLocale(definition) {
30359     locale = locale_default(definition);
30360     format = locale.format;
30361     formatPrefix = locale.formatPrefix;
30362     return locale;
30363   }
30364
30365   // node_modules/d3-format/src/precisionFixed.js
30366   function precisionFixed_default(step) {
30367     return Math.max(0, -exponent_default(Math.abs(step)));
30368   }
30369
30370   // node_modules/d3-format/src/precisionPrefix.js
30371   function precisionPrefix_default(step, value) {
30372     return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
30373   }
30374
30375   // node_modules/d3-format/src/precisionRound.js
30376   function precisionRound_default(step, max3) {
30377     step = Math.abs(step), max3 = Math.abs(max3) - step;
30378     return Math.max(0, exponent_default(max3) - exponent_default(step)) + 1;
30379   }
30380
30381   // node_modules/d3-scale/src/tickFormat.js
30382   function tickFormat(start2, stop, count, specifier) {
30383     var step = tickStep(start2, stop, count), precision3;
30384     specifier = formatSpecifier(specifier == null ? ",f" : specifier);
30385     switch (specifier.type) {
30386       case "s": {
30387         var value = Math.max(Math.abs(start2), Math.abs(stop));
30388         if (specifier.precision == null && !isNaN(precision3 = precisionPrefix_default(step, value))) specifier.precision = precision3;
30389         return formatPrefix(specifier, value);
30390       }
30391       case "":
30392       case "e":
30393       case "g":
30394       case "p":
30395       case "r": {
30396         if (specifier.precision == null && !isNaN(precision3 = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop))))) specifier.precision = precision3 - (specifier.type === "e");
30397         break;
30398       }
30399       case "f":
30400       case "%": {
30401         if (specifier.precision == null && !isNaN(precision3 = precisionFixed_default(step))) specifier.precision = precision3 - (specifier.type === "%") * 2;
30402         break;
30403       }
30404     }
30405     return format(specifier);
30406   }
30407
30408   // node_modules/d3-scale/src/linear.js
30409   function linearish(scale) {
30410     var domain = scale.domain;
30411     scale.ticks = function(count) {
30412       var d2 = domain();
30413       return ticks(d2[0], d2[d2.length - 1], count == null ? 10 : count);
30414     };
30415     scale.tickFormat = function(count, specifier) {
30416       var d2 = domain();
30417       return tickFormat(d2[0], d2[d2.length - 1], count == null ? 10 : count, specifier);
30418     };
30419     scale.nice = function(count) {
30420       if (count == null) count = 10;
30421       var d2 = domain();
30422       var i0 = 0;
30423       var i1 = d2.length - 1;
30424       var start2 = d2[i0];
30425       var stop = d2[i1];
30426       var prestep;
30427       var step;
30428       var maxIter = 10;
30429       if (stop < start2) {
30430         step = start2, start2 = stop, stop = step;
30431         step = i0, i0 = i1, i1 = step;
30432       }
30433       while (maxIter-- > 0) {
30434         step = tickIncrement(start2, stop, count);
30435         if (step === prestep) {
30436           d2[i0] = start2;
30437           d2[i1] = stop;
30438           return domain(d2);
30439         } else if (step > 0) {
30440           start2 = Math.floor(start2 / step) * step;
30441           stop = Math.ceil(stop / step) * step;
30442         } else if (step < 0) {
30443           start2 = Math.ceil(start2 * step) / step;
30444           stop = Math.floor(stop * step) / step;
30445         } else {
30446           break;
30447         }
30448         prestep = step;
30449       }
30450       return scale;
30451     };
30452     return scale;
30453   }
30454   function linear3() {
30455     var scale = continuous();
30456     scale.copy = function() {
30457       return copy(scale, linear3());
30458     };
30459     initRange.apply(scale, arguments);
30460     return linearish(scale);
30461   }
30462
30463   // node_modules/d3-scale/src/quantize.js
30464   function quantize() {
30465     var x05 = 0, x12 = 1, n3 = 1, domain = [0.5], range3 = [0, 1], unknown;
30466     function scale(x3) {
30467       return x3 != null && x3 <= x3 ? range3[bisect_default(domain, x3, 0, n3)] : unknown;
30468     }
30469     function rescale() {
30470       var i3 = -1;
30471       domain = new Array(n3);
30472       while (++i3 < n3) domain[i3] = ((i3 + 1) * x12 - (i3 - n3) * x05) / (n3 + 1);
30473       return scale;
30474     }
30475     scale.domain = function(_3) {
30476       return arguments.length ? ([x05, x12] = _3, x05 = +x05, x12 = +x12, rescale()) : [x05, x12];
30477     };
30478     scale.range = function(_3) {
30479       return arguments.length ? (n3 = (range3 = Array.from(_3)).length - 1, rescale()) : range3.slice();
30480     };
30481     scale.invertExtent = function(y3) {
30482       var i3 = range3.indexOf(y3);
30483       return i3 < 0 ? [NaN, NaN] : i3 < 1 ? [x05, domain[0]] : i3 >= n3 ? [domain[n3 - 1], x12] : [domain[i3 - 1], domain[i3]];
30484     };
30485     scale.unknown = function(_3) {
30486       return arguments.length ? (unknown = _3, scale) : scale;
30487     };
30488     scale.thresholds = function() {
30489       return domain.slice();
30490     };
30491     scale.copy = function() {
30492       return quantize().domain([x05, x12]).range(range3).unknown(unknown);
30493     };
30494     return initRange.apply(linearish(scale), arguments);
30495   }
30496
30497   // modules/behavior/breathe.js
30498   function behaviorBreathe() {
30499     var duration = 800;
30500     var steps = 4;
30501     var selector = ".selected.shadow, .selected .shadow";
30502     var _selected = select_default2(null);
30503     var _classed = "";
30504     var _params = {};
30505     var _done = false;
30506     var _timer;
30507     function ratchetyInterpolator(a2, b3, steps2, units) {
30508       a2 = Number(a2);
30509       b3 = Number(b3);
30510       var sample = quantize().domain([0, 1]).range(quantize_default(number_default(a2, b3), steps2));
30511       return function(t2) {
30512         return String(sample(t2)) + (units || "");
30513       };
30514     }
30515     function reset(selection2) {
30516       selection2.style("stroke-opacity", null).style("stroke-width", null).style("fill-opacity", null).style("r", null);
30517     }
30518     function setAnimationParams(transition2, fromTo) {
30519       var toFrom = fromTo === "from" ? "to" : "from";
30520       transition2.styleTween("stroke-opacity", function(d2) {
30521         return ratchetyInterpolator(
30522           _params[d2.id][toFrom].opacity,
30523           _params[d2.id][fromTo].opacity,
30524           steps
30525         );
30526       }).styleTween("stroke-width", function(d2) {
30527         return ratchetyInterpolator(
30528           _params[d2.id][toFrom].width,
30529           _params[d2.id][fromTo].width,
30530           steps,
30531           "px"
30532         );
30533       }).styleTween("fill-opacity", function(d2) {
30534         return ratchetyInterpolator(
30535           _params[d2.id][toFrom].opacity,
30536           _params[d2.id][fromTo].opacity,
30537           steps
30538         );
30539       }).styleTween("r", function(d2) {
30540         return ratchetyInterpolator(
30541           _params[d2.id][toFrom].width,
30542           _params[d2.id][fromTo].width,
30543           steps,
30544           "px"
30545         );
30546       });
30547     }
30548     function calcAnimationParams(selection2) {
30549       selection2.call(reset).each(function(d2) {
30550         var s2 = select_default2(this);
30551         var tag = s2.node().tagName;
30552         var p2 = { "from": {}, "to": {} };
30553         var opacity;
30554         var width;
30555         if (tag === "circle") {
30556           opacity = Number(s2.style("fill-opacity") || 0.5);
30557           width = Number(s2.style("r") || 15.5);
30558         } else {
30559           opacity = Number(s2.style("stroke-opacity") || 0.7);
30560           width = Number(s2.style("stroke-width") || 10);
30561         }
30562         p2.tag = tag;
30563         p2.from.opacity = opacity * 0.6;
30564         p2.to.opacity = opacity * 1.25;
30565         p2.from.width = width * 0.7;
30566         p2.to.width = width * (tag === "circle" ? 1.5 : 1);
30567         _params[d2.id] = p2;
30568       });
30569     }
30570     function run(surface, fromTo) {
30571       var toFrom = fromTo === "from" ? "to" : "from";
30572       var currSelected = surface.selectAll(selector);
30573       var currClassed = surface.attr("class");
30574       if (_done || currSelected.empty()) {
30575         _selected.call(reset);
30576         _selected = select_default2(null);
30577         return;
30578       }
30579       if (!(0, import_fast_deep_equal2.default)(currSelected.data(), _selected.data()) || currClassed !== _classed) {
30580         _selected.call(reset);
30581         _classed = currClassed;
30582         _selected = currSelected.call(calcAnimationParams);
30583       }
30584       var didCallNextRun = false;
30585       _selected.transition().duration(duration).call(setAnimationParams, fromTo).on("end", function() {
30586         if (!didCallNextRun) {
30587           surface.call(run, toFrom);
30588           didCallNextRun = true;
30589         }
30590         if (!select_default2(this).classed("selected")) {
30591           reset(select_default2(this));
30592         }
30593       });
30594     }
30595     function behavior(surface) {
30596       _done = false;
30597       _timer = timer(function() {
30598         if (surface.selectAll(selector).empty()) {
30599           return false;
30600         }
30601         surface.call(run, "from");
30602         _timer.stop();
30603         return true;
30604       }, 20);
30605     }
30606     behavior.restartIfNeeded = function(surface) {
30607       if (_selected.empty()) {
30608         surface.call(run, "from");
30609         if (_timer) {
30610           _timer.stop();
30611         }
30612       }
30613     };
30614     behavior.off = function() {
30615       _done = true;
30616       if (_timer) {
30617         _timer.stop();
30618       }
30619       _selected.interrupt().call(reset);
30620     };
30621     return behavior;
30622   }
30623
30624   // node_modules/d3-fetch/src/text.js
30625   function responseText(response) {
30626     if (!response.ok) throw new Error(response.status + " " + response.statusText);
30627     return response.text();
30628   }
30629   function text_default3(input, init2) {
30630     return fetch(input, init2).then(responseText);
30631   }
30632
30633   // node_modules/d3-fetch/src/json.js
30634   function responseJson(response) {
30635     if (!response.ok) throw new Error(response.status + " " + response.statusText);
30636     if (response.status === 204 || response.status === 205) return;
30637     return response.json();
30638   }
30639   function json_default(input, init2) {
30640     return fetch(input, init2).then(responseJson);
30641   }
30642
30643   // node_modules/d3-fetch/src/xml.js
30644   function parser(type2) {
30645     return (input, init2) => text_default3(input, init2).then((text) => new DOMParser().parseFromString(text, type2));
30646   }
30647   var xml_default = parser("application/xml");
30648   var html = parser("text/html");
30649   var svg = parser("image/svg+xml");
30650
30651   // modules/core/difference.js
30652   var import_fast_deep_equal3 = __toESM(require_fast_deep_equal(), 1);
30653   function coreDifference(base, head) {
30654     var _changes = {};
30655     var _didChange = {};
30656     var _diff = {};
30657     function checkEntityID(id2) {
30658       var h3 = head.entities[id2];
30659       var b3 = base.entities[id2];
30660       if (h3 === b3) return;
30661       if (_changes[id2]) return;
30662       if (!h3 && b3) {
30663         _changes[id2] = { base: b3, head: h3 };
30664         _didChange.deletion = true;
30665         return;
30666       }
30667       if (h3 && !b3) {
30668         _changes[id2] = { base: b3, head: h3 };
30669         _didChange.addition = true;
30670         return;
30671       }
30672       if (h3 && b3) {
30673         if (h3.members && b3.members && !(0, import_fast_deep_equal3.default)(h3.members, b3.members)) {
30674           _changes[id2] = { base: b3, head: h3 };
30675           _didChange.geometry = true;
30676           _didChange.properties = true;
30677           return;
30678         }
30679         if (h3.loc && b3.loc && !geoVecEqual(h3.loc, b3.loc)) {
30680           _changes[id2] = { base: b3, head: h3 };
30681           _didChange.geometry = true;
30682         }
30683         if (h3.nodes && b3.nodes && !(0, import_fast_deep_equal3.default)(h3.nodes, b3.nodes)) {
30684           _changes[id2] = { base: b3, head: h3 };
30685           _didChange.geometry = true;
30686         }
30687         if (h3.tags && b3.tags && !(0, import_fast_deep_equal3.default)(h3.tags, b3.tags)) {
30688           _changes[id2] = { base: b3, head: h3 };
30689           _didChange.properties = true;
30690         }
30691       }
30692     }
30693     function load() {
30694       var ids = utilArrayUniq(Object.keys(head.entities).concat(Object.keys(base.entities)));
30695       for (var i3 = 0; i3 < ids.length; i3++) {
30696         checkEntityID(ids[i3]);
30697       }
30698     }
30699     load();
30700     _diff.length = function length2() {
30701       return Object.keys(_changes).length;
30702     };
30703     _diff.changes = function changes() {
30704       return _changes;
30705     };
30706     _diff.didChange = _didChange;
30707     _diff.extantIDs = function extantIDs(includeRelMembers) {
30708       var result = /* @__PURE__ */ new Set();
30709       Object.keys(_changes).forEach(function(id2) {
30710         if (_changes[id2].head) {
30711           result.add(id2);
30712         }
30713         var h3 = _changes[id2].head;
30714         var b3 = _changes[id2].base;
30715         var entity = h3 || b3;
30716         if (includeRelMembers && entity.type === "relation") {
30717           var mh = h3 ? h3.members.map(function(m3) {
30718             return m3.id;
30719           }) : [];
30720           var mb = b3 ? b3.members.map(function(m3) {
30721             return m3.id;
30722           }) : [];
30723           utilArrayUnion(mh, mb).forEach(function(memberID) {
30724             if (head.hasEntity(memberID)) {
30725               result.add(memberID);
30726             }
30727           });
30728         }
30729       });
30730       return Array.from(result);
30731     };
30732     _diff.modified = function modified() {
30733       var result = [];
30734       Object.values(_changes).forEach(function(change) {
30735         if (change.base && change.head) {
30736           result.push(change.head);
30737         }
30738       });
30739       return result;
30740     };
30741     _diff.created = function created() {
30742       var result = [];
30743       Object.values(_changes).forEach(function(change) {
30744         if (!change.base && change.head) {
30745           result.push(change.head);
30746         }
30747       });
30748       return result;
30749     };
30750     _diff.deleted = function deleted() {
30751       var result = [];
30752       Object.values(_changes).forEach(function(change) {
30753         if (change.base && !change.head) {
30754           result.push(change.base);
30755         }
30756       });
30757       return result;
30758     };
30759     _diff.summary = function summary() {
30760       var relevant = {};
30761       var keys2 = Object.keys(_changes);
30762       for (var i3 = 0; i3 < keys2.length; i3++) {
30763         var change = _changes[keys2[i3]];
30764         if (change.head && change.head.geometry(head) !== "vertex") {
30765           addEntity(change.head, head, change.base ? "modified" : "created");
30766         } else if (change.base && change.base.geometry(base) !== "vertex") {
30767           addEntity(change.base, base, "deleted");
30768         } else if (change.base && change.head) {
30769           var moved = !(0, import_fast_deep_equal3.default)(change.base.loc, change.head.loc);
30770           var retagged = !(0, import_fast_deep_equal3.default)(change.base.tags, change.head.tags);
30771           if (moved) {
30772             addParents(change.head);
30773           }
30774           if (retagged || moved && change.head.hasInterestingTags()) {
30775             addEntity(change.head, head, "modified");
30776           }
30777         } else if (change.head && change.head.hasInterestingTags()) {
30778           addEntity(change.head, head, "created");
30779         } else if (change.base && change.base.hasInterestingTags()) {
30780           addEntity(change.base, base, "deleted");
30781         }
30782       }
30783       return Object.values(relevant);
30784       function addEntity(entity, graph, changeType) {
30785         relevant[entity.id] = {
30786           entity,
30787           graph,
30788           changeType
30789         };
30790       }
30791       function addParents(entity) {
30792         var parents = head.parentWays(entity);
30793         for (var j3 = parents.length - 1; j3 >= 0; j3--) {
30794           var parent2 = parents[j3];
30795           if (!(parent2.id in relevant)) {
30796             addEntity(parent2, head, "modified");
30797           }
30798         }
30799       }
30800     };
30801     _diff.complete = function complete(extent) {
30802       var result = {};
30803       var id2, change;
30804       for (id2 in _changes) {
30805         change = _changes[id2];
30806         var h3 = change.head;
30807         var b3 = change.base;
30808         var entity = h3 || b3;
30809         var i3;
30810         if (extent && (!h3 || !h3.intersects(extent, head)) && (!b3 || !b3.intersects(extent, base))) {
30811           continue;
30812         }
30813         result[id2] = h3;
30814         if (entity.type === "way") {
30815           var nh = h3 ? h3.nodes : [];
30816           var nb = b3 ? b3.nodes : [];
30817           var diff;
30818           diff = utilArrayDifference(nh, nb);
30819           for (i3 = 0; i3 < diff.length; i3++) {
30820             result[diff[i3]] = head.hasEntity(diff[i3]);
30821           }
30822           diff = utilArrayDifference(nb, nh);
30823           for (i3 = 0; i3 < diff.length; i3++) {
30824             result[diff[i3]] = head.hasEntity(diff[i3]);
30825           }
30826         }
30827         if (entity.type === "relation" && entity.isMultipolygon()) {
30828           var mh = h3 ? h3.members.map(function(m3) {
30829             return m3.id;
30830           }) : [];
30831           var mb = b3 ? b3.members.map(function(m3) {
30832             return m3.id;
30833           }) : [];
30834           var ids = utilArrayUnion(mh, mb);
30835           for (i3 = 0; i3 < ids.length; i3++) {
30836             var member = head.hasEntity(ids[i3]);
30837             if (!member) continue;
30838             if (extent && !member.intersects(extent, head)) continue;
30839             result[ids[i3]] = member;
30840           }
30841         }
30842         addParents(head.parentWays(entity), result);
30843         addParents(head.parentRelations(entity), result);
30844       }
30845       return result;
30846       function addParents(parents, result2) {
30847         for (var i4 = 0; i4 < parents.length; i4++) {
30848           var parent2 = parents[i4];
30849           if (parent2.id in result2) continue;
30850           result2[parent2.id] = parent2;
30851           addParents(head.parentRelations(parent2), result2);
30852         }
30853       }
30854     };
30855     return _diff;
30856   }
30857
30858   // node_modules/quickselect/index.js
30859   function quickselect2(arr, k3, left = 0, right = arr.length - 1, compare2 = defaultCompare) {
30860     while (right > left) {
30861       if (right - left > 600) {
30862         const n3 = right - left + 1;
30863         const m3 = k3 - left + 1;
30864         const z3 = Math.log(n3);
30865         const s2 = 0.5 * Math.exp(2 * z3 / 3);
30866         const sd = 0.5 * Math.sqrt(z3 * s2 * (n3 - s2) / n3) * (m3 - n3 / 2 < 0 ? -1 : 1);
30867         const newLeft = Math.max(left, Math.floor(k3 - m3 * s2 / n3 + sd));
30868         const newRight = Math.min(right, Math.floor(k3 + (n3 - m3) * s2 / n3 + sd));
30869         quickselect2(arr, k3, newLeft, newRight, compare2);
30870       }
30871       const t2 = arr[k3];
30872       let i3 = left;
30873       let j3 = right;
30874       swap2(arr, left, k3);
30875       if (compare2(arr[right], t2) > 0) swap2(arr, left, right);
30876       while (i3 < j3) {
30877         swap2(arr, i3, j3);
30878         i3++;
30879         j3--;
30880         while (compare2(arr[i3], t2) < 0) i3++;
30881         while (compare2(arr[j3], t2) > 0) j3--;
30882       }
30883       if (compare2(arr[left], t2) === 0) swap2(arr, left, j3);
30884       else {
30885         j3++;
30886         swap2(arr, j3, right);
30887       }
30888       if (j3 <= k3) left = j3 + 1;
30889       if (k3 <= j3) right = j3 - 1;
30890     }
30891   }
30892   function swap2(arr, i3, j3) {
30893     const tmp = arr[i3];
30894     arr[i3] = arr[j3];
30895     arr[j3] = tmp;
30896   }
30897   function defaultCompare(a2, b3) {
30898     return a2 < b3 ? -1 : a2 > b3 ? 1 : 0;
30899   }
30900
30901   // node_modules/rbush/index.js
30902   var RBush = class {
30903     constructor(maxEntries = 9) {
30904       this._maxEntries = Math.max(4, maxEntries);
30905       this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));
30906       this.clear();
30907     }
30908     all() {
30909       return this._all(this.data, []);
30910     }
30911     search(bbox2) {
30912       let node = this.data;
30913       const result = [];
30914       if (!intersects(bbox2, node)) return result;
30915       const toBBox = this.toBBox;
30916       const nodesToSearch = [];
30917       while (node) {
30918         for (let i3 = 0; i3 < node.children.length; i3++) {
30919           const child = node.children[i3];
30920           const childBBox = node.leaf ? toBBox(child) : child;
30921           if (intersects(bbox2, childBBox)) {
30922             if (node.leaf) result.push(child);
30923             else if (contains(bbox2, childBBox)) this._all(child, result);
30924             else nodesToSearch.push(child);
30925           }
30926         }
30927         node = nodesToSearch.pop();
30928       }
30929       return result;
30930     }
30931     collides(bbox2) {
30932       let node = this.data;
30933       if (!intersects(bbox2, node)) return false;
30934       const nodesToSearch = [];
30935       while (node) {
30936         for (let i3 = 0; i3 < node.children.length; i3++) {
30937           const child = node.children[i3];
30938           const childBBox = node.leaf ? this.toBBox(child) : child;
30939           if (intersects(bbox2, childBBox)) {
30940             if (node.leaf || contains(bbox2, childBBox)) return true;
30941             nodesToSearch.push(child);
30942           }
30943         }
30944         node = nodesToSearch.pop();
30945       }
30946       return false;
30947     }
30948     load(data) {
30949       if (!(data && data.length)) return this;
30950       if (data.length < this._minEntries) {
30951         for (let i3 = 0; i3 < data.length; i3++) {
30952           this.insert(data[i3]);
30953         }
30954         return this;
30955       }
30956       let node = this._build(data.slice(), 0, data.length - 1, 0);
30957       if (!this.data.children.length) {
30958         this.data = node;
30959       } else if (this.data.height === node.height) {
30960         this._splitRoot(this.data, node);
30961       } else {
30962         if (this.data.height < node.height) {
30963           const tmpNode = this.data;
30964           this.data = node;
30965           node = tmpNode;
30966         }
30967         this._insert(node, this.data.height - node.height - 1, true);
30968       }
30969       return this;
30970     }
30971     insert(item) {
30972       if (item) this._insert(item, this.data.height - 1);
30973       return this;
30974     }
30975     clear() {
30976       this.data = createNode([]);
30977       return this;
30978     }
30979     remove(item, equalsFn) {
30980       if (!item) return this;
30981       let node = this.data;
30982       const bbox2 = this.toBBox(item);
30983       const path = [];
30984       const indexes = [];
30985       let i3, parent2, goingUp;
30986       while (node || path.length) {
30987         if (!node) {
30988           node = path.pop();
30989           parent2 = path[path.length - 1];
30990           i3 = indexes.pop();
30991           goingUp = true;
30992         }
30993         if (node.leaf) {
30994           const index = findItem(item, node.children, equalsFn);
30995           if (index !== -1) {
30996             node.children.splice(index, 1);
30997             path.push(node);
30998             this._condense(path);
30999             return this;
31000           }
31001         }
31002         if (!goingUp && !node.leaf && contains(node, bbox2)) {
31003           path.push(node);
31004           indexes.push(i3);
31005           i3 = 0;
31006           parent2 = node;
31007           node = node.children[0];
31008         } else if (parent2) {
31009           i3++;
31010           node = parent2.children[i3];
31011           goingUp = false;
31012         } else node = null;
31013       }
31014       return this;
31015     }
31016     toBBox(item) {
31017       return item;
31018     }
31019     compareMinX(a2, b3) {
31020       return a2.minX - b3.minX;
31021     }
31022     compareMinY(a2, b3) {
31023       return a2.minY - b3.minY;
31024     }
31025     toJSON() {
31026       return this.data;
31027     }
31028     fromJSON(data) {
31029       this.data = data;
31030       return this;
31031     }
31032     _all(node, result) {
31033       const nodesToSearch = [];
31034       while (node) {
31035         if (node.leaf) result.push(...node.children);
31036         else nodesToSearch.push(...node.children);
31037         node = nodesToSearch.pop();
31038       }
31039       return result;
31040     }
31041     _build(items, left, right, height) {
31042       const N3 = right - left + 1;
31043       let M3 = this._maxEntries;
31044       let node;
31045       if (N3 <= M3) {
31046         node = createNode(items.slice(left, right + 1));
31047         calcBBox(node, this.toBBox);
31048         return node;
31049       }
31050       if (!height) {
31051         height = Math.ceil(Math.log(N3) / Math.log(M3));
31052         M3 = Math.ceil(N3 / Math.pow(M3, height - 1));
31053       }
31054       node = createNode([]);
31055       node.leaf = false;
31056       node.height = height;
31057       const N22 = Math.ceil(N3 / M3);
31058       const N1 = N22 * Math.ceil(Math.sqrt(M3));
31059       multiSelect(items, left, right, N1, this.compareMinX);
31060       for (let i3 = left; i3 <= right; i3 += N1) {
31061         const right2 = Math.min(i3 + N1 - 1, right);
31062         multiSelect(items, i3, right2, N22, this.compareMinY);
31063         for (let j3 = i3; j3 <= right2; j3 += N22) {
31064           const right3 = Math.min(j3 + N22 - 1, right2);
31065           node.children.push(this._build(items, j3, right3, height - 1));
31066         }
31067       }
31068       calcBBox(node, this.toBBox);
31069       return node;
31070     }
31071     _chooseSubtree(bbox2, node, level, path) {
31072       while (true) {
31073         path.push(node);
31074         if (node.leaf || path.length - 1 === level) break;
31075         let minArea = Infinity;
31076         let minEnlargement = Infinity;
31077         let targetNode;
31078         for (let i3 = 0; i3 < node.children.length; i3++) {
31079           const child = node.children[i3];
31080           const area = bboxArea(child);
31081           const enlargement = enlargedArea(bbox2, child) - area;
31082           if (enlargement < minEnlargement) {
31083             minEnlargement = enlargement;
31084             minArea = area < minArea ? area : minArea;
31085             targetNode = child;
31086           } else if (enlargement === minEnlargement) {
31087             if (area < minArea) {
31088               minArea = area;
31089               targetNode = child;
31090             }
31091           }
31092         }
31093         node = targetNode || node.children[0];
31094       }
31095       return node;
31096     }
31097     _insert(item, level, isNode) {
31098       const bbox2 = isNode ? item : this.toBBox(item);
31099       const insertPath = [];
31100       const node = this._chooseSubtree(bbox2, this.data, level, insertPath);
31101       node.children.push(item);
31102       extend2(node, bbox2);
31103       while (level >= 0) {
31104         if (insertPath[level].children.length > this._maxEntries) {
31105           this._split(insertPath, level);
31106           level--;
31107         } else break;
31108       }
31109       this._adjustParentBBoxes(bbox2, insertPath, level);
31110     }
31111     // split overflowed node into two
31112     _split(insertPath, level) {
31113       const node = insertPath[level];
31114       const M3 = node.children.length;
31115       const m3 = this._minEntries;
31116       this._chooseSplitAxis(node, m3, M3);
31117       const splitIndex = this._chooseSplitIndex(node, m3, M3);
31118       const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));
31119       newNode.height = node.height;
31120       newNode.leaf = node.leaf;
31121       calcBBox(node, this.toBBox);
31122       calcBBox(newNode, this.toBBox);
31123       if (level) insertPath[level - 1].children.push(newNode);
31124       else this._splitRoot(node, newNode);
31125     }
31126     _splitRoot(node, newNode) {
31127       this.data = createNode([node, newNode]);
31128       this.data.height = node.height + 1;
31129       this.data.leaf = false;
31130       calcBBox(this.data, this.toBBox);
31131     }
31132     _chooseSplitIndex(node, m3, M3) {
31133       let index;
31134       let minOverlap = Infinity;
31135       let minArea = Infinity;
31136       for (let i3 = m3; i3 <= M3 - m3; i3++) {
31137         const bbox1 = distBBox(node, 0, i3, this.toBBox);
31138         const bbox2 = distBBox(node, i3, M3, this.toBBox);
31139         const overlap = intersectionArea(bbox1, bbox2);
31140         const area = bboxArea(bbox1) + bboxArea(bbox2);
31141         if (overlap < minOverlap) {
31142           minOverlap = overlap;
31143           index = i3;
31144           minArea = area < minArea ? area : minArea;
31145         } else if (overlap === minOverlap) {
31146           if (area < minArea) {
31147             minArea = area;
31148             index = i3;
31149           }
31150         }
31151       }
31152       return index || M3 - m3;
31153     }
31154     // sorts node children by the best axis for split
31155     _chooseSplitAxis(node, m3, M3) {
31156       const compareMinX = node.leaf ? this.compareMinX : compareNodeMinX;
31157       const compareMinY = node.leaf ? this.compareMinY : compareNodeMinY;
31158       const xMargin = this._allDistMargin(node, m3, M3, compareMinX);
31159       const yMargin = this._allDistMargin(node, m3, M3, compareMinY);
31160       if (xMargin < yMargin) node.children.sort(compareMinX);
31161     }
31162     // total margin of all possible split distributions where each node is at least m full
31163     _allDistMargin(node, m3, M3, compare2) {
31164       node.children.sort(compare2);
31165       const toBBox = this.toBBox;
31166       const leftBBox = distBBox(node, 0, m3, toBBox);
31167       const rightBBox = distBBox(node, M3 - m3, M3, toBBox);
31168       let margin = bboxMargin(leftBBox) + bboxMargin(rightBBox);
31169       for (let i3 = m3; i3 < M3 - m3; i3++) {
31170         const child = node.children[i3];
31171         extend2(leftBBox, node.leaf ? toBBox(child) : child);
31172         margin += bboxMargin(leftBBox);
31173       }
31174       for (let i3 = M3 - m3 - 1; i3 >= m3; i3--) {
31175         const child = node.children[i3];
31176         extend2(rightBBox, node.leaf ? toBBox(child) : child);
31177         margin += bboxMargin(rightBBox);
31178       }
31179       return margin;
31180     }
31181     _adjustParentBBoxes(bbox2, path, level) {
31182       for (let i3 = level; i3 >= 0; i3--) {
31183         extend2(path[i3], bbox2);
31184       }
31185     }
31186     _condense(path) {
31187       for (let i3 = path.length - 1, siblings; i3 >= 0; i3--) {
31188         if (path[i3].children.length === 0) {
31189           if (i3 > 0) {
31190             siblings = path[i3 - 1].children;
31191             siblings.splice(siblings.indexOf(path[i3]), 1);
31192           } else this.clear();
31193         } else calcBBox(path[i3], this.toBBox);
31194       }
31195     }
31196   };
31197   function findItem(item, items, equalsFn) {
31198     if (!equalsFn) return items.indexOf(item);
31199     for (let i3 = 0; i3 < items.length; i3++) {
31200       if (equalsFn(item, items[i3])) return i3;
31201     }
31202     return -1;
31203   }
31204   function calcBBox(node, toBBox) {
31205     distBBox(node, 0, node.children.length, toBBox, node);
31206   }
31207   function distBBox(node, k3, p2, toBBox, destNode) {
31208     if (!destNode) destNode = createNode(null);
31209     destNode.minX = Infinity;
31210     destNode.minY = Infinity;
31211     destNode.maxX = -Infinity;
31212     destNode.maxY = -Infinity;
31213     for (let i3 = k3; i3 < p2; i3++) {
31214       const child = node.children[i3];
31215       extend2(destNode, node.leaf ? toBBox(child) : child);
31216     }
31217     return destNode;
31218   }
31219   function extend2(a2, b3) {
31220     a2.minX = Math.min(a2.minX, b3.minX);
31221     a2.minY = Math.min(a2.minY, b3.minY);
31222     a2.maxX = Math.max(a2.maxX, b3.maxX);
31223     a2.maxY = Math.max(a2.maxY, b3.maxY);
31224     return a2;
31225   }
31226   function compareNodeMinX(a2, b3) {
31227     return a2.minX - b3.minX;
31228   }
31229   function compareNodeMinY(a2, b3) {
31230     return a2.minY - b3.minY;
31231   }
31232   function bboxArea(a2) {
31233     return (a2.maxX - a2.minX) * (a2.maxY - a2.minY);
31234   }
31235   function bboxMargin(a2) {
31236     return a2.maxX - a2.minX + (a2.maxY - a2.minY);
31237   }
31238   function enlargedArea(a2, b3) {
31239     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));
31240   }
31241   function intersectionArea(a2, b3) {
31242     const minX = Math.max(a2.minX, b3.minX);
31243     const minY = Math.max(a2.minY, b3.minY);
31244     const maxX = Math.min(a2.maxX, b3.maxX);
31245     const maxY = Math.min(a2.maxY, b3.maxY);
31246     return Math.max(0, maxX - minX) * Math.max(0, maxY - minY);
31247   }
31248   function contains(a2, b3) {
31249     return a2.minX <= b3.minX && a2.minY <= b3.minY && b3.maxX <= a2.maxX && b3.maxY <= a2.maxY;
31250   }
31251   function intersects(a2, b3) {
31252     return b3.minX <= a2.maxX && b3.minY <= a2.maxY && b3.maxX >= a2.minX && b3.maxY >= a2.minY;
31253   }
31254   function createNode(children2) {
31255     return {
31256       children: children2,
31257       height: 1,
31258       leaf: true,
31259       minX: Infinity,
31260       minY: Infinity,
31261       maxX: -Infinity,
31262       maxY: -Infinity
31263     };
31264   }
31265   function multiSelect(arr, left, right, n3, compare2) {
31266     const stack = [left, right];
31267     while (stack.length) {
31268       right = stack.pop();
31269       left = stack.pop();
31270       if (right - left <= n3) continue;
31271       const mid = left + Math.ceil((right - left) / n3 / 2) * n3;
31272       quickselect2(arr, mid, left, right, compare2);
31273       stack.push(left, mid, mid, right);
31274     }
31275   }
31276
31277   // modules/core/tree.js
31278   function coreTree(head) {
31279     var _rtree = new RBush();
31280     var _bboxes = {};
31281     var _segmentsRTree = new RBush();
31282     var _segmentsBBoxes = {};
31283     var _segmentsByWayId = {};
31284     var tree = {};
31285     function entityBBox(entity) {
31286       var bbox2 = entity.extent(head).bbox();
31287       bbox2.id = entity.id;
31288       _bboxes[entity.id] = bbox2;
31289       return bbox2;
31290     }
31291     function segmentBBox(segment) {
31292       var extent = segment.extent(head);
31293       if (!extent) return null;
31294       var bbox2 = extent.bbox();
31295       bbox2.segment = segment;
31296       _segmentsBBoxes[segment.id] = bbox2;
31297       return bbox2;
31298     }
31299     function removeEntity(entity) {
31300       _rtree.remove(_bboxes[entity.id]);
31301       delete _bboxes[entity.id];
31302       if (_segmentsByWayId[entity.id]) {
31303         _segmentsByWayId[entity.id].forEach(function(segment) {
31304           _segmentsRTree.remove(_segmentsBBoxes[segment.id]);
31305           delete _segmentsBBoxes[segment.id];
31306         });
31307         delete _segmentsByWayId[entity.id];
31308       }
31309     }
31310     function loadEntities(entities) {
31311       _rtree.load(entities.map(entityBBox));
31312       var segments = [];
31313       entities.forEach(function(entity) {
31314         if (entity.segments) {
31315           var entitySegments = entity.segments(head);
31316           _segmentsByWayId[entity.id] = entitySegments;
31317           segments = segments.concat(entitySegments);
31318         }
31319       });
31320       if (segments.length) _segmentsRTree.load(segments.map(segmentBBox).filter(Boolean));
31321     }
31322     function updateParents(entity, insertions, memo) {
31323       head.parentWays(entity).forEach(function(way) {
31324         if (_bboxes[way.id]) {
31325           removeEntity(way);
31326           insertions[way.id] = way;
31327         }
31328         updateParents(way, insertions, memo);
31329       });
31330       head.parentRelations(entity).forEach(function(relation) {
31331         if (memo[relation.id]) return;
31332         memo[relation.id] = true;
31333         if (_bboxes[relation.id]) {
31334           removeEntity(relation);
31335           insertions[relation.id] = relation;
31336         }
31337         updateParents(relation, insertions, memo);
31338       });
31339     }
31340     tree.rebase = function(entities, force) {
31341       var insertions = {};
31342       for (var i3 = 0; i3 < entities.length; i3++) {
31343         var entity = entities[i3];
31344         if (!entity.visible) continue;
31345         if (head.entities.hasOwnProperty(entity.id) || _bboxes[entity.id]) {
31346           if (!force) {
31347             continue;
31348           } else if (_bboxes[entity.id]) {
31349             removeEntity(entity);
31350           }
31351         }
31352         insertions[entity.id] = entity;
31353         updateParents(entity, insertions, {});
31354       }
31355       loadEntities(Object.values(insertions));
31356       return tree;
31357     };
31358     function updateToGraph(graph) {
31359       if (graph === head) return;
31360       var diff = coreDifference(head, graph);
31361       head = graph;
31362       var changed = diff.didChange;
31363       if (!changed.addition && !changed.deletion && !changed.geometry) return;
31364       var insertions = {};
31365       if (changed.deletion) {
31366         diff.deleted().forEach(function(entity) {
31367           removeEntity(entity);
31368         });
31369       }
31370       if (changed.geometry) {
31371         diff.modified().forEach(function(entity) {
31372           removeEntity(entity);
31373           insertions[entity.id] = entity;
31374           updateParents(entity, insertions, {});
31375         });
31376       }
31377       if (changed.addition) {
31378         diff.created().forEach(function(entity) {
31379           insertions[entity.id] = entity;
31380         });
31381       }
31382       loadEntities(Object.values(insertions));
31383     }
31384     tree.intersects = function(extent, graph) {
31385       updateToGraph(graph);
31386       return _rtree.search(extent.bbox()).map(function(bbox2) {
31387         return graph.entity(bbox2.id);
31388       });
31389     };
31390     tree.waySegments = function(extent, graph) {
31391       updateToGraph(graph);
31392       return _segmentsRTree.search(extent.bbox()).map(function(bbox2) {
31393         return bbox2.segment;
31394       });
31395     };
31396     return tree;
31397   }
31398
31399   // modules/svg/icon.js
31400   function svgIcon(name, svgklass, useklass) {
31401     return function drawIcon(selection2) {
31402       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);
31403     };
31404   }
31405
31406   // modules/ui/modal.js
31407   function uiModal(selection2, blocking) {
31408     let keybinding = utilKeybinding("modal");
31409     let previous = selection2.select("div.modal");
31410     let animate = previous.empty();
31411     previous.transition().duration(200).style("opacity", 0).remove();
31412     let shaded = selection2.append("div").attr("class", "shaded").style("opacity", 0);
31413     shaded.close = () => {
31414       shaded.transition().duration(200).style("opacity", 0).remove();
31415       modal.transition().duration(200).style("top", "0px");
31416       select_default2(document).call(keybinding.unbind);
31417     };
31418     let modal = shaded.append("div").attr("class", "modal fillL");
31419     modal.append("input").attr("class", "keytrap keytrap-first").on("focus.keytrap", moveFocusToLast);
31420     if (!blocking) {
31421       shaded.on("click.remove-modal", (d3_event) => {
31422         if (d3_event.target === this) {
31423           shaded.close();
31424         }
31425       });
31426       modal.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", shaded.close).call(svgIcon("#iD-icon-close"));
31427       keybinding.on("\u232B", shaded.close).on("\u238B", shaded.close);
31428       select_default2(document).call(keybinding);
31429     }
31430     modal.append("div").attr("class", "content");
31431     modal.append("input").attr("class", "keytrap keytrap-last").on("focus.keytrap", moveFocusToFirst);
31432     if (animate) {
31433       shaded.transition().style("opacity", 1);
31434     } else {
31435       shaded.style("opacity", 1);
31436     }
31437     return shaded;
31438     function moveFocusToFirst() {
31439       let node = modal.select("a, button, input:not(.keytrap), select, textarea").node();
31440       if (node) {
31441         node.focus();
31442       } else {
31443         select_default2(this).node().blur();
31444       }
31445     }
31446     function moveFocusToLast() {
31447       let nodes = modal.selectAll("a, button, input:not(.keytrap), select, textarea").nodes();
31448       if (nodes.length) {
31449         nodes[nodes.length - 1].focus();
31450       } else {
31451         select_default2(this).node().blur();
31452       }
31453     }
31454   }
31455
31456   // modules/ui/loading.js
31457   function uiLoading(context) {
31458     let _modalSelection = select_default2(null);
31459     let _message = "";
31460     let _blocking = false;
31461     let loading = (selection2) => {
31462       _modalSelection = uiModal(selection2, _blocking);
31463       let loadertext = _modalSelection.select(".content").classed("loading-modal", true).append("div").attr("class", "modal-section fillL");
31464       loadertext.append("img").attr("class", "loader").attr("src", context.imagePath("loader-white.gif"));
31465       loadertext.append("h3").html(_message);
31466       _modalSelection.select("button.close").attr("class", "hide");
31467       return loading;
31468     };
31469     loading.message = function(val) {
31470       if (!arguments.length) return _message;
31471       _message = val;
31472       return loading;
31473     };
31474     loading.blocking = function(val) {
31475       if (!arguments.length) return _blocking;
31476       _blocking = val;
31477       return loading;
31478     };
31479     loading.close = () => {
31480       _modalSelection.remove();
31481     };
31482     loading.isShown = () => {
31483       return _modalSelection && !_modalSelection.empty() && _modalSelection.node().parentNode;
31484     };
31485     return loading;
31486   }
31487
31488   // modules/core/history.js
31489   function coreHistory(context) {
31490     var dispatch12 = dispatch_default("reset", "change", "merge", "restore", "undone", "redone", "storage_error");
31491     var lock = utilSessionMutex("lock");
31492     var _hasUnresolvedRestorableChanges = lock.lock() && !!corePreferences("has_saved_history");
31493     var duration = 150;
31494     var _imageryUsed = [];
31495     var _photoOverlaysUsed = [];
31496     var _checkpoints = {};
31497     var _pausedGraph;
31498     var _stack;
31499     var _index;
31500     var _tree;
31501     function _act(actions, t2) {
31502       actions = Array.prototype.slice.call(actions);
31503       var annotation;
31504       if (typeof actions[actions.length - 1] !== "function") {
31505         annotation = actions.pop();
31506       }
31507       var graph = _stack[_index].graph;
31508       for (var i3 = 0; i3 < actions.length; i3++) {
31509         graph = actions[i3](graph, t2);
31510       }
31511       return {
31512         graph,
31513         annotation,
31514         imageryUsed: _imageryUsed,
31515         photoOverlaysUsed: _photoOverlaysUsed,
31516         transform: context.projection.transform(),
31517         selectedIDs: context.selectedIDs()
31518       };
31519     }
31520     function _perform(args, t2) {
31521       var previous = _stack[_index].graph;
31522       _stack = _stack.slice(0, _index + 1);
31523       var actionResult = _act(args, t2);
31524       _stack.push(actionResult);
31525       _index++;
31526       return change(previous);
31527     }
31528     function _replace(args, t2) {
31529       var previous = _stack[_index].graph;
31530       var actionResult = _act(args, t2);
31531       _stack[_index] = actionResult;
31532       return change(previous);
31533     }
31534     function _overwrite(args, t2) {
31535       var previous = _stack[_index].graph;
31536       if (_index > 0) {
31537         _index--;
31538         _stack.pop();
31539       }
31540       _stack = _stack.slice(0, _index + 1);
31541       var actionResult = _act(args, t2);
31542       _stack.push(actionResult);
31543       _index++;
31544       return change(previous);
31545     }
31546     function change(previous) {
31547       var difference2 = coreDifference(previous, history.graph());
31548       if (!_pausedGraph) {
31549         dispatch12.call("change", this, difference2);
31550       }
31551       return difference2;
31552     }
31553     var history = {
31554       graph: function() {
31555         return _stack[_index].graph;
31556       },
31557       tree: function() {
31558         return _tree;
31559       },
31560       base: function() {
31561         return _stack[0].graph;
31562       },
31563       merge: function(entities) {
31564         var stack = _stack.map(function(state) {
31565           return state.graph;
31566         });
31567         _stack[0].graph.rebase(entities, stack, false);
31568         _tree.rebase(entities, false);
31569         dispatch12.call("merge", this, entities);
31570       },
31571       perform: function() {
31572         select_default2(document).interrupt("history.perform");
31573         var transitionable = false;
31574         var action0 = arguments[0];
31575         if (arguments.length === 1 || arguments.length === 2 && typeof arguments[1] !== "function") {
31576           transitionable = !!action0.transitionable;
31577         }
31578         if (transitionable) {
31579           var origArguments = arguments;
31580           return new Promise((resolve) => {
31581             select_default2(document).transition("history.perform").duration(duration).ease(linear2).tween("history.tween", function() {
31582               return function(t2) {
31583                 if (t2 < 1) _overwrite([action0], t2);
31584               };
31585             }).on("start", function() {
31586               resolve(_perform([action0], 0));
31587             }).on("end interrupt", function() {
31588               resolve(_overwrite(origArguments, 1));
31589             });
31590           });
31591         } else {
31592           return _perform(arguments);
31593         }
31594       },
31595       replace: function() {
31596         select_default2(document).interrupt("history.perform");
31597         return _replace(arguments);
31598       },
31599       pop: function(n3) {
31600         select_default2(document).interrupt("history.perform");
31601         var previous = _stack[_index].graph;
31602         if (isNaN(+n3) || +n3 < 0) {
31603           n3 = 1;
31604         }
31605         while (n3-- > 0 && _index > 0) {
31606           _index--;
31607           _stack.pop();
31608         }
31609         return change(previous);
31610       },
31611       // Back to the previous annotated state or _index = 0.
31612       undo: function() {
31613         select_default2(document).interrupt("history.perform");
31614         var previousStack = _stack[_index];
31615         var previous = previousStack.graph;
31616         while (_index > 0) {
31617           _index--;
31618           if (_stack[_index].annotation) break;
31619         }
31620         dispatch12.call("undone", this, _stack[_index], previousStack);
31621         return change(previous);
31622       },
31623       // Forward to the next annotated state.
31624       redo: function() {
31625         select_default2(document).interrupt("history.perform");
31626         var previousStack = _stack[_index];
31627         var previous = previousStack.graph;
31628         var tryIndex = _index;
31629         while (tryIndex < _stack.length - 1) {
31630           tryIndex++;
31631           if (_stack[tryIndex].annotation) {
31632             _index = tryIndex;
31633             dispatch12.call("redone", this, _stack[_index], previousStack);
31634             break;
31635           }
31636         }
31637         return change(previous);
31638       },
31639       pauseChangeDispatch: function() {
31640         if (!_pausedGraph) {
31641           _pausedGraph = _stack[_index].graph;
31642         }
31643       },
31644       resumeChangeDispatch: function() {
31645         if (_pausedGraph) {
31646           var previous = _pausedGraph;
31647           _pausedGraph = null;
31648           return change(previous);
31649         }
31650       },
31651       undoAnnotation: function() {
31652         var i3 = _index;
31653         while (i3 >= 0) {
31654           if (_stack[i3].annotation) return _stack[i3].annotation;
31655           i3--;
31656         }
31657       },
31658       redoAnnotation: function() {
31659         var i3 = _index + 1;
31660         while (i3 <= _stack.length - 1) {
31661           if (_stack[i3].annotation) return _stack[i3].annotation;
31662           i3++;
31663         }
31664       },
31665       // Returns the entities from the active graph with bounding boxes
31666       // overlapping the given `extent`.
31667       intersects: function(extent) {
31668         return _tree.intersects(extent, _stack[_index].graph);
31669       },
31670       difference: function() {
31671         var base = _stack[0].graph;
31672         var head = _stack[_index].graph;
31673         return coreDifference(base, head);
31674       },
31675       changes: function(action) {
31676         var base = _stack[0].graph;
31677         var head = _stack[_index].graph;
31678         if (action) {
31679           head = action(head);
31680         }
31681         var difference2 = coreDifference(base, head);
31682         return {
31683           modified: difference2.modified(),
31684           created: difference2.created(),
31685           deleted: difference2.deleted()
31686         };
31687       },
31688       hasChanges: function() {
31689         return this.difference().length() > 0;
31690       },
31691       imageryUsed: function(sources) {
31692         if (sources) {
31693           _imageryUsed = sources;
31694           return history;
31695         } else {
31696           var s2 = /* @__PURE__ */ new Set();
31697           _stack.slice(1, _index + 1).forEach(function(state) {
31698             state.imageryUsed.forEach(function(source) {
31699               if (source !== "Custom") {
31700                 s2.add(source);
31701               }
31702             });
31703           });
31704           return Array.from(s2);
31705         }
31706       },
31707       photoOverlaysUsed: function(sources) {
31708         if (sources) {
31709           _photoOverlaysUsed = sources;
31710           return history;
31711         } else {
31712           var s2 = /* @__PURE__ */ new Set();
31713           _stack.slice(1, _index + 1).forEach(function(state) {
31714             if (state.photoOverlaysUsed && Array.isArray(state.photoOverlaysUsed)) {
31715               state.photoOverlaysUsed.forEach(function(photoOverlay) {
31716                 s2.add(photoOverlay);
31717               });
31718             }
31719           });
31720           return Array.from(s2);
31721         }
31722       },
31723       // save the current history state
31724       checkpoint: function(key) {
31725         _checkpoints[key] = {
31726           stack: _stack,
31727           index: _index
31728         };
31729         return history;
31730       },
31731       // restore history state to a given checkpoint or reset completely
31732       reset: function(key) {
31733         if (key !== void 0 && _checkpoints.hasOwnProperty(key)) {
31734           _stack = _checkpoints[key].stack;
31735           _index = _checkpoints[key].index;
31736         } else {
31737           _stack = [{ graph: coreGraph() }];
31738           _index = 0;
31739           _tree = coreTree(_stack[0].graph);
31740           _checkpoints = {};
31741         }
31742         _pausedGraph = null;
31743         dispatch12.call("reset");
31744         dispatch12.call("change");
31745         return history;
31746       },
31747       // `toIntroGraph()` is used to export the intro graph used by the walkthrough.
31748       //
31749       // To use it:
31750       //  1. Start the walkthrough.
31751       //  2. Get to a "free editing" tutorial step
31752       //  3. Make your edits to the walkthrough map
31753       //  4. In your browser dev console run:
31754       //        `id.history().toIntroGraph()`
31755       //  5. This outputs stringified JSON to the browser console
31756       //  6. Copy it to `data/intro_graph.json` and prettify it in your code editor
31757       toIntroGraph: function() {
31758         var nextID = { n: 0, r: 0, w: 0 };
31759         var permIDs = {};
31760         var graph = this.graph();
31761         var baseEntities = {};
31762         Object.values(graph.base().entities).forEach(function(entity) {
31763           var copy2 = copyIntroEntity(entity);
31764           baseEntities[copy2.id] = copy2;
31765         });
31766         Object.keys(graph.entities).forEach(function(id2) {
31767           var entity = graph.entities[id2];
31768           if (entity) {
31769             var copy2 = copyIntroEntity(entity);
31770             baseEntities[copy2.id] = copy2;
31771           } else {
31772             delete baseEntities[id2];
31773           }
31774         });
31775         Object.values(baseEntities).forEach(function(entity) {
31776           if (Array.isArray(entity.nodes)) {
31777             entity.nodes = entity.nodes.map(function(node) {
31778               return permIDs[node] || node;
31779             });
31780           }
31781           if (Array.isArray(entity.members)) {
31782             entity.members = entity.members.map(function(member) {
31783               member.id = permIDs[member.id] || member.id;
31784               return member;
31785             });
31786           }
31787         });
31788         return JSON.stringify({ dataIntroGraph: baseEntities });
31789         function copyIntroEntity(source) {
31790           var copy2 = utilObjectOmit(source, ["type", "user", "v", "version", "visible"]);
31791           if (copy2.tags && !Object.keys(copy2.tags)) {
31792             delete copy2.tags;
31793           }
31794           if (Array.isArray(copy2.loc)) {
31795             copy2.loc[0] = +copy2.loc[0].toFixed(6);
31796             copy2.loc[1] = +copy2.loc[1].toFixed(6);
31797           }
31798           var match = source.id.match(/([nrw])-\d*/);
31799           if (match !== null) {
31800             var nrw = match[1];
31801             var permID;
31802             do {
31803               permID = nrw + ++nextID[nrw];
31804             } while (baseEntities.hasOwnProperty(permID));
31805             copy2.id = permIDs[source.id] = permID;
31806           }
31807           return copy2;
31808         }
31809       },
31810       toJSON: function() {
31811         if (!this.hasChanges()) return;
31812         var allEntities = {};
31813         var baseEntities = {};
31814         var base = _stack[0];
31815         var s2 = _stack.map(function(i3) {
31816           var modified = [];
31817           var deleted = [];
31818           Object.keys(i3.graph.entities).forEach(function(id2) {
31819             var entity = i3.graph.entities[id2];
31820             if (entity) {
31821               var key = osmEntity.key(entity);
31822               allEntities[key] = entity;
31823               modified.push(key);
31824             } else {
31825               deleted.push(id2);
31826             }
31827             if (id2 in base.graph.entities) {
31828               baseEntities[id2] = base.graph.entities[id2];
31829             }
31830             if (entity && entity.nodes) {
31831               entity.nodes.forEach(function(nodeID) {
31832                 if (nodeID in base.graph.entities) {
31833                   baseEntities[nodeID] = base.graph.entities[nodeID];
31834                 }
31835               });
31836             }
31837             var baseParents = base.graph._parentWays[id2];
31838             if (baseParents) {
31839               baseParents.forEach(function(parentID) {
31840                 if (parentID in base.graph.entities) {
31841                   baseEntities[parentID] = base.graph.entities[parentID];
31842                 }
31843               });
31844             }
31845           });
31846           var x3 = {};
31847           if (modified.length) x3.modified = modified;
31848           if (deleted.length) x3.deleted = deleted;
31849           if (i3.imageryUsed) x3.imageryUsed = i3.imageryUsed;
31850           if (i3.photoOverlaysUsed) x3.photoOverlaysUsed = i3.photoOverlaysUsed;
31851           if (i3.annotation) x3.annotation = i3.annotation;
31852           if (i3.transform) x3.transform = i3.transform;
31853           if (i3.selectedIDs) x3.selectedIDs = i3.selectedIDs;
31854           return x3;
31855         });
31856         return {
31857           version: 3,
31858           entities: Object.values(allEntities),
31859           baseEntities: Object.values(baseEntities),
31860           stack: s2,
31861           nextIDs: osmEntity.id.next,
31862           index: _index,
31863           // note the time the changes were saved
31864           timestamp: (/* @__PURE__ */ new Date()).getTime()
31865         };
31866       },
31867       fromJSON: function(h3, loadChildNodes) {
31868         var loadComplete = true;
31869         osmEntity.id.next = h3.nextIDs;
31870         _index = h3.index;
31871         if (h3.version === 2 || h3.version === 3) {
31872           var allEntities = {};
31873           h3.entities.forEach(function(entity) {
31874             allEntities[osmEntity.key(entity)] = osmEntity(entity);
31875           });
31876           if (h3.version === 3) {
31877             var baseEntities = h3.baseEntities.map(function(d2) {
31878               return osmEntity(d2);
31879             });
31880             var stack = _stack.map(function(state) {
31881               return state.graph;
31882             });
31883             _stack[0].graph.rebase(baseEntities, stack, true);
31884             _tree.rebase(baseEntities, true);
31885             if (loadChildNodes) {
31886               var osm = context.connection();
31887               var baseWays = baseEntities.filter(function(e3) {
31888                 return e3.type === "way";
31889               });
31890               var nodeIDs = baseWays.reduce(function(acc, way) {
31891                 return utilArrayUnion(acc, way.nodes);
31892               }, []);
31893               var missing = nodeIDs.filter(function(n3) {
31894                 return !_stack[0].graph.hasEntity(n3);
31895               });
31896               if (missing.length && osm) {
31897                 loadComplete = false;
31898                 context.map().redrawEnable(false);
31899                 var loading = uiLoading(context).blocking(true);
31900                 context.container().call(loading);
31901                 var childNodesLoaded = function(err, result) {
31902                   if (!err) {
31903                     var visibleGroups = utilArrayGroupBy(result.data, "visible");
31904                     var visibles = visibleGroups.true || [];
31905                     var invisibles = visibleGroups.false || [];
31906                     if (visibles.length) {
31907                       var visibleIDs = visibles.map(function(entity) {
31908                         return entity.id;
31909                       });
31910                       var stack2 = _stack.map(function(state) {
31911                         return state.graph;
31912                       });
31913                       missing = utilArrayDifference(missing, visibleIDs);
31914                       _stack[0].graph.rebase(visibles, stack2, true);
31915                       _tree.rebase(visibles, true);
31916                     }
31917                     invisibles.forEach(function(entity) {
31918                       osm.loadEntityVersion(entity.id, +entity.version - 1, childNodesLoaded);
31919                     });
31920                   }
31921                   if (err || !missing.length) {
31922                     loading.close();
31923                     context.map().redrawEnable(true);
31924                     dispatch12.call("change");
31925                     dispatch12.call("restore", this);
31926                   }
31927                 };
31928                 osm.loadMultiple(missing, childNodesLoaded);
31929               }
31930             }
31931           }
31932           _stack = h3.stack.map(function(d2) {
31933             var entities = {}, entity;
31934             if (d2.modified) {
31935               d2.modified.forEach(function(key) {
31936                 entity = allEntities[key];
31937                 entities[entity.id] = entity;
31938               });
31939             }
31940             if (d2.deleted) {
31941               d2.deleted.forEach(function(id2) {
31942                 entities[id2] = void 0;
31943               });
31944             }
31945             return {
31946               graph: coreGraph(_stack[0].graph).load(entities),
31947               annotation: d2.annotation,
31948               imageryUsed: d2.imageryUsed,
31949               photoOverlaysUsed: d2.photoOverlaysUsed,
31950               transform: d2.transform,
31951               selectedIDs: d2.selectedIDs
31952             };
31953           });
31954         } else {
31955           _stack = h3.stack.map(function(d2) {
31956             var entities = {};
31957             for (var i3 in d2.entities) {
31958               var entity = d2.entities[i3];
31959               entities[i3] = entity === "undefined" ? void 0 : osmEntity(entity);
31960             }
31961             d2.graph = coreGraph(_stack[0].graph).load(entities);
31962             return d2;
31963           });
31964         }
31965         var transform2 = _stack[_index].transform;
31966         if (transform2) {
31967           context.map().transformEase(transform2, 0);
31968         }
31969         if (loadComplete) {
31970           dispatch12.call("change");
31971           dispatch12.call("restore", this);
31972         }
31973         return history;
31974       },
31975       lock: function() {
31976         return lock.lock();
31977       },
31978       unlock: function() {
31979         lock.unlock();
31980       },
31981       save: function() {
31982         if (lock.locked() && // don't overwrite existing, unresolved changes
31983         !_hasUnresolvedRestorableChanges) {
31984           const historyData = history.toJSON();
31985           if (!historyData) {
31986             asyncPrefs.del("saved_history").then(() => corePreferences("has_saved_history", null)).catch(() => dispatch12.call("storage_error"));
31987           } else {
31988             asyncPrefs.set("saved_history", history.toJSON()).then(() => corePreferences("has_saved_history", true)).catch(() => dispatch12.call("storage_error"));
31989           }
31990         }
31991         return history;
31992       },
31993       // delete the history version saved in IndexedDB
31994       clearSaved: function() {
31995         context.debouncedSave.cancel();
31996         if (lock.locked()) {
31997           _hasUnresolvedRestorableChanges = false;
31998           asyncPrefs.del("saved_history").then(() => corePreferences("has_saved_history", null));
31999           corePreferences("comment", null);
32000           corePreferences("hashtags", null);
32001           corePreferences("source", null);
32002         }
32003         return history;
32004       },
32005       hasRestorableChanges: function() {
32006         return _hasUnresolvedRestorableChanges;
32007       },
32008       restore: async function() {
32009         if (lock.locked()) {
32010           _hasUnresolvedRestorableChanges = false;
32011           var json = await asyncPrefs.get("saved_history");
32012           if (json) history.fromJSON(json, true);
32013         }
32014       },
32015       migrateHistoryData: async function() {
32016         const value = JSON.parse(corePreferences(this._getLegacyKey("saved_history")));
32017         if (value !== null) {
32018           await asyncPrefs.set("saved_history", value);
32019           corePreferences("has_saved_history", true);
32020           corePreferences(this._getLegacyKey("saved_history"), null);
32021         }
32022       },
32023       // (legacy, was used for local-storage based history)
32024       // iD uses namespaced keys so multiple installations do not conflict
32025       _getLegacyKey: (n3) => "iD_" + window.location.origin + "_" + n3
32026     };
32027     history.reset();
32028     return utilRebind(history, dispatch12, "on");
32029   }
32030
32031   // modules/validations/index.js
32032   var validations_exports = {};
32033   __export(validations_exports, {
32034     validationAlmostJunction: () => validationAlmostJunction,
32035     validationCloseNodes: () => validationCloseNodes,
32036     validationCrossingWays: () => validationCrossingWays,
32037     validationDisconnectedWay: () => validationDisconnectedWay,
32038     validationFormatting: () => validationFormatting,
32039     validationHelpRequest: () => validationHelpRequest,
32040     validationImpossibleOneway: () => validationImpossibleOneway,
32041     validationIncompatibleSource: () => validationIncompatibleSource,
32042     validationMaprules: () => validationMaprules,
32043     validationMismatchedGeometry: () => validationMismatchedGeometry,
32044     validationMissingRole: () => validationMissingRole,
32045     validationMissingTag: () => validationMissingTag,
32046     validationMutuallyExclusiveTags: () => validationMutuallyExclusiveTags,
32047     validationOsmApiLimits: () => validationOsmApiLimits,
32048     validationOutdatedTags: () => validationOutdatedTags,
32049     validationPrivateData: () => validationPrivateData,
32050     validationSuspiciousName: () => validationSuspiciousName,
32051     validationUnsquareWay: () => validationUnsquareWay
32052   });
32053
32054   // modules/util/utilDisplayLabel.js
32055   function utilDisplayLabel(entity, graphOrGeometry, verbose) {
32056     var result;
32057     var displayName = utilDisplayName(entity);
32058     var preset = typeof graphOrGeometry === "string" ? _mainPresetIndex.matchTags(entity.tags, graphOrGeometry) : _mainPresetIndex.match(entity, graphOrGeometry);
32059     var presetName = preset && (preset.suggestion ? preset.subtitle() : preset.name());
32060     if (verbose) {
32061       result = [presetName, displayName].filter(Boolean).join(" ");
32062     } else {
32063       result = displayName || presetName;
32064     }
32065     return result || utilDisplayType(entity.id);
32066   }
32067
32068   // modules/core/validation/models.js
32069   function validationIssue(attrs) {
32070     this.type = attrs.type;
32071     this.subtype = attrs.subtype;
32072     this.severity = attrs.severity;
32073     this.message = attrs.message;
32074     this.reference = attrs.reference;
32075     this.entityIds = attrs.entityIds;
32076     this.loc = attrs.loc;
32077     this.data = attrs.data;
32078     this.dynamicFixes = attrs.dynamicFixes;
32079     this.hash = attrs.hash;
32080     this.extent = attrs.extent;
32081     this.id = generateID.apply(this);
32082     this.key = generateKey.apply(this);
32083     function generateID() {
32084       var parts = [this.type];
32085       if (this.hash) {
32086         parts.push(this.hash);
32087       }
32088       if (this.subtype) {
32089         parts.push(this.subtype);
32090       }
32091       if (this.entityIds) {
32092         var entityKeys = this.entityIds.slice().sort();
32093         parts.push.apply(parts, entityKeys);
32094       }
32095       return parts.join(":");
32096     }
32097     function generateKey() {
32098       return this.id + ":" + Date.now().toString();
32099     }
32100     this.extent = this.extent || function(resolver) {
32101       if (this.loc) {
32102         return geoExtent(this.loc);
32103       }
32104       if (this.entityIds && this.entityIds.length) {
32105         return this.entityIds.reduce(function(extent, entityId) {
32106           return extent.extend(resolver.entity(entityId).extent(resolver));
32107         }, geoExtent());
32108       }
32109       return null;
32110     };
32111     this.fixes = function(context) {
32112       var fixes = this.dynamicFixes ? this.dynamicFixes(context) : [];
32113       var issue = this;
32114       if (issue.severity === "warning" || issue.severity === "suggestion") {
32115         fixes.push(new validationIssueFix({
32116           title: _t.append("issues.fix.ignore_issue.title"),
32117           icon: "iD-icon-close",
32118           onClick: function() {
32119             context.validator().ignoreIssue(this.issue.id);
32120           }
32121         }));
32122       }
32123       fixes.forEach(function(fix) {
32124         fix.id = fix.title.stringId;
32125         fix.issue = issue;
32126       });
32127       return fixes;
32128     };
32129   }
32130   validationIssue.ICONS = {
32131     suggestion: "#iD-icon-info",
32132     warning: "#iD-icon-alert",
32133     error: "#iD-icon-error"
32134   };
32135   function validationIssueFix(attrs) {
32136     this.title = attrs.title;
32137     this.onClick = attrs.onClick;
32138     this.disabledReason = attrs.disabledReason;
32139     this.icon = attrs.icon;
32140     this.entityIds = attrs.entityIds || [];
32141     this.issue = null;
32142   }
32143
32144   // modules/services/keepRight.js
32145   var tiler = utilTiler();
32146   var dispatch2 = dispatch_default("loaded");
32147   var _tileZoom = 14;
32148   var _krUrlRoot = "https://www.keepright.at";
32149   var _krData = { errorTypes: {}, localizeStrings: {} };
32150   var _cache;
32151   var _krRuleset = [
32152     // no 20 - multiple node on same spot - these are mostly boundaries overlapping roads
32153     30,
32154     40,
32155     50,
32156     60,
32157     70,
32158     90,
32159     100,
32160     110,
32161     120,
32162     130,
32163     150,
32164     160,
32165     170,
32166     180,
32167     190,
32168     191,
32169     192,
32170     193,
32171     194,
32172     195,
32173     196,
32174     197,
32175     198,
32176     200,
32177     201,
32178     202,
32179     203,
32180     204,
32181     205,
32182     206,
32183     207,
32184     208,
32185     210,
32186     220,
32187     230,
32188     231,
32189     232,
32190     270,
32191     280,
32192     281,
32193     282,
32194     283,
32195     284,
32196     285,
32197     290,
32198     291,
32199     292,
32200     293,
32201     294,
32202     295,
32203     296,
32204     297,
32205     298,
32206     300,
32207     310,
32208     311,
32209     312,
32210     313,
32211     320,
32212     350,
32213     360,
32214     370,
32215     380,
32216     390,
32217     400,
32218     401,
32219     402,
32220     410,
32221     411,
32222     412,
32223     413
32224   ];
32225   function abortRequest(controller) {
32226     if (controller) {
32227       controller.abort();
32228     }
32229   }
32230   function abortUnwantedRequests(cache, tiles) {
32231     Object.keys(cache.inflightTile).forEach((k3) => {
32232       const wanted = tiles.find((tile) => k3 === tile.id);
32233       if (!wanted) {
32234         abortRequest(cache.inflightTile[k3]);
32235         delete cache.inflightTile[k3];
32236       }
32237     });
32238   }
32239   function encodeIssueRtree(d2) {
32240     return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
32241   }
32242   function updateRtree(item, replace) {
32243     _cache.rtree.remove(item, (a2, b3) => a2.data.id === b3.data.id);
32244     if (replace) {
32245       _cache.rtree.insert(item);
32246     }
32247   }
32248   function tokenReplacements(d2) {
32249     if (!(d2 instanceof QAItem)) return;
32250     const replacements = {};
32251     const issueTemplate = _krData.errorTypes[d2.whichType];
32252     if (!issueTemplate) {
32253       console.log("No Template: ", d2.whichType);
32254       console.log("  ", d2.description);
32255       return;
32256     }
32257     if (!issueTemplate.regex) return;
32258     const errorRegex = new RegExp(issueTemplate.regex, "i");
32259     const errorMatch = errorRegex.exec(d2.description);
32260     if (!errorMatch) {
32261       console.log("Unmatched: ", d2.whichType);
32262       console.log("  ", d2.description);
32263       console.log("  ", errorRegex);
32264       return;
32265     }
32266     for (let i3 = 1; i3 < errorMatch.length; i3++) {
32267       let capture = errorMatch[i3];
32268       let idType;
32269       idType = "IDs" in issueTemplate ? issueTemplate.IDs[i3 - 1] : "";
32270       if (idType && capture) {
32271         capture = parseError(capture, idType);
32272       } else {
32273         const compare2 = capture.toLowerCase();
32274         if (_krData.localizeStrings[compare2]) {
32275           capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare2]);
32276         } else {
32277           capture = unescape_default(capture);
32278         }
32279       }
32280       replacements["var" + i3] = capture;
32281     }
32282     return replacements;
32283   }
32284   function parseError(capture, idType) {
32285     const compare2 = capture.toLowerCase();
32286     if (_krData.localizeStrings[compare2]) {
32287       capture = _t("QA.keepRight.error_parts." + _krData.localizeStrings[compare2]);
32288     }
32289     switch (idType) {
32290       // link a string like "this node"
32291       case "this":
32292         capture = linkErrorObject(capture);
32293         break;
32294       case "url":
32295         capture = linkURL(capture);
32296         break;
32297       // link an entity ID
32298       case "n":
32299       case "w":
32300       case "r":
32301         capture = linkEntity(idType + capture);
32302         break;
32303       // some errors have more complex ID lists/variance
32304       case "20":
32305         capture = parse20(capture);
32306         break;
32307       case "211":
32308         capture = parse211(capture);
32309         break;
32310       case "231":
32311         capture = parse231(capture);
32312         break;
32313       case "294":
32314         capture = parse294(capture);
32315         break;
32316       case "370":
32317         capture = parse370(capture);
32318         break;
32319     }
32320     return capture;
32321     function linkErrorObject(d2) {
32322       return { html: '<a class="error_object_link">'.concat(d2, "</a>") };
32323     }
32324     function linkEntity(d2) {
32325       return { html: '<a class="error_entity_link">'.concat(d2, "</a>") };
32326     }
32327     function linkURL(d2) {
32328       return { html: '<a class="kr_external_link" target="_blank" href="'.concat(d2, '">').concat(d2, "</a>") };
32329     }
32330     function parse211(capture2) {
32331       let newList = [];
32332       const items = capture2.split(", ");
32333       items.forEach((item) => {
32334         let id2 = linkEntity("n" + item.slice(1));
32335         newList.push(id2);
32336       });
32337       return newList.join(", ");
32338     }
32339     function parse231(capture2) {
32340       let newList = [];
32341       const items = capture2.split("),");
32342       items.forEach((item) => {
32343         const match = item.match(/\#(\d+)\((.+)\)?/);
32344         if (match !== null && match.length > 2) {
32345           newList.push(
32346             linkEntity("w" + match[1]) + " " + _t("QA.keepRight.errorTypes.231.layer", { layer: match[2] })
32347           );
32348         }
32349       });
32350       return newList.join(", ");
32351     }
32352     function parse294(capture2) {
32353       let newList = [];
32354       const items = capture2.split(",");
32355       items.forEach((item) => {
32356         item = item.split(" ");
32357         const role = '"'.concat(item[0], '"');
32358         const idType2 = item[1].slice(0, 1);
32359         let id2 = item[2].slice(1);
32360         id2 = linkEntity(idType2 + id2);
32361         newList.push("".concat(role, " ").concat(item[1], " ").concat(id2));
32362       });
32363       return newList.join(", ");
32364     }
32365     function parse370(capture2) {
32366       if (!capture2) return "";
32367       const match = capture2.match(/\(including the name (\'.+\')\)/);
32368       if (match && match.length) {
32369         return _t("QA.keepRight.errorTypes.370.including_the_name", { name: match[1] });
32370       }
32371       return "";
32372     }
32373     function parse20(capture2) {
32374       let newList = [];
32375       const items = capture2.split(",");
32376       items.forEach((item) => {
32377         const id2 = linkEntity("n" + item.slice(1));
32378         newList.push(id2);
32379       });
32380       return newList.join(", ");
32381     }
32382   }
32383   var keepRight_default = {
32384     title: "keepRight",
32385     init() {
32386       _mainFileFetcher.get("keepRight").then((d2) => _krData = d2);
32387       if (!_cache) {
32388         this.reset();
32389       }
32390       this.event = utilRebind(this, dispatch2, "on");
32391     },
32392     reset() {
32393       if (_cache) {
32394         Object.values(_cache.inflightTile).forEach(abortRequest);
32395       }
32396       _cache = {
32397         data: {},
32398         loadedTile: {},
32399         inflightTile: {},
32400         inflightPost: {},
32401         closed: {},
32402         rtree: new RBush()
32403       };
32404     },
32405     // KeepRight API:  http://osm.mueschelsoft.de/keepright/interfacing.php
32406     loadIssues(projection2) {
32407       const options = {
32408         format: "geojson",
32409         ch: _krRuleset
32410       };
32411       const tiles = tiler.zoomExtent([_tileZoom, _tileZoom]).getTiles(projection2);
32412       abortUnwantedRequests(_cache, tiles);
32413       tiles.forEach((tile) => {
32414         if (_cache.loadedTile[tile.id] || _cache.inflightTile[tile.id]) return;
32415         const [left, top, right, bottom] = tile.extent.rectangle();
32416         const params = Object.assign({}, options, { left, bottom, right, top });
32417         const url = "".concat(_krUrlRoot, "/export.php?") + utilQsString(params);
32418         const controller = new AbortController();
32419         _cache.inflightTile[tile.id] = controller;
32420         json_default(url, { signal: controller.signal }).then((data) => {
32421           delete _cache.inflightTile[tile.id];
32422           _cache.loadedTile[tile.id] = true;
32423           if (!data || !data.features || !data.features.length) {
32424             throw new Error("No Data");
32425           }
32426           data.features.forEach((feature4) => {
32427             const {
32428               properties: {
32429                 error_type: itemType,
32430                 error_id: id2,
32431                 comment = null,
32432                 object_id: objectId,
32433                 object_type: objectType,
32434                 schema,
32435                 title
32436               }
32437             } = feature4;
32438             let {
32439               geometry: { coordinates: loc },
32440               properties: { description = "" }
32441             } = feature4;
32442             const issueTemplate = _krData.errorTypes[itemType];
32443             const parentIssueType = (Math.floor(itemType / 10) * 10).toString();
32444             const whichType = issueTemplate ? itemType : parentIssueType;
32445             const whichTemplate = _krData.errorTypes[whichType];
32446             switch (whichType) {
32447               case "170":
32448                 description = "This feature has a FIXME tag: ".concat(description);
32449                 break;
32450               case "292":
32451               case "293":
32452                 description = description.replace("A turn-", "This turn-");
32453                 break;
32454               case "294":
32455               case "295":
32456               case "296":
32457               case "297":
32458               case "298":
32459                 description = "This turn-restriction~".concat(description);
32460                 break;
32461               case "300":
32462                 description = "This highway is missing a maxspeed tag";
32463                 break;
32464               case "411":
32465               case "412":
32466               case "413":
32467                 description = "This feature~".concat(description);
32468                 break;
32469             }
32470             let coincident = false;
32471             do {
32472               let delta = coincident ? [1e-5, 0] : [0, 1e-5];
32473               loc = geoVecAdd(loc, delta);
32474               let bbox2 = geoExtent(loc).bbox();
32475               coincident = _cache.rtree.search(bbox2).length;
32476             } while (coincident);
32477             let d2 = new QAItem(loc, this, itemType, id2, {
32478               comment,
32479               description,
32480               whichType,
32481               parentIssueType,
32482               severity: whichTemplate.severity || "error",
32483               objectId,
32484               objectType,
32485               schema,
32486               title
32487             });
32488             d2.replacements = tokenReplacements(d2);
32489             _cache.data[id2] = d2;
32490             _cache.rtree.insert(encodeIssueRtree(d2));
32491           });
32492           dispatch2.call("loaded");
32493         }).catch(() => {
32494           delete _cache.inflightTile[tile.id];
32495           _cache.loadedTile[tile.id] = true;
32496         });
32497       });
32498     },
32499     postUpdate(d2, callback) {
32500       if (_cache.inflightPost[d2.id]) {
32501         return callback({ message: "Error update already inflight", status: -2 }, d2);
32502       }
32503       const params = { schema: d2.schema, id: d2.id };
32504       if (d2.newStatus) {
32505         params.st = d2.newStatus;
32506       }
32507       if (d2.newComment !== void 0) {
32508         params.co = d2.newComment;
32509       }
32510       const url = "".concat(_krUrlRoot, "/comment.php?") + utilQsString(params);
32511       const controller = new AbortController();
32512       _cache.inflightPost[d2.id] = controller;
32513       json_default(url, { signal: controller.signal }).finally(() => {
32514         delete _cache.inflightPost[d2.id];
32515         if (d2.newStatus === "ignore") {
32516           this.removeItem(d2);
32517         } else if (d2.newStatus === "ignore_t") {
32518           this.removeItem(d2);
32519           _cache.closed["".concat(d2.schema, ":").concat(d2.id)] = true;
32520         } else {
32521           d2 = this.replaceItem(d2.update({
32522             comment: d2.newComment,
32523             newComment: void 0,
32524             newState: void 0
32525           }));
32526         }
32527         if (callback) callback(null, d2);
32528       });
32529     },
32530     // Get all cached QAItems covering the viewport
32531     getItems(projection2) {
32532       const viewport = projection2.clipExtent();
32533       const min3 = [viewport[0][0], viewport[1][1]];
32534       const max3 = [viewport[1][0], viewport[0][1]];
32535       const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
32536       return _cache.rtree.search(bbox2).map((d2) => d2.data);
32537     },
32538     // Get a QAItem from cache
32539     // NOTE: Don't change method name until UI v3 is merged
32540     getError(id2) {
32541       return _cache.data[id2];
32542     },
32543     // Replace a single QAItem in the cache
32544     replaceItem(item) {
32545       if (!(item instanceof QAItem) || !item.id) return;
32546       _cache.data[item.id] = item;
32547       updateRtree(encodeIssueRtree(item), true);
32548       return item;
32549     },
32550     // Remove a single QAItem from the cache
32551     removeItem(item) {
32552       if (!(item instanceof QAItem) || !item.id) return;
32553       delete _cache.data[item.id];
32554       updateRtree(encodeIssueRtree(item), false);
32555     },
32556     issueURL(item) {
32557       return "".concat(_krUrlRoot, "/report_map.php?schema=").concat(item.schema, "&error=").concat(item.id);
32558     },
32559     // Get an array of issues closed during this session.
32560     // Used to populate `closed:keepright` changeset tag
32561     getClosedIDs() {
32562       return Object.keys(_cache.closed).sort();
32563     }
32564   };
32565
32566   // node_modules/marked/lib/marked.esm.js
32567   function L() {
32568     return { async: false, breaks: false, extensions: null, gfm: true, hooks: null, pedantic: false, renderer: null, silent: false, tokenizer: null, walkTokens: null };
32569   }
32570   var T = L();
32571   function G(u4) {
32572     T = u4;
32573   }
32574   var I = { exec: () => null };
32575   function h(u4, e3 = "") {
32576     let t2 = typeof u4 == "string" ? u4 : u4.source, n3 = { replace: (r2, i3) => {
32577       let s2 = typeof i3 == "string" ? i3 : i3.source;
32578       return s2 = s2.replace(m.caret, "$1"), t2 = t2.replace(r2, s2), n3;
32579     }, getRegex: () => new RegExp(t2, e3) };
32580     return n3;
32581   }
32582   var 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: new RegExp("[\\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: (u4) => new RegExp("^( {0,3}".concat(u4, ")((?:[       ][^\\n]*)?(?:\\n|$))")), nextBulletRegex: (u4) => new RegExp("^ {0,".concat(Math.min(3, u4 - 1), "}(?:[*+-]|\\d{1,9}[.)])((?:[         ][^\\n]*)?(?:\\n|$))")), hrRegex: (u4) => new RegExp("^ {0,".concat(Math.min(3, u4 - 1), "}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)")), fencesBeginRegex: (u4) => new RegExp("^ {0,".concat(Math.min(3, u4 - 1), "}(?:```|~~~)")), headingBeginRegex: (u4) => new RegExp("^ {0,".concat(Math.min(3, u4 - 1), "}#")), htmlBeginRegex: (u4) => new RegExp("^ {0,".concat(Math.min(3, u4 - 1), "}<(?:[a-z].*>|!--)"), "i") };
32583   var be = /^(?:[ \t]*(?:\n|$))+/;
32584   var Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/;
32585   var Te = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;
32586   var E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;
32587   var Oe = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;
32588   var F = /(?:[*+-]|\d{1,9}[.)])/;
32589   var ie = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/;
32590   var oe = h(ie).replace(/bull/g, F).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();
32591   var we = h(ie).replace(/bull/g, F).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();
32592   var j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;
32593   var ye = /^[^\n]+/;
32594   var Q = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/;
32595   var Pe = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Q).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();
32596   var Se = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, F).getRegex();
32597   var 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";
32598   var U = /<!--(?:-?>|[\s\S]*?(?:-->|$))/;
32599   var $e = 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();
32600   var ae = h(j).replace("hr", E).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();
32601   var _e = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex();
32602   var K = { blockquote: _e, code: Re, def: Pe, fences: Te, heading: Oe, hr: E, html: $e, lheading: oe, list: Se, newline: be, paragraph: ae, table: I, text: ye };
32603   var re2 = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).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();
32604   var Le = __spreadProps(__spreadValues({}, K), { lheading: we, table: re2, paragraph: h(j).replace("hr", E).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() });
32605   var Me = __spreadProps(__spreadValues({}, 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: I, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(j).replace("hr", E).replace("heading", " *#{1,6} *[^\n]").replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() });
32606   var ze = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;
32607   var Ae = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;
32608   var le = /^( {2,}|\\)\n(?!\s*$)/;
32609   var Ie = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;
32610   var D = new RegExp("[\\p{P}\\p{S}]", "u");
32611   var W = new RegExp("[\\s\\p{P}\\p{S}]", "u");
32612   var ue = new RegExp("[^\\s\\p{P}\\p{S}]", "u");
32613   var Ee = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, W).getRegex();
32614   var pe = new RegExp("(?!~)[\\p{P}\\p{S}]", "u");
32615   var Ce = new RegExp("(?!~)[\\s\\p{P}\\p{S}]", "u");
32616   var Be = new RegExp("(?:[^\\s\\p{P}\\p{S}]|~)", "u");
32617   var qe = h(/link|code|html/, "g").replace("link", new RegExp("\\[(?:[^\\[\\]`]|(?<!`)(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("code", new RegExp("(?<!`)(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html", /<(?! )[^<>]*?>/).getRegex();
32618   var ce = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/;
32619   var ve = h(ce, "u").replace(/punct/g, D).getRegex();
32620   var De = h(ce, "u").replace(/punct/g, pe).getRegex();
32621   var he = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)";
32622   var He = h(he, "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
32623   var Ze = h(he, "gu").replace(/notPunctSpace/g, Be).replace(/punctSpace/g, Ce).replace(/punct/g, pe).getRegex();
32624   var Ge = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ue).replace(/punctSpace/g, W).replace(/punct/g, D).getRegex();
32625   var Ne = h(/\\(punct)/, "gu").replace(/punct/g, D).getRegex();
32626   var Fe = 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();
32627   var je = h(U).replace("(?:-->|$)", "-->").getRegex();
32628   var Qe = 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();
32629   var q = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/;
32630   var Ue = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", q).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();
32631   var de = h(/^!?\[(label)\]\[(ref)\]/).replace("label", q).replace("ref", Q).getRegex();
32632   var ke = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", Q).getRegex();
32633   var Ke = h("reflink|nolink(?!\\()", "g").replace("reflink", de).replace("nolink", ke).getRegex();
32634   var se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;
32635   var X = { _backpedal: I, anyPunctuation: Ne, autolink: Fe, blockSkip: qe, br: le, code: Ae, del: I, emStrongLDelim: ve, emStrongRDelimAst: He, emStrongRDelimUnd: Ge, escape: ze, link: Ue, nolink: ke, punctuation: Ee, reflink: de, reflinkSearch: Ke, tag: Qe, text: Ie, url: I };
32636   var We = __spreadProps(__spreadValues({}, X), { link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", q).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q).getRegex() });
32637   var N = __spreadProps(__spreadValues({}, X), { emStrongRDelimAst: Ze, emStrongLDelim: De, url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() });
32638   var Xe = __spreadProps(__spreadValues({}, N), { br: h(le).replace("{2,}", "*").getRegex(), text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() });
32639   var C = { normal: K, gfm: Le, pedantic: Me };
32640   var M = { normal: X, gfm: N, breaks: Xe, pedantic: We };
32641   var Je = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" };
32642   var ge = (u4) => Je[u4];
32643   function w(u4, e3) {
32644     if (e3) {
32645       if (m.escapeTest.test(u4)) return u4.replace(m.escapeReplace, ge);
32646     } else if (m.escapeTestNoEncode.test(u4)) return u4.replace(m.escapeReplaceNoEncode, ge);
32647     return u4;
32648   }
32649   function J(u4) {
32650     try {
32651       u4 = encodeURI(u4).replace(m.percentDecode, "%");
32652     } catch (e3) {
32653       return null;
32654     }
32655     return u4;
32656   }
32657   function V(u4, e3) {
32658     var _a5;
32659     let t2 = u4.replace(m.findPipe, (i3, s2, o2) => {
32660       let a2 = false, l2 = s2;
32661       for (; --l2 >= 0 && o2[l2] === "\\"; ) a2 = !a2;
32662       return a2 ? "|" : " |";
32663     }), n3 = t2.split(m.splitPipe), r2 = 0;
32664     if (n3[0].trim() || n3.shift(), n3.length > 0 && !((_a5 = n3.at(-1)) == null ? void 0 : _a5.trim()) && n3.pop(), e3) if (n3.length > e3) n3.splice(e3);
32665     else for (; n3.length < e3; ) n3.push("");
32666     for (; r2 < n3.length; r2++) n3[r2] = n3[r2].trim().replace(m.slashPipe, "|");
32667     return n3;
32668   }
32669   function z(u4, e3, t2) {
32670     let n3 = u4.length;
32671     if (n3 === 0) return "";
32672     let r2 = 0;
32673     for (; r2 < n3; ) {
32674       let i3 = u4.charAt(n3 - r2 - 1);
32675       if (i3 === e3 && !t2) r2++;
32676       else if (i3 !== e3 && t2) r2++;
32677       else break;
32678     }
32679     return u4.slice(0, n3 - r2);
32680   }
32681   function fe(u4, e3) {
32682     if (u4.indexOf(e3[1]) === -1) return -1;
32683     let t2 = 0;
32684     for (let n3 = 0; n3 < u4.length; n3++) if (u4[n3] === "\\") n3++;
32685     else if (u4[n3] === e3[0]) t2++;
32686     else if (u4[n3] === e3[1] && (t2--, t2 < 0)) return n3;
32687     return t2 > 0 ? -2 : -1;
32688   }
32689   function me(u4, e3, t2, n3, r2) {
32690     let i3 = e3.href, s2 = e3.title || null, o2 = u4[1].replace(r2.other.outputLinkReplace, "$1");
32691     n3.state.inLink = true;
32692     let a2 = { type: u4[0].charAt(0) === "!" ? "image" : "link", raw: t2, href: i3, title: s2, text: o2, tokens: n3.inlineTokens(o2) };
32693     return n3.state.inLink = false, a2;
32694   }
32695   function Ve(u4, e3, t2) {
32696     let n3 = u4.match(t2.other.indentCodeCompensation);
32697     if (n3 === null) return e3;
32698     let r2 = n3[1];
32699     return e3.split("\n").map((i3) => {
32700       let s2 = i3.match(t2.other.beginningSpace);
32701       if (s2 === null) return i3;
32702       let [o2] = s2;
32703       return o2.length >= r2.length ? i3.slice(r2.length) : i3;
32704     }).join("\n");
32705   }
32706   var y = class {
32707     constructor(e3) {
32708       __publicField(this, "options");
32709       __publicField(this, "rules");
32710       __publicField(this, "lexer");
32711       this.options = e3 || T;
32712     }
32713     space(e3) {
32714       let t2 = this.rules.block.newline.exec(e3);
32715       if (t2 && t2[0].length > 0) return { type: "space", raw: t2[0] };
32716     }
32717     code(e3) {
32718       let t2 = this.rules.block.code.exec(e3);
32719       if (t2) {
32720         let n3 = t2[0].replace(this.rules.other.codeRemoveIndent, "");
32721         return { type: "code", raw: t2[0], codeBlockStyle: "indented", text: this.options.pedantic ? n3 : z(n3, "\n") };
32722       }
32723     }
32724     fences(e3) {
32725       let t2 = this.rules.block.fences.exec(e3);
32726       if (t2) {
32727         let n3 = t2[0], r2 = Ve(n3, t2[3] || "", this.rules);
32728         return { type: "code", raw: n3, lang: t2[2] ? t2[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t2[2], text: r2 };
32729       }
32730     }
32731     heading(e3) {
32732       let t2 = this.rules.block.heading.exec(e3);
32733       if (t2) {
32734         let n3 = t2[2].trim();
32735         if (this.rules.other.endingHash.test(n3)) {
32736           let r2 = z(n3, "#");
32737           (this.options.pedantic || !r2 || this.rules.other.endingSpaceChar.test(r2)) && (n3 = r2.trim());
32738         }
32739         return { type: "heading", raw: t2[0], depth: t2[1].length, text: n3, tokens: this.lexer.inline(n3) };
32740       }
32741     }
32742     hr(e3) {
32743       let t2 = this.rules.block.hr.exec(e3);
32744       if (t2) return { type: "hr", raw: z(t2[0], "\n") };
32745     }
32746     blockquote(e3) {
32747       let t2 = this.rules.block.blockquote.exec(e3);
32748       if (t2) {
32749         let n3 = z(t2[0], "\n").split("\n"), r2 = "", i3 = "", s2 = [];
32750         for (; n3.length > 0; ) {
32751           let o2 = false, a2 = [], l2;
32752           for (l2 = 0; l2 < n3.length; l2++) if (this.rules.other.blockquoteStart.test(n3[l2])) a2.push(n3[l2]), o2 = true;
32753           else if (!o2) a2.push(n3[l2]);
32754           else break;
32755           n3 = n3.slice(l2);
32756           let c2 = a2.join("\n"), p2 = c2.replace(this.rules.other.blockquoteSetextReplace, "\n    $1").replace(this.rules.other.blockquoteSetextReplace2, "");
32757           r2 = r2 ? "".concat(r2, "\n").concat(c2) : c2, i3 = i3 ? "".concat(i3, "\n").concat(p2) : p2;
32758           let g3 = this.lexer.state.top;
32759           if (this.lexer.state.top = true, this.lexer.blockTokens(p2, s2, true), this.lexer.state.top = g3, n3.length === 0) break;
32760           let d2 = s2.at(-1);
32761           if ((d2 == null ? void 0 : d2.type) === "code") break;
32762           if ((d2 == null ? void 0 : d2.type) === "blockquote") {
32763             let R2 = d2, f2 = R2.raw + "\n" + n3.join("\n"), O2 = this.blockquote(f2);
32764             s2[s2.length - 1] = O2, r2 = r2.substring(0, r2.length - R2.raw.length) + O2.raw, i3 = i3.substring(0, i3.length - R2.text.length) + O2.text;
32765             break;
32766           } else if ((d2 == null ? void 0 : d2.type) === "list") {
32767             let R2 = d2, f2 = R2.raw + "\n" + n3.join("\n"), O2 = this.list(f2);
32768             s2[s2.length - 1] = O2, r2 = r2.substring(0, r2.length - d2.raw.length) + O2.raw, i3 = i3.substring(0, i3.length - R2.raw.length) + O2.raw, n3 = f2.substring(s2.at(-1).raw.length).split("\n");
32769             continue;
32770           }
32771         }
32772         return { type: "blockquote", raw: r2, tokens: s2, text: i3 };
32773       }
32774     }
32775     list(e3) {
32776       let t2 = this.rules.block.list.exec(e3);
32777       if (t2) {
32778         let n3 = t2[1].trim(), r2 = n3.length > 1, i3 = { type: "list", raw: "", ordered: r2, start: r2 ? +n3.slice(0, -1) : "", loose: false, items: [] };
32779         n3 = r2 ? "\\d{1,9}\\".concat(n3.slice(-1)) : "\\".concat(n3), this.options.pedantic && (n3 = r2 ? n3 : "[*+-]");
32780         let s2 = this.rules.other.listItemRegex(n3), o2 = false;
32781         for (; e3; ) {
32782           let l2 = false, c2 = "", p2 = "";
32783           if (!(t2 = s2.exec(e3)) || this.rules.block.hr.test(e3)) break;
32784           c2 = t2[0], e3 = e3.substring(c2.length);
32785           let g3 = t2[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (H2) => " ".repeat(3 * H2.length)), d2 = e3.split("\n", 1)[0], R2 = !g3.trim(), f2 = 0;
32786           if (this.options.pedantic ? (f2 = 2, p2 = g3.trimStart()) : R2 ? f2 = t2[1].length + 1 : (f2 = t2[2].search(this.rules.other.nonSpaceChar), f2 = f2 > 4 ? 1 : f2, p2 = g3.slice(f2), f2 += t2[1].length), R2 && this.rules.other.blankLine.test(d2) && (c2 += d2 + "\n", e3 = e3.substring(d2.length + 1), l2 = true), !l2) {
32787             let H2 = this.rules.other.nextBulletRegex(f2), ee2 = this.rules.other.hrRegex(f2), te2 = this.rules.other.fencesBeginRegex(f2), ne2 = this.rules.other.headingBeginRegex(f2), xe2 = this.rules.other.htmlBeginRegex(f2);
32788             for (; e3; ) {
32789               let Z3 = e3.split("\n", 1)[0], A2;
32790               if (d2 = Z3, this.options.pedantic ? (d2 = d2.replace(this.rules.other.listReplaceNesting, "  "), A2 = d2) : A2 = d2.replace(this.rules.other.tabCharGlobal, "    "), te2.test(d2) || ne2.test(d2) || xe2.test(d2) || H2.test(d2) || ee2.test(d2)) break;
32791               if (A2.search(this.rules.other.nonSpaceChar) >= f2 || !d2.trim()) p2 += "\n" + A2.slice(f2);
32792               else {
32793                 if (R2 || g3.replace(this.rules.other.tabCharGlobal, "    ").search(this.rules.other.nonSpaceChar) >= 4 || te2.test(g3) || ne2.test(g3) || ee2.test(g3)) break;
32794                 p2 += "\n" + d2;
32795               }
32796               !R2 && !d2.trim() && (R2 = true), c2 += Z3 + "\n", e3 = e3.substring(Z3.length + 1), g3 = A2.slice(f2);
32797             }
32798           }
32799           i3.loose || (o2 ? i3.loose = true : this.rules.other.doubleBlankLine.test(c2) && (o2 = true));
32800           let O2 = null, Y4;
32801           this.options.gfm && (O2 = this.rules.other.listIsTask.exec(p2), O2 && (Y4 = O2[0] !== "[ ] ", p2 = p2.replace(this.rules.other.listReplaceTask, ""))), i3.items.push({ type: "list_item", raw: c2, task: !!O2, checked: Y4, loose: false, text: p2, tokens: [] }), i3.raw += c2;
32802         }
32803         let a2 = i3.items.at(-1);
32804         if (a2) a2.raw = a2.raw.trimEnd(), a2.text = a2.text.trimEnd();
32805         else return;
32806         i3.raw = i3.raw.trimEnd();
32807         for (let l2 = 0; l2 < i3.items.length; l2++) if (this.lexer.state.top = false, i3.items[l2].tokens = this.lexer.blockTokens(i3.items[l2].text, []), !i3.loose) {
32808           let c2 = i3.items[l2].tokens.filter((g3) => g3.type === "space"), p2 = c2.length > 0 && c2.some((g3) => this.rules.other.anyLine.test(g3.raw));
32809           i3.loose = p2;
32810         }
32811         if (i3.loose) for (let l2 = 0; l2 < i3.items.length; l2++) i3.items[l2].loose = true;
32812         return i3;
32813       }
32814     }
32815     html(e3) {
32816       let t2 = this.rules.block.html.exec(e3);
32817       if (t2) return { type: "html", block: true, raw: t2[0], pre: t2[1] === "pre" || t2[1] === "script" || t2[1] === "style", text: t2[0] };
32818     }
32819     def(e3) {
32820       let t2 = this.rules.block.def.exec(e3);
32821       if (t2) {
32822         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];
32823         return { type: "def", tag: n3, raw: t2[0], href: r2, title: i3 };
32824       }
32825     }
32826     table(e3) {
32827       var _a5;
32828       let t2 = this.rules.block.table.exec(e3);
32829       if (!t2 || !this.rules.other.tableDelimiter.test(t2[2])) return;
32830       let n3 = V(t2[1]), r2 = t2[2].replace(this.rules.other.tableAlignChars, "").split("|"), i3 = ((_a5 = t2[3]) == null ? void 0 : _a5.trim()) ? t2[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], s2 = { type: "table", raw: t2[0], header: [], align: [], rows: [] };
32831       if (n3.length === r2.length) {
32832         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);
32833         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] });
32834         for (let o2 of i3) s2.rows.push(V(o2, s2.header.length).map((a2, l2) => ({ text: a2, tokens: this.lexer.inline(a2), header: false, align: s2.align[l2] })));
32835         return s2;
32836       }
32837     }
32838     lheading(e3) {
32839       let t2 = this.rules.block.lheading.exec(e3);
32840       if (t2) return { type: "heading", raw: t2[0], depth: t2[2].charAt(0) === "=" ? 1 : 2, text: t2[1], tokens: this.lexer.inline(t2[1]) };
32841     }
32842     paragraph(e3) {
32843       let t2 = this.rules.block.paragraph.exec(e3);
32844       if (t2) {
32845         let n3 = t2[1].charAt(t2[1].length - 1) === "\n" ? t2[1].slice(0, -1) : t2[1];
32846         return { type: "paragraph", raw: t2[0], text: n3, tokens: this.lexer.inline(n3) };
32847       }
32848     }
32849     text(e3) {
32850       let t2 = this.rules.block.text.exec(e3);
32851       if (t2) return { type: "text", raw: t2[0], text: t2[0], tokens: this.lexer.inline(t2[0]) };
32852     }
32853     escape(e3) {
32854       let t2 = this.rules.inline.escape.exec(e3);
32855       if (t2) return { type: "escape", raw: t2[0], text: t2[1] };
32856     }
32857     tag(e3) {
32858       let t2 = this.rules.inline.tag.exec(e3);
32859       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] };
32860     }
32861     link(e3) {
32862       let t2 = this.rules.inline.link.exec(e3);
32863       if (t2) {
32864         let n3 = t2[2].trim();
32865         if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n3)) {
32866           if (!this.rules.other.endAngleBracket.test(n3)) return;
32867           let s2 = z(n3.slice(0, -1), "\\");
32868           if ((n3.length - s2.length) % 2 === 0) return;
32869         } else {
32870           let s2 = fe(t2[2], "()");
32871           if (s2 === -2) return;
32872           if (s2 > -1) {
32873             let a2 = (t2[0].indexOf("!") === 0 ? 5 : 4) + t2[1].length + s2;
32874             t2[2] = t2[2].substring(0, s2), t2[0] = t2[0].substring(0, a2).trim(), t2[3] = "";
32875           }
32876         }
32877         let r2 = t2[2], i3 = "";
32878         if (this.options.pedantic) {
32879           let s2 = this.rules.other.pedanticHrefTitle.exec(r2);
32880           s2 && (r2 = s2[1], i3 = s2[3]);
32881         } else i3 = t2[3] ? t2[3].slice(1, -1) : "";
32882         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)), me(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);
32883       }
32884     }
32885     reflink(e3, t2) {
32886       let n3;
32887       if ((n3 = this.rules.inline.reflink.exec(e3)) || (n3 = this.rules.inline.nolink.exec(e3))) {
32888         let r2 = (n3[2] || n3[1]).replace(this.rules.other.multipleSpaceGlobal, " "), i3 = t2[r2.toLowerCase()];
32889         if (!i3) {
32890           let s2 = n3[0].charAt(0);
32891           return { type: "text", raw: s2, text: s2 };
32892         }
32893         return me(n3, i3, n3[0], this.lexer, this.rules);
32894       }
32895     }
32896     emStrong(e3, t2, n3 = "") {
32897       let r2 = this.rules.inline.emStrongLDelim.exec(e3);
32898       if (!r2 || r2[3] && n3.match(this.rules.other.unicodeAlphaNumeric)) return;
32899       if (!(r2[1] || r2[2] || "") || !n3 || this.rules.inline.punctuation.exec(n3)) {
32900         let s2 = [...r2[0]].length - 1, o2, a2, l2 = s2, c2 = 0, p2 = r2[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
32901         for (p2.lastIndex = 0, t2 = t2.slice(-1 * e3.length + s2); (r2 = p2.exec(t2)) != null; ) {
32902           if (o2 = r2[1] || r2[2] || r2[3] || r2[4] || r2[5] || r2[6], !o2) continue;
32903           if (a2 = [...o2].length, r2[3] || r2[4]) {
32904             l2 += a2;
32905             continue;
32906           } else if ((r2[5] || r2[6]) && s2 % 3 && !((s2 + a2) % 3)) {
32907             c2 += a2;
32908             continue;
32909           }
32910           if (l2 -= a2, l2 > 0) continue;
32911           a2 = Math.min(a2, a2 + l2 + c2);
32912           let g3 = [...r2[0]][0].length, d2 = e3.slice(0, s2 + r2.index + g3 + a2);
32913           if (Math.min(s2, a2) % 2) {
32914             let f2 = d2.slice(1, -1);
32915             return { type: "em", raw: d2, text: f2, tokens: this.lexer.inlineTokens(f2) };
32916           }
32917           let R2 = d2.slice(2, -2);
32918           return { type: "strong", raw: d2, text: R2, tokens: this.lexer.inlineTokens(R2) };
32919         }
32920       }
32921     }
32922     codespan(e3) {
32923       let t2 = this.rules.inline.code.exec(e3);
32924       if (t2) {
32925         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);
32926         return r2 && i3 && (n3 = n3.substring(1, n3.length - 1)), { type: "codespan", raw: t2[0], text: n3 };
32927       }
32928     }
32929     br(e3) {
32930       let t2 = this.rules.inline.br.exec(e3);
32931       if (t2) return { type: "br", raw: t2[0] };
32932     }
32933     del(e3) {
32934       let t2 = this.rules.inline.del.exec(e3);
32935       if (t2) return { type: "del", raw: t2[0], text: t2[2], tokens: this.lexer.inlineTokens(t2[2]) };
32936     }
32937     autolink(e3) {
32938       let t2 = this.rules.inline.autolink.exec(e3);
32939       if (t2) {
32940         let n3, r2;
32941         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 }] };
32942       }
32943     }
32944     url(e3) {
32945       var _a5, _b3;
32946       let t2;
32947       if (t2 = this.rules.inline.url.exec(e3)) {
32948         let n3, r2;
32949         if (t2[2] === "@") n3 = t2[0], r2 = "mailto:" + n3;
32950         else {
32951           let i3;
32952           do
32953             i3 = t2[0], t2[0] = (_b3 = (_a5 = this.rules.inline._backpedal.exec(t2[0])) == null ? void 0 : _a5[0]) != null ? _b3 : "";
32954           while (i3 !== t2[0]);
32955           n3 = t2[0], t2[1] === "www." ? r2 = "http://" + t2[0] : r2 = t2[0];
32956         }
32957         return { type: "link", raw: t2[0], text: n3, href: r2, tokens: [{ type: "text", raw: n3, text: n3 }] };
32958       }
32959     }
32960     inlineText(e3) {
32961       let t2 = this.rules.inline.text.exec(e3);
32962       if (t2) {
32963         let n3 = this.lexer.state.inRawBlock;
32964         return { type: "text", raw: t2[0], text: t2[0], escaped: n3 };
32965       }
32966     }
32967   };
32968   var x = class u {
32969     constructor(e3) {
32970       __publicField(this, "tokens");
32971       __publicField(this, "options");
32972       __publicField(this, "state");
32973       __publicField(this, "tokenizer");
32974       __publicField(this, "inlineQueue");
32975       this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e3 || T, 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 };
32976       let t2 = { other: m, block: C.normal, inline: M.normal };
32977       this.options.pedantic ? (t2.block = C.pedantic, t2.inline = M.pedantic) : this.options.gfm && (t2.block = C.gfm, this.options.breaks ? t2.inline = M.breaks : t2.inline = M.gfm), this.tokenizer.rules = t2;
32978     }
32979     static get rules() {
32980       return { block: C, inline: M };
32981     }
32982     static lex(e3, t2) {
32983       return new u(t2).lex(e3);
32984     }
32985     static lexInline(e3, t2) {
32986       return new u(t2).inlineTokens(e3);
32987     }
32988     lex(e3) {
32989       e3 = e3.replace(m.carriageReturn, "\n"), this.blockTokens(e3, this.tokens);
32990       for (let t2 = 0; t2 < this.inlineQueue.length; t2++) {
32991         let n3 = this.inlineQueue[t2];
32992         this.inlineTokens(n3.src, n3.tokens);
32993       }
32994       return this.inlineQueue = [], this.tokens;
32995     }
32996     blockTokens(e3, t2 = [], n3 = false) {
32997       var _a5, _b3, _c2;
32998       for (this.options.pedantic && (e3 = e3.replace(m.tabCharGlobal, "    ").replace(m.spaceLine, "")); e3; ) {
32999         let r2;
33000         if ((_b3 = (_a5 = this.options.extensions) == null ? void 0 : _a5.block) == null ? void 0 : _b3.some((s2) => (r2 = s2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(r2.raw.length), t2.push(r2), true) : false)) continue;
33001         if (r2 = this.tokenizer.space(e3)) {
33002           e3 = e3.substring(r2.raw.length);
33003           let s2 = t2.at(-1);
33004           r2.raw.length === 1 && s2 !== void 0 ? s2.raw += "\n" : t2.push(r2);
33005           continue;
33006         }
33007         if (r2 = this.tokenizer.code(e3)) {
33008           e3 = e3.substring(r2.raw.length);
33009           let s2 = t2.at(-1);
33010           (s2 == null ? void 0 : s2.type) === "paragraph" || (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith("\n") ? "" : "\n") + r2.raw, s2.text += "\n" + r2.text, this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
33011           continue;
33012         }
33013         if (r2 = this.tokenizer.fences(e3)) {
33014           e3 = e3.substring(r2.raw.length), t2.push(r2);
33015           continue;
33016         }
33017         if (r2 = this.tokenizer.heading(e3)) {
33018           e3 = e3.substring(r2.raw.length), t2.push(r2);
33019           continue;
33020         }
33021         if (r2 = this.tokenizer.hr(e3)) {
33022           e3 = e3.substring(r2.raw.length), t2.push(r2);
33023           continue;
33024         }
33025         if (r2 = this.tokenizer.blockquote(e3)) {
33026           e3 = e3.substring(r2.raw.length), t2.push(r2);
33027           continue;
33028         }
33029         if (r2 = this.tokenizer.list(e3)) {
33030           e3 = e3.substring(r2.raw.length), t2.push(r2);
33031           continue;
33032         }
33033         if (r2 = this.tokenizer.html(e3)) {
33034           e3 = e3.substring(r2.raw.length), t2.push(r2);
33035           continue;
33036         }
33037         if (r2 = this.tokenizer.def(e3)) {
33038           e3 = e3.substring(r2.raw.length);
33039           let s2 = t2.at(-1);
33040           (s2 == null ? void 0 : s2.type) === "paragraph" || (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith("\n") ? "" : "\n") + r2.raw, s2.text += "\n" + 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));
33041           continue;
33042         }
33043         if (r2 = this.tokenizer.table(e3)) {
33044           e3 = e3.substring(r2.raw.length), t2.push(r2);
33045           continue;
33046         }
33047         if (r2 = this.tokenizer.lheading(e3)) {
33048           e3 = e3.substring(r2.raw.length), t2.push(r2);
33049           continue;
33050         }
33051         let i3 = e3;
33052         if ((_c2 = this.options.extensions) == null ? void 0 : _c2.startBlock) {
33053           let s2 = 1 / 0, o2 = e3.slice(1), a2;
33054           this.options.extensions.startBlock.forEach((l2) => {
33055             a2 = l2.call({ lexer: this }, o2), typeof a2 == "number" && a2 >= 0 && (s2 = Math.min(s2, a2));
33056           }), s2 < 1 / 0 && s2 >= 0 && (i3 = e3.substring(0, s2 + 1));
33057         }
33058         if (this.state.top && (r2 = this.tokenizer.paragraph(i3))) {
33059           let s2 = t2.at(-1);
33060           n3 && (s2 == null ? void 0 : s2.type) === "paragraph" ? (s2.raw += (s2.raw.endsWith("\n") ? "" : "\n") + r2.raw, s2.text += "\n" + 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);
33061           continue;
33062         }
33063         if (r2 = this.tokenizer.text(e3)) {
33064           e3 = e3.substring(r2.raw.length);
33065           let s2 = t2.at(-1);
33066           (s2 == null ? void 0 : s2.type) === "text" ? (s2.raw += (s2.raw.endsWith("\n") ? "" : "\n") + r2.raw, s2.text += "\n" + r2.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = s2.text) : t2.push(r2);
33067           continue;
33068         }
33069         if (e3) {
33070           let s2 = "Infinite loop on byte: " + e3.charCodeAt(0);
33071           if (this.options.silent) {
33072             console.error(s2);
33073             break;
33074           } else throw new Error(s2);
33075         }
33076       }
33077       return this.state.top = true, t2;
33078     }
33079     inline(e3, t2 = []) {
33080       return this.inlineQueue.push({ src: e3, tokens: t2 }), t2;
33081     }
33082     inlineTokens(e3, t2 = []) {
33083       var _a5, _b3, _c2, _d2, _e3, _f;
33084       let n3 = e3, r2 = null;
33085       if (this.tokens.links) {
33086         let o2 = Object.keys(this.tokens.links);
33087         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));
33088       }
33089       for (; (r2 = this.tokenizer.rules.inline.anyPunctuation.exec(n3)) != null; ) n3 = n3.slice(0, r2.index) + "++" + n3.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
33090       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);
33091       n3 = (_c2 = (_b3 = (_a5 = this.options.hooks) == null ? void 0 : _a5.emStrongMask) == null ? void 0 : _b3.call({ lexer: this }, n3)) != null ? _c2 : n3;
33092       let i3 = false, s2 = "";
33093       for (; e3; ) {
33094         i3 || (s2 = ""), i3 = false;
33095         let o2;
33096         if ((_e3 = (_d2 = this.options.extensions) == null ? void 0 : _d2.inline) == null ? void 0 : _e3.some((l2) => (o2 = l2.call({ lexer: this }, e3, t2)) ? (e3 = e3.substring(o2.raw.length), t2.push(o2), true) : false)) continue;
33097         if (o2 = this.tokenizer.escape(e3)) {
33098           e3 = e3.substring(o2.raw.length), t2.push(o2);
33099           continue;
33100         }
33101         if (o2 = this.tokenizer.tag(e3)) {
33102           e3 = e3.substring(o2.raw.length), t2.push(o2);
33103           continue;
33104         }
33105         if (o2 = this.tokenizer.link(e3)) {
33106           e3 = e3.substring(o2.raw.length), t2.push(o2);
33107           continue;
33108         }
33109         if (o2 = this.tokenizer.reflink(e3, this.tokens.links)) {
33110           e3 = e3.substring(o2.raw.length);
33111           let l2 = t2.at(-1);
33112           o2.type === "text" && (l2 == null ? void 0 : l2.type) === "text" ? (l2.raw += o2.raw, l2.text += o2.text) : t2.push(o2);
33113           continue;
33114         }
33115         if (o2 = this.tokenizer.emStrong(e3, n3, s2)) {
33116           e3 = e3.substring(o2.raw.length), t2.push(o2);
33117           continue;
33118         }
33119         if (o2 = this.tokenizer.codespan(e3)) {
33120           e3 = e3.substring(o2.raw.length), t2.push(o2);
33121           continue;
33122         }
33123         if (o2 = this.tokenizer.br(e3)) {
33124           e3 = e3.substring(o2.raw.length), t2.push(o2);
33125           continue;
33126         }
33127         if (o2 = this.tokenizer.del(e3)) {
33128           e3 = e3.substring(o2.raw.length), t2.push(o2);
33129           continue;
33130         }
33131         if (o2 = this.tokenizer.autolink(e3)) {
33132           e3 = e3.substring(o2.raw.length), t2.push(o2);
33133           continue;
33134         }
33135         if (!this.state.inLink && (o2 = this.tokenizer.url(e3))) {
33136           e3 = e3.substring(o2.raw.length), t2.push(o2);
33137           continue;
33138         }
33139         let a2 = e3;
33140         if ((_f = this.options.extensions) == null ? void 0 : _f.startInline) {
33141           let l2 = 1 / 0, c2 = e3.slice(1), p2;
33142           this.options.extensions.startInline.forEach((g3) => {
33143             p2 = g3.call({ lexer: this }, c2), typeof p2 == "number" && p2 >= 0 && (l2 = Math.min(l2, p2));
33144           }), l2 < 1 / 0 && l2 >= 0 && (a2 = e3.substring(0, l2 + 1));
33145         }
33146         if (o2 = this.tokenizer.inlineText(a2)) {
33147           e3 = e3.substring(o2.raw.length), o2.raw.slice(-1) !== "_" && (s2 = o2.raw.slice(-1)), i3 = true;
33148           let l2 = t2.at(-1);
33149           (l2 == null ? void 0 : l2.type) === "text" ? (l2.raw += o2.raw, l2.text += o2.text) : t2.push(o2);
33150           continue;
33151         }
33152         if (e3) {
33153           let l2 = "Infinite loop on byte: " + e3.charCodeAt(0);
33154           if (this.options.silent) {
33155             console.error(l2);
33156             break;
33157           } else throw new Error(l2);
33158         }
33159       }
33160       return t2;
33161     }
33162   };
33163   var P = class {
33164     constructor(e3) {
33165       __publicField(this, "options");
33166       __publicField(this, "parser");
33167       this.options = e3 || T;
33168     }
33169     space(e3) {
33170       return "";
33171     }
33172     code({ text: e3, lang: t2, escaped: n3 }) {
33173       var _a5;
33174       let r2 = (_a5 = (t2 || "").match(m.notSpaceStart)) == null ? void 0 : _a5[0], i3 = e3.replace(m.endingNewline, "") + "\n";
33175       return r2 ? '<pre><code class="language-' + w(r2) + '">' + (n3 ? i3 : w(i3, true)) + "</code></pre>\n" : "<pre><code>" + (n3 ? i3 : w(i3, true)) + "</code></pre>\n";
33176     }
33177     blockquote({ tokens: e3 }) {
33178       return "<blockquote>\n".concat(this.parser.parse(e3), "</blockquote>\n");
33179     }
33180     html({ text: e3 }) {
33181       return e3;
33182     }
33183     def(e3) {
33184       return "";
33185     }
33186     heading({ tokens: e3, depth: t2 }) {
33187       return "<h".concat(t2, ">").concat(this.parser.parseInline(e3), "</h").concat(t2, ">\n");
33188     }
33189     hr(e3) {
33190       return "<hr>\n";
33191     }
33192     list(e3) {
33193       let t2 = e3.ordered, n3 = e3.start, r2 = "";
33194       for (let o2 = 0; o2 < e3.items.length; o2++) {
33195         let a2 = e3.items[o2];
33196         r2 += this.listitem(a2);
33197       }
33198       let i3 = t2 ? "ol" : "ul", s2 = t2 && n3 !== 1 ? ' start="' + n3 + '"' : "";
33199       return "<" + i3 + s2 + ">\n" + r2 + "</" + i3 + ">\n";
33200     }
33201     listitem(e3) {
33202       var _a5;
33203       let t2 = "";
33204       if (e3.task) {
33205         let n3 = this.checkbox({ checked: !!e3.checked });
33206         e3.loose ? ((_a5 = e3.tokens[0]) == null ? void 0 : _a5.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 + " ";
33207       }
33208       return t2 += this.parser.parse(e3.tokens, !!e3.loose), "<li>".concat(t2, "</li>\n");
33209     }
33210     checkbox({ checked: e3 }) {
33211       return "<input " + (e3 ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
33212     }
33213     paragraph({ tokens: e3 }) {
33214       return "<p>".concat(this.parser.parseInline(e3), "</p>\n");
33215     }
33216     table(e3) {
33217       let t2 = "", n3 = "";
33218       for (let i3 = 0; i3 < e3.header.length; i3++) n3 += this.tablecell(e3.header[i3]);
33219       t2 += this.tablerow({ text: n3 });
33220       let r2 = "";
33221       for (let i3 = 0; i3 < e3.rows.length; i3++) {
33222         let s2 = e3.rows[i3];
33223         n3 = "";
33224         for (let o2 = 0; o2 < s2.length; o2++) n3 += this.tablecell(s2[o2]);
33225         r2 += this.tablerow({ text: n3 });
33226       }
33227       return r2 && (r2 = "<tbody>".concat(r2, "</tbody>")), "<table>\n<thead>\n" + t2 + "</thead>\n" + r2 + "</table>\n";
33228     }
33229     tablerow({ text: e3 }) {
33230       return "<tr>\n".concat(e3, "</tr>\n");
33231     }
33232     tablecell(e3) {
33233       let t2 = this.parser.parseInline(e3.tokens), n3 = e3.header ? "th" : "td";
33234       return (e3.align ? "<".concat(n3, ' align="').concat(e3.align, '">') : "<".concat(n3, ">")) + t2 + "</".concat(n3, ">\n");
33235     }
33236     strong({ tokens: e3 }) {
33237       return "<strong>".concat(this.parser.parseInline(e3), "</strong>");
33238     }
33239     em({ tokens: e3 }) {
33240       return "<em>".concat(this.parser.parseInline(e3), "</em>");
33241     }
33242     codespan({ text: e3 }) {
33243       return "<code>".concat(w(e3, true), "</code>");
33244     }
33245     br(e3) {
33246       return "<br>";
33247     }
33248     del({ tokens: e3 }) {
33249       return "<del>".concat(this.parser.parseInline(e3), "</del>");
33250     }
33251     link({ href: e3, title: t2, tokens: n3 }) {
33252       let r2 = this.parser.parseInline(n3), i3 = J(e3);
33253       if (i3 === null) return r2;
33254       e3 = i3;
33255       let s2 = '<a href="' + e3 + '"';
33256       return t2 && (s2 += ' title="' + w(t2) + '"'), s2 += ">" + r2 + "</a>", s2;
33257     }
33258     image({ href: e3, title: t2, text: n3, tokens: r2 }) {
33259       r2 && (n3 = this.parser.parseInline(r2, this.parser.textRenderer));
33260       let i3 = J(e3);
33261       if (i3 === null) return w(n3);
33262       e3 = i3;
33263       let s2 = '<img src="'.concat(e3, '" alt="').concat(n3, '"');
33264       return t2 && (s2 += ' title="'.concat(w(t2), '"')), s2 += ">", s2;
33265     }
33266     text(e3) {
33267       return "tokens" in e3 && e3.tokens ? this.parser.parseInline(e3.tokens) : "escaped" in e3 && e3.escaped ? e3.text : w(e3.text);
33268     }
33269   };
33270   var $ = class {
33271     strong({ text: e3 }) {
33272       return e3;
33273     }
33274     em({ text: e3 }) {
33275       return e3;
33276     }
33277     codespan({ text: e3 }) {
33278       return e3;
33279     }
33280     del({ text: e3 }) {
33281       return e3;
33282     }
33283     html({ text: e3 }) {
33284       return e3;
33285     }
33286     text({ text: e3 }) {
33287       return e3;
33288     }
33289     link({ text: e3 }) {
33290       return "" + e3;
33291     }
33292     image({ text: e3 }) {
33293       return "" + e3;
33294     }
33295     br() {
33296       return "";
33297     }
33298   };
33299   var b = class u2 {
33300     constructor(e3) {
33301       __publicField(this, "options");
33302       __publicField(this, "renderer");
33303       __publicField(this, "textRenderer");
33304       this.options = e3 || T, 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 $();
33305     }
33306     static parse(e3, t2) {
33307       return new u2(t2).parse(e3);
33308     }
33309     static parseInline(e3, t2) {
33310       return new u2(t2).parseInline(e3);
33311     }
33312     parse(e3, t2 = true) {
33313       var _a5, _b3;
33314       let n3 = "";
33315       for (let r2 = 0; r2 < e3.length; r2++) {
33316         let i3 = e3[r2];
33317         if ((_b3 = (_a5 = this.options.extensions) == null ? void 0 : _a5.renderers) == null ? void 0 : _b3[i3.type]) {
33318           let o2 = i3, a2 = this.options.extensions.renderers[o2.type].call({ parser: this }, o2);
33319           if (a2 !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(o2.type)) {
33320             n3 += a2 || "";
33321             continue;
33322           }
33323         }
33324         let s2 = i3;
33325         switch (s2.type) {
33326           case "space": {
33327             n3 += this.renderer.space(s2);
33328             continue;
33329           }
33330           case "hr": {
33331             n3 += this.renderer.hr(s2);
33332             continue;
33333           }
33334           case "heading": {
33335             n3 += this.renderer.heading(s2);
33336             continue;
33337           }
33338           case "code": {
33339             n3 += this.renderer.code(s2);
33340             continue;
33341           }
33342           case "table": {
33343             n3 += this.renderer.table(s2);
33344             continue;
33345           }
33346           case "blockquote": {
33347             n3 += this.renderer.blockquote(s2);
33348             continue;
33349           }
33350           case "list": {
33351             n3 += this.renderer.list(s2);
33352             continue;
33353           }
33354           case "html": {
33355             n3 += this.renderer.html(s2);
33356             continue;
33357           }
33358           case "def": {
33359             n3 += this.renderer.def(s2);
33360             continue;
33361           }
33362           case "paragraph": {
33363             n3 += this.renderer.paragraph(s2);
33364             continue;
33365           }
33366           case "text": {
33367             let o2 = s2, a2 = this.renderer.text(o2);
33368             for (; r2 + 1 < e3.length && e3[r2 + 1].type === "text"; ) o2 = e3[++r2], a2 += "\n" + this.renderer.text(o2);
33369             t2 ? n3 += this.renderer.paragraph({ type: "paragraph", raw: a2, text: a2, tokens: [{ type: "text", raw: a2, text: a2, escaped: true }] }) : n3 += a2;
33370             continue;
33371           }
33372           default: {
33373             let o2 = 'Token with "' + s2.type + '" type was not found.';
33374             if (this.options.silent) return console.error(o2), "";
33375             throw new Error(o2);
33376           }
33377         }
33378       }
33379       return n3;
33380     }
33381     parseInline(e3, t2 = this.renderer) {
33382       var _a5, _b3;
33383       let n3 = "";
33384       for (let r2 = 0; r2 < e3.length; r2++) {
33385         let i3 = e3[r2];
33386         if ((_b3 = (_a5 = this.options.extensions) == null ? void 0 : _a5.renderers) == null ? void 0 : _b3[i3.type]) {
33387           let o2 = this.options.extensions.renderers[i3.type].call({ parser: this }, i3);
33388           if (o2 !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i3.type)) {
33389             n3 += o2 || "";
33390             continue;
33391           }
33392         }
33393         let s2 = i3;
33394         switch (s2.type) {
33395           case "escape": {
33396             n3 += t2.text(s2);
33397             break;
33398           }
33399           case "html": {
33400             n3 += t2.html(s2);
33401             break;
33402           }
33403           case "link": {
33404             n3 += t2.link(s2);
33405             break;
33406           }
33407           case "image": {
33408             n3 += t2.image(s2);
33409             break;
33410           }
33411           case "strong": {
33412             n3 += t2.strong(s2);
33413             break;
33414           }
33415           case "em": {
33416             n3 += t2.em(s2);
33417             break;
33418           }
33419           case "codespan": {
33420             n3 += t2.codespan(s2);
33421             break;
33422           }
33423           case "br": {
33424             n3 += t2.br(s2);
33425             break;
33426           }
33427           case "del": {
33428             n3 += t2.del(s2);
33429             break;
33430           }
33431           case "text": {
33432             n3 += t2.text(s2);
33433             break;
33434           }
33435           default: {
33436             let o2 = 'Token with "' + s2.type + '" type was not found.';
33437             if (this.options.silent) return console.error(o2), "";
33438             throw new Error(o2);
33439           }
33440         }
33441       }
33442       return n3;
33443     }
33444   };
33445   var _a3;
33446   var S = (_a3 = class {
33447     constructor(e3) {
33448       __publicField(this, "options");
33449       __publicField(this, "block");
33450       this.options = e3 || T;
33451     }
33452     preprocess(e3) {
33453       return e3;
33454     }
33455     postprocess(e3) {
33456       return e3;
33457     }
33458     processAllTokens(e3) {
33459       return e3;
33460     }
33461     emStrongMask(e3) {
33462       return e3;
33463     }
33464     provideLexer() {
33465       return this.block ? x.lex : x.lexInline;
33466     }
33467     provideParser() {
33468       return this.block ? b.parse : b.parseInline;
33469     }
33470   }, __publicField(_a3, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), __publicField(_a3, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), _a3);
33471   var B = class {
33472     constructor(...e3) {
33473       __publicField(this, "defaults", L());
33474       __publicField(this, "options", this.setOptions);
33475       __publicField(this, "parse", this.parseMarkdown(true));
33476       __publicField(this, "parseInline", this.parseMarkdown(false));
33477       __publicField(this, "Parser", b);
33478       __publicField(this, "Renderer", P);
33479       __publicField(this, "TextRenderer", $);
33480       __publicField(this, "Lexer", x);
33481       __publicField(this, "Tokenizer", y);
33482       __publicField(this, "Hooks", S);
33483       this.use(...e3);
33484     }
33485     walkTokens(e3, t2) {
33486       var _a5, _b3;
33487       let n3 = [];
33488       for (let r2 of e3) switch (n3 = n3.concat(t2.call(this, r2)), r2.type) {
33489         case "table": {
33490           let i3 = r2;
33491           for (let s2 of i3.header) n3 = n3.concat(this.walkTokens(s2.tokens, t2));
33492           for (let s2 of i3.rows) for (let o2 of s2) n3 = n3.concat(this.walkTokens(o2.tokens, t2));
33493           break;
33494         }
33495         case "list": {
33496           let i3 = r2;
33497           n3 = n3.concat(this.walkTokens(i3.items, t2));
33498           break;
33499         }
33500         default: {
33501           let i3 = r2;
33502           ((_b3 = (_a5 = this.defaults.extensions) == null ? void 0 : _a5.childTokens) == null ? void 0 : _b3[i3.type]) ? this.defaults.extensions.childTokens[i3.type].forEach((s2) => {
33503             let o2 = i3[s2].flat(1 / 0);
33504             n3 = n3.concat(this.walkTokens(o2, t2));
33505           }) : i3.tokens && (n3 = n3.concat(this.walkTokens(i3.tokens, t2)));
33506         }
33507       }
33508       return n3;
33509     }
33510     use(...e3) {
33511       let t2 = this.defaults.extensions || { renderers: {}, childTokens: {} };
33512       return e3.forEach((n3) => {
33513         let r2 = __spreadValues({}, n3);
33514         if (r2.async = this.defaults.async || r2.async || false, n3.extensions && (n3.extensions.forEach((i3) => {
33515           if (!i3.name) throw new Error("extension name required");
33516           if ("renderer" in i3) {
33517             let s2 = t2.renderers[i3.name];
33518             s2 ? t2.renderers[i3.name] = function(...o2) {
33519               let a2 = i3.renderer.apply(this, o2);
33520               return a2 === false && (a2 = s2.apply(this, o2)), a2;
33521             } : t2.renderers[i3.name] = i3.renderer;
33522           }
33523           if ("tokenizer" in i3) {
33524             if (!i3.level || i3.level !== "block" && i3.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
33525             let s2 = t2[i3.level];
33526             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]));
33527           }
33528           "childTokens" in i3 && i3.childTokens && (t2.childTokens[i3.name] = i3.childTokens);
33529         }), r2.extensions = t2), n3.renderer) {
33530           let i3 = this.defaults.renderer || new P(this.defaults);
33531           for (let s2 in n3.renderer) {
33532             if (!(s2 in i3)) throw new Error("renderer '".concat(s2, "' does not exist"));
33533             if (["options", "parser"].includes(s2)) continue;
33534             let o2 = s2, a2 = n3.renderer[o2], l2 = i3[o2];
33535             i3[o2] = (...c2) => {
33536               let p2 = a2.apply(i3, c2);
33537               return p2 === false && (p2 = l2.apply(i3, c2)), p2 || "";
33538             };
33539           }
33540           r2.renderer = i3;
33541         }
33542         if (n3.tokenizer) {
33543           let i3 = this.defaults.tokenizer || new y(this.defaults);
33544           for (let s2 in n3.tokenizer) {
33545             if (!(s2 in i3)) throw new Error("tokenizer '".concat(s2, "' does not exist"));
33546             if (["options", "rules", "lexer"].includes(s2)) continue;
33547             let o2 = s2, a2 = n3.tokenizer[o2], l2 = i3[o2];
33548             i3[o2] = (...c2) => {
33549               let p2 = a2.apply(i3, c2);
33550               return p2 === false && (p2 = l2.apply(i3, c2)), p2;
33551             };
33552           }
33553           r2.tokenizer = i3;
33554         }
33555         if (n3.hooks) {
33556           let i3 = this.defaults.hooks || new S();
33557           for (let s2 in n3.hooks) {
33558             if (!(s2 in i3)) throw new Error("hook '".concat(s2, "' does not exist"));
33559             if (["options", "block"].includes(s2)) continue;
33560             let o2 = s2, a2 = n3.hooks[o2], l2 = i3[o2];
33561             S.passThroughHooks.has(s2) ? i3[o2] = (c2) => {
33562               if (this.defaults.async && S.passThroughHooksRespectAsync.has(s2)) return (async () => {
33563                 let g3 = await a2.call(i3, c2);
33564                 return l2.call(i3, g3);
33565               })();
33566               let p2 = a2.call(i3, c2);
33567               return l2.call(i3, p2);
33568             } : i3[o2] = (...c2) => {
33569               if (this.defaults.async) return (async () => {
33570                 let g3 = await a2.apply(i3, c2);
33571                 return g3 === false && (g3 = await l2.apply(i3, c2)), g3;
33572               })();
33573               let p2 = a2.apply(i3, c2);
33574               return p2 === false && (p2 = l2.apply(i3, c2)), p2;
33575             };
33576           }
33577           r2.hooks = i3;
33578         }
33579         if (n3.walkTokens) {
33580           let i3 = this.defaults.walkTokens, s2 = n3.walkTokens;
33581           r2.walkTokens = function(o2) {
33582             let a2 = [];
33583             return a2.push(s2.call(this, o2)), i3 && (a2 = a2.concat(i3.call(this, o2))), a2;
33584           };
33585         }
33586         this.defaults = __spreadValues(__spreadValues({}, this.defaults), r2);
33587       }), this;
33588     }
33589     setOptions(e3) {
33590       return this.defaults = __spreadValues(__spreadValues({}, this.defaults), e3), this;
33591     }
33592     lexer(e3, t2) {
33593       return x.lex(e3, t2 != null ? t2 : this.defaults);
33594     }
33595     parser(e3, t2) {
33596       return b.parse(e3, t2 != null ? t2 : this.defaults);
33597     }
33598     parseMarkdown(e3) {
33599       return (n3, r2) => {
33600         let i3 = __spreadValues({}, r2), s2 = __spreadValues(__spreadValues({}, this.defaults), i3), o2 = this.onError(!!s2.silent, !!s2.async);
33601         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."));
33602         if (typeof n3 > "u" || n3 === null) return o2(new Error("marked(): input parameter is undefined or null"));
33603         if (typeof n3 != "string") return o2(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n3) + ", string expected"));
33604         if (s2.hooks && (s2.hooks.options = s2, s2.hooks.block = e3), s2.async) return (async () => {
33605           let a2 = s2.hooks ? await s2.hooks.preprocess(n3) : n3, c2 = await (s2.hooks ? await s2.hooks.provideLexer() : e3 ? x.lex : x.lexInline)(a2, s2), p2 = s2.hooks ? await s2.hooks.processAllTokens(c2) : c2;
33606           s2.walkTokens && await Promise.all(this.walkTokens(p2, s2.walkTokens));
33607           let d2 = await (s2.hooks ? await s2.hooks.provideParser() : e3 ? b.parse : b.parseInline)(p2, s2);
33608           return s2.hooks ? await s2.hooks.postprocess(d2) : d2;
33609         })().catch(o2);
33610         try {
33611           s2.hooks && (n3 = s2.hooks.preprocess(n3));
33612           let l2 = (s2.hooks ? s2.hooks.provideLexer() : e3 ? x.lex : x.lexInline)(n3, s2);
33613           s2.hooks && (l2 = s2.hooks.processAllTokens(l2)), s2.walkTokens && this.walkTokens(l2, s2.walkTokens);
33614           let p2 = (s2.hooks ? s2.hooks.provideParser() : e3 ? b.parse : b.parseInline)(l2, s2);
33615           return s2.hooks && (p2 = s2.hooks.postprocess(p2)), p2;
33616         } catch (a2) {
33617           return o2(a2);
33618         }
33619       };
33620     }
33621     onError(e3, t2) {
33622       return (n3) => {
33623         if (n3.message += "\nPlease report this to https://github.com/markedjs/marked.", e3) {
33624           let r2 = "<p>An error occurred:</p><pre>" + w(n3.message + "", true) + "</pre>";
33625           return t2 ? Promise.resolve(r2) : r2;
33626         }
33627         if (t2) return Promise.reject(n3);
33628         throw n3;
33629       };
33630     }
33631   };
33632   var _ = new B();
33633   function k(u4, e3) {
33634     return _.parse(u4, e3);
33635   }
33636   k.options = k.setOptions = function(u4) {
33637     return _.setOptions(u4), k.defaults = _.defaults, G(k.defaults), k;
33638   };
33639   k.getDefaults = L;
33640   k.defaults = T;
33641   k.use = function(...u4) {
33642     return _.use(...u4), k.defaults = _.defaults, G(k.defaults), k;
33643   };
33644   k.walkTokens = function(u4, e3) {
33645     return _.walkTokens(u4, e3);
33646   };
33647   k.parseInline = _.parseInline;
33648   k.Parser = b;
33649   k.parser = b.parse;
33650   k.Renderer = P;
33651   k.TextRenderer = $;
33652   k.Lexer = x;
33653   k.lexer = x.lex;
33654   k.Tokenizer = y;
33655   k.Hooks = S;
33656   k.parse = k;
33657   var Ht = k.options;
33658   var Zt = k.setOptions;
33659   var Gt = k.use;
33660   var Nt = k.walkTokens;
33661   var Ft = k.parseInline;
33662   var Qt = b.parse;
33663   var Ut = x.lex;
33664
33665   // node_modules/pbf/index.js
33666   var SHIFT_LEFT_32 = (1 << 16) * (1 << 16);
33667   var SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;
33668   var TEXT_DECODER_MIN_LENGTH = 12;
33669   var utf8TextDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder("utf-8");
33670   var PBF_VARINT = 0;
33671   var PBF_FIXED64 = 1;
33672   var PBF_BYTES = 2;
33673   var PBF_FIXED32 = 5;
33674   var Pbf = class {
33675     /**
33676      * @param {Uint8Array | ArrayBuffer} [buf]
33677      */
33678     constructor(buf = new Uint8Array(16)) {
33679       this.buf = ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf);
33680       this.dataView = new DataView(this.buf.buffer);
33681       this.pos = 0;
33682       this.type = 0;
33683       this.length = this.buf.length;
33684     }
33685     // === READING =================================================================
33686     /**
33687      * @template T
33688      * @param {(tag: number, result: T, pbf: Pbf) => void} readField
33689      * @param {T} result
33690      * @param {number} [end]
33691      */
33692     readFields(readField, result, end = this.length) {
33693       while (this.pos < end) {
33694         const val = this.readVarint(), tag = val >> 3, startPos = this.pos;
33695         this.type = val & 7;
33696         readField(tag, result, this);
33697         if (this.pos === startPos) this.skip(val);
33698       }
33699       return result;
33700     }
33701     /**
33702      * @template T
33703      * @param {(tag: number, result: T, pbf: Pbf) => void} readField
33704      * @param {T} result
33705      */
33706     readMessage(readField, result) {
33707       return this.readFields(readField, result, this.readVarint() + this.pos);
33708     }
33709     readFixed32() {
33710       const val = this.dataView.getUint32(this.pos, true);
33711       this.pos += 4;
33712       return val;
33713     }
33714     readSFixed32() {
33715       const val = this.dataView.getInt32(this.pos, true);
33716       this.pos += 4;
33717       return val;
33718     }
33719     // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)
33720     readFixed64() {
33721       const val = this.dataView.getUint32(this.pos, true) + this.dataView.getUint32(this.pos + 4, true) * SHIFT_LEFT_32;
33722       this.pos += 8;
33723       return val;
33724     }
33725     readSFixed64() {
33726       const val = this.dataView.getUint32(this.pos, true) + this.dataView.getInt32(this.pos + 4, true) * SHIFT_LEFT_32;
33727       this.pos += 8;
33728       return val;
33729     }
33730     readFloat() {
33731       const val = this.dataView.getFloat32(this.pos, true);
33732       this.pos += 4;
33733       return val;
33734     }
33735     readDouble() {
33736       const val = this.dataView.getFloat64(this.pos, true);
33737       this.pos += 8;
33738       return val;
33739     }
33740     /**
33741      * @param {boolean} [isSigned]
33742      */
33743     readVarint(isSigned) {
33744       const buf = this.buf;
33745       let val, b3;
33746       b3 = buf[this.pos++];
33747       val = b3 & 127;
33748       if (b3 < 128) return val;
33749       b3 = buf[this.pos++];
33750       val |= (b3 & 127) << 7;
33751       if (b3 < 128) return val;
33752       b3 = buf[this.pos++];
33753       val |= (b3 & 127) << 14;
33754       if (b3 < 128) return val;
33755       b3 = buf[this.pos++];
33756       val |= (b3 & 127) << 21;
33757       if (b3 < 128) return val;
33758       b3 = buf[this.pos];
33759       val |= (b3 & 15) << 28;
33760       return readVarintRemainder(val, isSigned, this);
33761     }
33762     readVarint64() {
33763       return this.readVarint(true);
33764     }
33765     readSVarint() {
33766       const num = this.readVarint();
33767       return num % 2 === 1 ? (num + 1) / -2 : num / 2;
33768     }
33769     readBoolean() {
33770       return Boolean(this.readVarint());
33771     }
33772     readString() {
33773       const end = this.readVarint() + this.pos;
33774       const pos = this.pos;
33775       this.pos = end;
33776       if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {
33777         return utf8TextDecoder.decode(this.buf.subarray(pos, end));
33778       }
33779       return readUtf8(this.buf, pos, end);
33780     }
33781     readBytes() {
33782       const end = this.readVarint() + this.pos, buffer = this.buf.subarray(this.pos, end);
33783       this.pos = end;
33784       return buffer;
33785     }
33786     // verbose for performance reasons; doesn't affect gzipped size
33787     /**
33788      * @param {number[]} [arr]
33789      * @param {boolean} [isSigned]
33790      */
33791     readPackedVarint(arr = [], isSigned) {
33792       const end = this.readPackedEnd();
33793       while (this.pos < end) arr.push(this.readVarint(isSigned));
33794       return arr;
33795     }
33796     /** @param {number[]} [arr] */
33797     readPackedSVarint(arr = []) {
33798       const end = this.readPackedEnd();
33799       while (this.pos < end) arr.push(this.readSVarint());
33800       return arr;
33801     }
33802     /** @param {boolean[]} [arr] */
33803     readPackedBoolean(arr = []) {
33804       const end = this.readPackedEnd();
33805       while (this.pos < end) arr.push(this.readBoolean());
33806       return arr;
33807     }
33808     /** @param {number[]} [arr] */
33809     readPackedFloat(arr = []) {
33810       const end = this.readPackedEnd();
33811       while (this.pos < end) arr.push(this.readFloat());
33812       return arr;
33813     }
33814     /** @param {number[]} [arr] */
33815     readPackedDouble(arr = []) {
33816       const end = this.readPackedEnd();
33817       while (this.pos < end) arr.push(this.readDouble());
33818       return arr;
33819     }
33820     /** @param {number[]} [arr] */
33821     readPackedFixed32(arr = []) {
33822       const end = this.readPackedEnd();
33823       while (this.pos < end) arr.push(this.readFixed32());
33824       return arr;
33825     }
33826     /** @param {number[]} [arr] */
33827     readPackedSFixed32(arr = []) {
33828       const end = this.readPackedEnd();
33829       while (this.pos < end) arr.push(this.readSFixed32());
33830       return arr;
33831     }
33832     /** @param {number[]} [arr] */
33833     readPackedFixed64(arr = []) {
33834       const end = this.readPackedEnd();
33835       while (this.pos < end) arr.push(this.readFixed64());
33836       return arr;
33837     }
33838     /** @param {number[]} [arr] */
33839     readPackedSFixed64(arr = []) {
33840       const end = this.readPackedEnd();
33841       while (this.pos < end) arr.push(this.readSFixed64());
33842       return arr;
33843     }
33844     readPackedEnd() {
33845       return this.type === PBF_BYTES ? this.readVarint() + this.pos : this.pos + 1;
33846     }
33847     /** @param {number} val */
33848     skip(val) {
33849       const type2 = val & 7;
33850       if (type2 === PBF_VARINT) while (this.buf[this.pos++] > 127) {
33851       }
33852       else if (type2 === PBF_BYTES) this.pos = this.readVarint() + this.pos;
33853       else if (type2 === PBF_FIXED32) this.pos += 4;
33854       else if (type2 === PBF_FIXED64) this.pos += 8;
33855       else throw new Error("Unimplemented type: ".concat(type2));
33856     }
33857     // === WRITING =================================================================
33858     /**
33859      * @param {number} tag
33860      * @param {number} type
33861      */
33862     writeTag(tag, type2) {
33863       this.writeVarint(tag << 3 | type2);
33864     }
33865     /** @param {number} min */
33866     realloc(min3) {
33867       let length2 = this.length || 16;
33868       while (length2 < this.pos + min3) length2 *= 2;
33869       if (length2 !== this.length) {
33870         const buf = new Uint8Array(length2);
33871         buf.set(this.buf);
33872         this.buf = buf;
33873         this.dataView = new DataView(buf.buffer);
33874         this.length = length2;
33875       }
33876     }
33877     finish() {
33878       this.length = this.pos;
33879       this.pos = 0;
33880       return this.buf.subarray(0, this.length);
33881     }
33882     /** @param {number} val */
33883     writeFixed32(val) {
33884       this.realloc(4);
33885       this.dataView.setInt32(this.pos, val, true);
33886       this.pos += 4;
33887     }
33888     /** @param {number} val */
33889     writeSFixed32(val) {
33890       this.realloc(4);
33891       this.dataView.setInt32(this.pos, val, true);
33892       this.pos += 4;
33893     }
33894     /** @param {number} val */
33895     writeFixed64(val) {
33896       this.realloc(8);
33897       this.dataView.setInt32(this.pos, val & -1, true);
33898       this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);
33899       this.pos += 8;
33900     }
33901     /** @param {number} val */
33902     writeSFixed64(val) {
33903       this.realloc(8);
33904       this.dataView.setInt32(this.pos, val & -1, true);
33905       this.dataView.setInt32(this.pos + 4, Math.floor(val * SHIFT_RIGHT_32), true);
33906       this.pos += 8;
33907     }
33908     /** @param {number} val */
33909     writeVarint(val) {
33910       val = +val || 0;
33911       if (val > 268435455 || val < 0) {
33912         writeBigVarint(val, this);
33913         return;
33914       }
33915       this.realloc(4);
33916       this.buf[this.pos++] = val & 127 | (val > 127 ? 128 : 0);
33917       if (val <= 127) return;
33918       this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
33919       if (val <= 127) return;
33920       this.buf[this.pos++] = (val >>>= 7) & 127 | (val > 127 ? 128 : 0);
33921       if (val <= 127) return;
33922       this.buf[this.pos++] = val >>> 7 & 127;
33923     }
33924     /** @param {number} val */
33925     writeSVarint(val) {
33926       this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);
33927     }
33928     /** @param {boolean} val */
33929     writeBoolean(val) {
33930       this.writeVarint(+val);
33931     }
33932     /** @param {string} str */
33933     writeString(str) {
33934       str = String(str);
33935       this.realloc(str.length * 4);
33936       this.pos++;
33937       const startPos = this.pos;
33938       this.pos = writeUtf8(this.buf, str, this.pos);
33939       const len = this.pos - startPos;
33940       if (len >= 128) makeRoomForExtraLength(startPos, len, this);
33941       this.pos = startPos - 1;
33942       this.writeVarint(len);
33943       this.pos += len;
33944     }
33945     /** @param {number} val */
33946     writeFloat(val) {
33947       this.realloc(4);
33948       this.dataView.setFloat32(this.pos, val, true);
33949       this.pos += 4;
33950     }
33951     /** @param {number} val */
33952     writeDouble(val) {
33953       this.realloc(8);
33954       this.dataView.setFloat64(this.pos, val, true);
33955       this.pos += 8;
33956     }
33957     /** @param {Uint8Array} buffer */
33958     writeBytes(buffer) {
33959       const len = buffer.length;
33960       this.writeVarint(len);
33961       this.realloc(len);
33962       for (let i3 = 0; i3 < len; i3++) this.buf[this.pos++] = buffer[i3];
33963     }
33964     /**
33965      * @template T
33966      * @param {(obj: T, pbf: Pbf) => void} fn
33967      * @param {T} obj
33968      */
33969     writeRawMessage(fn, obj) {
33970       this.pos++;
33971       const startPos = this.pos;
33972       fn(obj, this);
33973       const len = this.pos - startPos;
33974       if (len >= 128) makeRoomForExtraLength(startPos, len, this);
33975       this.pos = startPos - 1;
33976       this.writeVarint(len);
33977       this.pos += len;
33978     }
33979     /**
33980      * @template T
33981      * @param {number} tag
33982      * @param {(obj: T, pbf: Pbf) => void} fn
33983      * @param {T} obj
33984      */
33985     writeMessage(tag, fn, obj) {
33986       this.writeTag(tag, PBF_BYTES);
33987       this.writeRawMessage(fn, obj);
33988     }
33989     /**
33990      * @param {number} tag
33991      * @param {number[]} arr
33992      */
33993     writePackedVarint(tag, arr) {
33994       if (arr.length) this.writeMessage(tag, writePackedVarint, arr);
33995     }
33996     /**
33997      * @param {number} tag
33998      * @param {number[]} arr
33999      */
34000     writePackedSVarint(tag, arr) {
34001       if (arr.length) this.writeMessage(tag, writePackedSVarint, arr);
34002     }
34003     /**
34004      * @param {number} tag
34005      * @param {boolean[]} arr
34006      */
34007     writePackedBoolean(tag, arr) {
34008       if (arr.length) this.writeMessage(tag, writePackedBoolean, arr);
34009     }
34010     /**
34011      * @param {number} tag
34012      * @param {number[]} arr
34013      */
34014     writePackedFloat(tag, arr) {
34015       if (arr.length) this.writeMessage(tag, writePackedFloat, arr);
34016     }
34017     /**
34018      * @param {number} tag
34019      * @param {number[]} arr
34020      */
34021     writePackedDouble(tag, arr) {
34022       if (arr.length) this.writeMessage(tag, writePackedDouble, arr);
34023     }
34024     /**
34025      * @param {number} tag
34026      * @param {number[]} arr
34027      */
34028     writePackedFixed32(tag, arr) {
34029       if (arr.length) this.writeMessage(tag, writePackedFixed32, arr);
34030     }
34031     /**
34032      * @param {number} tag
34033      * @param {number[]} arr
34034      */
34035     writePackedSFixed32(tag, arr) {
34036       if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr);
34037     }
34038     /**
34039      * @param {number} tag
34040      * @param {number[]} arr
34041      */
34042     writePackedFixed64(tag, arr) {
34043       if (arr.length) this.writeMessage(tag, writePackedFixed64, arr);
34044     }
34045     /**
34046      * @param {number} tag
34047      * @param {number[]} arr
34048      */
34049     writePackedSFixed64(tag, arr) {
34050       if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr);
34051     }
34052     /**
34053      * @param {number} tag
34054      * @param {Uint8Array} buffer
34055      */
34056     writeBytesField(tag, buffer) {
34057       this.writeTag(tag, PBF_BYTES);
34058       this.writeBytes(buffer);
34059     }
34060     /**
34061      * @param {number} tag
34062      * @param {number} val
34063      */
34064     writeFixed32Field(tag, val) {
34065       this.writeTag(tag, PBF_FIXED32);
34066       this.writeFixed32(val);
34067     }
34068     /**
34069      * @param {number} tag
34070      * @param {number} val
34071      */
34072     writeSFixed32Field(tag, val) {
34073       this.writeTag(tag, PBF_FIXED32);
34074       this.writeSFixed32(val);
34075     }
34076     /**
34077      * @param {number} tag
34078      * @param {number} val
34079      */
34080     writeFixed64Field(tag, val) {
34081       this.writeTag(tag, PBF_FIXED64);
34082       this.writeFixed64(val);
34083     }
34084     /**
34085      * @param {number} tag
34086      * @param {number} val
34087      */
34088     writeSFixed64Field(tag, val) {
34089       this.writeTag(tag, PBF_FIXED64);
34090       this.writeSFixed64(val);
34091     }
34092     /**
34093      * @param {number} tag
34094      * @param {number} val
34095      */
34096     writeVarintField(tag, val) {
34097       this.writeTag(tag, PBF_VARINT);
34098       this.writeVarint(val);
34099     }
34100     /**
34101      * @param {number} tag
34102      * @param {number} val
34103      */
34104     writeSVarintField(tag, val) {
34105       this.writeTag(tag, PBF_VARINT);
34106       this.writeSVarint(val);
34107     }
34108     /**
34109      * @param {number} tag
34110      * @param {string} str
34111      */
34112     writeStringField(tag, str) {
34113       this.writeTag(tag, PBF_BYTES);
34114       this.writeString(str);
34115     }
34116     /**
34117      * @param {number} tag
34118      * @param {number} val
34119      */
34120     writeFloatField(tag, val) {
34121       this.writeTag(tag, PBF_FIXED32);
34122       this.writeFloat(val);
34123     }
34124     /**
34125      * @param {number} tag
34126      * @param {number} val
34127      */
34128     writeDoubleField(tag, val) {
34129       this.writeTag(tag, PBF_FIXED64);
34130       this.writeDouble(val);
34131     }
34132     /**
34133      * @param {number} tag
34134      * @param {boolean} val
34135      */
34136     writeBooleanField(tag, val) {
34137       this.writeVarintField(tag, +val);
34138     }
34139   };
34140   function readVarintRemainder(l2, s2, p2) {
34141     const buf = p2.buf;
34142     let h3, b3;
34143     b3 = buf[p2.pos++];
34144     h3 = (b3 & 112) >> 4;
34145     if (b3 < 128) return toNum(l2, h3, s2);
34146     b3 = buf[p2.pos++];
34147     h3 |= (b3 & 127) << 3;
34148     if (b3 < 128) return toNum(l2, h3, s2);
34149     b3 = buf[p2.pos++];
34150     h3 |= (b3 & 127) << 10;
34151     if (b3 < 128) return toNum(l2, h3, s2);
34152     b3 = buf[p2.pos++];
34153     h3 |= (b3 & 127) << 17;
34154     if (b3 < 128) return toNum(l2, h3, s2);
34155     b3 = buf[p2.pos++];
34156     h3 |= (b3 & 127) << 24;
34157     if (b3 < 128) return toNum(l2, h3, s2);
34158     b3 = buf[p2.pos++];
34159     h3 |= (b3 & 1) << 31;
34160     if (b3 < 128) return toNum(l2, h3, s2);
34161     throw new Error("Expected varint not more than 10 bytes");
34162   }
34163   function toNum(low, high, isSigned) {
34164     return isSigned ? high * 4294967296 + (low >>> 0) : (high >>> 0) * 4294967296 + (low >>> 0);
34165   }
34166   function writeBigVarint(val, pbf) {
34167     let low, high;
34168     if (val >= 0) {
34169       low = val % 4294967296 | 0;
34170       high = val / 4294967296 | 0;
34171     } else {
34172       low = ~(-val % 4294967296);
34173       high = ~(-val / 4294967296);
34174       if (low ^ 4294967295) {
34175         low = low + 1 | 0;
34176       } else {
34177         low = 0;
34178         high = high + 1 | 0;
34179       }
34180     }
34181     if (val >= 18446744073709552e3 || val < -18446744073709552e3) {
34182       throw new Error("Given varint doesn't fit into 10 bytes");
34183     }
34184     pbf.realloc(10);
34185     writeBigVarintLow(low, high, pbf);
34186     writeBigVarintHigh(high, pbf);
34187   }
34188   function writeBigVarintLow(low, high, pbf) {
34189     pbf.buf[pbf.pos++] = low & 127 | 128;
34190     low >>>= 7;
34191     pbf.buf[pbf.pos++] = low & 127 | 128;
34192     low >>>= 7;
34193     pbf.buf[pbf.pos++] = low & 127 | 128;
34194     low >>>= 7;
34195     pbf.buf[pbf.pos++] = low & 127 | 128;
34196     low >>>= 7;
34197     pbf.buf[pbf.pos] = low & 127;
34198   }
34199   function writeBigVarintHigh(high, pbf) {
34200     const lsb = (high & 7) << 4;
34201     pbf.buf[pbf.pos++] |= lsb | ((high >>>= 3) ? 128 : 0);
34202     if (!high) return;
34203     pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
34204     if (!high) return;
34205     pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
34206     if (!high) return;
34207     pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
34208     if (!high) return;
34209     pbf.buf[pbf.pos++] = high & 127 | ((high >>>= 7) ? 128 : 0);
34210     if (!high) return;
34211     pbf.buf[pbf.pos++] = high & 127;
34212   }
34213   function makeRoomForExtraLength(startPos, len, pbf) {
34214     const extraLen = len <= 16383 ? 1 : len <= 2097151 ? 2 : len <= 268435455 ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));
34215     pbf.realloc(extraLen);
34216     for (let i3 = pbf.pos - 1; i3 >= startPos; i3--) pbf.buf[i3 + extraLen] = pbf.buf[i3];
34217   }
34218   function writePackedVarint(arr, pbf) {
34219     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeVarint(arr[i3]);
34220   }
34221   function writePackedSVarint(arr, pbf) {
34222     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeSVarint(arr[i3]);
34223   }
34224   function writePackedFloat(arr, pbf) {
34225     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeFloat(arr[i3]);
34226   }
34227   function writePackedDouble(arr, pbf) {
34228     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeDouble(arr[i3]);
34229   }
34230   function writePackedBoolean(arr, pbf) {
34231     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeBoolean(arr[i3]);
34232   }
34233   function writePackedFixed32(arr, pbf) {
34234     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeFixed32(arr[i3]);
34235   }
34236   function writePackedSFixed32(arr, pbf) {
34237     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeSFixed32(arr[i3]);
34238   }
34239   function writePackedFixed64(arr, pbf) {
34240     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeFixed64(arr[i3]);
34241   }
34242   function writePackedSFixed64(arr, pbf) {
34243     for (let i3 = 0; i3 < arr.length; i3++) pbf.writeSFixed64(arr[i3]);
34244   }
34245   function readUtf8(buf, pos, end) {
34246     let str = "";
34247     let i3 = pos;
34248     while (i3 < end) {
34249       const b0 = buf[i3];
34250       let c2 = null;
34251       let bytesPerSequence = b0 > 239 ? 4 : b0 > 223 ? 3 : b0 > 191 ? 2 : 1;
34252       if (i3 + bytesPerSequence > end) break;
34253       let b1, b22, b3;
34254       if (bytesPerSequence === 1) {
34255         if (b0 < 128) {
34256           c2 = b0;
34257         }
34258       } else if (bytesPerSequence === 2) {
34259         b1 = buf[i3 + 1];
34260         if ((b1 & 192) === 128) {
34261           c2 = (b0 & 31) << 6 | b1 & 63;
34262           if (c2 <= 127) {
34263             c2 = null;
34264           }
34265         }
34266       } else if (bytesPerSequence === 3) {
34267         b1 = buf[i3 + 1];
34268         b22 = buf[i3 + 2];
34269         if ((b1 & 192) === 128 && (b22 & 192) === 128) {
34270           c2 = (b0 & 15) << 12 | (b1 & 63) << 6 | b22 & 63;
34271           if (c2 <= 2047 || c2 >= 55296 && c2 <= 57343) {
34272             c2 = null;
34273           }
34274         }
34275       } else if (bytesPerSequence === 4) {
34276         b1 = buf[i3 + 1];
34277         b22 = buf[i3 + 2];
34278         b3 = buf[i3 + 3];
34279         if ((b1 & 192) === 128 && (b22 & 192) === 128 && (b3 & 192) === 128) {
34280           c2 = (b0 & 15) << 18 | (b1 & 63) << 12 | (b22 & 63) << 6 | b3 & 63;
34281           if (c2 <= 65535 || c2 >= 1114112) {
34282             c2 = null;
34283           }
34284         }
34285       }
34286       if (c2 === null) {
34287         c2 = 65533;
34288         bytesPerSequence = 1;
34289       } else if (c2 > 65535) {
34290         c2 -= 65536;
34291         str += String.fromCharCode(c2 >>> 10 & 1023 | 55296);
34292         c2 = 56320 | c2 & 1023;
34293       }
34294       str += String.fromCharCode(c2);
34295       i3 += bytesPerSequence;
34296     }
34297     return str;
34298   }
34299   function writeUtf8(buf, str, pos) {
34300     for (let i3 = 0, c2, lead; i3 < str.length; i3++) {
34301       c2 = str.charCodeAt(i3);
34302       if (c2 > 55295 && c2 < 57344) {
34303         if (lead) {
34304           if (c2 < 56320) {
34305             buf[pos++] = 239;
34306             buf[pos++] = 191;
34307             buf[pos++] = 189;
34308             lead = c2;
34309             continue;
34310           } else {
34311             c2 = lead - 55296 << 10 | c2 - 56320 | 65536;
34312             lead = null;
34313           }
34314         } else {
34315           if (c2 > 56319 || i3 + 1 === str.length) {
34316             buf[pos++] = 239;
34317             buf[pos++] = 191;
34318             buf[pos++] = 189;
34319           } else {
34320             lead = c2;
34321           }
34322           continue;
34323         }
34324       } else if (lead) {
34325         buf[pos++] = 239;
34326         buf[pos++] = 191;
34327         buf[pos++] = 189;
34328         lead = null;
34329       }
34330       if (c2 < 128) {
34331         buf[pos++] = c2;
34332       } else {
34333         if (c2 < 2048) {
34334           buf[pos++] = c2 >> 6 | 192;
34335         } else {
34336           if (c2 < 65536) {
34337             buf[pos++] = c2 >> 12 | 224;
34338           } else {
34339             buf[pos++] = c2 >> 18 | 240;
34340             buf[pos++] = c2 >> 12 & 63 | 128;
34341           }
34342           buf[pos++] = c2 >> 6 & 63 | 128;
34343         }
34344         buf[pos++] = c2 & 63 | 128;
34345       }
34346     }
34347     return pos;
34348   }
34349
34350   // node_modules/@mapbox/point-geometry/index.js
34351   function Point(x3, y3) {
34352     this.x = x3;
34353     this.y = y3;
34354   }
34355   Point.prototype = {
34356     /**
34357      * Clone this point, returning a new point that can be modified
34358      * without affecting the old one.
34359      * @return {Point} the clone
34360      */
34361     clone() {
34362       return new Point(this.x, this.y);
34363     },
34364     /**
34365      * Add this point's x & y coordinates to another point,
34366      * yielding a new point.
34367      * @param {Point} p the other point
34368      * @return {Point} output point
34369      */
34370     add(p2) {
34371       return this.clone()._add(p2);
34372     },
34373     /**
34374      * Subtract this point's x & y coordinates to from point,
34375      * yielding a new point.
34376      * @param {Point} p the other point
34377      * @return {Point} output point
34378      */
34379     sub(p2) {
34380       return this.clone()._sub(p2);
34381     },
34382     /**
34383      * Multiply this point's x & y coordinates by point,
34384      * yielding a new point.
34385      * @param {Point} p the other point
34386      * @return {Point} output point
34387      */
34388     multByPoint(p2) {
34389       return this.clone()._multByPoint(p2);
34390     },
34391     /**
34392      * Divide this point's x & y coordinates by point,
34393      * yielding a new point.
34394      * @param {Point} p the other point
34395      * @return {Point} output point
34396      */
34397     divByPoint(p2) {
34398       return this.clone()._divByPoint(p2);
34399     },
34400     /**
34401      * Multiply this point's x & y coordinates by a factor,
34402      * yielding a new point.
34403      * @param {number} k factor
34404      * @return {Point} output point
34405      */
34406     mult(k3) {
34407       return this.clone()._mult(k3);
34408     },
34409     /**
34410      * Divide this point's x & y coordinates by a factor,
34411      * yielding a new point.
34412      * @param {number} k factor
34413      * @return {Point} output point
34414      */
34415     div(k3) {
34416       return this.clone()._div(k3);
34417     },
34418     /**
34419      * Rotate this point around the 0, 0 origin by an angle a,
34420      * given in radians
34421      * @param {number} a angle to rotate around, in radians
34422      * @return {Point} output point
34423      */
34424     rotate(a2) {
34425       return this.clone()._rotate(a2);
34426     },
34427     /**
34428      * Rotate this point around p point by an angle a,
34429      * given in radians
34430      * @param {number} a angle to rotate around, in radians
34431      * @param {Point} p Point to rotate around
34432      * @return {Point} output point
34433      */
34434     rotateAround(a2, p2) {
34435       return this.clone()._rotateAround(a2, p2);
34436     },
34437     /**
34438      * Multiply this point by a 4x1 transformation matrix
34439      * @param {[number, number, number, number]} m transformation matrix
34440      * @return {Point} output point
34441      */
34442     matMult(m3) {
34443       return this.clone()._matMult(m3);
34444     },
34445     /**
34446      * Calculate this point but as a unit vector from 0, 0, meaning
34447      * that the distance from the resulting point to the 0, 0
34448      * coordinate will be equal to 1 and the angle from the resulting
34449      * point to the 0, 0 coordinate will be the same as before.
34450      * @return {Point} unit vector point
34451      */
34452     unit() {
34453       return this.clone()._unit();
34454     },
34455     /**
34456      * Compute a perpendicular point, where the new y coordinate
34457      * is the old x coordinate and the new x coordinate is the old y
34458      * coordinate multiplied by -1
34459      * @return {Point} perpendicular point
34460      */
34461     perp() {
34462       return this.clone()._perp();
34463     },
34464     /**
34465      * Return a version of this point with the x & y coordinates
34466      * rounded to integers.
34467      * @return {Point} rounded point
34468      */
34469     round() {
34470       return this.clone()._round();
34471     },
34472     /**
34473      * Return the magnitude of this point: this is the Euclidean
34474      * distance from the 0, 0 coordinate to this point's x and y
34475      * coordinates.
34476      * @return {number} magnitude
34477      */
34478     mag() {
34479       return Math.sqrt(this.x * this.x + this.y * this.y);
34480     },
34481     /**
34482      * Judge whether this point is equal to another point, returning
34483      * true or false.
34484      * @param {Point} other the other point
34485      * @return {boolean} whether the points are equal
34486      */
34487     equals(other) {
34488       return this.x === other.x && this.y === other.y;
34489     },
34490     /**
34491      * Calculate the distance from this point to another point
34492      * @param {Point} p the other point
34493      * @return {number} distance
34494      */
34495     dist(p2) {
34496       return Math.sqrt(this.distSqr(p2));
34497     },
34498     /**
34499      * Calculate the distance from this point to another point,
34500      * without the square root step. Useful if you're comparing
34501      * relative distances.
34502      * @param {Point} p the other point
34503      * @return {number} distance
34504      */
34505     distSqr(p2) {
34506       const dx = p2.x - this.x, dy = p2.y - this.y;
34507       return dx * dx + dy * dy;
34508     },
34509     /**
34510      * Get the angle from the 0, 0 coordinate to this point, in radians
34511      * coordinates.
34512      * @return {number} angle
34513      */
34514     angle() {
34515       return Math.atan2(this.y, this.x);
34516     },
34517     /**
34518      * Get the angle from this point to another point, in radians
34519      * @param {Point} b the other point
34520      * @return {number} angle
34521      */
34522     angleTo(b3) {
34523       return Math.atan2(this.y - b3.y, this.x - b3.x);
34524     },
34525     /**
34526      * Get the angle between this point and another point, in radians
34527      * @param {Point} b the other point
34528      * @return {number} angle
34529      */
34530     angleWith(b3) {
34531       return this.angleWithSep(b3.x, b3.y);
34532     },
34533     /**
34534      * Find the angle of the two vectors, solving the formula for
34535      * the cross product a x b = |a||b|sin(θ) for θ.
34536      * @param {number} x the x-coordinate
34537      * @param {number} y the y-coordinate
34538      * @return {number} the angle in radians
34539      */
34540     angleWithSep(x3, y3) {
34541       return Math.atan2(
34542         this.x * y3 - this.y * x3,
34543         this.x * x3 + this.y * y3
34544       );
34545     },
34546     /** @param {[number, number, number, number]} m */
34547     _matMult(m3) {
34548       const x3 = m3[0] * this.x + m3[1] * this.y, y3 = m3[2] * this.x + m3[3] * this.y;
34549       this.x = x3;
34550       this.y = y3;
34551       return this;
34552     },
34553     /** @param {Point} p */
34554     _add(p2) {
34555       this.x += p2.x;
34556       this.y += p2.y;
34557       return this;
34558     },
34559     /** @param {Point} p */
34560     _sub(p2) {
34561       this.x -= p2.x;
34562       this.y -= p2.y;
34563       return this;
34564     },
34565     /** @param {number} k */
34566     _mult(k3) {
34567       this.x *= k3;
34568       this.y *= k3;
34569       return this;
34570     },
34571     /** @param {number} k */
34572     _div(k3) {
34573       this.x /= k3;
34574       this.y /= k3;
34575       return this;
34576     },
34577     /** @param {Point} p */
34578     _multByPoint(p2) {
34579       this.x *= p2.x;
34580       this.y *= p2.y;
34581       return this;
34582     },
34583     /** @param {Point} p */
34584     _divByPoint(p2) {
34585       this.x /= p2.x;
34586       this.y /= p2.y;
34587       return this;
34588     },
34589     _unit() {
34590       this._div(this.mag());
34591       return this;
34592     },
34593     _perp() {
34594       const y3 = this.y;
34595       this.y = this.x;
34596       this.x = -y3;
34597       return this;
34598     },
34599     /** @param {number} angle */
34600     _rotate(angle2) {
34601       const cos2 = Math.cos(angle2), sin2 = Math.sin(angle2), x3 = cos2 * this.x - sin2 * this.y, y3 = sin2 * this.x + cos2 * this.y;
34602       this.x = x3;
34603       this.y = y3;
34604       return this;
34605     },
34606     /**
34607      * @param {number} angle
34608      * @param {Point} p
34609      */
34610     _rotateAround(angle2, p2) {
34611       const cos2 = Math.cos(angle2), sin2 = Math.sin(angle2), x3 = 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);
34612       this.x = x3;
34613       this.y = y3;
34614       return this;
34615     },
34616     _round() {
34617       this.x = Math.round(this.x);
34618       this.y = Math.round(this.y);
34619       return this;
34620     },
34621     constructor: Point
34622   };
34623   Point.convert = function(p2) {
34624     if (p2 instanceof Point) {
34625       return (
34626         /** @type {Point} */
34627         p2
34628       );
34629     }
34630     if (Array.isArray(p2)) {
34631       return new Point(+p2[0], +p2[1]);
34632     }
34633     if (p2.x !== void 0 && p2.y !== void 0) {
34634       return new Point(+p2.x, +p2.y);
34635     }
34636     throw new Error("Expected [x, y] or {x, y} point format");
34637   };
34638
34639   // node_modules/@mapbox/vector-tile/index.js
34640   var VectorTileFeature = class {
34641     /**
34642      * @param {Pbf} pbf
34643      * @param {number} end
34644      * @param {number} extent
34645      * @param {string[]} keys
34646      * @param {(number | string | boolean)[]} values
34647      */
34648     constructor(pbf, end, extent, keys2, values) {
34649       this.properties = {};
34650       this.extent = extent;
34651       this.type = 0;
34652       this.id = void 0;
34653       this._pbf = pbf;
34654       this._geometry = -1;
34655       this._keys = keys2;
34656       this._values = values;
34657       pbf.readFields(readFeature, this, end);
34658     }
34659     loadGeometry() {
34660       const pbf = this._pbf;
34661       pbf.pos = this._geometry;
34662       const end = pbf.readVarint() + pbf.pos;
34663       const lines = [];
34664       let line;
34665       let cmd = 1;
34666       let length2 = 0;
34667       let x3 = 0;
34668       let y3 = 0;
34669       while (pbf.pos < end) {
34670         if (length2 <= 0) {
34671           const cmdLen = pbf.readVarint();
34672           cmd = cmdLen & 7;
34673           length2 = cmdLen >> 3;
34674         }
34675         length2--;
34676         if (cmd === 1 || cmd === 2) {
34677           x3 += pbf.readSVarint();
34678           y3 += pbf.readSVarint();
34679           if (cmd === 1) {
34680             if (line) lines.push(line);
34681             line = [];
34682           }
34683           if (line) line.push(new Point(x3, y3));
34684         } else if (cmd === 7) {
34685           if (line) {
34686             line.push(line[0].clone());
34687           }
34688         } else {
34689           throw new Error("unknown command ".concat(cmd));
34690         }
34691       }
34692       if (line) lines.push(line);
34693       return lines;
34694     }
34695     bbox() {
34696       const pbf = this._pbf;
34697       pbf.pos = this._geometry;
34698       const end = pbf.readVarint() + pbf.pos;
34699       let cmd = 1, length2 = 0, x3 = 0, y3 = 0, x12 = Infinity, x22 = -Infinity, y12 = Infinity, y22 = -Infinity;
34700       while (pbf.pos < end) {
34701         if (length2 <= 0) {
34702           const cmdLen = pbf.readVarint();
34703           cmd = cmdLen & 7;
34704           length2 = cmdLen >> 3;
34705         }
34706         length2--;
34707         if (cmd === 1 || cmd === 2) {
34708           x3 += pbf.readSVarint();
34709           y3 += pbf.readSVarint();
34710           if (x3 < x12) x12 = x3;
34711           if (x3 > x22) x22 = x3;
34712           if (y3 < y12) y12 = y3;
34713           if (y3 > y22) y22 = y3;
34714         } else if (cmd !== 7) {
34715           throw new Error("unknown command ".concat(cmd));
34716         }
34717       }
34718       return [x12, y12, x22, y22];
34719     }
34720     /**
34721      * @param {number} x
34722      * @param {number} y
34723      * @param {number} z
34724      * @return {Feature}
34725      */
34726     toGeoJSON(x3, y3, z3) {
34727       const size = this.extent * Math.pow(2, z3), x05 = this.extent * x3, y05 = this.extent * y3, vtCoords = this.loadGeometry();
34728       function projectPoint(p2) {
34729         return [
34730           (p2.x + x05) * 360 / size - 180,
34731           360 / Math.PI * Math.atan(Math.exp((1 - (p2.y + y05) * 2 / size) * Math.PI)) - 90
34732         ];
34733       }
34734       function projectLine(line) {
34735         return line.map(projectPoint);
34736       }
34737       let geometry;
34738       if (this.type === 1) {
34739         const points = [];
34740         for (const line of vtCoords) {
34741           points.push(line[0]);
34742         }
34743         const coordinates = projectLine(points);
34744         geometry = points.length === 1 ? { type: "Point", coordinates: coordinates[0] } : { type: "MultiPoint", coordinates };
34745       } else if (this.type === 2) {
34746         const coordinates = vtCoords.map(projectLine);
34747         geometry = coordinates.length === 1 ? { type: "LineString", coordinates: coordinates[0] } : { type: "MultiLineString", coordinates };
34748       } else if (this.type === 3) {
34749         const polygons = classifyRings(vtCoords);
34750         const coordinates = [];
34751         for (const polygon2 of polygons) {
34752           coordinates.push(polygon2.map(projectLine));
34753         }
34754         geometry = coordinates.length === 1 ? { type: "Polygon", coordinates: coordinates[0] } : { type: "MultiPolygon", coordinates };
34755       } else {
34756         throw new Error("unknown feature type");
34757       }
34758       const result = {
34759         type: "Feature",
34760         geometry,
34761         properties: this.properties
34762       };
34763       if (this.id != null) {
34764         result.id = this.id;
34765       }
34766       return result;
34767     }
34768   };
34769   VectorTileFeature.types = ["Unknown", "Point", "LineString", "Polygon"];
34770   function readFeature(tag, feature4, pbf) {
34771     if (tag === 1) feature4.id = pbf.readVarint();
34772     else if (tag === 2) readTag(pbf, feature4);
34773     else if (tag === 3) feature4.type = /** @type {0 | 1 | 2 | 3} */
34774     pbf.readVarint();
34775     else if (tag === 4) feature4._geometry = pbf.pos;
34776   }
34777   function readTag(pbf, feature4) {
34778     const end = pbf.readVarint() + pbf.pos;
34779     while (pbf.pos < end) {
34780       const key = feature4._keys[pbf.readVarint()];
34781       const value = feature4._values[pbf.readVarint()];
34782       feature4.properties[key] = value;
34783     }
34784   }
34785   function classifyRings(rings) {
34786     const len = rings.length;
34787     if (len <= 1) return [rings];
34788     const polygons = [];
34789     let polygon2, ccw;
34790     for (let i3 = 0; i3 < len; i3++) {
34791       const area = signedArea(rings[i3]);
34792       if (area === 0) continue;
34793       if (ccw === void 0) ccw = area < 0;
34794       if (ccw === area < 0) {
34795         if (polygon2) polygons.push(polygon2);
34796         polygon2 = [rings[i3]];
34797       } else if (polygon2) {
34798         polygon2.push(rings[i3]);
34799       }
34800     }
34801     if (polygon2) polygons.push(polygon2);
34802     return polygons;
34803   }
34804   function signedArea(ring) {
34805     let sum = 0;
34806     for (let i3 = 0, len = ring.length, j3 = len - 1, p1, p2; i3 < len; j3 = i3++) {
34807       p1 = ring[i3];
34808       p2 = ring[j3];
34809       sum += (p2.x - p1.x) * (p1.y + p2.y);
34810     }
34811     return sum;
34812   }
34813   var VectorTileLayer = class {
34814     /**
34815      * @param {Pbf} pbf
34816      * @param {number} [end]
34817      */
34818     constructor(pbf, end) {
34819       this.version = 1;
34820       this.name = "";
34821       this.extent = 4096;
34822       this.length = 0;
34823       this._pbf = pbf;
34824       this._keys = [];
34825       this._values = [];
34826       this._features = [];
34827       pbf.readFields(readLayer, this, end);
34828       this.length = this._features.length;
34829     }
34830     /** return feature `i` from this layer as a `VectorTileFeature`
34831      * @param {number} i
34832      */
34833     feature(i3) {
34834       if (i3 < 0 || i3 >= this._features.length) throw new Error("feature index out of bounds");
34835       this._pbf.pos = this._features[i3];
34836       const end = this._pbf.readVarint() + this._pbf.pos;
34837       return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);
34838     }
34839   };
34840   function readLayer(tag, layer, pbf) {
34841     if (tag === 15) layer.version = pbf.readVarint();
34842     else if (tag === 1) layer.name = pbf.readString();
34843     else if (tag === 5) layer.extent = pbf.readVarint();
34844     else if (tag === 2) layer._features.push(pbf.pos);
34845     else if (tag === 3) layer._keys.push(pbf.readString());
34846     else if (tag === 4) layer._values.push(readValueMessage(pbf));
34847   }
34848   function readValueMessage(pbf) {
34849     let value = null;
34850     const end = pbf.readVarint() + pbf.pos;
34851     while (pbf.pos < end) {
34852       const tag = pbf.readVarint() >> 3;
34853       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;
34854     }
34855     if (value == null) {
34856       throw new Error("unknown feature value");
34857     }
34858     return value;
34859   }
34860   var VectorTile = class {
34861     /**
34862      * @param {Pbf} pbf
34863      * @param {number} [end]
34864      */
34865     constructor(pbf, end) {
34866       this.layers = pbf.readFields(readTile, {}, end);
34867     }
34868   };
34869   function readTile(tag, layers, pbf) {
34870     if (tag === 3) {
34871       const layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);
34872       if (layer.length) layers[layer.name] = layer;
34873     }
34874   }
34875
34876   // modules/services/osmose.js
34877   var tiler2 = utilTiler();
34878   var dispatch3 = dispatch_default("loaded");
34879   var _tileZoom2 = 14;
34880   var _osmoseUrlRoot = "https://osmose.openstreetmap.fr/api/0.3";
34881   var _osmoseData = { icons: {}, items: [] };
34882   var _cache2;
34883   function abortRequest2(controller) {
34884     if (controller) {
34885       controller.abort();
34886     }
34887   }
34888   function abortUnwantedRequests2(cache, tiles) {
34889     Object.keys(cache.inflightTile).forEach((k3) => {
34890       let wanted = tiles.find((tile) => k3 === tile.id);
34891       if (!wanted) {
34892         abortRequest2(cache.inflightTile[k3]);
34893         delete cache.inflightTile[k3];
34894       }
34895     });
34896   }
34897   function encodeIssueRtree2(d2) {
34898     return { minX: d2.loc[0], minY: d2.loc[1], maxX: d2.loc[0], maxY: d2.loc[1], data: d2 };
34899   }
34900   function updateRtree2(item, replace) {
34901     _cache2.rtree.remove(item, (a2, b3) => a2.data.id === b3.data.id);
34902     if (replace) {
34903       _cache2.rtree.insert(item);
34904     }
34905   }
34906   function preventCoincident(loc) {
34907     let coincident = false;
34908     do {
34909       let delta = coincident ? [1e-5, 0] : [0, 1e-5];
34910       loc = geoVecAdd(loc, delta);
34911       let bbox2 = geoExtent(loc).bbox();
34912       coincident = _cache2.rtree.search(bbox2).length;
34913     } while (coincident);
34914     return loc;
34915   }
34916   var osmose_default = {
34917     title: "osmose",
34918     init() {
34919       _mainFileFetcher.get("qa_data").then((d2) => {
34920         _osmoseData = d2.osmose;
34921         _osmoseData.items = Object.keys(d2.osmose.icons).map((s2) => s2.split("-")[0]).reduce((unique, item) => unique.indexOf(item) !== -1 ? unique : [...unique, item], []);
34922       });
34923       if (!_cache2) {
34924         this.reset();
34925       }
34926       this.event = utilRebind(this, dispatch3, "on");
34927     },
34928     reset() {
34929       let _strings = {};
34930       let _colors = {};
34931       if (_cache2) {
34932         Object.values(_cache2.inflightTile).forEach(abortRequest2);
34933         _strings = _cache2.strings;
34934         _colors = _cache2.colors;
34935       }
34936       _cache2 = {
34937         data: {},
34938         loadedTile: {},
34939         inflightTile: {},
34940         inflightPost: {},
34941         closed: {},
34942         rtree: new RBush(),
34943         strings: _strings,
34944         colors: _colors
34945       };
34946     },
34947     loadIssues(projection2) {
34948       let params = {
34949         // Tiles return a maximum # of issues
34950         // So we want to filter our request for only types iD supports
34951         item: _osmoseData.items
34952       };
34953       let tiles = tiler2.zoomExtent([_tileZoom2, _tileZoom2]).getTiles(projection2);
34954       abortUnwantedRequests2(_cache2, tiles);
34955       tiles.forEach((tile) => {
34956         if (_cache2.loadedTile[tile.id] || _cache2.inflightTile[tile.id]) return;
34957         let [x3, y3, z3] = tile.xyz;
34958         let url = "".concat(_osmoseUrlRoot, "/issues/").concat(z3, "/").concat(x3, "/").concat(y3, ".mvt?") + utilQsString(params);
34959         let controller = new AbortController();
34960         _cache2.inflightTile[tile.id] = controller;
34961         fetch(url, { signal: controller.signal }).then((data) => data.arrayBuffer()).then((data) => {
34962           delete _cache2.inflightTile[tile.id];
34963           _cache2.loadedTile[tile.id] = true;
34964           var vectorTile = new VectorTile(new Pbf(data));
34965           data = vectorTile.layers.issues;
34966           const features = [];
34967           for (let i3 = 0; i3 < data.length; i3++) {
34968             features.push(data.feature(i3).toGeoJSON(x3, y3, z3));
34969           }
34970           if (features.length > 0) {
34971             features.forEach((issue) => {
34972               const { item, class: cl, uuid: id2 } = issue.properties;
34973               const itemType = "".concat(item, "-").concat(cl);
34974               if (itemType in _osmoseData.icons) {
34975                 let loc = issue.geometry.coordinates;
34976                 loc = preventCoincident(loc);
34977                 let d2 = new QAItem(loc, this, itemType, id2, { item });
34978                 if (item === 8300 || item === 8360) {
34979                   d2.elems = [];
34980                 }
34981                 _cache2.data[d2.id] = d2;
34982                 _cache2.rtree.insert(encodeIssueRtree2(d2));
34983               }
34984             });
34985           }
34986           dispatch3.call("loaded");
34987         }).catch(() => {
34988           delete _cache2.inflightTile[tile.id];
34989           _cache2.loadedTile[tile.id] = true;
34990         });
34991       });
34992     },
34993     loadIssueDetail(issue) {
34994       if (issue.elems !== void 0) {
34995         return Promise.resolve(issue);
34996       }
34997       const url = "".concat(_osmoseUrlRoot, "/issue/").concat(issue.id, "?langs=").concat(_mainLocalizer.localeCode());
34998       const cacheDetails = (data) => {
34999         issue.elems = data.elems.map((e3) => e3.type.substring(0, 1) + e3.id);
35000         issue.detail = data.subtitle ? k(data.subtitle.auto) : "";
35001         this.replaceItem(issue);
35002       };
35003       return json_default(url).then(cacheDetails).then(() => issue);
35004     },
35005     loadStrings(locale2 = _mainLocalizer.localeCode()) {
35006       const items = Object.keys(_osmoseData.icons);
35007       if (locale2 in _cache2.strings && Object.keys(_cache2.strings[locale2]).length === items.length) {
35008         return Promise.resolve(_cache2.strings[locale2]);
35009       }
35010       if (!(locale2 in _cache2.strings)) {
35011         _cache2.strings[locale2] = {};
35012       }
35013       const allRequests = items.map((itemType) => {
35014         if (itemType in _cache2.strings[locale2]) return null;
35015         const cacheData = (data) => {
35016           const [cat = { items: [] }] = data.categories;
35017           const [item2 = { class: [] }] = cat.items;
35018           const [cl2 = null] = item2.class;
35019           if (!cl2) {
35020             console.log("Osmose strings request (".concat(itemType, ") had unexpected data"));
35021             return;
35022           }
35023           const { item: itemInt, color: color2 } = item2;
35024           if (/^#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/.test(color2)) {
35025             _cache2.colors[itemInt] = color2;
35026           }
35027           const { title, detail, fix, trap } = cl2;
35028           let issueStrings = {};
35029           if (title) issueStrings.title = title.auto;
35030           if (detail) issueStrings.detail = k(detail.auto);
35031           if (trap) issueStrings.trap = k(trap.auto);
35032           if (fix) issueStrings.fix = k(fix.auto);
35033           _cache2.strings[locale2][itemType] = issueStrings;
35034         };
35035         const [item, cl] = itemType.split("-");
35036         const url = "".concat(_osmoseUrlRoot, "/items/").concat(item, "/class/").concat(cl, "?langs=").concat(locale2);
35037         return json_default(url).then(cacheData);
35038       }).filter(Boolean);
35039       return Promise.all(allRequests).then(() => _cache2.strings[locale2]);
35040     },
35041     getStrings(itemType, locale2 = _mainLocalizer.localeCode()) {
35042       return locale2 in _cache2.strings ? _cache2.strings[locale2][itemType] : {};
35043     },
35044     getColor(itemType) {
35045       return itemType in _cache2.colors ? _cache2.colors[itemType] : "#FFFFFF";
35046     },
35047     postUpdate(issue, callback) {
35048       if (_cache2.inflightPost[issue.id]) {
35049         return callback({ message: "Issue update already inflight", status: -2 }, issue);
35050       }
35051       const url = "".concat(_osmoseUrlRoot, "/issue/").concat(issue.id, "/").concat(issue.newStatus);
35052       const controller = new AbortController();
35053       const after = () => {
35054         delete _cache2.inflightPost[issue.id];
35055         this.removeItem(issue);
35056         if (issue.newStatus === "done") {
35057           if (!(issue.item in _cache2.closed)) {
35058             _cache2.closed[issue.item] = 0;
35059           }
35060           _cache2.closed[issue.item] += 1;
35061         }
35062         if (callback) callback(null, issue);
35063       };
35064       _cache2.inflightPost[issue.id] = controller;
35065       fetch(url, { signal: controller.signal }).then(after).catch((err) => {
35066         delete _cache2.inflightPost[issue.id];
35067         if (callback) callback(err.message);
35068       });
35069     },
35070     // Get all cached QAItems covering the viewport
35071     getItems(projection2) {
35072       const viewport = projection2.clipExtent();
35073       const min3 = [viewport[0][0], viewport[1][1]];
35074       const max3 = [viewport[1][0], viewport[0][1]];
35075       const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
35076       return _cache2.rtree.search(bbox2).map((d2) => d2.data);
35077     },
35078     // Get a QAItem from cache
35079     // NOTE: Don't change method name until UI v3 is merged
35080     getError(id2) {
35081       return _cache2.data[id2];
35082     },
35083     // get the name of the icon to display for this item
35084     getIcon(itemType) {
35085       return _osmoseData.icons[itemType];
35086     },
35087     // Replace a single QAItem in the cache
35088     replaceItem(item) {
35089       if (!(item instanceof QAItem) || !item.id) return;
35090       _cache2.data[item.id] = item;
35091       updateRtree2(encodeIssueRtree2(item), true);
35092       return item;
35093     },
35094     // Remove a single QAItem from the cache
35095     removeItem(item) {
35096       if (!(item instanceof QAItem) || !item.id) return;
35097       delete _cache2.data[item.id];
35098       updateRtree2(encodeIssueRtree2(item), false);
35099     },
35100     // Used to populate `closed:osmose:*` changeset tags
35101     getClosedCounts() {
35102       return _cache2.closed;
35103     },
35104     itemURL(item) {
35105       return "https://osmose.openstreetmap.fr/en/error/".concat(item.id);
35106     }
35107   };
35108
35109   // modules/services/mapillary.js
35110   var accessToken = "MLY|4100327730013843|5bb78b81720791946a9a7b956c57b7cf";
35111   var apiUrl = "https://graph.mapillary.com/";
35112   var baseTileUrl = "https://tiles.mapillary.com/maps/vtp";
35113   var mapFeatureTileUrl = "".concat(baseTileUrl, "/mly_map_feature_point/2/{z}/{x}/{y}?access_token=").concat(accessToken);
35114   var tileUrl = "".concat(baseTileUrl, "/mly1_public/2/{z}/{x}/{y}?access_token=").concat(accessToken);
35115   var trafficSignTileUrl = "".concat(baseTileUrl, "/mly_map_feature_traffic_sign/2/{z}/{x}/{y}?access_token=").concat(accessToken);
35116   var viewercss = "mapillary-js/mapillary.css";
35117   var viewerjs = "mapillary-js/mapillary.js";
35118   var minZoom = 14;
35119   var dispatch4 = dispatch_default("change", "loadedImages", "loadedSigns", "loadedMapFeatures", "bearingChanged", "imageChanged");
35120   var _loadViewerPromise;
35121   var _mlyActiveImage;
35122   var _mlyCache;
35123   var _mlyFallback = false;
35124   var _mlyHighlightedDetection;
35125   var _mlyShowFeatureDetections = false;
35126   var _mlyShowSignDetections = false;
35127   var _mlyViewer;
35128   var _mlyViewerFilter = ["all"];
35129   var _isViewerOpen = false;
35130   function loadTiles(which, url, maxZoom2, projection2) {
35131     const tiler8 = utilTiler().zoomExtent([minZoom, maxZoom2]).skipNullIsland(true);
35132     const tiles = tiler8.getTiles(projection2);
35133     tiles.forEach(function(tile) {
35134       loadTile(which, url, tile);
35135     });
35136   }
35137   function loadTile(which, url, tile) {
35138     const cache = _mlyCache.requests;
35139     const tileId = "".concat(tile.id, "-").concat(which);
35140     if (cache.loaded[tileId] || cache.inflight[tileId]) return;
35141     const controller = new AbortController();
35142     cache.inflight[tileId] = controller;
35143     const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
35144     fetch(requestUrl, { signal: controller.signal }).then(function(response) {
35145       if (!response.ok) {
35146         throw new Error(response.status + " " + response.statusText);
35147       }
35148       cache.loaded[tileId] = true;
35149       delete cache.inflight[tileId];
35150       return response.arrayBuffer();
35151     }).then(function(data) {
35152       if (!data) {
35153         throw new Error("No Data");
35154       }
35155       loadTileDataToCache(data, tile, which);
35156       if (which === "images") {
35157         dispatch4.call("loadedImages");
35158       } else if (which === "signs") {
35159         dispatch4.call("loadedSigns");
35160       } else if (which === "points") {
35161         dispatch4.call("loadedMapFeatures");
35162       }
35163     }).catch(function() {
35164       cache.loaded[tileId] = true;
35165       delete cache.inflight[tileId];
35166     });
35167   }
35168   function loadTileDataToCache(data, tile, which) {
35169     const vectorTile = new VectorTile(new Pbf(data));
35170     let features, cache, layer, i3, feature4, loc, d2;
35171     if (vectorTile.layers.hasOwnProperty("image")) {
35172       features = [];
35173       cache = _mlyCache.images;
35174       layer = vectorTile.layers.image;
35175       for (i3 = 0; i3 < layer.length; i3++) {
35176         feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
35177         loc = feature4.geometry.coordinates;
35178         d2 = {
35179           service: "photo",
35180           loc,
35181           captured_at: feature4.properties.captured_at,
35182           ca: feature4.properties.compass_angle,
35183           id: feature4.properties.id,
35184           is_pano: feature4.properties.is_pano,
35185           sequence_id: feature4.properties.sequence_id
35186         };
35187         cache.forImageId[d2.id] = d2;
35188         features.push({
35189           minX: loc[0],
35190           minY: loc[1],
35191           maxX: loc[0],
35192           maxY: loc[1],
35193           data: d2
35194         });
35195       }
35196       if (cache.rtree) {
35197         cache.rtree.load(features);
35198       }
35199     }
35200     if (vectorTile.layers.hasOwnProperty("sequence")) {
35201       features = [];
35202       cache = _mlyCache.sequences;
35203       layer = vectorTile.layers.sequence;
35204       for (i3 = 0; i3 < layer.length; i3++) {
35205         feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
35206         if (cache.lineString[feature4.properties.id]) {
35207           cache.lineString[feature4.properties.id].push(feature4);
35208         } else {
35209           cache.lineString[feature4.properties.id] = [feature4];
35210         }
35211       }
35212     }
35213     if (vectorTile.layers.hasOwnProperty("point")) {
35214       features = [];
35215       cache = _mlyCache[which];
35216       layer = vectorTile.layers.point;
35217       for (i3 = 0; i3 < layer.length; i3++) {
35218         feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
35219         loc = feature4.geometry.coordinates;
35220         d2 = {
35221           service: "photo",
35222           loc,
35223           id: feature4.properties.id,
35224           first_seen_at: feature4.properties.first_seen_at,
35225           last_seen_at: feature4.properties.last_seen_at,
35226           value: feature4.properties.value
35227         };
35228         features.push({
35229           minX: loc[0],
35230           minY: loc[1],
35231           maxX: loc[0],
35232           maxY: loc[1],
35233           data: d2
35234         });
35235       }
35236       if (cache.rtree) {
35237         cache.rtree.load(features);
35238       }
35239     }
35240     if (vectorTile.layers.hasOwnProperty("traffic_sign")) {
35241       features = [];
35242       cache = _mlyCache[which];
35243       layer = vectorTile.layers.traffic_sign;
35244       for (i3 = 0; i3 < layer.length; i3++) {
35245         feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
35246         loc = feature4.geometry.coordinates;
35247         d2 = {
35248           service: "photo",
35249           loc,
35250           id: feature4.properties.id,
35251           first_seen_at: feature4.properties.first_seen_at,
35252           last_seen_at: feature4.properties.last_seen_at,
35253           value: feature4.properties.value
35254         };
35255         features.push({
35256           minX: loc[0],
35257           minY: loc[1],
35258           maxX: loc[0],
35259           maxY: loc[1],
35260           data: d2
35261         });
35262       }
35263       if (cache.rtree) {
35264         cache.rtree.load(features);
35265       }
35266     }
35267   }
35268   function loadData(url) {
35269     return fetch(url).then(function(response) {
35270       if (!response.ok) {
35271         throw new Error(response.status + " " + response.statusText);
35272       }
35273       return response.json();
35274     }).then(function(result) {
35275       if (!result) {
35276         return [];
35277       }
35278       return result.data || [];
35279     });
35280   }
35281   function partitionViewport(projection2) {
35282     const z3 = geoScaleToZoom(projection2.scale());
35283     const z22 = Math.ceil(z3 * 2) / 2 + 2.5;
35284     const tiler8 = utilTiler().zoomExtent([z22, z22]);
35285     return tiler8.getTiles(projection2).map(function(tile) {
35286       return tile.extent;
35287     });
35288   }
35289   function searchLimited(limit, projection2, rtree) {
35290     limit = limit || 5;
35291     return partitionViewport(projection2).reduce(function(result, extent) {
35292       const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
35293         return d2.data;
35294       });
35295       return found.length ? result.concat(found) : result;
35296     }, []);
35297   }
35298   var mapillary_default = {
35299     // Initialize Mapillary
35300     init: function() {
35301       if (!_mlyCache) {
35302         this.reset();
35303       }
35304       this.event = utilRebind(this, dispatch4, "on");
35305     },
35306     // Reset cache and state
35307     reset: function() {
35308       if (_mlyCache) {
35309         Object.values(_mlyCache.requests.inflight).forEach(function(request3) {
35310           request3.abort();
35311         });
35312       }
35313       _mlyCache = {
35314         images: { rtree: new RBush(), forImageId: {} },
35315         image_detections: { forImageId: {} },
35316         signs: { rtree: new RBush() },
35317         points: { rtree: new RBush() },
35318         sequences: { rtree: new RBush(), lineString: {} },
35319         requests: { loaded: {}, inflight: {} }
35320       };
35321       _mlyActiveImage = null;
35322     },
35323     // Get visible images
35324     images: function(projection2) {
35325       const limit = 5;
35326       return searchLimited(limit, projection2, _mlyCache.images.rtree);
35327     },
35328     // Get visible traffic signs
35329     signs: function(projection2) {
35330       const limit = 5;
35331       return searchLimited(limit, projection2, _mlyCache.signs.rtree);
35332     },
35333     // Get visible map (point) features
35334     mapFeatures: function(projection2) {
35335       const limit = 5;
35336       return searchLimited(limit, projection2, _mlyCache.points.rtree);
35337     },
35338     // Get cached image by id
35339     cachedImage: function(imageId) {
35340       return _mlyCache.images.forImageId[imageId];
35341     },
35342     // Get visible sequences
35343     sequences: function(projection2) {
35344       const viewport = projection2.clipExtent();
35345       const min3 = [viewport[0][0], viewport[1][1]];
35346       const max3 = [viewport[1][0], viewport[0][1]];
35347       const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
35348       const sequenceIds = {};
35349       let lineStrings = [];
35350       _mlyCache.images.rtree.search(bbox2).forEach(function(d2) {
35351         if (d2.data.sequence_id) {
35352           sequenceIds[d2.data.sequence_id] = true;
35353         }
35354       });
35355       Object.keys(sequenceIds).forEach(function(sequenceId) {
35356         if (_mlyCache.sequences.lineString[sequenceId]) {
35357           lineStrings = lineStrings.concat(_mlyCache.sequences.lineString[sequenceId]);
35358         }
35359       });
35360       return lineStrings;
35361     },
35362     // Load images in the visible area
35363     loadImages: function(projection2) {
35364       loadTiles("images", tileUrl, 14, projection2);
35365     },
35366     // Load traffic signs in the visible area
35367     loadSigns: function(projection2) {
35368       loadTiles("signs", trafficSignTileUrl, 14, projection2);
35369     },
35370     // Load map (point) features in the visible area
35371     loadMapFeatures: function(projection2) {
35372       loadTiles("points", mapFeatureTileUrl, 14, projection2);
35373     },
35374     // Return a promise that resolves when the image viewer (Mapillary JS) library has finished loading
35375     ensureViewerLoaded: function(context) {
35376       if (_loadViewerPromise) return _loadViewerPromise;
35377       const wrap2 = context.container().select(".photoviewer").selectAll(".mly-wrapper").data([0]);
35378       wrap2.enter().append("div").attr("id", "ideditor-mly").attr("class", "photo-wrapper mly-wrapper").classed("hide", true);
35379       const that = this;
35380       _loadViewerPromise = new Promise((resolve, reject) => {
35381         let loadedCount = 0;
35382         function loaded() {
35383           loadedCount += 1;
35384           if (loadedCount === 2) resolve();
35385         }
35386         const head = select_default2("head");
35387         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() {
35388           reject();
35389         });
35390         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() {
35391           reject();
35392         });
35393       }).catch(function() {
35394         _loadViewerPromise = null;
35395       }).then(function() {
35396         that.initViewer(context);
35397       });
35398       return _loadViewerPromise;
35399     },
35400     // Load traffic sign image sprites
35401     loadSignResources: function(context) {
35402       context.ui().svgDefs.addSprites(
35403         ["mapillary-sprite"],
35404         false
35405         /* don't override colors */
35406       );
35407       return this;
35408     },
35409     // Load map (point) feature image sprites
35410     loadObjectResources: function(context) {
35411       context.ui().svgDefs.addSprites(
35412         ["mapillary-object-sprite"],
35413         false
35414         /* don't override colors */
35415       );
35416       return this;
35417     },
35418     // Remove previous detections in image viewer
35419     resetTags: function() {
35420       if (_mlyViewer && !_mlyFallback) {
35421         _mlyViewer.getComponent("tag").removeAll();
35422       }
35423     },
35424     // Show map feature detections in image viewer
35425     showFeatureDetections: function(value) {
35426       _mlyShowFeatureDetections = value;
35427       if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
35428         this.resetTags();
35429       }
35430     },
35431     // Show traffic sign detections in image viewer
35432     showSignDetections: function(value) {
35433       _mlyShowSignDetections = value;
35434       if (!_mlyShowFeatureDetections && !_mlyShowSignDetections) {
35435         this.resetTags();
35436       }
35437     },
35438     // Apply filter to image viewer
35439     filterViewer: function(context) {
35440       const showsPano = context.photos().showsPanoramic();
35441       const showsFlat = context.photos().showsFlat();
35442       const fromDate = context.photos().fromDate();
35443       const toDate = context.photos().toDate();
35444       const filter2 = ["all"];
35445       if (!showsPano) filter2.push(["!=", "cameraType", "spherical"]);
35446       if (!showsFlat && showsPano) filter2.push(["==", "pano", true]);
35447       if (fromDate) {
35448         filter2.push([">=", "capturedAt", new Date(fromDate).getTime()]);
35449       }
35450       if (toDate) {
35451         filter2.push([">=", "capturedAt", new Date(toDate).getTime()]);
35452       }
35453       if (_mlyViewer) {
35454         _mlyViewer.setFilter(filter2);
35455       }
35456       _mlyViewerFilter = filter2;
35457       return filter2;
35458     },
35459     // Make the image viewer visible
35460     showViewer: function(context) {
35461       const wrap2 = context.container().select(".photoviewer");
35462       const isHidden = wrap2.selectAll(".photo-wrapper.mly-wrapper.hide").size();
35463       if (isHidden && _mlyViewer) {
35464         for (const service of Object.values(services)) {
35465           if (service === this) continue;
35466           if (typeof service.hideViewer === "function") {
35467             service.hideViewer(context);
35468           }
35469         }
35470         wrap2.classed("hide", false).selectAll(".photo-wrapper.mly-wrapper").classed("hide", false);
35471         _mlyViewer.resize();
35472       }
35473       _isViewerOpen = true;
35474       return this;
35475     },
35476     // Hide the image viewer and resets map markers
35477     hideViewer: function(context) {
35478       _mlyActiveImage = null;
35479       if (!_mlyFallback && _mlyViewer) {
35480         _mlyViewer.getComponent("sequence").stop();
35481       }
35482       const viewer = context.container().select(".photoviewer");
35483       if (!viewer.empty()) viewer.datum(null);
35484       viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
35485       this.updateUrlImage(null);
35486       dispatch4.call("imageChanged");
35487       dispatch4.call("loadedMapFeatures");
35488       dispatch4.call("loadedSigns");
35489       _isViewerOpen = false;
35490       return this.setStyles(context, null);
35491     },
35492     // Get viewer status
35493     isViewerOpen: function() {
35494       return _isViewerOpen;
35495     },
35496     // Update the URL with current image id
35497     updateUrlImage: function(imageId) {
35498       const hash2 = utilStringQs(window.location.hash);
35499       if (imageId) {
35500         hash2.photo = "mapillary/" + imageId;
35501       } else {
35502         delete hash2.photo;
35503       }
35504       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
35505     },
35506     // Highlight the detection in the viewer that is related to the clicked map feature
35507     highlightDetection: function(detection) {
35508       if (detection) {
35509         _mlyHighlightedDetection = detection.id;
35510       }
35511       return this;
35512     },
35513     // Initialize image viewer (Mapillar JS)
35514     initViewer: function(context) {
35515       if (!window.mapillary) return;
35516       const opts = {
35517         accessToken,
35518         component: {
35519           cover: false,
35520           keyboard: false,
35521           tag: true
35522         },
35523         container: "ideditor-mly"
35524       };
35525       if (!mapillary.isSupported() && mapillary.isFallbackSupported()) {
35526         _mlyFallback = true;
35527         opts.component = {
35528           cover: false,
35529           direction: false,
35530           imagePlane: false,
35531           keyboard: false,
35532           mouse: false,
35533           sequence: false,
35534           tag: false,
35535           image: true,
35536           // fallback
35537           navigation: true
35538           // fallback
35539         };
35540       }
35541       _mlyViewer = new mapillary.Viewer(opts);
35542       _mlyViewer.on("image", imageChanged.bind(this));
35543       _mlyViewer.on("bearing", bearingChanged);
35544       if (_mlyViewerFilter) {
35545         _mlyViewer.setFilter(_mlyViewerFilter);
35546       }
35547       context.ui().photoviewer.on("resize.mapillary", function() {
35548         if (_mlyViewer) _mlyViewer.resize();
35549       });
35550       function imageChanged(photo) {
35551         this.resetTags();
35552         const image = photo.image;
35553         this.setActiveImage(image);
35554         this.setStyles(context, null);
35555         const loc = [image.originalLngLat.lng, image.originalLngLat.lat];
35556         context.map().centerEase(loc);
35557         this.updateUrlImage(image.id);
35558         if (_mlyShowFeatureDetections || _mlyShowSignDetections) {
35559           this.updateDetections(image.id, "".concat(apiUrl, "/").concat(image.id, "/detections?access_token=").concat(accessToken, "&fields=id,image,geometry,value"));
35560         }
35561         dispatch4.call("imageChanged");
35562       }
35563       function bearingChanged(e3) {
35564         dispatch4.call("bearingChanged", void 0, e3);
35565       }
35566     },
35567     // Move to an image
35568     selectImage: function(context, imageId) {
35569       if (_mlyViewer && imageId) {
35570         _mlyViewer.moveTo(imageId).then((image) => this.setActiveImage(image)).catch(function(e3) {
35571           console.error("mly3", e3);
35572         });
35573       }
35574       return this;
35575     },
35576     // Return the currently displayed image
35577     getActiveImage: function() {
35578       return _mlyActiveImage;
35579     },
35580     // Return a list of detection objects for the given id
35581     getDetections: function(id2) {
35582       return loadData("".concat(apiUrl, "/").concat(id2, "/detections?access_token=").concat(accessToken, "&fields=id,value,image"));
35583     },
35584     // Set the currently visible image
35585     setActiveImage: function(image) {
35586       if (image) {
35587         _mlyActiveImage = {
35588           ca: image.originalCompassAngle,
35589           id: image.id,
35590           loc: [image.originalLngLat.lng, image.originalLngLat.lat],
35591           is_pano: image.cameraType === "spherical",
35592           sequence_id: image.sequenceId
35593         };
35594       } else {
35595         _mlyActiveImage = null;
35596       }
35597     },
35598     // Update the currently highlighted sequence and selected bubble.
35599     setStyles: function(context, hovered) {
35600       const hoveredImageId = hovered && hovered.id;
35601       const hoveredSequenceId = hovered && hovered.sequence_id;
35602       const selectedSequenceId = _mlyActiveImage && _mlyActiveImage.sequence_id;
35603       context.container().selectAll(".layer-mapillary .viewfield-group").classed("highlighted", function(d2) {
35604         return d2.sequence_id === selectedSequenceId || d2.id === hoveredImageId;
35605       }).classed("hovered", function(d2) {
35606         return d2.id === hoveredImageId;
35607       });
35608       context.container().selectAll(".layer-mapillary .sequence").classed("highlighted", function(d2) {
35609         return d2.properties.id === hoveredSequenceId;
35610       }).classed("currentView", function(d2) {
35611         return d2.properties.id === selectedSequenceId;
35612       });
35613       return this;
35614     },
35615     // Get detections for the current image and shows them in the image viewer
35616     updateDetections: function(imageId, url) {
35617       if (!_mlyViewer || _mlyFallback) return;
35618       if (!imageId) return;
35619       const cache = _mlyCache.image_detections;
35620       if (cache.forImageId[imageId]) {
35621         showDetections(_mlyCache.image_detections.forImageId[imageId]);
35622       } else {
35623         loadData(url).then((detections) => {
35624           detections.forEach(function(detection) {
35625             if (!cache.forImageId[imageId]) {
35626               cache.forImageId[imageId] = [];
35627             }
35628             cache.forImageId[imageId].push({
35629               geometry: detection.geometry,
35630               id: detection.id,
35631               image_id: imageId,
35632               value: detection.value
35633             });
35634           });
35635           showDetections(_mlyCache.image_detections.forImageId[imageId] || []);
35636         });
35637       }
35638       function showDetections(detections) {
35639         const tagComponent = _mlyViewer.getComponent("tag");
35640         detections.forEach(function(data) {
35641           const tag = makeTag(data);
35642           if (tag) {
35643             tagComponent.add([tag]);
35644           }
35645         });
35646       }
35647       function makeTag(data) {
35648         const valueParts = data.value.split("--");
35649         if (!valueParts.length) return;
35650         let tag;
35651         let text;
35652         let color2 = 16777215;
35653         if (_mlyHighlightedDetection === data.id) {
35654           color2 = 16776960;
35655           text = valueParts[1];
35656           if (text === "flat" || text === "discrete" || text === "sign") {
35657             text = valueParts[2];
35658           }
35659           text = text.replace(/-/g, " ");
35660           text = text.charAt(0).toUpperCase() + text.slice(1);
35661           _mlyHighlightedDetection = null;
35662         }
35663         var decodedGeometry = window.atob(data.geometry);
35664         var uintArray = new Uint8Array(decodedGeometry.length);
35665         for (var i3 = 0; i3 < decodedGeometry.length; i3++) {
35666           uintArray[i3] = decodedGeometry.charCodeAt(i3);
35667         }
35668         const tile = new VectorTile(new Pbf(uintArray.buffer));
35669         const layer = tile.layers["mpy-or"];
35670         const geometries = layer.feature(0).loadGeometry();
35671         const polygon2 = geometries.map((ring) => ring.map((point) => [point.x / layer.extent, point.y / layer.extent]));
35672         tag = new mapillary.OutlineTag(
35673           data.id,
35674           new mapillary.PolygonGeometry(polygon2[0]),
35675           {
35676             text,
35677             textColor: color2,
35678             lineColor: color2,
35679             lineWidth: 2,
35680             fillColor: color2,
35681             fillOpacity: 0.3
35682           }
35683         );
35684         return tag;
35685       }
35686     },
35687     // Return the current cache
35688     cache: function() {
35689       return _mlyCache;
35690     }
35691   };
35692
35693   // modules/services/maprules.js
35694   var buildRuleChecks = function() {
35695     return {
35696       equals: function(equals) {
35697         return function(tags) {
35698           return Object.keys(equals).every(function(k3) {
35699             return equals[k3] === tags[k3];
35700           });
35701         };
35702       },
35703       notEquals: function(notEquals) {
35704         return function(tags) {
35705           return Object.keys(notEquals).some(function(k3) {
35706             return notEquals[k3] !== tags[k3];
35707           });
35708         };
35709       },
35710       absence: function(absence) {
35711         return function(tags) {
35712           return Object.keys(tags).indexOf(absence) === -1;
35713         };
35714       },
35715       presence: function(presence) {
35716         return function(tags) {
35717           return Object.keys(tags).indexOf(presence) > -1;
35718         };
35719       },
35720       greaterThan: function(greaterThan) {
35721         var key = Object.keys(greaterThan)[0];
35722         var value = greaterThan[key];
35723         return function(tags) {
35724           return tags[key] > value;
35725         };
35726       },
35727       greaterThanEqual: function(greaterThanEqual) {
35728         var key = Object.keys(greaterThanEqual)[0];
35729         var value = greaterThanEqual[key];
35730         return function(tags) {
35731           return tags[key] >= value;
35732         };
35733       },
35734       lessThan: function(lessThan) {
35735         var key = Object.keys(lessThan)[0];
35736         var value = lessThan[key];
35737         return function(tags) {
35738           return tags[key] < value;
35739         };
35740       },
35741       lessThanEqual: function(lessThanEqual) {
35742         var key = Object.keys(lessThanEqual)[0];
35743         var value = lessThanEqual[key];
35744         return function(tags) {
35745           return tags[key] <= value;
35746         };
35747       },
35748       positiveRegex: function(positiveRegex) {
35749         var tagKey = Object.keys(positiveRegex)[0];
35750         var expression = positiveRegex[tagKey].join("|");
35751         var regex = new RegExp(expression);
35752         return function(tags) {
35753           return regex.test(tags[tagKey]);
35754         };
35755       },
35756       negativeRegex: function(negativeRegex) {
35757         var tagKey = Object.keys(negativeRegex)[0];
35758         var expression = negativeRegex[tagKey].join("|");
35759         var regex = new RegExp(expression);
35760         return function(tags) {
35761           return !regex.test(tags[tagKey]);
35762         };
35763       }
35764     };
35765   };
35766   var buildLineKeys = function() {
35767     return {
35768       highway: {
35769         rest_area: true,
35770         services: true
35771       },
35772       railway: {
35773         roundhouse: true,
35774         station: true,
35775         traverser: true,
35776         turntable: true,
35777         wash: true
35778       }
35779     };
35780   };
35781   var maprules_default = {
35782     init: function() {
35783       this._ruleChecks = buildRuleChecks();
35784       this._validationRules = [];
35785       this._areaKeys = osmAreaKeys;
35786       this._lineKeys = buildLineKeys();
35787     },
35788     // list of rules only relevant to tag checks...
35789     filterRuleChecks: function(selector) {
35790       var _ruleChecks = this._ruleChecks;
35791       return Object.keys(selector).reduce(function(rules, key) {
35792         if (["geometry", "error", "warning"].indexOf(key) === -1) {
35793           rules.push(_ruleChecks[key](selector[key]));
35794         }
35795         return rules;
35796       }, []);
35797     },
35798     // builds tagMap from mapcss-parse selector object...
35799     buildTagMap: function(selector) {
35800       var getRegexValues = function(regexes) {
35801         return regexes.map(function(regex) {
35802           return regex.replace(/\$|\^/g, "");
35803         });
35804       };
35805       var tagMap = Object.keys(selector).reduce(function(expectedTags, key) {
35806         var values;
35807         var isRegex = /regex/gi.test(key);
35808         var isEqual2 = /equals/gi.test(key);
35809         if (isRegex || isEqual2) {
35810           Object.keys(selector[key]).forEach(function(selectorKey) {
35811             values = isEqual2 ? [selector[key][selectorKey]] : getRegexValues(selector[key][selectorKey]);
35812             if (expectedTags.hasOwnProperty(selectorKey)) {
35813               values = values.concat(expectedTags[selectorKey]);
35814             }
35815             expectedTags[selectorKey] = values;
35816           });
35817         } else if (/(greater|less)Than(Equal)?|presence/g.test(key)) {
35818           var tagKey = /presence/.test(key) ? selector[key] : Object.keys(selector[key])[0];
35819           values = [selector[key][tagKey]];
35820           if (expectedTags.hasOwnProperty(tagKey)) {
35821             values = values.concat(expectedTags[tagKey]);
35822           }
35823           expectedTags[tagKey] = values;
35824         }
35825         return expectedTags;
35826       }, {});
35827       return tagMap;
35828     },
35829     // inspired by osmWay#isArea()
35830     inferGeometry: function(tagMap) {
35831       var _lineKeys = this._lineKeys;
35832       var _areaKeys = this._areaKeys;
35833       var keyValueDoesNotImplyArea = function(key2) {
35834         return utilArrayIntersection(tagMap[key2], Object.keys(_areaKeys[key2])).length > 0;
35835       };
35836       var keyValueImpliesLine = function(key2) {
35837         return utilArrayIntersection(tagMap[key2], Object.keys(_lineKeys[key2])).length > 0;
35838       };
35839       if (tagMap.hasOwnProperty("area")) {
35840         if (tagMap.area.indexOf("yes") > -1) {
35841           return "area";
35842         }
35843         if (tagMap.area.indexOf("no") > -1) {
35844           return "line";
35845         }
35846       }
35847       for (var key in tagMap) {
35848         if (key in _areaKeys && !keyValueDoesNotImplyArea(key)) {
35849           return "area";
35850         }
35851         if (key in _lineKeys && keyValueImpliesLine(key)) {
35852           return "area";
35853         }
35854       }
35855       return "line";
35856     },
35857     // adds from mapcss-parse selector check...
35858     addRule: function(selector) {
35859       var rule = {
35860         // checks relevant to mapcss-selector
35861         checks: this.filterRuleChecks(selector),
35862         // true if all conditions for a tag error are true..
35863         matches: function(entity) {
35864           return this.checks.every(function(check) {
35865             return check(entity.tags);
35866           });
35867         },
35868         // borrowed from Way#isArea()
35869         inferredGeometry: this.inferGeometry(this.buildTagMap(selector), this._areaKeys),
35870         geometryMatches: function(entity, graph) {
35871           if (entity.type === "node" || entity.type === "relation") {
35872             return selector.geometry === entity.type;
35873           } else if (entity.type === "way") {
35874             return this.inferredGeometry === entity.geometry(graph);
35875           }
35876         },
35877         // when geometries match and tag matches are present, return a warning...
35878         findIssues: function(entity, graph, issues) {
35879           if (this.geometryMatches(entity, graph) && this.matches(entity)) {
35880             var severity = Object.keys(selector).indexOf("error") > -1 ? "error" : "warning";
35881             var message = selector[severity];
35882             issues.push(new validationIssue({
35883               type: "maprules",
35884               severity,
35885               message: function() {
35886                 return message;
35887               },
35888               entityIds: [entity.id]
35889             }));
35890           }
35891         }
35892       };
35893       this._validationRules.push(rule);
35894     },
35895     clearRules: function() {
35896       this._validationRules = [];
35897     },
35898     // returns validationRules...
35899     validationRules: function() {
35900       return this._validationRules;
35901     },
35902     // returns ruleChecks
35903     ruleChecks: function() {
35904       return this._ruleChecks;
35905     }
35906   };
35907
35908   // modules/services/nominatim.js
35909   var apibase = nominatimApiUrl;
35910   var _inflight = {};
35911   var _nominatimCache;
35912   var nominatim_default = {
35913     init: function() {
35914       _inflight = {};
35915       _nominatimCache = new RBush();
35916     },
35917     reset: function() {
35918       Object.values(_inflight).forEach(function(controller) {
35919         controller.abort();
35920       });
35921       _inflight = {};
35922       _nominatimCache = new RBush();
35923     },
35924     countryCode: function(location, callback) {
35925       this.reverse(location, function(err, result) {
35926         if (err) {
35927           return callback(err);
35928         } else if (result.address) {
35929           return callback(null, result.address.country_code);
35930         } else {
35931           return callback("Unable to geocode", null);
35932         }
35933       });
35934     },
35935     reverse: function(loc, callback) {
35936       var cached = _nominatimCache.search(
35937         { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] }
35938       );
35939       if (cached.length > 0) {
35940         if (callback) callback(null, cached[0].data);
35941         return;
35942       }
35943       var params = { zoom: 13, format: "json", addressdetails: 1, lat: loc[1], lon: loc[0] };
35944       var url = apibase + "reverse?" + utilQsString(params);
35945       if (_inflight[url]) return;
35946       var controller = new AbortController();
35947       _inflight[url] = controller;
35948       json_default(url, {
35949         signal: controller.signal,
35950         headers: {
35951           "Accept-Language": _mainLocalizer.localeCodes().join(",")
35952         }
35953       }).then(function(result) {
35954         delete _inflight[url];
35955         if (result && result.error) {
35956           throw new Error(result.error);
35957         }
35958         var extent = geoExtent(loc).padByMeters(200);
35959         _nominatimCache.insert(Object.assign(extent.bbox(), { data: result }));
35960         if (callback) callback(null, result);
35961       }).catch(function(err) {
35962         delete _inflight[url];
35963         if (err.name === "AbortError") return;
35964         if (callback) callback(err.message);
35965       });
35966     },
35967     search: function(val, callback) {
35968       const params = {
35969         q: val,
35970         limit: 10,
35971         format: "json"
35972       };
35973       var url = apibase + "search?" + utilQsString(params);
35974       if (_inflight[url]) return;
35975       var controller = new AbortController();
35976       _inflight[url] = controller;
35977       json_default(url, {
35978         signal: controller.signal,
35979         headers: {
35980           "Accept-Language": _mainLocalizer.localeCodes().join(",")
35981         }
35982       }).then(function(result) {
35983         delete _inflight[url];
35984         if (result && result.error) {
35985           throw new Error(result.error);
35986         }
35987         if (callback) callback(null, result);
35988       }).catch(function(err) {
35989         delete _inflight[url];
35990         if (err.name === "AbortError") return;
35991         if (callback) callback(err.message);
35992       });
35993     }
35994   };
35995
35996   // node_modules/name-suggestion-index/lib/matcher.js
35997   var import_which_polygon3 = __toESM(require_which_polygon(), 1);
35998
35999   // node_modules/name-suggestion-index/lib/simplify.js
36000   var import_diacritics2 = __toESM(require_diacritics(), 1);
36001   function simplify(str) {
36002     if (typeof str !== "string") return "";
36003     return import_diacritics2.default.remove(
36004       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()
36005     );
36006   }
36007
36008   // node_modules/name-suggestion-index/config/matchGroups.json
36009   var matchGroups_default = {
36010     matchGroups: {
36011       adult_gaming_centre: [
36012         "amenity/casino",
36013         "amenity/gambling",
36014         "leisure/adult_gaming_centre"
36015       ],
36016       bar: [
36017         "amenity/bar",
36018         "amenity/pub",
36019         "amenity/restaurant"
36020       ],
36021       beauty: [
36022         "shop/beauty",
36023         "shop/hairdresser_supply"
36024       ],
36025       bed: [
36026         "shop/bed",
36027         "shop/furniture"
36028       ],
36029       beverages: [
36030         "shop/alcohol",
36031         "shop/beer",
36032         "shop/beverages",
36033         "shop/kiosk",
36034         "shop/wine"
36035       ],
36036       camping: [
36037         "tourism/camp_site",
36038         "tourism/caravan_site"
36039       ],
36040       car_parts: [
36041         "shop/car_parts",
36042         "shop/car_repair",
36043         "shop/tires",
36044         "shop/tyres"
36045       ],
36046       clinic: [
36047         "amenity/clinic",
36048         "amenity/doctors",
36049         "healthcare/clinic",
36050         "healthcare/laboratory",
36051         "healthcare/physiotherapist",
36052         "healthcare/sample_collection",
36053         "healthcare/dialysis"
36054       ],
36055       convenience: [
36056         "shop/beauty",
36057         "shop/chemist",
36058         "shop/convenience",
36059         "shop/cosmetics",
36060         "shop/grocery",
36061         "shop/kiosk",
36062         "shop/newsagent",
36063         "shop/perfumery"
36064       ],
36065       coworking: [
36066         "amenity/coworking_space",
36067         "office/coworking",
36068         "office/coworking_space"
36069       ],
36070       dentist: [
36071         "amenity/dentist",
36072         "amenity/doctors",
36073         "healthcare/dentist"
36074       ],
36075       electronics: [
36076         "office/telecommunication",
36077         "shop/appliance",
36078         "shop/computer",
36079         "shop/electronics",
36080         "shop/hifi",
36081         "shop/kiosk",
36082         "shop/mobile",
36083         "shop/mobile_phone",
36084         "shop/telecommunication",
36085         "shop/video_games"
36086       ],
36087       estate_agents: [
36088         "office/estate_agent",
36089         "shop/estate_agent",
36090         "office/mortgage",
36091         "office/financial"
36092       ],
36093       fabric: [
36094         "shop/fabric",
36095         "shop/haberdashery",
36096         "shop/sewing"
36097       ],
36098       fashion: [
36099         "shop/accessories",
36100         "shop/bag",
36101         "shop/boutique",
36102         "shop/clothes",
36103         "shop/department_store",
36104         "shop/fashion",
36105         "shop/fashion_accessories",
36106         "shop/sports",
36107         "shop/shoes"
36108       ],
36109       financial: [
36110         "amenity/bank",
36111         "office/accountant",
36112         "office/financial",
36113         "office/financial_advisor",
36114         "office/tax_advisor",
36115         "shop/tax"
36116       ],
36117       fitness: [
36118         "leisure/fitness_centre",
36119         "leisure/fitness_center",
36120         "leisure/sports_centre",
36121         "leisure/sports_center"
36122       ],
36123       food: [
36124         "amenity/cafe",
36125         "amenity/fast_food",
36126         "amenity/ice_cream",
36127         "amenity/restaurant",
36128         "shop/bakery",
36129         "shop/candy",
36130         "shop/chocolate",
36131         "shop/coffee",
36132         "shop/confectionary",
36133         "shop/confectionery",
36134         "shop/deli",
36135         "shop/food",
36136         "shop/kiosk",
36137         "shop/ice_cream",
36138         "shop/pastry",
36139         "shop/tea"
36140       ],
36141       fuel: [
36142         "amenity/fuel",
36143         "shop/gas",
36144         "shop/convenience;gas",
36145         "shop/gas;convenience"
36146       ],
36147       gift: [
36148         "shop/gift",
36149         "shop/card",
36150         "shop/cards",
36151         "shop/kiosk",
36152         "shop/stationery"
36153       ],
36154       glass: [
36155         "craft/window_construction",
36156         "craft/glaziery",
36157         "shop/car_repair"
36158       ],
36159       hardware: [
36160         "shop/bathroom_furnishing",
36161         "shop/carpet",
36162         "shop/diy",
36163         "shop/doityourself",
36164         "shop/doors",
36165         "shop/electrical",
36166         "shop/flooring",
36167         "shop/hardware",
36168         "shop/hardware_store",
36169         "shop/power_tools",
36170         "shop/tool_hire",
36171         "shop/tools",
36172         "shop/trade"
36173       ],
36174       health_food: [
36175         "shop/health",
36176         "shop/health_food",
36177         "shop/herbalist",
36178         "shop/nutrition_supplements"
36179       ],
36180       hobby: [
36181         "shop/electronics",
36182         "shop/hobby",
36183         "shop/books",
36184         "shop/games",
36185         "shop/collector",
36186         "shop/toys",
36187         "shop/model",
36188         "shop/video_games",
36189         "shop/anime"
36190       ],
36191       hospital: [
36192         "amenity/doctors",
36193         "amenity/hospital",
36194         "healthcare/hospital"
36195       ],
36196       houseware: [
36197         "shop/houseware",
36198         "shop/interior_decoration"
36199       ],
36200       water_rescue: [
36201         "amenity/lifeboat_station",
36202         "emergency/lifeboat_station",
36203         "emergency/marine_rescue",
36204         "emergency/water_rescue"
36205       ],
36206       locksmith: [
36207         "craft/key_cutter",
36208         "craft/locksmith",
36209         "shop/locksmith"
36210       ],
36211       lodging: [
36212         "tourism/guest_house",
36213         "tourism/hotel",
36214         "tourism/motel"
36215       ],
36216       money_transfer: [
36217         "amenity/money_transfer",
36218         "shop/money_transfer"
36219       ],
36220       music: ["shop/music", "shop/musical_instrument"],
36221       office_supplies: [
36222         "shop/office_supplies",
36223         "shop/stationary",
36224         "shop/stationery"
36225       ],
36226       outdoor: [
36227         "shop/clothes",
36228         "shop/outdoor",
36229         "shop/sports"
36230       ],
36231       parcel_locker: [
36232         "amenity/parcel_locker",
36233         "amenity/vending_machine"
36234       ],
36235       pharmacy: [
36236         "amenity/doctors",
36237         "amenity/pharmacy",
36238         "healthcare/pharmacy",
36239         "shop/chemist"
36240       ],
36241       playground: [
36242         "amenity/theme_park",
36243         "leisure/amusement_arcade",
36244         "leisure/playground"
36245       ],
36246       rental: [
36247         "amenity/bicycle_rental",
36248         "amenity/boat_rental",
36249         "amenity/car_rental",
36250         "amenity/truck_rental",
36251         "amenity/vehicle_rental",
36252         "shop/kiosk",
36253         "shop/plant_hire",
36254         "shop/rental",
36255         "shop/tool_hire"
36256       ],
36257       school: [
36258         "amenity/childcare",
36259         "amenity/college",
36260         "amenity/kindergarten",
36261         "amenity/language_school",
36262         "amenity/prep_school",
36263         "amenity/school",
36264         "amenity/university"
36265       ],
36266       storage: [
36267         "shop/storage_units",
36268         "shop/storage_rental"
36269       ],
36270       substation: [
36271         "power/station",
36272         "power/substation",
36273         "power/sub_station"
36274       ],
36275       supermarket: [
36276         "shop/food",
36277         "shop/frozen_food",
36278         "shop/greengrocer",
36279         "shop/grocery",
36280         "shop/supermarket",
36281         "shop/wholesale"
36282       ],
36283       thrift: [
36284         "shop/charity",
36285         "shop/clothes",
36286         "shop/second_hand"
36287       ],
36288       tobacco: [
36289         "shop/e-cigarette",
36290         "shop/tobacco"
36291       ],
36292       variety_store: [
36293         "shop/variety_store",
36294         "shop/discount",
36295         "shop/convenience"
36296       ],
36297       vending: [
36298         "amenity/vending_machine",
36299         "shop/kiosk",
36300         "shop/vending_machine"
36301       ],
36302       weight_loss: [
36303         "amenity/clinic",
36304         "amenity/doctors",
36305         "amenity/weight_clinic",
36306         "healthcare/counselling",
36307         "leisure/fitness_centre",
36308         "office/therapist",
36309         "shop/beauty",
36310         "shop/diet",
36311         "shop/food",
36312         "shop/health_food",
36313         "shop/herbalist",
36314         "shop/nutrition",
36315         "shop/nutrition_supplements",
36316         "shop/weight_loss"
36317       ],
36318       wholesale: [
36319         "shop/wholesale",
36320         "shop/supermarket",
36321         "shop/department_store"
36322       ]
36323     }
36324   };
36325
36326   // node_modules/name-suggestion-index/config/genericWords.json
36327   var genericWords_default = {
36328     genericWords: [
36329       "^(barn|bazaa?r|bench|bou?tique|building|casa|church)$",
36330       "^(baseball|basketball|football|soccer|softball|tennis(halle)?)\\s?(field|court)?$",
36331       "^(club|green|out|ware)\\s?house$",
36332       "^(driveway|el \xE1rbol|fountain|generic|golf|government|graveyard)$",
36333       "^(fixme|n\\s?\\/?\\s?a|name|no\\s?name|none|null|temporary|test|unknown)$",
36334       "^(hofladen|librairie|magazine?|maison|toko)$",
36335       "^(mobile home|skate)?\\s?park$",
36336       "^(obuwie|pond|pool|sale|shops?|sklep|stores?)$",
36337       "^\\?+$",
36338       "^private$",
36339       "^tattoo( studio)?$",
36340       "^windmill$",
36341       "^\u0446\u0435\u0440\u043A\u043E\u0432\u043D\u0430\u044F( \u043B\u0430\u0432\u043A\u0430)?$"
36342     ]
36343   };
36344
36345   // node_modules/name-suggestion-index/config/trees.json
36346   var trees_default = {
36347     trees: {
36348       brands: {
36349         emoji: "\u{1F354}",
36350         mainTag: "brand:wikidata",
36351         sourceTags: ["brand", "name"],
36352         nameTags: {
36353           primary: "^(name|name:\\w+)$",
36354           alternate: "^(brand|brand:\\w+|operator|operator:\\w+|\\w+_name|\\w+_name:\\w+)$"
36355         }
36356       },
36357       flags: {
36358         emoji: "\u{1F6A9}",
36359         mainTag: "flag:wikidata",
36360         nameTags: {
36361           primary: "^(flag:name|flag:name:\\w+)$",
36362           alternate: "^(country|country:\\w+|flag|flag:\\w+|subject|subject:\\w+)$"
36363         }
36364       },
36365       operators: {
36366         emoji: "\u{1F4BC}",
36367         mainTag: "operator:wikidata",
36368         sourceTags: ["operator"],
36369         nameTags: {
36370           primary: "^(name|name:\\w+|operator|operator:\\w+)$",
36371           alternate: "^(brand|brand:\\w+|\\w+_name|\\w+_name:\\w+)$"
36372         }
36373       },
36374       transit: {
36375         emoji: "\u{1F687}",
36376         mainTag: "network:wikidata",
36377         sourceTags: ["network"],
36378         nameTags: {
36379           primary: "^network$",
36380           alternate: "^(operator|operator:\\w+|network:\\w+|\\w+_name|\\w+_name:\\w+)$"
36381         }
36382       }
36383     }
36384   };
36385
36386   // node_modules/name-suggestion-index/lib/matcher.js
36387   var matchGroups = matchGroups_default.matchGroups;
36388   var trees = trees_default.trees;
36389   var Matcher = class {
36390     //
36391     // `constructor`
36392     // initialize the genericWords regexes
36393     constructor() {
36394       this.matchIndex = void 0;
36395       this.genericWords = /* @__PURE__ */ new Map();
36396       (genericWords_default.genericWords || []).forEach((s2) => this.genericWords.set(s2, new RegExp(s2, "i")));
36397       this.itemLocation = void 0;
36398       this.locationSets = void 0;
36399       this.locationIndex = void 0;
36400       this.warnings = [];
36401     }
36402     //
36403     // `buildMatchIndex()`
36404     // Call this to prepare the matcher for use
36405     //
36406     // `data` needs to be an Object indexed on a 'tree/key/value' path.
36407     // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
36408     // {
36409     //    'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
36410     //    'brands/amenity/bar':  { properties: {}, items: [ {}, {}, … ] },
36411     //    …
36412     // }
36413     //
36414     buildMatchIndex(data) {
36415       const that = this;
36416       if (that.matchIndex) return;
36417       that.matchIndex = /* @__PURE__ */ new Map();
36418       const seenTree = /* @__PURE__ */ new Map();
36419       Object.keys(data).forEach((tkv) => {
36420         const category = data[tkv];
36421         const parts = tkv.split("/", 3);
36422         const t2 = parts[0];
36423         const k3 = parts[1];
36424         const v3 = parts[2];
36425         const thiskv = "".concat(k3, "/").concat(v3);
36426         const tree = trees[t2];
36427         let branch = that.matchIndex.get(thiskv);
36428         if (!branch) {
36429           branch = {
36430             primary: /* @__PURE__ */ new Map(),
36431             alternate: /* @__PURE__ */ new Map(),
36432             excludeGeneric: /* @__PURE__ */ new Map(),
36433             excludeNamed: /* @__PURE__ */ new Map()
36434           };
36435           that.matchIndex.set(thiskv, branch);
36436         }
36437         const properties = category.properties || {};
36438         const exclude = properties.exclude || {};
36439         (exclude.generic || []).forEach((s2) => branch.excludeGeneric.set(s2, new RegExp(s2, "i")));
36440         (exclude.named || []).forEach((s2) => branch.excludeNamed.set(s2, new RegExp(s2, "i")));
36441         const excludeRegexes = [...branch.excludeGeneric.values(), ...branch.excludeNamed.values()];
36442         let items = category.items;
36443         if (!Array.isArray(items) || !items.length) return;
36444         const primaryName = new RegExp(tree.nameTags.primary, "i");
36445         const alternateName = new RegExp(tree.nameTags.alternate, "i");
36446         const notName = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
36447         const skipGenericKV = skipGenericKVMatches(t2, k3, v3);
36448         const genericKV = /* @__PURE__ */ new Set(["".concat(k3, "/yes"), "building/yes"]);
36449         const matchGroupKV = /* @__PURE__ */ new Set();
36450         Object.values(matchGroups).forEach((matchGroup) => {
36451           const inGroup = matchGroup.some((otherkv) => otherkv === thiskv);
36452           if (!inGroup) return;
36453           matchGroup.forEach((otherkv) => {
36454             if (otherkv === thiskv) return;
36455             matchGroupKV.add(otherkv);
36456             const otherk = otherkv.split("/", 2)[0];
36457             genericKV.add("".concat(otherk, "/yes"));
36458           });
36459         });
36460         items.forEach((item) => {
36461           if (!item.id) return;
36462           if (Array.isArray(item.matchTags) && item.matchTags.length) {
36463             item.matchTags = item.matchTags.filter((matchTag) => !matchGroupKV.has(matchTag) && matchTag !== thiskv && !genericKV.has(matchTag));
36464             if (!item.matchTags.length) delete item.matchTags;
36465           }
36466           let kvTags = ["".concat(thiskv)].concat(item.matchTags || []);
36467           if (!skipGenericKV) {
36468             kvTags = kvTags.concat(Array.from(genericKV));
36469           }
36470           Object.keys(item.tags).forEach((osmkey) => {
36471             if (notName.test(osmkey)) return;
36472             const osmvalue = item.tags[osmkey];
36473             if (!osmvalue || excludeRegexes.some((regex) => regex.test(osmvalue))) return;
36474             if (primaryName.test(osmkey)) {
36475               kvTags.forEach((kv) => insertName("primary", t2, kv, simplify(osmvalue), item.id));
36476             } else if (alternateName.test(osmkey)) {
36477               kvTags.forEach((kv) => insertName("alternate", t2, kv, simplify(osmvalue), item.id));
36478             }
36479           });
36480           let keepMatchNames = /* @__PURE__ */ new Set();
36481           (item.matchNames || []).forEach((matchName) => {
36482             const nsimple = simplify(matchName);
36483             kvTags.forEach((kv) => {
36484               const branch2 = that.matchIndex.get(kv);
36485               const primaryLeaf = branch2 && branch2.primary.get(nsimple);
36486               const alternateLeaf = branch2 && branch2.alternate.get(nsimple);
36487               const inPrimary = primaryLeaf && primaryLeaf.has(item.id);
36488               const inAlternate = alternateLeaf && alternateLeaf.has(item.id);
36489               if (!inPrimary && !inAlternate) {
36490                 insertName("alternate", t2, kv, nsimple, item.id);
36491                 keepMatchNames.add(matchName);
36492               }
36493             });
36494           });
36495           if (keepMatchNames.size) {
36496             item.matchNames = Array.from(keepMatchNames);
36497           } else {
36498             delete item.matchNames;
36499           }
36500         });
36501       });
36502       function insertName(which, t2, kv, nsimple, itemID) {
36503         if (!nsimple) {
36504           that.warnings.push("Warning: skipping empty ".concat(which, " name for item ").concat(t2, "/").concat(kv, ": ").concat(itemID));
36505           return;
36506         }
36507         let branch = that.matchIndex.get(kv);
36508         if (!branch) {
36509           branch = {
36510             primary: /* @__PURE__ */ new Map(),
36511             alternate: /* @__PURE__ */ new Map(),
36512             excludeGeneric: /* @__PURE__ */ new Map(),
36513             excludeNamed: /* @__PURE__ */ new Map()
36514           };
36515           that.matchIndex.set(kv, branch);
36516         }
36517         let leaf = branch[which].get(nsimple);
36518         if (!leaf) {
36519           leaf = /* @__PURE__ */ new Set();
36520           branch[which].set(nsimple, leaf);
36521         }
36522         leaf.add(itemID);
36523         if (!/yes$/.test(kv)) {
36524           const kvnsimple = "".concat(kv, "/").concat(nsimple);
36525           const existing = seenTree.get(kvnsimple);
36526           if (existing && existing !== t2) {
36527             const items = Array.from(leaf);
36528             that.warnings.push('Duplicate cache key "'.concat(kvnsimple, '" in trees "').concat(t2, '" and "').concat(existing, '", check items: ').concat(items));
36529             return;
36530           }
36531           seenTree.set(kvnsimple, t2);
36532         }
36533       }
36534       function skipGenericKVMatches(t2, k3, v3) {
36535         return t2 === "flags" || t2 === "transit" || k3 === "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";
36536       }
36537     }
36538     //
36539     // `buildLocationIndex()`
36540     // Call this to prepare a which-polygon location index.
36541     // This *resolves* all the locationSets into GeoJSON, which takes some time.
36542     // You can skip this step if you don't care about matching within a location.
36543     //
36544     // `data` needs to be an Object indexed on a 'tree/key/value' path.
36545     // (e.g. cache filled by `fileTree.read` or data found in `dist/nsi.json`)
36546     // {
36547     //    'brands/amenity/bank': { properties: {}, items: [ {}, {}, … ] },
36548     //    'brands/amenity/bar':  { properties: {}, items: [ {}, {}, … ] },
36549     //    …
36550     // }
36551     //
36552     buildLocationIndex(data, loco) {
36553       const that = this;
36554       if (that.locationIndex) return;
36555       that.itemLocation = /* @__PURE__ */ new Map();
36556       that.locationSets = /* @__PURE__ */ new Map();
36557       Object.keys(data).forEach((tkv) => {
36558         const items = data[tkv].items;
36559         if (!Array.isArray(items) || !items.length) return;
36560         items.forEach((item) => {
36561           if (that.itemLocation.has(item.id)) return;
36562           let resolved;
36563           try {
36564             resolved = loco.resolveLocationSet(item.locationSet);
36565           } catch (err) {
36566             console.warn("buildLocationIndex: ".concat(err.message));
36567           }
36568           if (!resolved || !resolved.id) return;
36569           that.itemLocation.set(item.id, resolved.id);
36570           if (that.locationSets.has(resolved.id)) return;
36571           let feature4 = _cloneDeep2(resolved.feature);
36572           feature4.id = resolved.id;
36573           feature4.properties.id = resolved.id;
36574           if (!feature4.geometry.coordinates.length || !feature4.properties.area) {
36575             console.warn("buildLocationIndex: locationSet ".concat(resolved.id, " for ").concat(item.id, " resolves to an empty feature:"));
36576             console.warn(JSON.stringify(feature4));
36577             return;
36578           }
36579           that.locationSets.set(resolved.id, feature4);
36580         });
36581       });
36582       that.locationIndex = (0, import_which_polygon3.default)({ type: "FeatureCollection", features: [...that.locationSets.values()] });
36583       function _cloneDeep2(obj) {
36584         return JSON.parse(JSON.stringify(obj));
36585       }
36586     }
36587     //
36588     // `match()`
36589     // Pass parts and return an Array of matches.
36590     // `k` - key
36591     // `v` - value
36592     // `n` - namelike
36593     // `loc` - optional - [lon,lat] location to search
36594     //
36595     // 1. If the [k,v,n] tuple matches a canonical item…
36596     // Return an Array of match results.
36597     // Each result will include the area in km² that the item is valid.
36598     //
36599     // Order of results:
36600     // Primary ordering will be on the "match" column:
36601     //   "primary" - where the query matches the `name` tag, followed by
36602     //   "alternate" - where the query matches an alternate name tag (e.g. short_name, brand, operator, etc)
36603     // Secondary ordering will be on the "area" column:
36604     //   "area descending" if no location was provided, (worldwide before local)
36605     //   "area ascending" if location was provided (local before worldwide)
36606     //
36607     // [
36608     //   { match: 'primary',   itemID: String,  area: Number,  kv: String,  nsimple: String },
36609     //   { match: 'primary',   itemID: String,  area: Number,  kv: String,  nsimple: String },
36610     //   { match: 'alternate', itemID: String,  area: Number,  kv: String,  nsimple: String },
36611     //   { match: 'alternate', itemID: String,  area: Number,  kv: String,  nsimple: String },
36612     //   …
36613     // ]
36614     //
36615     // -or-
36616     //
36617     // 2. If the [k,v,n] tuple matches an exclude pattern…
36618     // Return an Array with a single exclude result, either
36619     //
36620     // [ { match: 'excludeGeneric', pattern: String,  kv: String } ]  // "generic" e.g. "Food Court"
36621     //   or
36622     // [ { match: 'excludeNamed', pattern: String,  kv: String } ]    // "named", e.g. "Kebabai"
36623     //
36624     // About results
36625     //   "generic" - a generic word that is probably not really a name.
36626     //     For these, iD should warn the user "Hey don't put 'food court' in the name tag".
36627     //   "named" - a real name like "Kebabai" that is just common, but not a brand.
36628     //     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.
36629     //
36630     // -or-
36631     //
36632     // 3. If the [k,v,n] tuple matches nothing of any kind, return `null`
36633     //
36634     //
36635     match(k3, v3, n3, loc) {
36636       const that = this;
36637       if (!that.matchIndex) {
36638         throw new Error("match:  matchIndex not built.");
36639       }
36640       let matchLocations;
36641       if (Array.isArray(loc) && that.locationIndex) {
36642         matchLocations = that.locationIndex([loc[0], loc[1], loc[0], loc[1]], true);
36643       }
36644       const nsimple = simplify(n3);
36645       let seen = /* @__PURE__ */ new Set();
36646       let results = [];
36647       gatherResults("primary");
36648       gatherResults("alternate");
36649       if (results.length) return results;
36650       gatherResults("exclude");
36651       return results.length ? results : null;
36652       function gatherResults(which) {
36653         const kv = "".concat(k3, "/").concat(v3);
36654         let didMatch = tryMatch(which, kv);
36655         if (didMatch) return;
36656         for (let mg in matchGroups) {
36657           const matchGroup = matchGroups[mg];
36658           const inGroup = matchGroup.some((otherkv) => otherkv === kv);
36659           if (!inGroup) continue;
36660           for (let i3 = 0; i3 < matchGroup.length; i3++) {
36661             const otherkv = matchGroup[i3];
36662             if (otherkv === kv) continue;
36663             didMatch = tryMatch(which, otherkv);
36664             if (didMatch) return;
36665           }
36666         }
36667         if (which === "exclude") {
36668           const regex = [...that.genericWords.values()].find((regex2) => regex2.test(n3));
36669           if (regex) {
36670             results.push({ match: "excludeGeneric", pattern: String(regex) });
36671             return;
36672           }
36673         }
36674       }
36675       function tryMatch(which, kv) {
36676         const branch = that.matchIndex.get(kv);
36677         if (!branch) return;
36678         if (which === "exclude") {
36679           let regex = [...branch.excludeNamed.values()].find((regex2) => regex2.test(n3));
36680           if (regex) {
36681             results.push({ match: "excludeNamed", pattern: String(regex), kv });
36682             return;
36683           }
36684           regex = [...branch.excludeGeneric.values()].find((regex2) => regex2.test(n3));
36685           if (regex) {
36686             results.push({ match: "excludeGeneric", pattern: String(regex), kv });
36687             return;
36688           }
36689           return;
36690         }
36691         const leaf = branch[which].get(nsimple);
36692         if (!leaf || !leaf.size) return;
36693         let hits = Array.from(leaf).map((itemID) => {
36694           let area = Infinity;
36695           if (that.itemLocation && that.locationSets) {
36696             const location = that.locationSets.get(that.itemLocation.get(itemID));
36697             area = location && location.properties.area || Infinity;
36698           }
36699           return { match: which, itemID, area, kv, nsimple };
36700         });
36701         let sortFn = byAreaDescending;
36702         if (matchLocations) {
36703           hits = hits.filter(isValidLocation);
36704           sortFn = byAreaAscending;
36705         }
36706         if (!hits.length) return;
36707         hits.sort(sortFn).forEach((hit) => {
36708           if (seen.has(hit.itemID)) return;
36709           seen.add(hit.itemID);
36710           results.push(hit);
36711         });
36712         return true;
36713         function isValidLocation(hit) {
36714           if (!that.itemLocation) return true;
36715           return matchLocations.find((props) => props.id === that.itemLocation.get(hit.itemID));
36716         }
36717         function byAreaAscending(hitA, hitB) {
36718           return hitA.area - hitB.area;
36719         }
36720         function byAreaDescending(hitA, hitB) {
36721           return hitB.area - hitA.area;
36722         }
36723       }
36724     }
36725     //
36726     // `getWarnings()`
36727     // Return any warnings discovered when buiding the index.
36728     // (currently this does nothing)
36729     //
36730     getWarnings() {
36731       return this.warnings;
36732     }
36733   };
36734
36735   // modules/services/nsi.js
36736   var import_vparse = __toESM(require_vparse(), 1);
36737   var _nsiStatus = "loading";
36738   var _nsi = {};
36739   var buildingPreset = {
36740     "building/commercial": true,
36741     "building/government": true,
36742     "building/hotel": true,
36743     "building/retail": true,
36744     "building/office": true,
36745     "building/supermarket": true,
36746     "building/yes": true
36747   };
36748   var notNames = /:(colou?r|type|forward|backward|left|right|etymology|pronunciation|wikipedia)$/i;
36749   var notBranches = /(coop|express|wireless|factory|outlet)/i;
36750   function setNsiSources() {
36751     const nsiVersion = package_default.dependencies["name-suggestion-index"] || package_default.devDependencies["name-suggestion-index"];
36752     const v3 = (0, import_vparse.default)(nsiVersion);
36753     const vMinor = "".concat(v3.major, ".").concat(v3.minor);
36754     const cdn = nsiCdnUrl.replace("{version}", vMinor);
36755     const sources = {
36756       "nsi_data": cdn + "dist/nsi.min.json",
36757       "nsi_dissolved": cdn + "dist/dissolved.min.json",
36758       "nsi_features": cdn + "dist/featureCollection.min.json",
36759       "nsi_generics": cdn + "dist/genericWords.min.json",
36760       "nsi_presets": cdn + "dist/presets/nsi-id-presets.min.json",
36761       "nsi_replacements": cdn + "dist/replacements.min.json",
36762       "nsi_trees": cdn + "dist/trees.min.json"
36763     };
36764     let fileMap = _mainFileFetcher.fileMap();
36765     for (const k3 in sources) {
36766       if (!fileMap[k3]) fileMap[k3] = sources[k3];
36767     }
36768   }
36769   function loadNsiPresets() {
36770     return Promise.all([
36771       _mainFileFetcher.get("nsi_presets"),
36772       _mainFileFetcher.get("nsi_features")
36773     ]).then((vals) => {
36774       Object.values(vals[0].presets).forEach((preset) => preset.suggestion = true);
36775       Object.values(vals[0].presets).forEach((preset) => {
36776         if (preset.tags["brand:wikidata"]) {
36777           preset.removeTags = __spreadValues({ "brand:wikipedia": "*" }, preset.removeTags || preset.addTags || preset.tags);
36778         }
36779         if (preset.tags["operator:wikidata"]) {
36780           preset.removeTags = __spreadValues({ "operator:wikipedia": "*" }, preset.removeTags || preset.addTags || preset.tags);
36781         }
36782         if (preset.tags["network:wikidata"]) {
36783           preset.removeTags = __spreadValues({ "network:wikipedia": "*" }, preset.removeTags || preset.addTags || preset.tags);
36784         }
36785       });
36786       _mainPresetIndex.merge({
36787         presets: vals[0].presets,
36788         featureCollection: vals[1]
36789       });
36790     });
36791   }
36792   function loadNsiData() {
36793     return Promise.all([
36794       _mainFileFetcher.get("nsi_data"),
36795       _mainFileFetcher.get("nsi_dissolved"),
36796       _mainFileFetcher.get("nsi_replacements"),
36797       _mainFileFetcher.get("nsi_trees")
36798     ]).then((vals) => {
36799       _nsi = {
36800         data: vals[0].nsi,
36801         // the raw name-suggestion-index data
36802         dissolved: vals[1].dissolved,
36803         // list of dissolved items
36804         replacements: vals[2].replacements,
36805         // trivial old->new qid replacements
36806         trees: vals[3].trees,
36807         // metadata about trees, main tags
36808         kvt: /* @__PURE__ */ new Map(),
36809         // Map (k -> Map (v -> t) )
36810         qids: /* @__PURE__ */ new Map(),
36811         // Map (wd/wp tag values -> qids)
36812         ids: /* @__PURE__ */ new Map()
36813         // Map (id -> NSI item)
36814       };
36815       const matcher = _nsi.matcher = new Matcher();
36816       matcher.buildMatchIndex(_nsi.data);
36817       matcher.itemLocation = /* @__PURE__ */ new Map();
36818       matcher.locationSets = /* @__PURE__ */ new Map();
36819       Object.keys(_nsi.data).forEach((tkv) => {
36820         const items = _nsi.data[tkv].items;
36821         if (!Array.isArray(items) || !items.length) return;
36822         items.forEach((item) => {
36823           if (matcher.itemLocation.has(item.id)) return;
36824           const locationSetID = _sharedLocationManager.locationSetID(item.locationSet);
36825           matcher.itemLocation.set(item.id, locationSetID);
36826           if (matcher.locationSets.has(locationSetID)) return;
36827           const fakeFeature = { id: locationSetID, properties: { id: locationSetID, area: 1 } };
36828           matcher.locationSets.set(locationSetID, fakeFeature);
36829         });
36830       });
36831       matcher.locationIndex = (bbox2) => {
36832         const validHere = _sharedLocationManager.locationSetsAt([bbox2[0], bbox2[1]]);
36833         const results = [];
36834         for (const [locationSetID, area] of Object.entries(validHere)) {
36835           const fakeFeature = matcher.locationSets.get(locationSetID);
36836           if (fakeFeature) {
36837             fakeFeature.properties.area = area;
36838             results.push(fakeFeature);
36839           }
36840         }
36841         return results;
36842       };
36843       Object.keys(_nsi.data).forEach((tkv) => {
36844         const category = _nsi.data[tkv];
36845         const parts = tkv.split("/", 3);
36846         const t2 = parts[0];
36847         const k3 = parts[1];
36848         const v3 = parts[2];
36849         let vmap = _nsi.kvt.get(k3);
36850         if (!vmap) {
36851           vmap = /* @__PURE__ */ new Map();
36852           _nsi.kvt.set(k3, vmap);
36853         }
36854         vmap.set(v3, t2);
36855         const tree = _nsi.trees[t2];
36856         const mainTag = tree.mainTag;
36857         const items = category.items || [];
36858         items.forEach((item) => {
36859           item.tkv = tkv;
36860           item.mainTag = mainTag;
36861           _nsi.ids.set(item.id, item);
36862           const wd = item.tags[mainTag];
36863           const wp = item.tags[mainTag.replace("wikidata", "wikipedia")];
36864           if (wd) _nsi.qids.set(wd, wd);
36865           if (wp && wd) _nsi.qids.set(wp, wd);
36866         });
36867       });
36868     });
36869   }
36870   function gatherKVs(tags) {
36871     let primary = /* @__PURE__ */ new Set();
36872     let alternate = /* @__PURE__ */ new Set();
36873     Object.keys(tags).forEach((osmkey) => {
36874       const osmvalue = tags[osmkey];
36875       if (!osmvalue) return;
36876       if (osmkey === "route_master") osmkey = "route";
36877       const vmap = _nsi.kvt.get(osmkey);
36878       if (!vmap) return;
36879       if (vmap.get(osmvalue)) {
36880         primary.add("".concat(osmkey, "/").concat(osmvalue));
36881       } else if (osmvalue === "yes") {
36882         alternate.add("".concat(osmkey, "/").concat(osmvalue));
36883       }
36884     });
36885     const preset = _mainPresetIndex.matchTags(tags, "area");
36886     if (buildingPreset[preset.id]) {
36887       alternate.add("building/yes");
36888     }
36889     return { primary, alternate };
36890   }
36891   function identifyTree(tags) {
36892     let unknown;
36893     let t2;
36894     Object.keys(tags).forEach((osmkey) => {
36895       if (t2) return;
36896       const osmvalue = tags[osmkey];
36897       if (!osmvalue) return;
36898       if (osmkey === "route_master") osmkey = "route";
36899       const vmap = _nsi.kvt.get(osmkey);
36900       if (!vmap) return;
36901       if (osmvalue === "yes") {
36902         unknown = "unknown";
36903       } else {
36904         t2 = vmap.get(osmvalue);
36905       }
36906     });
36907     return t2 || unknown || null;
36908   }
36909   function gatherNames(tags) {
36910     const empty2 = { primary: /* @__PURE__ */ new Set(), alternate: /* @__PURE__ */ new Set() };
36911     let primary = /* @__PURE__ */ new Set();
36912     let alternate = /* @__PURE__ */ new Set();
36913     let foundSemi = false;
36914     let testNameFragments = false;
36915     let patterns2;
36916     let t2 = identifyTree(tags);
36917     if (!t2) return empty2;
36918     if (t2 === "transit") {
36919       patterns2 = {
36920         primary: /^network$/i,
36921         alternate: /^(operator|operator:\w+|network:\w+|\w+_name|\w+_name:\w+)$/i
36922       };
36923     } else if (t2 === "flags") {
36924       patterns2 = {
36925         primary: /^(flag:name|flag:name:\w+)$/i,
36926         alternate: /^(flag|flag:\w+|subject|subject:\w+)$/i
36927         // note: no `country`, we special-case it below
36928       };
36929     } else if (t2 === "brands") {
36930       testNameFragments = true;
36931       patterns2 = {
36932         primary: /^(name|name:\w+)$/i,
36933         alternate: /^(brand|brand:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
36934       };
36935     } else if (t2 === "operators") {
36936       testNameFragments = true;
36937       patterns2 = {
36938         primary: /^(name|name:\w+|operator|operator:\w+)$/i,
36939         alternate: /^(brand|brand:\w+|\w+_name|\w+_name:\w+)/i
36940       };
36941     } else {
36942       testNameFragments = true;
36943       patterns2 = {
36944         primary: /^(name|name:\w+)$/i,
36945         alternate: /^(brand|brand:\w+|network|network:\w+|operator|operator:\w+|\w+_name|\w+_name:\w+)/i
36946       };
36947     }
36948     if (tags.name && testNameFragments) {
36949       const nameParts = tags.name.split(/[\s\-\/,.]/);
36950       for (let split = nameParts.length; split > 0; split--) {
36951         const name = nameParts.slice(0, split).join(" ");
36952         primary.add(name);
36953       }
36954     }
36955     Object.keys(tags).forEach((osmkey) => {
36956       const osmvalue = tags[osmkey];
36957       if (!osmvalue) return;
36958       if (isNamelike(osmkey, "primary")) {
36959         if (/;/.test(osmvalue)) {
36960           foundSemi = true;
36961         } else {
36962           primary.add(osmvalue);
36963           alternate.delete(osmvalue);
36964         }
36965       } else if (!primary.has(osmvalue) && isNamelike(osmkey, "alternate")) {
36966         if (/;/.test(osmvalue)) {
36967           foundSemi = true;
36968         } else {
36969           alternate.add(osmvalue);
36970         }
36971       }
36972     });
36973     if (tags.man_made === "flagpole" && !primary.size && !alternate.size && !!tags.country) {
36974       const osmvalue = tags.country;
36975       if (/;/.test(osmvalue)) {
36976         foundSemi = true;
36977       } else {
36978         alternate.add(osmvalue);
36979       }
36980     }
36981     if (foundSemi) {
36982       return empty2;
36983     } else {
36984       return { primary, alternate };
36985     }
36986     function isNamelike(osmkey, which) {
36987       if (osmkey === "old_name") return false;
36988       return patterns2[which].test(osmkey) && !notNames.test(osmkey);
36989     }
36990   }
36991   function gatherTuples(tryKVs, tryNames) {
36992     let tuples = [];
36993     ["primary", "alternate"].forEach((whichName) => {
36994       const arr = Array.from(tryNames[whichName]).sort((a2, b3) => b3.length - a2.length);
36995       arr.forEach((n3) => {
36996         ["primary", "alternate"].forEach((whichKV) => {
36997           tryKVs[whichKV].forEach((kv) => {
36998             const parts = kv.split("/", 2);
36999             const k3 = parts[0];
37000             const v3 = parts[1];
37001             tuples.push({ k: k3, v: v3, n: n3 });
37002           });
37003         });
37004       });
37005     });
37006     return tuples;
37007   }
37008   function _upgradeTags(tags, loc) {
37009     let newTags = Object.assign({}, tags);
37010     let changed = false;
37011     Object.keys(newTags).forEach((osmkey) => {
37012       const matchTag = osmkey.match(/^(\w+:)?wikidata$/);
37013       if (matchTag) {
37014         const prefix = matchTag[1] || "";
37015         const wd = newTags[osmkey];
37016         const replace = _nsi.replacements[wd];
37017         if (replace && replace.wikidata !== void 0) {
37018           changed = true;
37019           if (replace.wikidata) {
37020             newTags[osmkey] = replace.wikidata;
37021           } else {
37022             delete newTags[osmkey];
37023           }
37024         }
37025         if (replace && replace.wikipedia !== void 0) {
37026           changed = true;
37027           const wpkey = "".concat(prefix, "wikipedia");
37028           if (replace.wikipedia) {
37029             newTags[wpkey] = replace.wikipedia;
37030           } else {
37031             delete newTags[wpkey];
37032           }
37033         }
37034       }
37035     });
37036     const isRouteMaster = tags.type === "route_master";
37037     const tryKVs = gatherKVs(tags);
37038     if (!tryKVs.primary.size && !tryKVs.alternate.size) {
37039       return changed ? { newTags, matched: null } : null;
37040     }
37041     const tryNames = gatherNames(tags);
37042     const foundQID = _nsi.qids.get(tags.wikidata) || _nsi.qids.get(tags.wikipedia);
37043     if (foundQID) tryNames.primary.add(foundQID);
37044     if (!tryNames.primary.size && !tryNames.alternate.size) {
37045       return changed ? { newTags, matched: null } : null;
37046     }
37047     const tuples = gatherTuples(tryKVs, tryNames);
37048     for (let i3 = 0; i3 < tuples.length; i3++) {
37049       const tuple = tuples[i3];
37050       const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n, loc);
37051       if (!hits || !hits.length) continue;
37052       if (hits[0].match !== "primary" && hits[0].match !== "alternate") break;
37053       let itemID, item;
37054       for (let j3 = 0; j3 < hits.length; j3++) {
37055         const hit = hits[j3];
37056         itemID = hit.itemID;
37057         if (_nsi.dissolved[itemID]) continue;
37058         item = _nsi.ids.get(itemID);
37059         if (!item) continue;
37060         const mainTag = item.mainTag;
37061         const itemQID = item.tags[mainTag];
37062         const notQID = newTags["not:".concat(mainTag)];
37063         if (
37064           // Exceptions, skip this hit
37065           !itemQID || itemQID === notQID || // No `*:wikidata` or matched a `not:*:wikidata`
37066           newTags.office && !item.tags.office
37067         ) {
37068           item = null;
37069           continue;
37070         } else {
37071           break;
37072         }
37073       }
37074       if (!item) continue;
37075       item = JSON.parse(JSON.stringify(item));
37076       const tkv = item.tkv;
37077       const parts = tkv.split("/", 3);
37078       const k3 = parts[1];
37079       const v3 = parts[2];
37080       const category = _nsi.data[tkv];
37081       const properties = category.properties || {};
37082       let preserveTags = item.preserveTags || properties.preserveTags || [];
37083       ["building", "emergency", "internet_access", "opening_hours", "takeaway"].forEach((osmkey) => {
37084         if (k3 !== osmkey) preserveTags.push("^".concat(osmkey, "$"));
37085       });
37086       const regexes = preserveTags.map((s2) => new RegExp(s2, "i"));
37087       let keepTags = {};
37088       Object.keys(newTags).forEach((osmkey) => {
37089         if (regexes.some((regex) => regex.test(osmkey))) {
37090           keepTags[osmkey] = newTags[osmkey];
37091         }
37092       });
37093       _nsi.kvt.forEach((vmap, k4) => {
37094         if (newTags[k4] === "yes") delete newTags[k4];
37095       });
37096       if (foundQID) {
37097         delete newTags.wikipedia;
37098         delete newTags.wikidata;
37099       }
37100       Object.assign(newTags, item.tags, keepTags);
37101       if (isRouteMaster) {
37102         newTags.route_master = newTags.route;
37103         delete newTags.route;
37104       }
37105       const origName = tags.name;
37106       const newName = newTags.name;
37107       if (newName && origName && newName !== origName && !newTags.branch) {
37108         const newNames = gatherNames(newTags);
37109         const newSet = /* @__PURE__ */ new Set([...newNames.primary, ...newNames.alternate]);
37110         const isMoved = newSet.has(origName);
37111         if (!isMoved) {
37112           const nameParts = origName.split(/[\s\-\/,.]/);
37113           for (let split = nameParts.length; split > 0; split--) {
37114             const name = nameParts.slice(0, split).join(" ");
37115             const branch = nameParts.slice(split).join(" ");
37116             const nameHits = _nsi.matcher.match(k3, v3, name, loc);
37117             if (!nameHits || !nameHits.length) continue;
37118             if (nameHits.some((hit) => hit.itemID === itemID)) {
37119               if (branch) {
37120                 if (notBranches.test(branch)) {
37121                   newTags.name = origName;
37122                 } else {
37123                   const branchHits = _nsi.matcher.match(k3, v3, branch, loc);
37124                   if (branchHits && branchHits.length) {
37125                     if (branchHits[0].match === "primary" || branchHits[0].match === "alternate") {
37126                       return null;
37127                     }
37128                   } else {
37129                     newTags.branch = branch;
37130                   }
37131                 }
37132               }
37133               break;
37134             }
37135           }
37136         }
37137       }
37138       return { newTags, matched: item };
37139     }
37140     return changed ? { newTags, matched: null } : null;
37141   }
37142   function _isGenericName(tags) {
37143     const n3 = tags.name;
37144     if (!n3) return false;
37145     const tryNames = { primary: /* @__PURE__ */ new Set([n3]), alternate: /* @__PURE__ */ new Set() };
37146     const tryKVs = gatherKVs(tags);
37147     if (!tryKVs.primary.size && !tryKVs.alternate.size) return false;
37148     const tuples = gatherTuples(tryKVs, tryNames);
37149     for (let i3 = 0; i3 < tuples.length; i3++) {
37150       const tuple = tuples[i3];
37151       const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n);
37152       if (hits && hits.length && hits[0].match === "excludeGeneric") return true;
37153     }
37154     return false;
37155   }
37156   var nsi_default = {
37157     // `init()`
37158     // On init, start preparing the name-suggestion-index
37159     //
37160     init: () => {
37161       setNsiSources();
37162       _mainPresetIndex.ensureLoaded().then(() => loadNsiPresets()).then(() => loadNsiData()).then(() => _nsiStatus = "ok").catch(() => _nsiStatus = "failed");
37163     },
37164     // `reset()`
37165     // Reset is called when user saves data to OSM (does nothing here)
37166     //
37167     reset: () => {
37168     },
37169     // `status()`
37170     // To let other code know how it's going...
37171     //
37172     // Returns
37173     //   `String`: 'loading', 'ok', 'failed'
37174     //
37175     status: () => _nsiStatus,
37176     // `isGenericName()`
37177     // Is the `name` tag generic?
37178     //
37179     // Arguments
37180     //   `tags`: `Object` containing the feature's OSM tags
37181     // Returns
37182     //   `true` if it is generic, `false` if not
37183     //
37184     isGenericName: (tags) => _isGenericName(tags),
37185     // `upgradeTags()`
37186     // Suggest tag upgrades.
37187     // This function will not modify the input tags, it makes a copy.
37188     //
37189     // Arguments
37190     //   `tags`: `Object` containing the feature's OSM tags
37191     //   `loc`: Location where this feature exists, as a [lon, lat]
37192     // Returns
37193     //   `Object` containing the result, or `null` if no changes needed:
37194     //   {
37195     //     'newTags': `Object` - The tags the the feature should have
37196     //     'matched': `Object` - The matched item
37197     //   }
37198     //
37199     upgradeTags: (tags, loc) => _upgradeTags(tags, loc),
37200     // `cache()`
37201     // Direct access to the NSI cache, useful for testing or breaking things
37202     //
37203     // Returns
37204     //   `Object`: the internal NSI cache
37205     //
37206     cache: () => _nsi
37207   };
37208
37209   // modules/services/kartaview.js
37210   var apibase2 = "https://kartaview.org";
37211   var maxResults = 1e3;
37212   var tileZoom = 14;
37213   var tiler3 = utilTiler().zoomExtent([tileZoom, tileZoom]).skipNullIsland(true);
37214   var dispatch5 = dispatch_default("loadedImages");
37215   var imgZoom = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
37216   var _oscCache;
37217   var _oscSelectedImage;
37218   var _loadViewerPromise2;
37219   function abortRequest3(controller) {
37220     controller.abort();
37221   }
37222   function maxPageAtZoom(z3) {
37223     if (z3 < 15) return 2;
37224     if (z3 === 15) return 5;
37225     if (z3 === 16) return 10;
37226     if (z3 === 17) return 20;
37227     if (z3 === 18) return 40;
37228     if (z3 > 18) return 80;
37229   }
37230   function loadTiles2(which, url, projection2) {
37231     var currZoom = Math.floor(geoScaleToZoom(projection2.scale()));
37232     var tiles = tiler3.getTiles(projection2);
37233     var cache = _oscCache[which];
37234     Object.keys(cache.inflight).forEach(function(k3) {
37235       var wanted = tiles.find(function(tile) {
37236         return k3.indexOf(tile.id + ",") === 0;
37237       });
37238       if (!wanted) {
37239         abortRequest3(cache.inflight[k3]);
37240         delete cache.inflight[k3];
37241       }
37242     });
37243     tiles.forEach(function(tile) {
37244       loadNextTilePage(which, currZoom, url, tile);
37245     });
37246   }
37247   function loadNextTilePage(which, currZoom, url, tile) {
37248     var cache = _oscCache[which];
37249     var bbox2 = tile.extent.bbox();
37250     var maxPages = maxPageAtZoom(currZoom);
37251     var nextPage = cache.nextPage[tile.id] || 1;
37252     var params = utilQsString({
37253       ipp: maxResults,
37254       page: nextPage,
37255       // client_id: clientId,
37256       bbTopLeft: [bbox2.maxY, bbox2.minX].join(","),
37257       bbBottomRight: [bbox2.minY, bbox2.maxX].join(",")
37258     }, true);
37259     if (nextPage > maxPages) return;
37260     var id2 = tile.id + "," + String(nextPage);
37261     if (cache.loaded[id2] || cache.inflight[id2]) return;
37262     var controller = new AbortController();
37263     cache.inflight[id2] = controller;
37264     var options = {
37265       method: "POST",
37266       signal: controller.signal,
37267       body: params,
37268       headers: { "Content-Type": "application/x-www-form-urlencoded" }
37269     };
37270     json_default(url, options).then(function(data) {
37271       cache.loaded[id2] = true;
37272       delete cache.inflight[id2];
37273       if (!data || !data.currentPageItems || !data.currentPageItems.length) {
37274         throw new Error("No Data");
37275       }
37276       var features = data.currentPageItems.map(function(item) {
37277         var loc = [+item.lng, +item.lat];
37278         var d2;
37279         if (which === "images") {
37280           d2 = {
37281             service: "photo",
37282             loc,
37283             key: item.id,
37284             ca: +item.heading,
37285             captured_at: item.shot_date || item.date_added,
37286             captured_by: item.username,
37287             imagePath: item.name,
37288             sequence_id: item.sequence_id,
37289             sequence_index: +item.sequence_index
37290           };
37291           var seq = _oscCache.sequences[d2.sequence_id];
37292           if (!seq) {
37293             seq = { rotation: 0, images: [] };
37294             _oscCache.sequences[d2.sequence_id] = seq;
37295           }
37296           seq.images[d2.sequence_index] = d2;
37297           _oscCache.images.forImageKey[d2.key] = d2;
37298         }
37299         return {
37300           minX: loc[0],
37301           minY: loc[1],
37302           maxX: loc[0],
37303           maxY: loc[1],
37304           data: d2
37305         };
37306       });
37307       cache.rtree.load(features);
37308       if (data.currentPageItems.length === maxResults) {
37309         cache.nextPage[tile.id] = nextPage + 1;
37310         loadNextTilePage(which, currZoom, url, tile);
37311       } else {
37312         cache.nextPage[tile.id] = Infinity;
37313       }
37314       if (which === "images") {
37315         dispatch5.call("loadedImages");
37316       }
37317     }).catch(function() {
37318       cache.loaded[id2] = true;
37319       delete cache.inflight[id2];
37320     });
37321   }
37322   function partitionViewport2(projection2) {
37323     var z3 = geoScaleToZoom(projection2.scale());
37324     var z22 = Math.ceil(z3 * 2) / 2 + 2.5;
37325     var tiler8 = utilTiler().zoomExtent([z22, z22]);
37326     return tiler8.getTiles(projection2).map(function(tile) {
37327       return tile.extent;
37328     });
37329   }
37330   function searchLimited2(limit, projection2, rtree) {
37331     limit = limit || 5;
37332     return partitionViewport2(projection2).reduce(function(result, extent) {
37333       var found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
37334         return d2.data;
37335       });
37336       return found.length ? result.concat(found) : result;
37337     }, []);
37338   }
37339   var kartaview_default = {
37340     init: function() {
37341       if (!_oscCache) {
37342         this.reset();
37343       }
37344       this.event = utilRebind(this, dispatch5, "on");
37345     },
37346     reset: function() {
37347       if (_oscCache) {
37348         Object.values(_oscCache.images.inflight).forEach(abortRequest3);
37349       }
37350       _oscCache = {
37351         images: { inflight: {}, loaded: {}, nextPage: {}, rtree: new RBush(), forImageKey: {} },
37352         sequences: {}
37353       };
37354     },
37355     images: function(projection2) {
37356       var limit = 5;
37357       return searchLimited2(limit, projection2, _oscCache.images.rtree);
37358     },
37359     sequences: function(projection2) {
37360       var viewport = projection2.clipExtent();
37361       var min3 = [viewport[0][0], viewport[1][1]];
37362       var max3 = [viewport[1][0], viewport[0][1]];
37363       var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
37364       var sequenceKeys = {};
37365       _oscCache.images.rtree.search(bbox2).forEach(function(d2) {
37366         sequenceKeys[d2.data.sequence_id] = true;
37367       });
37368       var lineStrings = [];
37369       Object.keys(sequenceKeys).forEach(function(sequenceKey) {
37370         var seq = _oscCache.sequences[sequenceKey];
37371         var images = seq && seq.images;
37372         if (images) {
37373           lineStrings.push({
37374             type: "LineString",
37375             coordinates: images.map(function(d2) {
37376               return d2.loc;
37377             }).filter(Boolean),
37378             properties: {
37379               captured_at: images[0] ? images[0].captured_at : null,
37380               captured_by: images[0] ? images[0].captured_by : null,
37381               key: sequenceKey
37382             }
37383           });
37384         }
37385       });
37386       return lineStrings;
37387     },
37388     cachedImage: function(imageKey) {
37389       return _oscCache.images.forImageKey[imageKey];
37390     },
37391     loadImages: function(projection2) {
37392       var url = apibase2 + "/1.0/list/nearby-photos/";
37393       loadTiles2("images", url, projection2);
37394     },
37395     ensureViewerLoaded: function(context) {
37396       if (_loadViewerPromise2) return _loadViewerPromise2;
37397       var wrap2 = context.container().select(".photoviewer").selectAll(".kartaview-wrapper").data([0]);
37398       var that = this;
37399       var wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper kartaview-wrapper").classed("hide", true).call(imgZoom.on("zoom", zoomPan)).on("dblclick.zoom", null);
37400       wrapEnter.append("div").attr("class", "photo-attribution fillD");
37401       var controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
37402       controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
37403       controlsEnter.append("button").on("click.rotate-ccw", rotate(-90)).text("\u293F");
37404       controlsEnter.append("button").on("click.rotate-cw", rotate(90)).text("\u293E");
37405       controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
37406       wrapEnter.append("div").attr("class", "kartaview-image-wrap");
37407       context.ui().photoviewer.on("resize.kartaview", function(dimensions) {
37408         imgZoom.extent([[0, 0], dimensions]).translateExtent([[0, 0], dimensions]);
37409       });
37410       function zoomPan(d3_event) {
37411         var t2 = d3_event.transform;
37412         context.container().select(".photoviewer .kartaview-image-wrap").call(utilSetTransform, t2.x, t2.y, t2.k);
37413       }
37414       function rotate(deg) {
37415         return function() {
37416           if (!_oscSelectedImage) return;
37417           var sequenceKey = _oscSelectedImage.sequence_id;
37418           var sequence = _oscCache.sequences[sequenceKey];
37419           if (!sequence) return;
37420           var r2 = sequence.rotation || 0;
37421           r2 += deg;
37422           if (r2 > 180) r2 -= 360;
37423           if (r2 < -180) r2 += 360;
37424           sequence.rotation = r2;
37425           var wrap3 = context.container().select(".photoviewer .kartaview-wrapper");
37426           wrap3.transition().duration(100).call(imgZoom.transform, identity3);
37427           wrap3.selectAll(".kartaview-image").transition().duration(100).style("transform", "rotate(" + r2 + "deg)");
37428         };
37429       }
37430       function step(stepBy) {
37431         return function() {
37432           if (!_oscSelectedImage) return;
37433           var sequenceKey = _oscSelectedImage.sequence_id;
37434           var sequence = _oscCache.sequences[sequenceKey];
37435           if (!sequence) return;
37436           var nextIndex = _oscSelectedImage.sequence_index + stepBy;
37437           var nextImage = sequence.images[nextIndex];
37438           if (!nextImage) return;
37439           context.map().centerEase(nextImage.loc);
37440           that.selectImage(context, nextImage.key);
37441         };
37442       }
37443       _loadViewerPromise2 = Promise.resolve();
37444       return _loadViewerPromise2;
37445     },
37446     showViewer: function(context) {
37447       const wrap2 = context.container().select(".photoviewer");
37448       const isHidden = wrap2.selectAll(".photo-wrapper.kartaview-wrapper.hide").size();
37449       if (isHidden) {
37450         for (const service of Object.values(services)) {
37451           if (service === this) continue;
37452           if (typeof service.hideViewer === "function") {
37453             service.hideViewer(context);
37454           }
37455         }
37456         wrap2.classed("hide", false).selectAll(".photo-wrapper.kartaview-wrapper").classed("hide", false);
37457       }
37458       return this;
37459     },
37460     hideViewer: function(context) {
37461       _oscSelectedImage = null;
37462       this.updateUrlImage(null);
37463       var viewer = context.container().select(".photoviewer");
37464       if (!viewer.empty()) viewer.datum(null);
37465       viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
37466       context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
37467       return this.setStyles(context, null, true);
37468     },
37469     selectImage: function(context, imageKey) {
37470       var d2 = this.cachedImage(imageKey);
37471       _oscSelectedImage = d2;
37472       this.updateUrlImage(imageKey);
37473       var viewer = context.container().select(".photoviewer");
37474       if (!viewer.empty()) viewer.datum(d2);
37475       this.setStyles(context, null, true);
37476       context.container().selectAll(".icon-sign").classed("currentView", false);
37477       if (!d2) return this;
37478       var wrap2 = context.container().select(".photoviewer .kartaview-wrapper");
37479       var imageWrap = wrap2.selectAll(".kartaview-image-wrap");
37480       var attribution = wrap2.selectAll(".photo-attribution").text("");
37481       wrap2.transition().duration(100).call(imgZoom.transform, identity3);
37482       imageWrap.selectAll(".kartaview-image").remove();
37483       if (d2) {
37484         var sequence = _oscCache.sequences[d2.sequence_id];
37485         var r2 = sequence && sequence.rotation || 0;
37486         imageWrap.append("img").attr("class", "kartaview-image").attr("src", (apibase2 + "/" + d2.imagePath).replace(/^https:\/\/kartaview\.org\/storage(\d+)\//, "https://storage$1.openstreetcam.org/")).style("transform", "rotate(" + r2 + "deg)");
37487         if (d2.captured_by) {
37488           attribution.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://kartaview.org/user/" + encodeURIComponent(d2.captured_by)).text("@" + d2.captured_by);
37489           attribution.append("span").text("|");
37490         }
37491         if (d2.captured_at) {
37492           attribution.append("span").attr("class", "captured_at").text(localeDateString2(d2.captured_at));
37493           attribution.append("span").text("|");
37494         }
37495         attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", "https://kartaview.org/details/" + d2.sequence_id + "/" + d2.sequence_index).text("kartaview.org");
37496       }
37497       return this;
37498       function localeDateString2(s2) {
37499         if (!s2) return null;
37500         var options = { day: "numeric", month: "short", year: "numeric" };
37501         var d4 = new Date(s2);
37502         if (isNaN(d4.getTime())) return null;
37503         return d4.toLocaleDateString(_mainLocalizer.localeCode(), options);
37504       }
37505     },
37506     getSelectedImage: function() {
37507       return _oscSelectedImage;
37508     },
37509     getSequenceKeyForImage: function(d2) {
37510       return d2 && d2.sequence_id;
37511     },
37512     // Updates the currently highlighted sequence and selected bubble.
37513     // Reset is only necessary when interacting with the viewport because
37514     // this implicitly changes the currently selected bubble/sequence
37515     setStyles: function(context, hovered, reset) {
37516       if (reset) {
37517         context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
37518         context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
37519       }
37520       var hoveredImageId = hovered && hovered.key;
37521       var hoveredSequenceId = this.getSequenceKeyForImage(hovered);
37522       var viewer = context.container().select(".photoviewer");
37523       var selected = viewer.empty() ? void 0 : viewer.datum();
37524       var selectedImageId = selected && selected.key;
37525       var selectedSequenceId = this.getSequenceKeyForImage(selected);
37526       context.container().selectAll(".layer-kartaview .viewfield-group").classed("highlighted", function(d2) {
37527         return d2.sequence_id === selectedSequenceId || d2.id === hoveredImageId;
37528       }).classed("hovered", function(d2) {
37529         return d2.key === hoveredImageId;
37530       }).classed("currentView", function(d2) {
37531         return d2.key === selectedImageId;
37532       });
37533       context.container().selectAll(".layer-kartaview .sequence").classed("highlighted", function(d2) {
37534         return d2.properties.key === hoveredSequenceId;
37535       }).classed("currentView", function(d2) {
37536         return d2.properties.key === selectedSequenceId;
37537       });
37538       context.container().selectAll(".layer-kartaview .viewfield-group .viewfield").attr("d", viewfieldPath);
37539       function viewfieldPath() {
37540         var d2 = this.parentNode.__data__;
37541         if (d2.pano && d2.key !== selectedImageId) {
37542           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
37543         } else {
37544           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
37545         }
37546       }
37547       return this;
37548     },
37549     updateUrlImage: function(imageKey) {
37550       const hash2 = utilStringQs(window.location.hash);
37551       if (imageKey) {
37552         hash2.photo = "kartaview/" + imageKey;
37553       } else {
37554         delete hash2.photo;
37555       }
37556       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
37557     },
37558     cache: function() {
37559       return _oscCache;
37560     }
37561   };
37562
37563   // node_modules/@rapideditor/country-coder/dist/country-coder.mjs
37564   var import_which_polygon4 = __toESM(require_which_polygon(), 1);
37565   var borders_default2 = { type: "FeatureCollection", features: [
37566     { 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]]]] } },
37567     { 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]]]] } },
37568     { 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]]]] } },
37569     { 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]]]] } },
37570     { 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]]]] } },
37571     { 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]]]] } },
37572     { 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]]]] } },
37573     { 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]]]] } },
37574     { 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]]]] } },
37575     { 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]]]] } },
37576     { 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]]]] } },
37577     { 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]]]] } },
37578     { 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]]]] } },
37579     { 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]]]] } },
37580     { 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]]]] } },
37581     { 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]]]] } },
37582     { 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]]]] } },
37583     { 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]]]] } },
37584     { 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]]]] } },
37585     { type: "Feature", properties: { wikidata: "Q12837", nameEn: "Iberia", level: "sharedLandform" }, geometry: null },
37586     { 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]]]] } },
37587     { 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]]]] } },
37588     { type: "Feature", properties: { wikidata: "Q22890", nameEn: "Ireland", level: "sharedLandform" }, geometry: null },
37589     { type: "Feature", properties: { wikidata: "Q23666", nameEn: "Great Britain", country: "GB", level: "sharedLandform" }, geometry: null },
37590     { 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]]]] } },
37591     { 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]]]] } },
37592     { 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]]]] } },
37593     { 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]]]] } },
37594     { 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]]]] } },
37595     { 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]]]] } },
37596     { 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]]]] } },
37597     { 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]]]] } },
37598     { 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]]]] } },
37599     { 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]]]] } },
37600     { 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]]]] } },
37601     { 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]]]] } },
37602     { type: "Feature", properties: { wikidata: "Q35657", nameEn: "US States", country: "US", level: "subcountryGroup" }, geometry: null },
37603     { type: "Feature", properties: { wikidata: "Q36117", nameEn: "Borneo", level: "sharedLandform" }, geometry: null },
37604     { 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]]]] } },
37605     { type: "Feature", properties: { wikidata: "Q37362", nameEn: "Akrotiri and Dhekelia", aliases: ["SBA"], country: "GB" }, geometry: null },
37606     { 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]]]] } },
37607     { 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]]]] } },
37608     { 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]]]] } },
37609     { 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]]]] } },
37610     { 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]]]] } },
37611     { 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]]]] } },
37612     { type: "Feature", properties: { wikidata: "Q46395", nameEn: "British Overseas Territories", aliases: ["BOTS", "UKOTS"], country: "GB", level: "subcountryGroup" }, geometry: null },
37613     { 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]]]] } },
37614     { 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]]]] } },
37615     { 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]]]] } },
37616     { 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]]]] } },
37617     { type: "Feature", properties: { wikidata: "Q105472", nameEn: "Macaronesia", level: "sharedLandform" }, geometry: null },
37618     { 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]]]] } },
37619     { 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]]]] } },
37620     { 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]]]] } },
37621     { 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]]]] } },
37622     { 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]]]] } },
37623     { 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]]]] } },
37624     { 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]]]] } },
37625     { 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]]]] } },
37626     { 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]]]] } },
37627     { 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]]]] } },
37628     { type: "Feature", properties: { wikidata: "Q153732", nameEn: "Mariana Islands", level: "sharedLandform" }, geometry: null },
37629     { 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]]]] } },
37630     { 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]]]] } },
37631     { type: "Feature", properties: { wikidata: "Q185086", nameEn: "Crown Dependencies", country: "GB", level: "subcountryGroup" }, geometry: null },
37632     { 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]]]] } },
37633     { type: "Feature", properties: { wikidata: "Q191011", nameEn: "Plazas de soberan\xEDa", country: "ES" }, geometry: null },
37634     { 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]]]] } },
37635     { 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]]]] } },
37636     { 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]]]] } },
37637     { 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]]]] } },
37638     { 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]]]] } },
37639     { type: "Feature", properties: { wikidata: "Q644636", nameEn: "Cyprus", level: "sharedLandform" }, geometry: null },
37640     { type: "Feature", properties: { wikidata: "Q851132", nameEn: "New Zealand Outlying Islands", country: "NZ", level: "subcountryGroup" }, geometry: null },
37641     { 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]]]] } },
37642     { 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]]]] } },
37643     { 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]]]] } },
37644     { 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]]]] } },
37645     { type: "Feature", properties: { wikidata: "Q1352230", nameEn: "US Territories", country: "US", level: "subcountryGroup" }, geometry: null },
37646     { type: "Feature", properties: { wikidata: "Q1451600", nameEn: "Overseas Countries and Territories of the EU", aliases: ["OCT"], level: "subunion" }, geometry: null },
37647     { 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]]]] } },
37648     { 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]]]] } },
37649     { 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]]]] } },
37650     { 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]]]] } },
37651     { 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]]]] } },
37652     { 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]]]] } },
37653     { 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]]]] } },
37654     { 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]]]] } },
37655     { type: "Feature", properties: { wikidata: "Q2914565", nameEn: "Autonomous Regions of Portugal", country: "PT", level: "subcountryGroup" }, geometry: null },
37656     { 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]]]] } },
37657     { 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]]]] } },
37658     { type: "Feature", properties: { wikidata: "Q3320166", nameEn: "Outermost Regions of the EU", aliases: ["OMR"], level: "subunion" }, geometry: null },
37659     { type: "Feature", properties: { wikidata: "Q3336843", nameEn: "Countries of the United Kingdom", aliases: ["GB-UKM"], country: "GB", level: "subcountryGroup" }, geometry: null },
37660     { 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]]]] } },
37661     { 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]]]] } },
37662     { 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]]]] } },
37663     { 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]]]] } },
37664     { 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]]]] } },
37665     { 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]]]] } },
37666     { type: "Feature", properties: { m49: "001", wikidata: "Q2", nameEn: "World", aliases: ["Earth", "Planet"], level: "world" }, geometry: null },
37667     { type: "Feature", properties: { m49: "002", wikidata: "Q15", nameEn: "Africa", level: "region" }, geometry: null },
37668     { type: "Feature", properties: { m49: "003", wikidata: "Q49", nameEn: "North America", level: "subregion" }, geometry: null },
37669     { type: "Feature", properties: { m49: "005", wikidata: "Q18", nameEn: "South America", level: "intermediateRegion" }, geometry: null },
37670     { type: "Feature", properties: { m49: "009", wikidata: "Q538", nameEn: "Oceania", level: "region" }, geometry: null },
37671     { type: "Feature", properties: { m49: "011", wikidata: "Q4412", nameEn: "Western Africa", level: "intermediateRegion" }, geometry: null },
37672     { type: "Feature", properties: { m49: "013", wikidata: "Q27611", nameEn: "Central America", level: "intermediateRegion" }, geometry: null },
37673     { type: "Feature", properties: { m49: "014", wikidata: "Q27407", nameEn: "Eastern Africa", level: "intermediateRegion" }, geometry: null },
37674     { type: "Feature", properties: { m49: "015", wikidata: "Q27381", nameEn: "Northern Africa", level: "subregion" }, geometry: null },
37675     { type: "Feature", properties: { m49: "017", wikidata: "Q27433", nameEn: "Middle Africa", level: "intermediateRegion" }, geometry: null },
37676     { type: "Feature", properties: { m49: "018", wikidata: "Q27394", nameEn: "Southern Africa", level: "intermediateRegion" }, geometry: null },
37677     { type: "Feature", properties: { m49: "019", wikidata: "Q828", nameEn: "Americas", level: "region" }, geometry: null },
37678     { type: "Feature", properties: { m49: "021", wikidata: "Q2017699", nameEn: "Northern America", level: "subregion" }, geometry: null },
37679     { type: "Feature", properties: { m49: "029", wikidata: "Q664609", nameEn: "Caribbean", level: "intermediateRegion" }, geometry: null },
37680     { type: "Feature", properties: { m49: "030", wikidata: "Q27231", nameEn: "Eastern Asia", level: "subregion" }, geometry: null },
37681     { type: "Feature", properties: { m49: "034", wikidata: "Q771405", nameEn: "Southern Asia", level: "subregion" }, geometry: null },
37682     { type: "Feature", properties: { m49: "035", wikidata: "Q11708", nameEn: "South-eastern Asia", level: "subregion" }, geometry: null },
37683     { type: "Feature", properties: { m49: "039", wikidata: "Q27449", nameEn: "Southern Europe", level: "subregion" }, geometry: null },
37684     { type: "Feature", properties: { m49: "053", wikidata: "Q45256", nameEn: "Australia and New Zealand", aliases: ["Australasia"], level: "subregion" }, geometry: null },
37685     { type: "Feature", properties: { m49: "054", wikidata: "Q37394", nameEn: "Melanesia", level: "subregion" }, geometry: null },
37686     { type: "Feature", properties: { m49: "057", wikidata: "Q3359409", nameEn: "Micronesia", level: "subregion" }, geometry: null },
37687     { type: "Feature", properties: { m49: "061", wikidata: "Q35942", nameEn: "Polynesia", level: "subregion" }, geometry: null },
37688     { type: "Feature", properties: { m49: "142", wikidata: "Q48", nameEn: "Asia", level: "region" }, geometry: null },
37689     { type: "Feature", properties: { m49: "143", wikidata: "Q27275", nameEn: "Central Asia", level: "subregion" }, geometry: null },
37690     { type: "Feature", properties: { m49: "145", wikidata: "Q27293", nameEn: "Western Asia", level: "subregion" }, geometry: null },
37691     { type: "Feature", properties: { m49: "150", wikidata: "Q46", nameEn: "Europe", level: "region" }, geometry: null },
37692     { type: "Feature", properties: { m49: "151", wikidata: "Q27468", nameEn: "Eastern Europe", level: "subregion" }, geometry: null },
37693     { type: "Feature", properties: { m49: "154", wikidata: "Q27479", nameEn: "Northern Europe", level: "subregion" }, geometry: null },
37694     { type: "Feature", properties: { m49: "155", wikidata: "Q27496", nameEn: "Western Europe", level: "subregion" }, geometry: null },
37695     { type: "Feature", properties: { m49: "202", wikidata: "Q132959", nameEn: "Sub-Saharan Africa", level: "subregion" }, geometry: null },
37696     { type: "Feature", properties: { m49: "419", wikidata: "Q72829598", nameEn: "Latin America and the Caribbean", level: "subregion" }, geometry: null },
37697     { type: "Feature", properties: { m49: "830", wikidata: "Q42314", nameEn: "Channel Islands", level: "intermediateRegion" }, geometry: null },
37698     { 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]]]] } },
37699     { 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]]]] } },
37700     { 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]]]] } },
37701     { 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]]]] } },
37702     { 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]]]] } },
37703     { 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]]]] } },
37704     { 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]]]] } },
37705     { 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]]]] } },
37706     { 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]]]] } },
37707     { 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]]]] } },
37708     { 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]]]] } },
37709     { 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]]]] } },
37710     { 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]]]] } },
37711     { type: "Feature", properties: { iso1A2: "AU", iso1A3: "AUS", iso1N3: "036", wikidata: "Q408", nameEn: "Australia" }, geometry: null },
37712     { 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]]]] } },
37713     { 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]]]] } },
37714     { 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]]]] } },
37715     { 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]]]] } },
37716     { 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]]]] } },
37717     { 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]]]] } },
37718     { 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]]]] } },
37719     { 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]]]] } },
37720     { 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]]]] } },
37721     { 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]]]] } },
37722     { 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]]]] } },
37723     { 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]]]] } },
37724     { 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]]]] } },
37725     { 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]]]] } },
37726     { 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]]]] } },
37727     { 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]]]] } },
37728     { type: "Feature", properties: { iso1A2: "BQ", iso1A3: "BES", iso1N3: "535", wikidata: "Q27561", nameEn: "Caribbean Netherlands", country: "NL" }, geometry: null },
37729     { 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]]]] } },
37730     { 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]]]] } },
37731     { 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]]]] } },
37732     { 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]]]] } },
37733     { 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]]]] } },
37734     { 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]]]] } },
37735     { 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]]]] } },
37736     { 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]]]] } },
37737     { 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]]]] } },
37738     { 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]]]] } },
37739     { 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]]]] } },
37740     { 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]]]] } },
37741     { 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]]]] } },
37742     { 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]]]] } },
37743     { 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]]]] } },
37744     { 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]]]] } },
37745     { 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]]]] } },
37746     { type: "Feature", properties: { iso1A2: "CN", iso1A3: "CHN", iso1N3: "156", wikidata: "Q148", nameEn: "People's Republic of China" }, geometry: null },
37747     { 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]]]] } },
37748     { 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]]]] } },
37749     { 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]]]] } },
37750     { 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]]]] } },
37751     { 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]]]] } },
37752     { 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]]]] } },
37753     { 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]]]] } },
37754     { 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]]]] } },
37755     { 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]]]] } },
37756     { 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]]]] } },
37757     { 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]]]] } },
37758     { 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]]]] } },
37759     { 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]]]] } },
37760     { type: "Feature", properties: { iso1A2: "DK", iso1A3: "DNK", iso1N3: "208", wikidata: "Q756617", nameEn: "Kingdom of Denmark" }, geometry: null },
37761     { 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]]]] } },
37762     { 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]]]] } },
37763     { 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]]]] } },
37764     { type: "Feature", properties: { iso1A2: "EA", wikidata: "Q28868874", nameEn: "Ceuta, Melilla", country: "ES", level: "territory", isoStatus: "excRes" }, geometry: null },
37765     { type: "Feature", properties: { iso1A2: "EC", iso1A3: "ECU", iso1N3: "218", wikidata: "Q736", nameEn: "Ecuador" }, geometry: null },
37766     { 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]]]] } },
37767     { 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]]]] } },
37768     { 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]]]] } },
37769     { 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]]]] } },
37770     { type: "Feature", properties: { iso1A2: "ES", iso1A3: "ESP", iso1N3: "724", wikidata: "Q29", nameEn: "Spain" }, geometry: null },
37771     { 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]]]] } },
37772     { type: "Feature", properties: { iso1A2: "EU", iso1A3: "EUE", wikidata: "Q458", nameEn: "European Union", level: "union", isoStatus: "excRes" }, geometry: null },
37773     { type: "Feature", properties: { iso1A2: "FI", iso1A3: "FIN", iso1N3: "246", wikidata: "Q33", nameEn: "Finland", aliases: ["SF"] }, geometry: null },
37774     { 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]]]] } },
37775     { 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]]]] } },
37776     { 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]]]] } },
37777     { 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]]]] } },
37778     { type: "Feature", properties: { iso1A2: "FR", iso1A3: "FRA", iso1N3: "250", wikidata: "Q142", nameEn: "France" }, geometry: null },
37779     { 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]]]] } },
37780     { 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]]]] } },
37781     { type: "Feature", properties: { iso1A2: "GB", iso1A3: "GBR", iso1N3: "826", wikidata: "Q145", ccTLD: ".uk", nameEn: "United Kingdom", aliases: ["UK"] }, geometry: null },
37782     { 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]]]] } },
37783     { 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]]]] } },
37784     { 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]]]] } },
37785     { type: "Feature", properties: { iso1A2: "GG", iso1A3: "GGY", iso1N3: "831", wikidata: "Q25230", nameEn: "Bailiwick of Guernsey", country: "GB" }, geometry: null },
37786     { 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]]]] } },
37787     { 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]]]] } },
37788     { 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]]]] } },
37789     { 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]]]] } },
37790     { 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]]]] } },
37791     { 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]]]] } },
37792     { 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]]]] } },
37793     { 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]]]] } },
37794     { 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]]]] } },
37795     { 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]]]] } },
37796     { 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]]]] } },
37797     { 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]]]] } },
37798     { 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]]]] } },
37799     { 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]]]] } },
37800     { 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]]]] } },
37801     { 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]]]] } },
37802     { 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]]]] } },
37803     { 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]]]] } },
37804     { 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]]]] } },
37805     { 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]]]] } },
37806     { type: "Feature", properties: { iso1A2: "ID", iso1A3: "IDN", iso1N3: "360", wikidata: "Q252", nameEn: "Indonesia", aliases: ["RI"] }, geometry: null },
37807     { 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]]]] } },
37808     { 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]]]] } },
37809     { 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]]]] } },
37810     { type: "Feature", properties: { iso1A2: "IN", iso1A3: "IND", iso1N3: "356", wikidata: "Q668", nameEn: "India" }, geometry: null },
37811     { type: "Feature", properties: { iso1A2: "IO", iso1A3: "IOT", iso1N3: "086", wikidata: "Q43448", nameEn: "British Indian Ocean Territory", country: "GB" }, geometry: null },
37812     { 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]]]] } },
37813     { 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]]]] } },
37814     { 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]]]] } },
37815     { 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]]]] } },
37816     { 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]]]] } },
37817     { 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]]]] } },
37818     { 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]]]] } },
37819     { 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]]]] } },
37820     { 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]]]] } },
37821     { 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]]]] } },
37822     { 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]]]] } },
37823     { 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]]]] } },
37824     { 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]]]] } },
37825     { 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]]]] } },
37826     { 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]]]] } },
37827     { 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]]]] } },
37828     { 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]]]] } },
37829     { 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]]]] } },
37830     { 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]]]] } },
37831     { 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]]]] } },
37832     { 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]]]] } },
37833     { 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]]]] } },
37834     { 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]]]] } },
37835     { 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]]]] } },
37836     { 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]]]] } },
37837     { 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]]]] } },
37838     { 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]]]] } },
37839     { 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]]]] } },
37840     { 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]]]] } },
37841     { 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]]]] } },
37842     { 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]]]] } },
37843     { 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]]]] } },
37844     { 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]]]] } },
37845     { 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]]]] } },
37846     { 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]]]] } },
37847     { 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]]]] } },
37848     { 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]]]] } },
37849     { 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]]]] } },
37850     { 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]]]] } },
37851     { 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]]]] } },
37852     { 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]]]] } },
37853     { 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]]]] } },
37854     { 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]]]] } },
37855     { 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]]]] } },
37856     { 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]]]] } },
37857     { 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]]]] } },
37858     { 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]]]] } },
37859     { 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]]]] } },
37860     { 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]]]] } },
37861     { 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]]]] } },
37862     { 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]]]] } },
37863     { type: "Feature", properties: { iso1A2: "MY", iso1A3: "MYS", iso1N3: "458", wikidata: "Q833", nameEn: "Malaysia" }, geometry: null },
37864     { 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]]]] } },
37865     { 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]]]] } },
37866     { 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]]]] } },
37867     { 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]]]] } },
37868     { 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]]]] } },
37869     { 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]]]] } },
37870     { 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]]]] } },
37871     { type: "Feature", properties: { iso1A2: "NL", iso1A3: "NLD", iso1N3: "528", wikidata: "Q29999", nameEn: "Kingdom of the Netherlands" }, geometry: null },
37872     { type: "Feature", properties: { iso1A2: "NO", iso1A3: "NOR", iso1N3: "578", wikidata: "Q20", nameEn: "Norway" }, geometry: null },
37873     { 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]]]] } },
37874     { 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]]]] } },
37875     { 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]]]] } },
37876     { type: "Feature", properties: { iso1A2: "NZ", iso1A3: "NZL", iso1N3: "554", wikidata: "Q664", nameEn: "New Zealand" }, geometry: null },
37877     { 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]]]] } },
37878     { 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]]]] } },
37879     { 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]]]] } },
37880     { 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]]]] } },
37881     { 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]]]] } },
37882     { 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]]]] } },
37883     { 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]]]] } },
37884     { 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]]]] } },
37885     { 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]]]] } },
37886     { 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]]]] } },
37887     { 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]]]] } },
37888     { type: "Feature", properties: { iso1A2: "PS", iso1A3: "PSE", iso1N3: "275", wikidata: "Q219060", nameEn: "Palestine" }, geometry: null },
37889     { type: "Feature", properties: { iso1A2: "PT", iso1A3: "PRT", iso1N3: "620", wikidata: "Q45", nameEn: "Portugal" }, geometry: null },
37890     { 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]]]] } },
37891     { 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]]]] } },
37892     { 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]]]] } },
37893     { 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]]]] } },
37894     { 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]]]] } },
37895     { 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]]]] } },
37896     { type: "Feature", properties: { iso1A2: "RU", iso1A3: "RUS", iso1N3: "643", wikidata: "Q159", nameEn: "Russia" }, geometry: null },
37897     { 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]]]] } },
37898     { 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]]]] } },
37899     { 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]]]] } },
37900     { 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]]]] } },
37901     { 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]]]] } },
37902     { 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]]]] } },
37903     { 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]]]] } },
37904     { type: "Feature", properties: { iso1A2: "SH", iso1A3: "SHN", iso1N3: "654", wikidata: "Q192184", nameEn: "Saint Helena, Ascension and Tristan da Cunha", country: "GB" }, geometry: null },
37905     { 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]]]] } },
37906     { type: "Feature", properties: { iso1A2: "SJ", iso1A3: "SJM", iso1N3: "744", wikidata: "Q842829", nameEn: "Svalbard and Jan Mayen", country: "NO" }, geometry: null },
37907     { 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]]]] } },
37908     { 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]]]] } },
37909     { 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]]]] } },
37910     { 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]]]] } },
37911     { 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]]]] } },
37912     { 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]]]] } },
37913     { 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]]]] } },
37914     { 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]]]] } },
37915     { 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]]]] } },
37916     { 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]]]] } },
37917     { 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]]]] } },
37918     { 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]]]] } },
37919     { 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]]]] } },
37920     { 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]]]] } },
37921     { 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]]]] } },
37922     { type: "Feature", properties: { iso1A2: "TF", iso1A3: "ATF", iso1N3: "260", wikidata: "Q129003", nameEn: "French Southern Territories", country: "FR", groups: ["EU", "UN"] }, geometry: null },
37923     { 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]]]] } },
37924     { 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]]]] } },
37925     { 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]]]] } },
37926     { 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]]]] } },
37927     { 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]]]] } },
37928     { 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]]]] } },
37929     { 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]]]] } },
37930     { 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]]]] } },
37931     { 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]]]] } },
37932     { 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]]]] } },
37933     { 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]]]] } },
37934     { 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]]]] } },
37935     { 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]]]] } },
37936     { 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]]]] } },
37937     { 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]]]] } },
37938     { type: "Feature", properties: { iso1A2: "UM", iso1A3: "UMI", iso1N3: "581", wikidata: "Q16645", nameEn: "United States Minor Outlying Islands", country: "US" }, geometry: null },
37939     { type: "Feature", properties: { iso1A2: "UN", wikidata: "Q1065", nameEn: "United Nations", level: "unitedNations", isoStatus: "excRes" }, geometry: null },
37940     { type: "Feature", properties: { iso1A2: "US", iso1A3: "USA", iso1N3: "840", wikidata: "Q30", nameEn: "United States of America" }, geometry: null },
37941     { 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]]]] } },
37942     { 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]]]] } },
37943     { 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]]]] } },
37944     { 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]]]] } },
37945     { 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]]]] } },
37946     { 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]]]] } },
37947     { 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]]]] } },
37948     { 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]]]] } },
37949     { 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]]]] } },
37950     { 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]]]] } },
37951     { 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]]]] } },
37952     { 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]]]] } },
37953     { 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]]]] } },
37954     { 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]]]] } },
37955     { 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]]]] } },
37956     { 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]]]] } },
37957     { 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]]]] } }
37958   ] };
37959   var borders2 = borders_default2;
37960   var _whichPolygon2 = {};
37961   var _featuresByCode2 = {};
37962   var idFilterRegex2 = /(?=(?!^(and|the|of|el|la|de)$))(\b(and|the|of|el|la|de)\b)|[-_ .,'()&[\]/]/gi;
37963   function canonicalID2(id2) {
37964     const s2 = id2 || "";
37965     if (s2.charAt(0) === ".") {
37966       return s2.toUpperCase();
37967     } else {
37968       return s2.replace(idFilterRegex2, "").toUpperCase();
37969     }
37970   }
37971   var levels2 = [
37972     "subterritory",
37973     "territory",
37974     "subcountryGroup",
37975     "country",
37976     "sharedLandform",
37977     "intermediateRegion",
37978     "subregion",
37979     "region",
37980     "subunion",
37981     "union",
37982     "unitedNations",
37983     "world"
37984   ];
37985   loadDerivedDataAndCaches2(borders2);
37986   function loadDerivedDataAndCaches2(borders22) {
37987     const identifierProps = ["iso1A2", "iso1A3", "m49", "wikidata", "emojiFlag", "ccTLD", "nameEn"];
37988     let geometryFeatures = [];
37989     for (const feature22 of borders22.features) {
37990       const props = feature22.properties;
37991       props.id = props.iso1A2 || props.m49 || props.wikidata;
37992       loadM49(feature22);
37993       loadTLD(feature22);
37994       loadIsoStatus(feature22);
37995       loadLevel(feature22);
37996       loadGroups(feature22);
37997       loadFlag(feature22);
37998       cacheFeatureByIDs(feature22);
37999       if (feature22.geometry) {
38000         geometryFeatures.push(feature22);
38001       }
38002     }
38003     for (const feature22 of borders22.features) {
38004       feature22.properties.groups = feature22.properties.groups.map((groupID) => {
38005         return _featuresByCode2[groupID].properties.id;
38006       });
38007       loadMembersForGroupsOf(feature22);
38008     }
38009     for (const feature22 of borders22.features) {
38010       loadRoadSpeedUnit(feature22);
38011       loadRoadHeightUnit(feature22);
38012       loadDriveSide(feature22);
38013       loadCallingCodes(feature22);
38014       loadGroupGroups(feature22);
38015     }
38016     for (const feature22 of borders22.features) {
38017       feature22.properties.groups.sort((groupID1, groupID2) => {
38018         return levels2.indexOf(_featuresByCode2[groupID1].properties.level) - levels2.indexOf(_featuresByCode2[groupID2].properties.level);
38019       });
38020       if (feature22.properties.members) {
38021         feature22.properties.members.sort((id1, id2) => {
38022           const diff = levels2.indexOf(_featuresByCode2[id1].properties.level) - levels2.indexOf(_featuresByCode2[id2].properties.level);
38023           if (diff === 0) {
38024             return borders22.features.indexOf(_featuresByCode2[id1]) - borders22.features.indexOf(_featuresByCode2[id2]);
38025           }
38026           return diff;
38027         });
38028       }
38029     }
38030     const geometryOnlyCollection = {
38031       type: "FeatureCollection",
38032       features: geometryFeatures
38033     };
38034     _whichPolygon2 = (0, import_which_polygon4.default)(geometryOnlyCollection);
38035     function loadGroups(feature22) {
38036       const props = feature22.properties;
38037       if (!props.groups) {
38038         props.groups = [];
38039       }
38040       if (feature22.geometry && props.country) {
38041         props.groups.push(props.country);
38042       }
38043       if (props.m49 !== "001") {
38044         props.groups.push("001");
38045       }
38046     }
38047     function loadM49(feature22) {
38048       const props = feature22.properties;
38049       if (!props.m49 && props.iso1N3) {
38050         props.m49 = props.iso1N3;
38051       }
38052     }
38053     function loadTLD(feature22) {
38054       const props = feature22.properties;
38055       if (props.level === "unitedNations") return;
38056       if (props.ccTLD === null) return;
38057       if (!props.ccTLD && props.iso1A2) {
38058         props.ccTLD = "." + props.iso1A2.toLowerCase();
38059       }
38060     }
38061     function loadIsoStatus(feature22) {
38062       const props = feature22.properties;
38063       if (!props.isoStatus && props.iso1A2) {
38064         props.isoStatus = "official";
38065       }
38066     }
38067     function loadLevel(feature22) {
38068       const props = feature22.properties;
38069       if (props.level) return;
38070       if (!props.country) {
38071         props.level = "country";
38072       } else if (!props.iso1A2 || props.isoStatus === "official") {
38073         props.level = "territory";
38074       } else {
38075         props.level = "subterritory";
38076       }
38077     }
38078     function loadGroupGroups(feature22) {
38079       const props = feature22.properties;
38080       if (feature22.geometry || !props.members) return;
38081       const featureLevelIndex = levels2.indexOf(props.level);
38082       let sharedGroups = [];
38083       props.members.forEach((memberID, index) => {
38084         const member = _featuresByCode2[memberID];
38085         const memberGroups = member.properties.groups.filter((groupID) => {
38086           return groupID !== feature22.properties.id && featureLevelIndex < levels2.indexOf(_featuresByCode2[groupID].properties.level);
38087         });
38088         if (index === 0) {
38089           sharedGroups = memberGroups;
38090         } else {
38091           sharedGroups = sharedGroups.filter((groupID) => memberGroups.indexOf(groupID) !== -1);
38092         }
38093       });
38094       props.groups = props.groups.concat(
38095         sharedGroups.filter((groupID) => props.groups.indexOf(groupID) === -1)
38096       );
38097       for (const groupID of sharedGroups) {
38098         const groupFeature = _featuresByCode2[groupID];
38099         if (groupFeature.properties.members.indexOf(props.id) === -1) {
38100           groupFeature.properties.members.push(props.id);
38101         }
38102       }
38103     }
38104     function loadRoadSpeedUnit(feature22) {
38105       const props = feature22.properties;
38106       if (feature22.geometry) {
38107         if (!props.roadSpeedUnit) props.roadSpeedUnit = "km/h";
38108       } else if (props.members) {
38109         const vals = Array.from(
38110           new Set(
38111             props.members.map((id2) => {
38112               const member = _featuresByCode2[id2];
38113               if (member.geometry) return member.properties.roadSpeedUnit || "km/h";
38114             }).filter(Boolean)
38115           )
38116         );
38117         if (vals.length === 1) props.roadSpeedUnit = vals[0];
38118       }
38119     }
38120     function loadRoadHeightUnit(feature22) {
38121       const props = feature22.properties;
38122       if (feature22.geometry) {
38123         if (!props.roadHeightUnit) props.roadHeightUnit = "m";
38124       } else if (props.members) {
38125         const vals = Array.from(
38126           new Set(
38127             props.members.map((id2) => {
38128               const member = _featuresByCode2[id2];
38129               if (member.geometry) return member.properties.roadHeightUnit || "m";
38130             }).filter(Boolean)
38131           )
38132         );
38133         if (vals.length === 1) props.roadHeightUnit = vals[0];
38134       }
38135     }
38136     function loadDriveSide(feature22) {
38137       const props = feature22.properties;
38138       if (feature22.geometry) {
38139         if (!props.driveSide) props.driveSide = "right";
38140       } else if (props.members) {
38141         const vals = Array.from(
38142           new Set(
38143             props.members.map((id2) => {
38144               const member = _featuresByCode2[id2];
38145               if (member.geometry) return member.properties.driveSide || "right";
38146             }).filter(Boolean)
38147           )
38148         );
38149         if (vals.length === 1) props.driveSide = vals[0];
38150       }
38151     }
38152     function loadCallingCodes(feature22) {
38153       const props = feature22.properties;
38154       if (!feature22.geometry && props.members) {
38155         props.callingCodes = Array.from(
38156           new Set(
38157             props.members.reduce((array2, id2) => {
38158               const member = _featuresByCode2[id2];
38159               if (member.geometry && member.properties.callingCodes) {
38160                 return array2.concat(member.properties.callingCodes);
38161               }
38162               return array2;
38163             }, [])
38164           )
38165         );
38166       }
38167     }
38168     function loadFlag(feature22) {
38169       let flag = "";
38170       const country = feature22.properties.iso1A2;
38171       if (country && country !== "FX") {
38172         flag = _toEmojiCountryFlag(country);
38173       }
38174       const regionStrings = {
38175         Q21: "gbeng",
38176         // GB-ENG (England)
38177         Q22: "gbsct",
38178         // GB-SCT (Scotland)
38179         Q25: "gbwls"
38180         // GB-WLS (Wales)
38181       };
38182       const region = regionStrings[feature22.properties.wikidata];
38183       if (region) {
38184         flag = _toEmojiRegionFlag(region);
38185       }
38186       if (flag) {
38187         feature22.properties.emojiFlag = flag;
38188       }
38189       function _toEmojiCountryFlag(s2) {
38190         return s2.replace(/./g, (c2) => String.fromCodePoint(c2.charCodeAt(0) + 127397));
38191       }
38192       function _toEmojiRegionFlag(s2) {
38193         const codepoints = [127988];
38194         for (const c2 of [...s2]) {
38195           codepoints.push(c2.codePointAt(0) + 917504);
38196         }
38197         codepoints.push(917631);
38198         return String.fromCodePoint.apply(null, codepoints);
38199       }
38200     }
38201     function loadMembersForGroupsOf(feature22) {
38202       for (const groupID of feature22.properties.groups) {
38203         const groupFeature = _featuresByCode2[groupID];
38204         if (!groupFeature.properties.members) {
38205           groupFeature.properties.members = [];
38206         }
38207         groupFeature.properties.members.push(feature22.properties.id);
38208       }
38209     }
38210     function cacheFeatureByIDs(feature22) {
38211       let ids = [];
38212       for (const prop of identifierProps) {
38213         const id2 = feature22.properties[prop];
38214         if (id2) {
38215           ids.push(id2);
38216         }
38217       }
38218       for (const alias of feature22.properties.aliases || []) {
38219         ids.push(alias);
38220       }
38221       for (const id2 of ids) {
38222         const cid = canonicalID2(id2);
38223         _featuresByCode2[cid] = feature22;
38224       }
38225     }
38226   }
38227   function locArray2(loc) {
38228     if (Array.isArray(loc)) {
38229       return loc;
38230     } else if (loc.coordinates) {
38231       return loc.coordinates;
38232     }
38233     return loc.geometry.coordinates;
38234   }
38235   function smallestFeature2(loc) {
38236     const query = locArray2(loc);
38237     const featureProperties = _whichPolygon2(query);
38238     if (!featureProperties) return null;
38239     return _featuresByCode2[featureProperties.id];
38240   }
38241   function countryFeature2(loc) {
38242     const feature22 = smallestFeature2(loc);
38243     if (!feature22) return null;
38244     const countryCode = feature22.properties.country || feature22.properties.iso1A2;
38245     return _featuresByCode2[countryCode] || null;
38246   }
38247   var defaultOpts2 = {
38248     level: void 0,
38249     maxLevel: void 0,
38250     withProp: void 0
38251   };
38252   function featureForLoc2(loc, opts) {
38253     const targetLevel = opts.level || "country";
38254     const maxLevel = opts.maxLevel || "world";
38255     const withProp = opts.withProp;
38256     const targetLevelIndex = levels2.indexOf(targetLevel);
38257     if (targetLevelIndex === -1) return null;
38258     const maxLevelIndex = levels2.indexOf(maxLevel);
38259     if (maxLevelIndex === -1) return null;
38260     if (maxLevelIndex < targetLevelIndex) return null;
38261     if (targetLevel === "country") {
38262       const fastFeature = countryFeature2(loc);
38263       if (fastFeature) {
38264         if (!withProp || fastFeature.properties[withProp]) {
38265           return fastFeature;
38266         }
38267       }
38268     }
38269     const features = featuresContaining2(loc);
38270     const match = features.find((feature22) => {
38271       let levelIndex = levels2.indexOf(feature22.properties.level);
38272       if (feature22.properties.level === targetLevel || // if no feature exists at the target level, return the first feature at the next level up
38273       levelIndex > targetLevelIndex && levelIndex <= maxLevelIndex) {
38274         if (!withProp || feature22.properties[withProp]) {
38275           return feature22;
38276         }
38277       }
38278       return false;
38279     });
38280     return match || null;
38281   }
38282   function featureForID2(id2) {
38283     let stringID;
38284     if (typeof id2 === "number") {
38285       stringID = id2.toString();
38286       if (stringID.length === 1) {
38287         stringID = "00" + stringID;
38288       } else if (stringID.length === 2) {
38289         stringID = "0" + stringID;
38290       }
38291     } else {
38292       stringID = canonicalID2(id2);
38293     }
38294     return _featuresByCode2[stringID] || null;
38295   }
38296   function smallestFeaturesForBbox2(bbox2) {
38297     return _whichPolygon2.bbox(bbox2).map((props) => _featuresByCode2[props.id]);
38298   }
38299   function smallestOrMatchingFeature2(query) {
38300     if (typeof query === "object") {
38301       return smallestFeature2(query);
38302     }
38303     return featureForID2(query);
38304   }
38305   function feature2(query, opts = defaultOpts2) {
38306     if (typeof query === "object") {
38307       return featureForLoc2(query, opts);
38308     }
38309     return featureForID2(query);
38310   }
38311   function iso1A2Code(query, opts = defaultOpts2) {
38312     opts.withProp = "iso1A2";
38313     const match = feature2(query, opts);
38314     if (!match) return null;
38315     return match.properties.iso1A2 || null;
38316   }
38317   function propertiesForQuery(query, property) {
38318     const features = featuresContaining2(query, false);
38319     return features.map((feature22) => feature22.properties[property]).filter(Boolean);
38320   }
38321   function iso1A2Codes(query) {
38322     return propertiesForQuery(query, "iso1A2");
38323   }
38324   function featuresContaining2(query, strict) {
38325     let matchingFeatures;
38326     if (Array.isArray(query) && query.length === 4) {
38327       matchingFeatures = smallestFeaturesForBbox2(query);
38328     } else {
38329       const smallestOrMatching = smallestOrMatchingFeature2(query);
38330       matchingFeatures = smallestOrMatching ? [smallestOrMatching] : [];
38331     }
38332     if (!matchingFeatures.length) return [];
38333     let returnFeatures;
38334     if (!strict || typeof query === "object") {
38335       returnFeatures = matchingFeatures.slice();
38336     } else {
38337       returnFeatures = [];
38338     }
38339     for (const feature22 of matchingFeatures) {
38340       const properties = feature22.properties;
38341       for (const groupID of properties.groups) {
38342         const groupFeature = _featuresByCode2[groupID];
38343         if (returnFeatures.indexOf(groupFeature) === -1) {
38344           returnFeatures.push(groupFeature);
38345         }
38346       }
38347     }
38348     return returnFeatures;
38349   }
38350   function roadSpeedUnit(query) {
38351     const feature22 = smallestOrMatchingFeature2(query);
38352     return feature22 && feature22.properties.roadSpeedUnit || null;
38353   }
38354   function roadHeightUnit(query) {
38355     const feature22 = smallestOrMatchingFeature2(query);
38356     return feature22 && feature22.properties.roadHeightUnit || null;
38357   }
38358
38359   // modules/services/pannellum_photo.js
38360   var pannellumViewerCSS = "pannellum/pannellum.css";
38361   var pannellumViewerJS = "pannellum/pannellum.js";
38362   async function pannellumPhotoFrame(context, selection2) {
38363     const dispatch12 = dispatch_default("viewerChanged");
38364     const module2 = {};
38365     module2.event = utilRebind(module2, dispatch12, "on");
38366     module2.loadPannellum = function(context2) {
38367       const head = select_default2("head");
38368       return Promise.all([
38369         new Promise((resolve, reject) => {
38370           head.selectAll("#ideditor-pannellum-viewercss").data([0]).enter().append("link").attr("id", "ideditor-pannellum-viewercss").attr("rel", "stylesheet").attr("crossorigin", "anonymous").attr("href", context2.asset(pannellumViewerCSS)).on("load.pannellum", resolve).on("error.pannellum", reject);
38371         }),
38372         new Promise((resolve, reject) => {
38373           head.selectAll("#ideditor-pannellum-viewerjs").data([0]).enter().append("script").attr("id", "ideditor-pannellum-viewerjs").attr("crossorigin", "anonymous").attr("src", context2.asset(pannellumViewerJS)).on("load.pannellum", resolve).on("error.pannellum", reject);
38374         })
38375       ]);
38376     };
38377     let _currScenes = [];
38378     let _pannellumViewer3;
38379     let _activeSceneKey;
38380     selection2.append("div").attr("class", "photo-frame pannellum-frame").attr("id", "ideditor-pannellum-viewer").classed("hide", true).on("mousedown", function(e3) {
38381       e3.stopPropagation();
38382     });
38383     if (!window.pannellum) {
38384       await module2.loadPannellum(context);
38385     }
38386     const options = {
38387       "default": { firstScene: "" },
38388       scenes: {},
38389       minHfov: 20,
38390       disableKeyboardCtrl: true,
38391       sceneFadeDuration: 0
38392     };
38393     _pannellumViewer3 = window.pannellum.viewer("ideditor-pannellum-viewer", options);
38394     _pannellumViewer3.on("mousedown", () => select_default2(window).on("pointermove.pannellum mousemove.pannellum", () => dispatch12.call("viewerChanged"))).on("mouseup", () => select_default2(window).on("pointermove.pannellum mousemove.pannellum", null)).on("animatefinished", () => dispatch12.call("viewerChanged"));
38395     context.ui().photoviewer.on("resize.pannellum", () => {
38396       _pannellumViewer3.resize();
38397     });
38398     module2.showPhotoFrame = function(context2) {
38399       const isHidden = context2.selectAll(".photo-frame.pannellum-frame.hide").size();
38400       if (isHidden) {
38401         context2.selectAll(".photo-frame:not(.pannellum-frame)").classed("hide", true);
38402         context2.selectAll(".photo-frame.pannellum-frame").classed("hide", false);
38403       }
38404       return module2;
38405     };
38406     module2.hidePhotoFrame = function(viewerContext) {
38407       viewerContext.select("photo-frame.pannellum-frame").classed("hide", false);
38408       return module2;
38409     };
38410     module2.selectPhoto = function(data, keepOrientation) {
38411       const key = _activeSceneKey = data.image_path;
38412       if (!_currScenes.includes(key)) {
38413         let newSceneOptions = {
38414           showFullscreenCtrl: false,
38415           autoLoad: false,
38416           compass: false,
38417           yaw: 0,
38418           type: "equirectangular",
38419           preview: data.preview_path,
38420           panorama: data.image_path,
38421           northOffset: data.ca
38422         };
38423         _currScenes.push(key);
38424         _pannellumViewer3.addScene(key, newSceneOptions);
38425       }
38426       let yaw = 0;
38427       let pitch = 0;
38428       let hfov = 0;
38429       if (keepOrientation) {
38430         yaw = module2.getYaw();
38431         pitch = module2.getPitch();
38432         hfov = module2.getHfov();
38433       }
38434       if (_pannellumViewer3.isLoaded() !== false) {
38435         _pannellumViewer3.loadScene(key, pitch, yaw, hfov);
38436         dispatch12.call("viewerChanged");
38437       } else {
38438         const retry = setInterval(() => {
38439           if (_pannellumViewer3.isLoaded() === false) {
38440             return;
38441           }
38442           if (_activeSceneKey === key) {
38443             _pannellumViewer3.loadScene(key, pitch, yaw, hfov);
38444             dispatch12.call("viewerChanged");
38445           }
38446           clearInterval(retry);
38447         }, 100);
38448       }
38449       if (_currScenes.length > 3) {
38450         const old_key = _currScenes.shift();
38451         _pannellumViewer3.removeScene(old_key);
38452       }
38453       _pannellumViewer3.resize();
38454       return module2;
38455     };
38456     module2.getYaw = function() {
38457       return _pannellumViewer3.getYaw();
38458     };
38459     module2.getPitch = function() {
38460       return _pannellumViewer3.getPitch();
38461     };
38462     module2.getHfov = function() {
38463       return _pannellumViewer3.getHfov();
38464     };
38465     return module2;
38466   }
38467
38468   // modules/services/plane_photo.js
38469   async function planePhotoFrame(context, selection2) {
38470     const dispatch12 = dispatch_default("viewerChanged");
38471     const module2 = {};
38472     module2.event = utilRebind(module2, dispatch12, "on");
38473     let _photo;
38474     let _imageWrapper;
38475     let _planeWrapper;
38476     let _viewerDimensions = [];
38477     let _photoDimensions = [];
38478     const _imgZoom = zoom_default2().on("zoom", zoomPan).on("start", () => _imageWrapper.classed("grabbing", true)).on("end", () => _imageWrapper.classed("grabbing", false));
38479     function zoomPan(d3_event) {
38480       let t2 = d3_event.transform;
38481       _imageWrapper.call(utilSetTransform, t2.x, t2.y, t2.k);
38482     }
38483     function loadImage2(selection3, path) {
38484       return new Promise((resolve) => {
38485         selection3.attr("src", path);
38486         selection3.on("load", () => {
38487           resolve(selection3);
38488         });
38489       });
38490     }
38491     function updateTransform() {
38492       const xScale = _viewerDimensions[0] / _photoDimensions[0];
38493       const yScale = _viewerDimensions[1] / _photoDimensions[1];
38494       const fitScale = Math.max(xScale, yScale);
38495       const minScale = Math.min(xScale, yScale);
38496       _imgZoom.extent([[0, 0], _viewerDimensions]).translateExtent([[0, 0], _photoDimensions]).scaleExtent([minScale, 4]);
38497       const centerOffset = [0, 0];
38498       if (xScale < yScale) {
38499         centerOffset[0] = (_viewerDimensions[0] / fitScale - _photoDimensions[0]) / 2;
38500       } else {
38501         centerOffset[1] = (_viewerDimensions[1] / fitScale - _photoDimensions[1]) / 2;
38502       }
38503       const transform2 = identity3.scale(fitScale).translate(centerOffset[0], centerOffset[1]);
38504       _planeWrapper.call(_imgZoom.transform, transform2);
38505     }
38506     _planeWrapper = selection2;
38507     _planeWrapper.call(_imgZoom);
38508     _imageWrapper = _planeWrapper.append("div").attr("class", "photo-frame plane-frame").classed("hide", true);
38509     _photo = _imageWrapper.append("img").attr("class", "plane-photo");
38510     context.ui().photoviewer.on("resize.plane", function(dimensions) {
38511       _viewerDimensions = dimensions;
38512       updateTransform();
38513     });
38514     await Promise.resolve();
38515     module2.showPhotoFrame = function(selection3) {
38516       const isHidden = selection3.selectAll(".photo-frame.plane-frame.hide").size();
38517       if (isHidden) {
38518         selection3.selectAll(".photo-frame:not(.plane-frame)").classed("hide", true);
38519         selection3.selectAll(".photo-frame.plane-frame").classed("hide", false);
38520       }
38521       _viewerDimensions = context.ui().photoviewer.viewerSize();
38522       updateTransform();
38523       return module2;
38524     };
38525     module2.hidePhotoFrame = function(context2) {
38526       context2.select("photo-frame.plane-frame").classed("hide", false);
38527       return module2;
38528     };
38529     module2.selectPhoto = function(data) {
38530       dispatch12.call("viewerChanged");
38531       loadImage2(_photo, "");
38532       _planeWrapper.classed("show-loader", true);
38533       loadImage2(_photo, data.image_path).then((selection3) => {
38534         _planeWrapper.classed("show-loader", false);
38535         const { naturalWidth, naturalHeight } = selection3.node();
38536         _photoDimensions = [naturalWidth, naturalHeight];
38537         updateTransform();
38538       });
38539       return module2;
38540     };
38541     module2.getYaw = function() {
38542       return 0;
38543     };
38544     return module2;
38545   }
38546
38547   // modules/services/vegbilder.js
38548   var owsEndpoint = "https://www.vegvesen.no/kart/ogc/vegbilder_1_0/ows?";
38549   var tileZoom2 = 14;
38550   var tiler4 = utilTiler().zoomExtent([tileZoom2, tileZoom2]).skipNullIsland(true);
38551   var dispatch6 = dispatch_default("loadedImages", "viewerChanged");
38552   var directionEnum = Object.freeze({
38553     forward: Symbol(0),
38554     backward: Symbol(1)
38555   });
38556   var _planeFrame;
38557   var _pannellumFrame;
38558   var _currentFrame;
38559   var _loadViewerPromise3;
38560   var _vegbilderCache;
38561   async function fetchAvailableLayers() {
38562     var _a5, _b3, _c2;
38563     const params = {
38564       service: "WFS",
38565       request: "GetCapabilities",
38566       version: "2.0.0"
38567     };
38568     const urlForRequest = owsEndpoint + utilQsString(params);
38569     const response = await xml_default(urlForRequest);
38570     const regexMatcher = new RegExp("^vegbilder_1_0:Vegbilder(?<image_type>_360)?_(?<year>\\d{4})$");
38571     const availableLayers = [];
38572     for (const node of response.querySelectorAll("FeatureType > Name")) {
38573       const match = (_a5 = node.textContent) == null ? void 0 : _a5.match(regexMatcher);
38574       if (match) {
38575         availableLayers.push({
38576           name: match[0],
38577           is_sphere: !!((_b3 = match.groups) == null ? void 0 : _b3.image_type),
38578           year: parseInt((_c2 = match.groups) == null ? void 0 : _c2.year, 10)
38579         });
38580       }
38581     }
38582     return availableLayers;
38583   }
38584   function filterAvailableLayers(photoContex) {
38585     const fromDateString = photoContex.fromDate();
38586     const toDateString = photoContex.toDate();
38587     const fromYear = fromDateString ? new Date(fromDateString).getFullYear() : 2016;
38588     const toYear = toDateString ? new Date(toDateString).getFullYear() : null;
38589     const showsFlat = photoContex.showsFlat();
38590     const showsPano = photoContex.showsPanoramic();
38591     return Array.from(_vegbilderCache.wfslayers.values()).filter(({ layerInfo }) => layerInfo.year >= fromYear && (!toYear || layerInfo.year <= toYear) && (!layerInfo.is_sphere && showsFlat || layerInfo.is_sphere && showsPano));
38592   }
38593   function loadWFSLayers(projection2, margin, wfslayers) {
38594     const tiles = tiler4.margin(margin).getTiles(projection2);
38595     for (const cache of wfslayers) {
38596       loadWFSLayer(projection2, cache, tiles);
38597     }
38598   }
38599   function loadWFSLayer(projection2, cache, tiles) {
38600     for (const [key, controller] of cache.inflight.entries()) {
38601       const wanted = tiles.some((tile) => key === tile.id);
38602       if (!wanted) {
38603         controller.abort();
38604         cache.inflight.delete(key);
38605       }
38606     }
38607     Promise.all(tiles.map(
38608       (tile) => loadTile2(cache, cache.layerInfo.name, tile)
38609     )).then(() => orderSequences(projection2, cache));
38610   }
38611   async function loadTile2(cache, typename, tile) {
38612     const bbox2 = tile.extent.bbox();
38613     const tileid = tile.id;
38614     if (cache.loaded.get(tileid) === true || cache.inflight.has(tileid)) return;
38615     const params = {
38616       service: "WFS",
38617       request: "GetFeature",
38618       version: "2.0.0",
38619       typenames: typename,
38620       bbox: [bbox2.minY, bbox2.minX, bbox2.maxY, bbox2.maxX].join(","),
38621       outputFormat: "json"
38622     };
38623     const controller = new AbortController();
38624     cache.inflight.set(tileid, controller);
38625     const options = {
38626       method: "GET",
38627       signal: controller.signal
38628     };
38629     const urlForRequest = owsEndpoint + utilQsString(params);
38630     let featureCollection;
38631     try {
38632       featureCollection = await json_default(urlForRequest, options);
38633     } catch (e3) {
38634       cache.loaded.set(tileid, false);
38635       return;
38636     } finally {
38637       cache.inflight.delete(tileid);
38638     }
38639     cache.loaded.set(tileid, true);
38640     if (featureCollection.features.length === 0) {
38641       return;
38642     }
38643     const features = featureCollection.features.map((feature4) => {
38644       const loc = feature4.geometry.coordinates;
38645       const key = feature4.id;
38646       const properties = feature4.properties;
38647       const {
38648         RETNING: ca,
38649         TIDSPUNKT: captured_at,
38650         URL: image_path,
38651         URLPREVIEW: preview_path,
38652         BILDETYPE: image_type,
38653         METER: metering,
38654         FELTKODE: lane_code
38655       } = properties;
38656       const lane_number = parseInt(lane_code.match(/^[0-9]+/)[0], 10);
38657       const direction = lane_number % 2 === 0 ? directionEnum.backward : directionEnum.forward;
38658       const data = {
38659         service: "photo",
38660         loc,
38661         key,
38662         ca,
38663         image_path,
38664         preview_path,
38665         road_reference: roadReference(properties),
38666         metering,
38667         lane_code,
38668         direction,
38669         captured_at: new Date(captured_at),
38670         is_sphere: image_type === "360"
38671       };
38672       cache.points.set(key, data);
38673       return {
38674         minX: loc[0],
38675         minY: loc[1],
38676         maxX: loc[0],
38677         maxY: loc[1],
38678         data
38679       };
38680     });
38681     _vegbilderCache.rtree.load(features);
38682     dispatch6.call("loadedImages");
38683   }
38684   function orderSequences(projection2, cache) {
38685     const { points } = cache;
38686     const grouped = Array.from(points.values()).reduce((grouped2, image) => {
38687       const key = image.road_reference;
38688       if (grouped2.has(key)) {
38689         grouped2.get(key).push(image);
38690       } else {
38691         grouped2.set(key, [image]);
38692       }
38693       return grouped2;
38694     }, /* @__PURE__ */ new Map());
38695     const imageSequences = Array.from(grouped.values()).reduce((imageSequences2, imageGroup) => {
38696       imageGroup.sort((a2, b3) => {
38697         if (a2.captured_at.valueOf() > b3.captured_at.valueOf()) {
38698           return 1;
38699         } else if (a2.captured_at.valueOf() < b3.captured_at.valueOf()) {
38700           return -1;
38701         } else {
38702           const { direction } = a2;
38703           if (direction === directionEnum.forward) {
38704             return a2.metering - b3.metering;
38705           } else {
38706             return b3.metering - a2.metering;
38707           }
38708         }
38709       });
38710       let imageSequence = [imageGroup[0]];
38711       let angle2 = null;
38712       for (const [lastImage, image] of pairs(imageGroup)) {
38713         if (lastImage.ca === null) {
38714           const b3 = projection2(lastImage.loc);
38715           const a2 = projection2(image.loc);
38716           if (!geoVecEqual(a2, b3)) {
38717             angle2 = geoVecAngle(a2, b3);
38718             angle2 *= 180 / Math.PI;
38719             angle2 -= 90;
38720             angle2 = angle2 >= 0 ? angle2 : angle2 + 360;
38721           }
38722           lastImage.ca = angle2;
38723         }
38724         if (image.direction === lastImage.direction && image.captured_at.valueOf() - lastImage.captured_at.valueOf() <= 2e4) {
38725           imageSequence.push(image);
38726         } else {
38727           imageSequences2.push(imageSequence);
38728           imageSequence = [image];
38729         }
38730       }
38731       imageSequences2.push(imageSequence);
38732       return imageSequences2;
38733     }, []);
38734     cache.sequences = imageSequences.map((images) => {
38735       const sequence = {
38736         images,
38737         key: images[0].key,
38738         geometry: {
38739           type: "LineString",
38740           coordinates: images.map((image) => image.loc)
38741         }
38742       };
38743       for (const image of images) {
38744         _vegbilderCache.image2sequence_map.set(image.key, sequence);
38745       }
38746       return sequence;
38747     });
38748   }
38749   function roadReference(properties) {
38750     const {
38751       FYLKENUMMER: county_number,
38752       VEGKATEGORI: road_class,
38753       VEGSTATUS: road_status,
38754       VEGNUMMER: road_number,
38755       STREKNING: section,
38756       DELSTREKNING: subsection,
38757       HP: parcel,
38758       KRYSSDEL: junction_part,
38759       SIDEANLEGGSDEL: services_part,
38760       ANKERPUNKT: anker_point,
38761       AAR: year
38762     } = properties;
38763     let reference;
38764     if (year >= 2020) {
38765       reference = "".concat(road_class).concat(road_status).concat(road_number, " S").concat(section, "D").concat(subsection);
38766       if (junction_part) {
38767         reference = "".concat(reference, " M").concat(anker_point, " KD").concat(junction_part);
38768       } else if (services_part) {
38769         reference = "".concat(reference, " M").concat(anker_point, " SD").concat(services_part);
38770       }
38771     } else {
38772       reference = "".concat(county_number).concat(road_class).concat(road_status).concat(road_number, " HP").concat(parcel);
38773     }
38774     return reference;
38775   }
38776   function localeTimestamp(date) {
38777     const options = {
38778       day: "2-digit",
38779       month: "2-digit",
38780       year: "numeric",
38781       hour: "numeric",
38782       minute: "numeric",
38783       second: "numeric"
38784     };
38785     return date.toLocaleString(_mainLocalizer.localeCode(), options);
38786   }
38787   function partitionViewport3(projection2) {
38788     const zoom = geoScaleToZoom(projection2.scale());
38789     const roundZoom = Math.ceil(zoom * 2) / 2 + 2.5;
38790     const tiler8 = utilTiler().zoomExtent([roundZoom, roundZoom]);
38791     return tiler8.getTiles(projection2).map((tile) => tile.extent);
38792   }
38793   function searchLimited3(limit, projection2, rtree) {
38794     limit != null ? limit : limit = 5;
38795     return partitionViewport3(projection2).reduce((result, extent) => {
38796       const found = rtree.search(extent.bbox()).slice(0, limit).map((d2) => d2.data);
38797       return result.concat(found);
38798     }, []);
38799   }
38800   var vegbilder_default = {
38801     init: function() {
38802       this.event = utilRebind(this, dispatch6, "on");
38803     },
38804     reset: async function() {
38805       if (_vegbilderCache) {
38806         for (const layer of _vegbilderCache.wfslayers.values()) {
38807           for (const controller of layer.inflight.values()) {
38808             controller.abort();
38809           }
38810         }
38811       }
38812       _vegbilderCache = {
38813         wfslayers: /* @__PURE__ */ new Map(),
38814         rtree: new RBush(),
38815         image2sequence_map: /* @__PURE__ */ new Map()
38816       };
38817       const availableLayers = await fetchAvailableLayers();
38818       const { wfslayers } = _vegbilderCache;
38819       for (const layerInfo of availableLayers) {
38820         const cache = {
38821           layerInfo,
38822           loaded: /* @__PURE__ */ new Map(),
38823           inflight: /* @__PURE__ */ new Map(),
38824           points: /* @__PURE__ */ new Map(),
38825           sequences: []
38826         };
38827         wfslayers.set(layerInfo.name, cache);
38828       }
38829     },
38830     images: function(projection2) {
38831       const limit = 5;
38832       return searchLimited3(limit, projection2, _vegbilderCache.rtree);
38833     },
38834     sequences: function(projection2) {
38835       const viewport = projection2.clipExtent();
38836       const min3 = [viewport[0][0], viewport[1][1]];
38837       const max3 = [viewport[1][0], viewport[0][1]];
38838       const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
38839       const seen = /* @__PURE__ */ new Set();
38840       const line_strings = [];
38841       for (const { data } of _vegbilderCache.rtree.search(bbox2)) {
38842         const sequence = _vegbilderCache.image2sequence_map.get(data.key);
38843         if (!sequence) continue;
38844         const { key, geometry, images } = sequence;
38845         if (seen.has(key)) continue;
38846         seen.add(key);
38847         const line = {
38848           type: "LineString",
38849           coordinates: geometry.coordinates,
38850           key,
38851           images
38852         };
38853         line_strings.push(line);
38854       }
38855       return line_strings;
38856     },
38857     cachedImage: function(key) {
38858       for (const { points } of _vegbilderCache.wfslayers.values()) {
38859         if (points.has(key)) return points.get(key);
38860       }
38861     },
38862     getSequenceForImage: function(image) {
38863       return _vegbilderCache == null ? void 0 : _vegbilderCache.image2sequence_map.get(image == null ? void 0 : image.key);
38864     },
38865     loadImages: async function(context, margin) {
38866       if (!_vegbilderCache) {
38867         await this.reset();
38868       }
38869       margin != null ? margin : margin = 1;
38870       const wfslayers = filterAvailableLayers(context.photos());
38871       loadWFSLayers(context.projection, margin, wfslayers);
38872     },
38873     photoFrame: function() {
38874       return _currentFrame;
38875     },
38876     ensureViewerLoaded: function(context) {
38877       if (_loadViewerPromise3) return _loadViewerPromise3;
38878       const step = (stepBy) => () => {
38879         const viewer = context.container().select(".photoviewer");
38880         const selected = viewer.empty() ? void 0 : viewer.datum();
38881         if (!selected) return;
38882         const sequence = this.getSequenceForImage(selected);
38883         const nextIndex = sequence.images.indexOf(selected) + stepBy;
38884         const nextImage = sequence.images[nextIndex];
38885         if (!nextImage) return;
38886         context.map().centerEase(nextImage.loc);
38887         this.selectImage(context, nextImage.key, true);
38888       };
38889       const wrap2 = context.container().select(".photoviewer").selectAll(".vegbilder-wrapper").data([0]);
38890       const wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper vegbilder-wrapper").classed("hide", true);
38891       wrapEnter.append("div").attr("class", "photo-attribution fillD");
38892       const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
38893       controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
38894       controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
38895       _loadViewerPromise3 = Promise.all([
38896         pannellumPhotoFrame(context, wrapEnter),
38897         planePhotoFrame(context, wrapEnter)
38898       ]).then(([pannellumPhotoFrame2, planePhotoFrame2]) => {
38899         _pannellumFrame = pannellumPhotoFrame2;
38900         _pannellumFrame.event.on("viewerChanged", () => dispatch6.call("viewerChanged"));
38901         _planeFrame = planePhotoFrame2;
38902         _planeFrame.event.on("viewerChanged", () => dispatch6.call("viewerChanged"));
38903       });
38904       return _loadViewerPromise3;
38905     },
38906     selectImage: function(context, key, keepOrientation) {
38907       const d2 = this.cachedImage(key);
38908       this.updateUrlImage(key);
38909       const viewer = context.container().select(".photoviewer");
38910       if (!viewer.empty()) {
38911         viewer.datum(d2);
38912       }
38913       this.setStyles(context, null, true);
38914       if (!d2) return this;
38915       const wrap2 = context.container().select(".photoviewer .vegbilder-wrapper");
38916       const attribution = wrap2.selectAll(".photo-attribution").text("");
38917       if (d2.captured_at) {
38918         attribution.append("span").attr("class", "captured_at").text(localeTimestamp(d2.captured_at));
38919       }
38920       attribution.append("a").attr("target", "_blank").attr("href", "https://vegvesen.no").call(_t.append("vegbilder.publisher"));
38921       attribution.append("a").attr("target", "_blank").attr("href", "https://vegbilder.atlas.vegvesen.no/?year=".concat(d2.captured_at.getFullYear(), "&lat=").concat(d2.loc[1], "&lng=").concat(d2.loc[0], "&view=image&imageId=").concat(d2.key)).call(_t.append("vegbilder.view_on"));
38922       _currentFrame = d2.is_sphere ? _pannellumFrame : _planeFrame;
38923       _currentFrame.showPhotoFrame(wrap2).selectPhoto(d2, keepOrientation);
38924       return this;
38925     },
38926     showViewer: function(context) {
38927       const viewer = context.container().select(".photoviewer");
38928       const isHidden = viewer.selectAll(".photo-wrapper.vegbilder-wrapper.hide").size();
38929       if (isHidden) {
38930         for (const service of Object.values(services)) {
38931           if (service === this) continue;
38932           if (typeof service.hideViewer === "function") {
38933             service.hideViewer(context);
38934           }
38935         }
38936         viewer.classed("hide", false).selectAll(".photo-wrapper.vegbilder-wrapper").classed("hide", false);
38937       }
38938       return this;
38939     },
38940     hideViewer: function(context) {
38941       this.updateUrlImage(null);
38942       const viewer = context.container().select(".photoviewer");
38943       if (!viewer.empty()) viewer.datum(null);
38944       viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
38945       context.container().selectAll(".viewfield-group, .sequence").classed("currentView", false);
38946       return this.setStyles(context, null, true);
38947     },
38948     // Updates the currently highlighted sequence and selected bubble.
38949     // Reset is only necessary when interacting with the viewport because
38950     // this implicitly changes the currently selected bubble/sequence
38951     setStyles: function(context, hovered, reset) {
38952       var _a5, _b3;
38953       if (reset) {
38954         context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
38955         context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
38956       }
38957       const hoveredImageKey = hovered == null ? void 0 : hovered.key;
38958       const hoveredSequence = this.getSequenceForImage(hovered);
38959       const hoveredSequenceKey = hoveredSequence == null ? void 0 : hoveredSequence.key;
38960       const hoveredImageKeys = (_a5 = hoveredSequence == null ? void 0 : hoveredSequence.images.map((d2) => d2.key)) != null ? _a5 : [];
38961       const viewer = context.container().select(".photoviewer");
38962       const selected = viewer.empty() ? void 0 : viewer.datum();
38963       const selectedImageKey = selected == null ? void 0 : selected.key;
38964       const selectedSequence = this.getSequenceForImage(selected);
38965       const selectedSequenceKey = selectedSequence == null ? void 0 : selectedSequence.key;
38966       const selectedImageKeys = (_b3 = selectedSequence == null ? void 0 : selectedSequence.images.map((d2) => d2.key)) != null ? _b3 : [];
38967       const highlightedImageKeys = utilArrayUnion(hoveredImageKeys, selectedImageKeys);
38968       context.container().selectAll(".layer-vegbilder .viewfield-group").classed("highlighted", (d2) => highlightedImageKeys.indexOf(d2.key) !== -1).classed("hovered", (d2) => d2.key === hoveredImageKey).classed("currentView", (d2) => d2.key === selectedImageKey);
38969       context.container().selectAll(".layer-vegbilder .sequence").classed("highlighted", (d2) => d2.key === hoveredSequenceKey).classed("currentView", (d2) => d2.key === selectedSequenceKey);
38970       context.container().selectAll(".layer-vegbilder .viewfield-group .viewfield").attr("d", viewfieldPath);
38971       function viewfieldPath() {
38972         const d2 = this.parentNode.__data__;
38973         if (d2.is_sphere && d2.key !== selectedImageKey) {
38974           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
38975         } else {
38976           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
38977         }
38978       }
38979       return this;
38980     },
38981     updateUrlImage: function(key) {
38982       const hash2 = utilStringQs(window.location.hash);
38983       if (key) {
38984         hash2.photo = "vegbilder/" + key;
38985       } else {
38986         delete hash2.photo;
38987       }
38988       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
38989     },
38990     validHere: function(extent) {
38991       const bbox2 = Object.values(extent.bbox());
38992       return iso1A2Codes(bbox2).includes("NO");
38993     },
38994     cache: function() {
38995       return _vegbilderCache;
38996     }
38997   };
38998
38999   // node_modules/osm-auth/dist/osm-auth.mjs
39000   function osmAuth(o2) {
39001     var oauth2 = {};
39002     var CHANNEL_ID = "osm-api-auth-complete";
39003     var _store = null;
39004     try {
39005       _store = window.localStorage;
39006     } catch (e3) {
39007       var _mock = /* @__PURE__ */ new Map();
39008       _store = {
39009         isMocked: true,
39010         hasItem: (k3) => _mock.has(k3),
39011         getItem: (k3) => _mock.get(k3),
39012         setItem: (k3, v3) => _mock.set(k3, v3),
39013         removeItem: (k3) => _mock.delete(k3),
39014         clear: () => _mock.clear()
39015       };
39016     }
39017     function token(k3, v3) {
39018       var key = o2.url + k3;
39019       if (arguments.length === 1) {
39020         var val = _store.getItem(key) || "";
39021         return val.replace(/"/g, "");
39022       } else if (arguments.length === 2) {
39023         if (v3) {
39024           return _store.setItem(key, v3);
39025         } else {
39026           return _store.removeItem(key);
39027         }
39028       }
39029     }
39030     oauth2.authenticated = function() {
39031       return !!token("oauth2_access_token");
39032     };
39033     oauth2.logout = function() {
39034       token("oauth2_access_token", "");
39035       token("oauth_token", "");
39036       token("oauth_token_secret", "");
39037       token("oauth_request_token_secret", "");
39038       return oauth2;
39039     };
39040     oauth2.authenticate = function(callback, options) {
39041       if (oauth2.authenticated()) {
39042         callback(null, oauth2);
39043         return;
39044       }
39045       oauth2.logout();
39046       _preopenPopup(function(error, popup) {
39047         if (error) {
39048           callback(error);
39049         } else {
39050           _generatePkceChallenge(function(pkce) {
39051             _authenticate(pkce, options, popup, callback);
39052           });
39053         }
39054       });
39055     };
39056     oauth2.authenticateAsync = function(options) {
39057       if (oauth2.authenticated()) {
39058         return Promise.resolve(oauth2);
39059       }
39060       oauth2.logout();
39061       return new Promise((resolve, reject) => {
39062         var errback = (err, result) => {
39063           if (err) {
39064             reject(err);
39065           } else {
39066             resolve(result);
39067           }
39068         };
39069         _preopenPopup((error, popup) => {
39070           if (error) {
39071             errback(error);
39072           } else {
39073             _generatePkceChallenge((pkce) => _authenticate(pkce, options, popup, errback));
39074           }
39075         });
39076       });
39077     };
39078     function _preopenPopup(callback) {
39079       if (o2.singlepage) {
39080         callback(null, void 0);
39081         return;
39082       }
39083       var w3 = 550;
39084       var h3 = 610;
39085       var settings = [
39086         ["width", w3],
39087         ["height", h3],
39088         ["left", window.screen.width / 2 - w3 / 2],
39089         ["top", window.screen.height / 2 - h3 / 2]
39090       ].map(function(x3) {
39091         return x3.join("=");
39092       }).join(",");
39093       var popup = window.open("about:blank", "oauth_window", settings);
39094       if (popup) {
39095         callback(null, popup);
39096       } else {
39097         var error = new Error("Popup was blocked");
39098         error.status = "popup-blocked";
39099         callback(error);
39100       }
39101     }
39102     function _authenticate(pkce, options, popup, callback) {
39103       var state = generateState();
39104       var path = "/oauth2/authorize?" + utilQsString2({
39105         client_id: o2.client_id,
39106         redirect_uri: o2.redirect_uri,
39107         response_type: "code",
39108         scope: o2.scope,
39109         state,
39110         code_challenge: pkce.code_challenge,
39111         code_challenge_method: pkce.code_challenge_method,
39112         locale: o2.locale || ""
39113       });
39114       var url = (options == null ? void 0 : options.switchUser) ? "".concat(o2.url, "/logout?referer=").concat(encodeURIComponent("/login?referer=".concat(encodeURIComponent(path)))) : o2.url + path;
39115       if (o2.singlepage) {
39116         if (_store.isMocked) {
39117           var error = new Error("localStorage unavailable, but required in singlepage mode");
39118           error.status = "pkce-localstorage-unavailable";
39119           callback(error);
39120           return;
39121         }
39122         var params = utilStringQs2(window.location.search.slice(1));
39123         if (params.code) {
39124           oauth2.bootstrapToken(params.code, callback);
39125         } else {
39126           token("oauth2_state", state);
39127           token("oauth2_pkce_code_verifier", pkce.code_verifier);
39128           window.location = url;
39129         }
39130       } else {
39131         oauth2.popupWindow = popup;
39132         popup.location = url;
39133       }
39134       var bc = new BroadcastChannel(CHANNEL_ID);
39135       bc.addEventListener("message", (event) => {
39136         var url2 = event.data;
39137         var params2 = utilStringQs2(url2.split("?")[1]);
39138         if (params2.state !== state) {
39139           var error2 = new Error("Invalid state");
39140           error2.status = "invalid-state";
39141           callback(error2);
39142           return;
39143         } else if (params2.error !== void 0) {
39144           var err = new Error(params2.error_description.replace(/\+/g, " "));
39145           err.status = params2.error;
39146           callback(err);
39147           return;
39148         }
39149         _getAccessToken(params2.code, pkce.code_verifier, accessTokenDone);
39150         bc.close();
39151       });
39152       function accessTokenDone(err, xhr) {
39153         o2.done();
39154         if (err) {
39155           callback(err);
39156           return;
39157         }
39158         var access_token = JSON.parse(xhr.response);
39159         token("oauth2_access_token", access_token.access_token);
39160         callback(null, oauth2);
39161       }
39162     }
39163     function _getAccessToken(auth_code, code_verifier, accessTokenDone) {
39164       var url = o2.url + "/oauth2/token?" + utilQsString2({
39165         client_id: o2.client_id,
39166         redirect_uri: o2.redirect_uri,
39167         grant_type: "authorization_code",
39168         code: auth_code,
39169         code_verifier
39170       });
39171       oauth2.rawxhr("POST", url, null, null, null, accessTokenDone);
39172       o2.loading();
39173     }
39174     oauth2.bringPopupWindowToFront = function() {
39175       var broughtPopupToFront = false;
39176       try {
39177         if (oauth2.popupWindow && !oauth2.popupWindow.closed) {
39178           oauth2.popupWindow.focus();
39179           broughtPopupToFront = true;
39180         }
39181       } catch (err) {
39182       }
39183       return broughtPopupToFront;
39184     };
39185     oauth2.bootstrapToken = function(auth_code, callback) {
39186       var state = token("oauth2_state");
39187       token("oauth2_state", "");
39188       var params = utilStringQs2(window.location.search.slice(1));
39189       if (params.state !== state) {
39190         var error = new Error("Invalid state");
39191         error.status = "invalid-state";
39192         callback(error);
39193         return;
39194       }
39195       var code_verifier = token("oauth2_pkce_code_verifier");
39196       token("oauth2_pkce_code_verifier", "");
39197       _getAccessToken(auth_code, code_verifier, accessTokenDone);
39198       function accessTokenDone(err, xhr) {
39199         o2.done();
39200         if (err) {
39201           callback(err);
39202           return;
39203         }
39204         var access_token = JSON.parse(xhr.response);
39205         token("oauth2_access_token", access_token.access_token);
39206         callback(null, oauth2);
39207       }
39208     };
39209     oauth2.fetch = function(resource, options) {
39210       if (oauth2.authenticated()) {
39211         return _doFetch();
39212       } else {
39213         if (o2.auto) {
39214           return oauth2.authenticateAsync().then(_doFetch);
39215         } else {
39216           return Promise.reject(new Error("not authenticated"));
39217         }
39218       }
39219       function _doFetch() {
39220         options = options || {};
39221         if (!options.headers) {
39222           options.headers = { "Content-Type": "application/x-www-form-urlencoded" };
39223         }
39224         options.headers.Authorization = "Bearer " + token("oauth2_access_token");
39225         return fetch(resource, options);
39226       }
39227     };
39228     oauth2.xhr = function(options, callback) {
39229       if (oauth2.authenticated()) {
39230         return _doXHR();
39231       } else {
39232         if (o2.auto) {
39233           oauth2.authenticate(_doXHR);
39234           return;
39235         } else {
39236           callback("not authenticated", null);
39237           return;
39238         }
39239       }
39240       function _doXHR() {
39241         var url = options.prefix !== false ? o2.apiUrl + options.path : options.path;
39242         return oauth2.rawxhr(options.method, url, token("oauth2_access_token"), options.content, options.headers, done);
39243       }
39244       function done(err, xhr) {
39245         if (err) {
39246           callback(err);
39247         } else if (xhr.responseXML) {
39248           callback(err, xhr.responseXML);
39249         } else {
39250           callback(err, xhr.response);
39251         }
39252       }
39253     };
39254     oauth2.rawxhr = function(method, url, access_token, data, headers, callback) {
39255       headers = headers || { "Content-Type": "application/x-www-form-urlencoded" };
39256       if (access_token) {
39257         headers.Authorization = "Bearer " + access_token;
39258       }
39259       var xhr = new XMLHttpRequest();
39260       xhr.onreadystatechange = function() {
39261         if (xhr.readyState === 4 && xhr.status !== 0) {
39262           if (/^20\d$/.test(xhr.status)) {
39263             callback(null, xhr);
39264           } else {
39265             callback(xhr, null);
39266           }
39267         }
39268       };
39269       xhr.onerror = function(e3) {
39270         callback(e3, null);
39271       };
39272       xhr.open(method, url, true);
39273       for (var h3 in headers)
39274         xhr.setRequestHeader(h3, headers[h3]);
39275       xhr.send(data);
39276       return xhr;
39277     };
39278     oauth2.preauth = function(val) {
39279       if (val && val.access_token) {
39280         token("oauth2_access_token", val.access_token);
39281       }
39282       return oauth2;
39283     };
39284     oauth2.options = function(val) {
39285       if (!arguments.length)
39286         return o2;
39287       o2 = val;
39288       o2.apiUrl = o2.apiUrl || "https://api.openstreetmap.org";
39289       o2.url = o2.url || "https://www.openstreetmap.org";
39290       o2.auto = o2.auto || false;
39291       o2.singlepage = o2.singlepage || false;
39292       o2.loading = o2.loading || function() {
39293       };
39294       o2.done = o2.done || function() {
39295       };
39296       return oauth2.preauth(o2);
39297     };
39298     oauth2.options(o2);
39299     return oauth2;
39300   }
39301   function utilQsString2(obj) {
39302     return Object.keys(obj).filter(function(key) {
39303       return obj[key] !== void 0;
39304     }).sort().map(function(key) {
39305       return encodeURIComponent(key) + "=" + encodeURIComponent(obj[key]);
39306     }).join("&");
39307   }
39308   function utilStringQs2(str) {
39309     var i3 = 0;
39310     while (i3 < str.length && (str[i3] === "?" || str[i3] === "#"))
39311       i3++;
39312     str = str.slice(i3);
39313     return str.split("&").reduce(function(obj, pair3) {
39314       var parts = pair3.split("=");
39315       if (parts.length === 2) {
39316         obj[parts[0]] = decodeURIComponent(parts[1]);
39317       }
39318       return obj;
39319     }, {});
39320   }
39321   function _generatePkceChallenge(callback) {
39322     var code_verifier;
39323     var random = globalThis.crypto.getRandomValues(new Uint8Array(32));
39324     code_verifier = base64(random.buffer);
39325     var verifier = Uint8Array.from(Array.from(code_verifier).map(function(char) {
39326       return char.charCodeAt(0);
39327     }));
39328     globalThis.crypto.subtle.digest("SHA-256", verifier).then(function(hash2) {
39329       var code_challenge = base64(hash2);
39330       callback({
39331         code_challenge,
39332         code_verifier,
39333         code_challenge_method: "S256"
39334       });
39335     });
39336   }
39337   function generateState() {
39338     var state;
39339     var random = globalThis.crypto.getRandomValues(new Uint8Array(32));
39340     state = base64(random.buffer);
39341     return state;
39342   }
39343   function base64(buffer) {
39344     return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))).replace(/\//g, "_").replace(/\+/g, "-").replace(/[=]/g, "");
39345   }
39346
39347   // modules/util/jxon.js
39348   var JXON = new (function() {
39349     var sValueProp = "keyValue", sAttributesProp = "keyAttributes", sAttrPref = "@", aCache = [], rIsNull = /^\s*$/, rIsBool = /^(?:true|false)$/i;
39350     function parseText(sValue) {
39351       if (rIsNull.test(sValue)) {
39352         return null;
39353       }
39354       if (rIsBool.test(sValue)) {
39355         return sValue.toLowerCase() === "true";
39356       }
39357       if (isFinite(sValue)) {
39358         return parseFloat(sValue);
39359       }
39360       if (isFinite(Date.parse(sValue))) {
39361         return new Date(sValue);
39362       }
39363       return sValue;
39364     }
39365     function EmptyTree() {
39366     }
39367     EmptyTree.prototype.toString = function() {
39368       return "null";
39369     };
39370     EmptyTree.prototype.valueOf = function() {
39371       return null;
39372     };
39373     function objectify(vValue) {
39374       return vValue === null ? new EmptyTree() : vValue instanceof Object ? vValue : new vValue.constructor(vValue);
39375     }
39376     function createObjTree(oParentNode, nVerb, bFreeze, bNesteAttr) {
39377       var nLevelStart = aCache.length, bChildren = oParentNode.hasChildNodes(), bAttributes = oParentNode.hasAttributes(), bHighVerb = Boolean(nVerb & 2);
39378       var sProp, vContent, nLength = 0, sCollectedTxt = "", vResult = bHighVerb ? {} : (
39379         /* put here the default value for empty nodes: */
39380         true
39381       );
39382       if (bChildren) {
39383         for (var oNode, nItem = 0; nItem < oParentNode.childNodes.length; nItem++) {
39384           oNode = oParentNode.childNodes.item(nItem);
39385           if (oNode.nodeType === 4) {
39386             sCollectedTxt += oNode.nodeValue;
39387           } else if (oNode.nodeType === 3) {
39388             sCollectedTxt += oNode.nodeValue.trim();
39389           } else if (oNode.nodeType === 1 && !oNode.prefix) {
39390             aCache.push(oNode);
39391           }
39392         }
39393       }
39394       var nLevelEnd = aCache.length, vBuiltVal = parseText(sCollectedTxt);
39395       if (!bHighVerb && (bChildren || bAttributes)) {
39396         vResult = nVerb === 0 ? objectify(vBuiltVal) : {};
39397       }
39398       for (var nElId = nLevelStart; nElId < nLevelEnd; nElId++) {
39399         sProp = aCache[nElId].nodeName.toLowerCase();
39400         vContent = createObjTree(aCache[nElId], nVerb, bFreeze, bNesteAttr);
39401         if (vResult.hasOwnProperty(sProp)) {
39402           if (vResult[sProp].constructor !== Array) {
39403             vResult[sProp] = [vResult[sProp]];
39404           }
39405           vResult[sProp].push(vContent);
39406         } else {
39407           vResult[sProp] = vContent;
39408           nLength++;
39409         }
39410       }
39411       if (bAttributes) {
39412         var nAttrLen = oParentNode.attributes.length, sAPrefix = bNesteAttr ? "" : sAttrPref, oAttrParent = bNesteAttr ? {} : vResult;
39413         for (var oAttrib, nAttrib = 0; nAttrib < nAttrLen; nLength++, nAttrib++) {
39414           oAttrib = oParentNode.attributes.item(nAttrib);
39415           oAttrParent[sAPrefix + oAttrib.name.toLowerCase()] = parseText(oAttrib.value.trim());
39416         }
39417         if (bNesteAttr) {
39418           if (bFreeze) {
39419             Object.freeze(oAttrParent);
39420           }
39421           vResult[sAttributesProp] = oAttrParent;
39422           nLength -= nAttrLen - 1;
39423         }
39424       }
39425       if (nVerb === 3 || (nVerb === 2 || nVerb === 1 && nLength > 0) && sCollectedTxt) {
39426         vResult[sValueProp] = vBuiltVal;
39427       } else if (!bHighVerb && nLength === 0 && sCollectedTxt) {
39428         vResult = vBuiltVal;
39429       }
39430       if (bFreeze && (bHighVerb || nLength > 0)) {
39431         Object.freeze(vResult);
39432       }
39433       aCache.length = nLevelStart;
39434       return vResult;
39435     }
39436     function loadObjTree(oXMLDoc, oParentEl, oParentObj) {
39437       var vValue, oChild;
39438       if (oParentObj instanceof String || oParentObj instanceof Number || oParentObj instanceof Boolean) {
39439         oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toString()));
39440       } else if (oParentObj.constructor === Date) {
39441         oParentEl.appendChild(oXMLDoc.createTextNode(oParentObj.toGMTString()));
39442       }
39443       for (var sName in oParentObj) {
39444         vValue = oParentObj[sName];
39445         if (isFinite(sName) || vValue instanceof Function) {
39446           continue;
39447         }
39448         if (sName === sValueProp) {
39449           if (vValue !== null && vValue !== true) {
39450             oParentEl.appendChild(oXMLDoc.createTextNode(vValue.constructor === Date ? vValue.toGMTString() : String(vValue)));
39451           }
39452         } else if (sName === sAttributesProp) {
39453           for (var sAttrib in vValue) {
39454             oParentEl.setAttribute(sAttrib, vValue[sAttrib]);
39455           }
39456         } else if (sName.charAt(0) === sAttrPref) {
39457           oParentEl.setAttribute(sName.slice(1), vValue);
39458         } else if (vValue.constructor === Array) {
39459           for (var nItem = 0; nItem < vValue.length; nItem++) {
39460             oChild = oXMLDoc.createElement(sName);
39461             loadObjTree(oXMLDoc, oChild, vValue[nItem]);
39462             oParentEl.appendChild(oChild);
39463           }
39464         } else {
39465           oChild = oXMLDoc.createElement(sName);
39466           if (vValue instanceof Object) {
39467             loadObjTree(oXMLDoc, oChild, vValue);
39468           } else if (vValue !== null && vValue !== true) {
39469             oChild.appendChild(oXMLDoc.createTextNode(vValue.toString()));
39470           }
39471           oParentEl.appendChild(oChild);
39472         }
39473       }
39474     }
39475     this.build = function(oXMLParent, nVerbosity, bFreeze, bNesteAttributes) {
39476       var _nVerb = arguments.length > 1 && typeof nVerbosity === "number" ? nVerbosity & 3 : (
39477         /* put here the default verbosity level: */
39478         1
39479       );
39480       return createObjTree(oXMLParent, _nVerb, bFreeze || false, arguments.length > 3 ? bNesteAttributes : _nVerb === 3);
39481     };
39482     this.unbuild = function(oObjTree) {
39483       var oNewDoc = document.implementation.createDocument("", "", null);
39484       loadObjTree(oNewDoc, oNewDoc, oObjTree);
39485       return oNewDoc;
39486     };
39487     this.stringify = function(oObjTree) {
39488       return new XMLSerializer().serializeToString(JXON.unbuild(oObjTree));
39489     };
39490   })();
39491
39492   // modules/services/osm.js
39493   var tiler5 = utilTiler();
39494   var dispatch7 = dispatch_default("apiStatusChange", "authLoading", "authDone", "change", "loading", "loaded", "loadedNotes");
39495   var urlroot = osmApiConnections[0].url;
39496   var apiUrlroot = osmApiConnections[0].apiUrl || urlroot;
39497   var redirectPath = window.location.origin + window.location.pathname;
39498   var oauth = osmAuth({
39499     url: urlroot,
39500     apiUrl: apiUrlroot,
39501     client_id: osmApiConnections[0].client_id,
39502     scope: "read_prefs write_prefs write_api read_gpx write_notes",
39503     redirect_uri: redirectPath + "land.html",
39504     loading: authLoading,
39505     done: authDone
39506   });
39507   var _apiConnections = osmApiConnections;
39508   var _imageryBlocklists = [/.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/];
39509   var _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new RBush() };
39510   var _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new RBush() };
39511   var _userCache = { toLoad: {}, user: {} };
39512   var _cachedApiStatus;
39513   var _changeset = {};
39514   var _deferred = /* @__PURE__ */ new Set();
39515   var _connectionID = 1;
39516   var _tileZoom3 = 16;
39517   var _noteZoom = 12;
39518   var _rateLimitError;
39519   var _userChangesets;
39520   var _userDetails;
39521   var _off;
39522   var _maxWayNodes = 2e3;
39523   function authLoading() {
39524     dispatch7.call("authLoading");
39525   }
39526   function authDone() {
39527     dispatch7.call("authDone");
39528   }
39529   function abortRequest4(controllerOrXHR) {
39530     if (controllerOrXHR) {
39531       controllerOrXHR.abort();
39532     }
39533   }
39534   function hasInflightRequests(cache) {
39535     return Object.keys(cache.inflight).length;
39536   }
39537   function abortUnwantedRequests3(cache, visibleTiles) {
39538     Object.keys(cache.inflight).forEach(function(k3) {
39539       if (cache.toLoad[k3]) return;
39540       if (visibleTiles.find(function(tile) {
39541         return k3 === tile.id;
39542       })) return;
39543       abortRequest4(cache.inflight[k3]);
39544       delete cache.inflight[k3];
39545     });
39546   }
39547   function getLoc(attrs) {
39548     var lon = attrs.lon && attrs.lon.value;
39549     var lat = attrs.lat && attrs.lat.value;
39550     return [Number(lon), Number(lat)];
39551   }
39552   function getNodes(obj) {
39553     var elems = obj.getElementsByTagName("nd");
39554     var nodes = new Array(elems.length);
39555     for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
39556       nodes[i3] = "n" + elems[i3].attributes.ref.value;
39557     }
39558     return nodes;
39559   }
39560   function getNodesJSON(obj) {
39561     var elems = obj.nodes;
39562     var nodes = new Array(elems.length);
39563     for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
39564       nodes[i3] = "n" + elems[i3];
39565     }
39566     return nodes;
39567   }
39568   function getTags(obj) {
39569     var elems = obj.getElementsByTagName("tag");
39570     var tags = {};
39571     for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
39572       var attrs = elems[i3].attributes;
39573       tags[attrs.k.value] = attrs.v.value;
39574     }
39575     return tags;
39576   }
39577   function getMembers(obj) {
39578     var elems = obj.getElementsByTagName("member");
39579     var members = new Array(elems.length);
39580     for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
39581       var attrs = elems[i3].attributes;
39582       members[i3] = {
39583         id: attrs.type.value[0] + attrs.ref.value,
39584         type: attrs.type.value,
39585         role: attrs.role.value
39586       };
39587     }
39588     return members;
39589   }
39590   function getMembersJSON(obj) {
39591     var elems = obj.members;
39592     var members = new Array(elems.length);
39593     for (var i3 = 0, l2 = elems.length; i3 < l2; i3++) {
39594       var attrs = elems[i3];
39595       members[i3] = {
39596         id: attrs.type[0] + attrs.ref,
39597         type: attrs.type,
39598         role: attrs.role
39599       };
39600     }
39601     return members;
39602   }
39603   function getVisible(attrs) {
39604     return !attrs.visible || attrs.visible.value !== "false";
39605   }
39606   function parseComments(comments) {
39607     var parsedComments = [];
39608     for (var i3 = 0; i3 < comments.length; i3++) {
39609       var comment = comments[i3];
39610       if (comment.nodeName === "comment") {
39611         var childNodes = comment.childNodes;
39612         var parsedComment = {};
39613         for (var j3 = 0; j3 < childNodes.length; j3++) {
39614           var node = childNodes[j3];
39615           var nodeName = node.nodeName;
39616           if (nodeName === "#text") continue;
39617           parsedComment[nodeName] = node.textContent;
39618           if (nodeName === "uid") {
39619             var uid = node.textContent;
39620             if (uid && !_userCache.user[uid]) {
39621               _userCache.toLoad[uid] = true;
39622             }
39623           }
39624         }
39625         if (parsedComment) {
39626           parsedComments.push(parsedComment);
39627         }
39628       }
39629     }
39630     return parsedComments;
39631   }
39632   function encodeNoteRtree(note) {
39633     return {
39634       minX: note.loc[0],
39635       minY: note.loc[1],
39636       maxX: note.loc[0],
39637       maxY: note.loc[1],
39638       data: note
39639     };
39640   }
39641   var jsonparsers = {
39642     node: function nodeData(obj, uid) {
39643       return new osmNode({
39644         id: uid,
39645         visible: typeof obj.visible === "boolean" ? obj.visible : true,
39646         version: obj.version && obj.version.toString(),
39647         changeset: obj.changeset && obj.changeset.toString(),
39648         timestamp: obj.timestamp,
39649         user: obj.user,
39650         uid: obj.uid && obj.uid.toString(),
39651         loc: [Number(obj.lon), Number(obj.lat)],
39652         tags: obj.tags
39653       });
39654     },
39655     way: function wayData(obj, uid) {
39656       return new osmWay({
39657         id: uid,
39658         visible: typeof obj.visible === "boolean" ? obj.visible : true,
39659         version: obj.version && obj.version.toString(),
39660         changeset: obj.changeset && obj.changeset.toString(),
39661         timestamp: obj.timestamp,
39662         user: obj.user,
39663         uid: obj.uid && obj.uid.toString(),
39664         tags: obj.tags,
39665         nodes: getNodesJSON(obj)
39666       });
39667     },
39668     relation: function relationData(obj, uid) {
39669       return new osmRelation({
39670         id: uid,
39671         visible: typeof obj.visible === "boolean" ? obj.visible : true,
39672         version: obj.version && obj.version.toString(),
39673         changeset: obj.changeset && obj.changeset.toString(),
39674         timestamp: obj.timestamp,
39675         user: obj.user,
39676         uid: obj.uid && obj.uid.toString(),
39677         tags: obj.tags,
39678         members: getMembersJSON(obj)
39679       });
39680     },
39681     user: function parseUser(obj, uid) {
39682       return {
39683         id: uid,
39684         display_name: obj.display_name,
39685         account_created: obj.account_created,
39686         image_url: obj.img && obj.img.href,
39687         changesets_count: obj.changesets && obj.changesets.count && obj.changesets.count.toString() || "0",
39688         active_blocks: obj.blocks && obj.blocks.received && obj.blocks.received.active && obj.blocks.received.active.toString() || "0"
39689       };
39690     }
39691   };
39692   function parseJSON(payload, callback, options) {
39693     options = Object.assign({ skipSeen: true }, options);
39694     if (!payload) {
39695       return callback({ message: "No JSON", status: -1 });
39696     }
39697     var json = payload;
39698     if (typeof json !== "object") json = JSON.parse(payload);
39699     if (!json.elements) return callback({ message: "No JSON", status: -1 });
39700     var children2 = json.elements;
39701     var handle = window.requestIdleCallback(function() {
39702       _deferred.delete(handle);
39703       var results = [];
39704       var result;
39705       for (var i3 = 0; i3 < children2.length; i3++) {
39706         result = parseChild(children2[i3]);
39707         if (result) results.push(result);
39708       }
39709       callback(null, results);
39710     });
39711     _deferred.add(handle);
39712     function parseChild(child) {
39713       var parser2 = jsonparsers[child.type];
39714       if (!parser2) return null;
39715       var uid;
39716       uid = osmEntity.id.fromOSM(child.type, child.id);
39717       if (options.skipSeen) {
39718         if (_tileCache.seen[uid]) return null;
39719         _tileCache.seen[uid] = true;
39720       }
39721       return parser2(child, uid);
39722     }
39723   }
39724   function parseUserJSON(payload, callback, options) {
39725     options = Object.assign({ skipSeen: true }, options);
39726     if (!payload) {
39727       return callback({ message: "No JSON", status: -1 });
39728     }
39729     var json = payload;
39730     if (typeof json !== "object") json = JSON.parse(payload);
39731     if (!json.users && !json.user) return callback({ message: "No JSON", status: -1 });
39732     var objs = json.users || [json];
39733     var handle = window.requestIdleCallback(function() {
39734       _deferred.delete(handle);
39735       var results = [];
39736       var result;
39737       for (var i3 = 0; i3 < objs.length; i3++) {
39738         result = parseObj(objs[i3]);
39739         if (result) results.push(result);
39740       }
39741       callback(null, results);
39742     });
39743     _deferred.add(handle);
39744     function parseObj(obj) {
39745       var uid = obj.user.id && obj.user.id.toString();
39746       if (options.skipSeen && _userCache.user[uid]) {
39747         delete _userCache.toLoad[uid];
39748         return null;
39749       }
39750       var user = jsonparsers.user(obj.user, uid);
39751       _userCache.user[uid] = user;
39752       delete _userCache.toLoad[uid];
39753       return user;
39754     }
39755   }
39756   var parsers = {
39757     node: function nodeData2(obj, uid) {
39758       var attrs = obj.attributes;
39759       return new osmNode({
39760         id: uid,
39761         visible: getVisible(attrs),
39762         version: attrs.version.value,
39763         changeset: attrs.changeset && attrs.changeset.value,
39764         timestamp: attrs.timestamp && attrs.timestamp.value,
39765         user: attrs.user && attrs.user.value,
39766         uid: attrs.uid && attrs.uid.value,
39767         loc: getLoc(attrs),
39768         tags: getTags(obj)
39769       });
39770     },
39771     way: function wayData2(obj, uid) {
39772       var attrs = obj.attributes;
39773       return new osmWay({
39774         id: uid,
39775         visible: getVisible(attrs),
39776         version: attrs.version.value,
39777         changeset: attrs.changeset && attrs.changeset.value,
39778         timestamp: attrs.timestamp && attrs.timestamp.value,
39779         user: attrs.user && attrs.user.value,
39780         uid: attrs.uid && attrs.uid.value,
39781         tags: getTags(obj),
39782         nodes: getNodes(obj)
39783       });
39784     },
39785     relation: function relationData2(obj, uid) {
39786       var attrs = obj.attributes;
39787       return new osmRelation({
39788         id: uid,
39789         visible: getVisible(attrs),
39790         version: attrs.version.value,
39791         changeset: attrs.changeset && attrs.changeset.value,
39792         timestamp: attrs.timestamp && attrs.timestamp.value,
39793         user: attrs.user && attrs.user.value,
39794         uid: attrs.uid && attrs.uid.value,
39795         tags: getTags(obj),
39796         members: getMembers(obj)
39797       });
39798     },
39799     note: function parseNote(obj, uid) {
39800       var attrs = obj.attributes;
39801       var childNodes = obj.childNodes;
39802       var props = {};
39803       props.id = uid;
39804       props.loc = getLoc(attrs);
39805       if (!_noteCache.note[uid]) {
39806         let coincident = false;
39807         const epsilon3 = 1e-5;
39808         do {
39809           if (coincident) {
39810             props.loc = geoVecAdd(props.loc, [epsilon3, epsilon3]);
39811           }
39812           const bbox2 = geoExtent(props.loc).bbox();
39813           coincident = _noteCache.rtree.search(bbox2).length;
39814         } while (coincident);
39815       } else {
39816         props.loc = _noteCache.note[uid].loc;
39817       }
39818       for (var i3 = 0; i3 < childNodes.length; i3++) {
39819         var node = childNodes[i3];
39820         var nodeName = node.nodeName;
39821         if (nodeName === "#text") continue;
39822         if (nodeName === "comments") {
39823           props[nodeName] = parseComments(node.childNodes);
39824         } else {
39825           props[nodeName] = node.textContent;
39826         }
39827       }
39828       var note = new osmNote(props);
39829       var item = encodeNoteRtree(note);
39830       _noteCache.note[note.id] = note;
39831       updateRtree3(item, true);
39832       return note;
39833     },
39834     user: function parseUser2(obj, uid) {
39835       var attrs = obj.attributes;
39836       var user = {
39837         id: uid,
39838         display_name: attrs.display_name && attrs.display_name.value,
39839         account_created: attrs.account_created && attrs.account_created.value,
39840         changesets_count: "0",
39841         active_blocks: "0"
39842       };
39843       var img = obj.getElementsByTagName("img");
39844       if (img && img[0] && img[0].getAttribute("href")) {
39845         user.image_url = img[0].getAttribute("href");
39846       }
39847       var changesets = obj.getElementsByTagName("changesets");
39848       if (changesets && changesets[0] && changesets[0].getAttribute("count")) {
39849         user.changesets_count = changesets[0].getAttribute("count");
39850       }
39851       var blocks = obj.getElementsByTagName("blocks");
39852       if (blocks && blocks[0]) {
39853         var received = blocks[0].getElementsByTagName("received");
39854         if (received && received[0] && received[0].getAttribute("active")) {
39855           user.active_blocks = received[0].getAttribute("active");
39856         }
39857       }
39858       _userCache.user[uid] = user;
39859       delete _userCache.toLoad[uid];
39860       return user;
39861     }
39862   };
39863   function parseXML(xml, callback, options) {
39864     options = Object.assign({ skipSeen: true }, options);
39865     if (!xml || !xml.childNodes) {
39866       return callback({ message: "No XML", status: -1 });
39867     }
39868     var root3 = xml.childNodes[0];
39869     var children2 = root3.childNodes;
39870     var handle = window.requestIdleCallback(function() {
39871       _deferred.delete(handle);
39872       var results = [];
39873       var result;
39874       for (var i3 = 0; i3 < children2.length; i3++) {
39875         result = parseChild(children2[i3]);
39876         if (result) results.push(result);
39877       }
39878       callback(null, results);
39879     });
39880     _deferred.add(handle);
39881     function parseChild(child) {
39882       var parser2 = parsers[child.nodeName];
39883       if (!parser2) return null;
39884       var uid;
39885       if (child.nodeName === "user") {
39886         uid = child.attributes.id.value;
39887         if (options.skipSeen && _userCache.user[uid]) {
39888           delete _userCache.toLoad[uid];
39889           return null;
39890         }
39891       } else if (child.nodeName === "note") {
39892         uid = child.getElementsByTagName("id")[0].textContent;
39893       } else {
39894         uid = osmEntity.id.fromOSM(child.nodeName, child.attributes.id.value);
39895         if (options.skipSeen) {
39896           if (_tileCache.seen[uid]) return null;
39897           _tileCache.seen[uid] = true;
39898         }
39899       }
39900       return parser2(child, uid);
39901     }
39902   }
39903   function updateRtree3(item, replace) {
39904     _noteCache.rtree.remove(item, function isEql(a2, b3) {
39905       return a2.data.id === b3.data.id;
39906     });
39907     if (replace) {
39908       _noteCache.rtree.insert(item);
39909     }
39910   }
39911   function wrapcb(thisArg, callback, cid) {
39912     return function(err, result) {
39913       if (err) {
39914         return callback.call(thisArg, err);
39915       } else if (thisArg.getConnectionId() !== cid) {
39916         return callback.call(thisArg, { message: "Connection Switched", status: -1 });
39917       } else {
39918         return callback.call(thisArg, err, result);
39919       }
39920     };
39921   }
39922   var osm_default = {
39923     init: function() {
39924       utilRebind(this, dispatch7, "on");
39925     },
39926     reset: function() {
39927       Array.from(_deferred).forEach(function(handle) {
39928         window.cancelIdleCallback(handle);
39929         _deferred.delete(handle);
39930       });
39931       _connectionID++;
39932       _userChangesets = void 0;
39933       _userDetails = void 0;
39934       _rateLimitError = void 0;
39935       Object.values(_tileCache.inflight).forEach(abortRequest4);
39936       Object.values(_noteCache.inflight).forEach(abortRequest4);
39937       Object.values(_noteCache.inflightPost).forEach(abortRequest4);
39938       if (_changeset.inflight) abortRequest4(_changeset.inflight);
39939       _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new RBush() };
39940       _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new RBush() };
39941       _userCache = { toLoad: {}, user: {} };
39942       _cachedApiStatus = void 0;
39943       _changeset = {};
39944       return this;
39945     },
39946     getConnectionId: function() {
39947       return _connectionID;
39948     },
39949     getUrlRoot: function() {
39950       return urlroot;
39951     },
39952     getApiUrlRoot: function() {
39953       return apiUrlroot;
39954     },
39955     changesetURL: function(changesetID) {
39956       return urlroot + "/changeset/" + changesetID;
39957     },
39958     changesetsURL: function(center, zoom) {
39959       var precision3 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
39960       return urlroot + "/history#map=" + Math.floor(zoom) + "/" + center[1].toFixed(precision3) + "/" + center[0].toFixed(precision3);
39961     },
39962     entityURL: function(entity) {
39963       return urlroot + "/" + entity.type + "/" + entity.osmId();
39964     },
39965     historyURL: function(entity) {
39966       return urlroot + "/" + entity.type + "/" + entity.osmId() + "/history";
39967     },
39968     userURL: function(username) {
39969       return urlroot + "/user/" + encodeURIComponent(username);
39970     },
39971     noteURL: function(note) {
39972       return urlroot + "/note/" + note.id;
39973     },
39974     noteReportURL: function(note) {
39975       return urlroot + "/reports/new?reportable_type=Note&reportable_id=" + note.id;
39976     },
39977     // Generic method to load data from the OSM API
39978     // Can handle either auth or unauth calls.
39979     loadFromAPI: function(path, callback, options) {
39980       options = Object.assign({ skipSeen: true }, options);
39981       var that = this;
39982       var cid = _connectionID;
39983       function done(err, payload) {
39984         if (that.getConnectionId() !== cid) {
39985           if (callback) callback({ message: "Connection Switched", status: -1 });
39986           return;
39987         }
39988         if (err && _cachedApiStatus === "online" || !err && _cachedApiStatus !== "online") {
39989           that.reloadApiStatus();
39990         }
39991         if (callback) {
39992           if (err) {
39993             console.error("API error:", err);
39994             return callback(err);
39995           } else {
39996             if (path.indexOf(".json") !== -1) {
39997               return parseJSON(payload, callback, options);
39998             } else {
39999               return parseXML(payload, callback, options);
40000             }
40001           }
40002         }
40003       }
40004       if (this.authenticated()) {
40005         return oauth.xhr({
40006           method: "GET",
40007           path
40008         }, done);
40009       } else {
40010         var url = apiUrlroot + path;
40011         var controller = new AbortController();
40012         var fn;
40013         if (path.indexOf(".json") !== -1) {
40014           fn = json_default;
40015         } else {
40016           fn = xml_default;
40017         }
40018         fn(url, { signal: controller.signal }).then(function(data) {
40019           done(null, data);
40020         }).catch(function(err) {
40021           if (err.name === "AbortError") return;
40022           var match = err.message.match(/^\d{3}/);
40023           if (match) {
40024             done({ status: +match[0], statusText: err.message });
40025           } else {
40026             done(err.message);
40027           }
40028         });
40029         return controller;
40030       }
40031     },
40032     // Load a single entity by id (ways and relations use the `/full` call to include
40033     // nodes and members). Parent relations are not included, see `loadEntityRelations`.
40034     // GET /api/0.6/node/#id
40035     // GET /api/0.6/[way|relation]/#id/full
40036     loadEntity: function(id2, callback) {
40037       var type2 = osmEntity.id.type(id2);
40038       var osmID = osmEntity.id.toOSM(id2);
40039       var options = { skipSeen: false };
40040       this.loadFromAPI(
40041         "/api/0.6/" + type2 + "/" + osmID + (type2 !== "node" ? "/full" : "") + ".json",
40042         function(err, entities) {
40043           if (callback) callback(err, { data: entities });
40044         },
40045         options
40046       );
40047     },
40048     // Load a single note by id , XML format
40049     // GET /api/0.6/notes/#id
40050     loadEntityNote: function(id2, callback) {
40051       var options = { skipSeen: false };
40052       this.loadFromAPI(
40053         "/api/0.6/notes/" + id2,
40054         function(err, entities) {
40055           if (callback) callback(err, { data: entities });
40056         },
40057         options
40058       );
40059     },
40060     // Load a single entity with a specific version
40061     // GET /api/0.6/[node|way|relation]/#id/#version
40062     loadEntityVersion: function(id2, version, callback) {
40063       var type2 = osmEntity.id.type(id2);
40064       var osmID = osmEntity.id.toOSM(id2);
40065       var options = { skipSeen: false };
40066       this.loadFromAPI(
40067         "/api/0.6/" + type2 + "/" + osmID + "/" + version + ".json",
40068         function(err, entities) {
40069           if (callback) callback(err, { data: entities });
40070         },
40071         options
40072       );
40073     },
40074     // Load the relations of a single entity with the given.
40075     // GET /api/0.6/[node|way|relation]/#id/relations
40076     loadEntityRelations: function(id2, callback) {
40077       var type2 = osmEntity.id.type(id2);
40078       var osmID = osmEntity.id.toOSM(id2);
40079       var options = { skipSeen: false };
40080       this.loadFromAPI(
40081         "/api/0.6/" + type2 + "/" + osmID + "/relations.json",
40082         function(err, entities) {
40083           if (callback) callback(err, { data: entities });
40084         },
40085         options
40086       );
40087     },
40088     // Load multiple entities in chunks
40089     // (note: callback may be called multiple times)
40090     // Unlike `loadEntity`, child nodes and members are not fetched
40091     // GET /api/0.6/[nodes|ways|relations]?#parameters
40092     loadMultiple: function(ids, callback) {
40093       var that = this;
40094       var groups = utilArrayGroupBy(utilArrayUniq(ids), osmEntity.id.type);
40095       Object.keys(groups).forEach(function(k3) {
40096         var type2 = k3 + "s";
40097         var osmIDs = groups[k3].map(function(id2) {
40098           return osmEntity.id.toOSM(id2);
40099         });
40100         var options = { skipSeen: false };
40101         utilArrayChunk(osmIDs, 150).forEach(function(arr) {
40102           that.loadFromAPI(
40103             "/api/0.6/" + type2 + ".json?" + type2 + "=" + arr.join(),
40104             function(err, entities) {
40105               if (callback) callback(err, { data: entities });
40106             },
40107             options
40108           );
40109         });
40110       });
40111     },
40112     // Create, upload, and close a changeset
40113     // PUT /api/0.6/changeset/create
40114     // POST /api/0.6/changeset/#id/upload
40115     // PUT /api/0.6/changeset/#id/close
40116     putChangeset: function(changeset, changes, callback) {
40117       var cid = _connectionID;
40118       if (_changeset.inflight) {
40119         return callback({ message: "Changeset already inflight", status: -2 }, changeset);
40120       } else if (_changeset.open) {
40121         return createdChangeset.call(this, null, _changeset.open);
40122       } else {
40123         var options = {
40124           method: "PUT",
40125           path: "/api/0.6/changeset/create",
40126           headers: { "Content-Type": "text/xml" },
40127           content: JXON.stringify(changeset.asJXON())
40128         };
40129         _changeset.inflight = oauth.xhr(
40130           options,
40131           wrapcb(this, createdChangeset, cid)
40132         );
40133       }
40134       async function createdChangeset(err, changesetID) {
40135         _changeset.inflight = null;
40136         if (err) {
40137           return callback(err, changeset);
40138         }
40139         _changeset.open = changesetID;
40140         changeset = changeset.update({ id: changesetID });
40141         const xml = JXON.stringify(changeset.osmChangeJXON(changes));
40142         const compressed = await utilGzip(xml);
40143         const headers = { "Content-Type": "text/xml" };
40144         if (compressed) headers["Content-Encoding"] = "gzip";
40145         var options2 = {
40146           method: "POST",
40147           path: "/api/0.6/changeset/" + changesetID + "/upload",
40148           headers,
40149           content: compressed || xml
40150         };
40151         _changeset.inflight = oauth.xhr(
40152           options2,
40153           wrapcb(this, uploadedChangeset, cid)
40154         );
40155       }
40156       function uploadedChangeset(err) {
40157         _changeset.inflight = null;
40158         if (err) return callback(err, changeset);
40159         window.setTimeout(function() {
40160           callback(null, changeset);
40161         }, 2500);
40162         _changeset.open = null;
40163         if (this.getConnectionId() === cid) {
40164           oauth.xhr({
40165             method: "PUT",
40166             path: "/api/0.6/changeset/" + changeset.id + "/close",
40167             headers: { "Content-Type": "text/xml" }
40168           }, function() {
40169             return true;
40170           });
40171         }
40172       }
40173     },
40174     /** updates the tags on an existing unclosed changeset */
40175     // PUT /api/0.6/changeset/#id
40176     updateChangesetTags: (changeset) => {
40177       return oauth.fetch("".concat(oauth.options().apiUrl, "/api/0.6/changeset/").concat(changeset.id), {
40178         method: "PUT",
40179         headers: { "Content-Type": "text/xml" },
40180         body: JXON.stringify(changeset.asJXON())
40181       });
40182     },
40183     // Load multiple users in chunks
40184     // (note: callback may be called multiple times)
40185     // GET /api/0.6/users?users=#id1,#id2,...,#idn
40186     loadUsers: function(uids, callback) {
40187       var toLoad = [];
40188       var cached = [];
40189       utilArrayUniq(uids).forEach(function(uid) {
40190         if (_userCache.user[uid]) {
40191           delete _userCache.toLoad[uid];
40192           cached.push(_userCache.user[uid]);
40193         } else {
40194           toLoad.push(uid);
40195         }
40196       });
40197       if (cached.length || !this.authenticated()) {
40198         callback(void 0, cached);
40199         if (!this.authenticated()) return;
40200       }
40201       utilArrayChunk(toLoad, 150).forEach((function(arr) {
40202         oauth.xhr({
40203           method: "GET",
40204           path: "/api/0.6/users.json?users=" + arr.join()
40205         }, wrapcb(this, done, _connectionID));
40206       }).bind(this));
40207       function done(err, payload) {
40208         if (err) return callback(err);
40209         var options = { skipSeen: true };
40210         return parseUserJSON(payload, function(err2, results) {
40211           if (err2) return callback(err2);
40212           return callback(void 0, results);
40213         }, options);
40214       }
40215     },
40216     // Load a given user by id
40217     // GET /api/0.6/user/#id
40218     loadUser: function(uid, callback) {
40219       if (_userCache.user[uid] || !this.authenticated()) {
40220         delete _userCache.toLoad[uid];
40221         return callback(void 0, _userCache.user[uid]);
40222       }
40223       oauth.xhr({
40224         method: "GET",
40225         path: "/api/0.6/user/" + uid + ".json"
40226       }, wrapcb(this, done, _connectionID));
40227       function done(err, payload) {
40228         if (err) return callback(err);
40229         var options = { skipSeen: true };
40230         return parseUserJSON(payload, function(err2, results) {
40231           if (err2) return callback(err2);
40232           return callback(void 0, results[0]);
40233         }, options);
40234       }
40235     },
40236     // Load the details of the logged-in user
40237     // GET /api/0.6/user/details
40238     userDetails: function(callback) {
40239       if (_userDetails) {
40240         return callback(void 0, _userDetails);
40241       }
40242       oauth.xhr({
40243         method: "GET",
40244         path: "/api/0.6/user/details.json"
40245       }, wrapcb(this, done, _connectionID));
40246       function done(err, payload) {
40247         if (err) return callback(err);
40248         var options = { skipSeen: false };
40249         return parseUserJSON(payload, function(err2, results) {
40250           if (err2) return callback(err2);
40251           _userDetails = results[0];
40252           return callback(void 0, _userDetails);
40253         }, options);
40254       }
40255     },
40256     // Load previous changesets for the logged in user
40257     // GET /api/0.6/changesets?user=#id
40258     userChangesets: function(callback) {
40259       if (_userChangesets) {
40260         return callback(void 0, _userChangesets);
40261       }
40262       this.userDetails(
40263         wrapcb(this, gotDetails, _connectionID)
40264       );
40265       function gotDetails(err, user) {
40266         if (err) {
40267           return callback(err);
40268         }
40269         oauth.xhr({
40270           method: "GET",
40271           path: "/api/0.6/changesets?user=" + user.id
40272         }, wrapcb(this, done, _connectionID));
40273       }
40274       function done(err, xml) {
40275         if (err) {
40276           return callback(err);
40277         }
40278         _userChangesets = Array.prototype.map.call(
40279           xml.getElementsByTagName("changeset"),
40280           function(changeset) {
40281             return { tags: getTags(changeset) };
40282           }
40283         ).filter(function(changeset) {
40284           var comment = changeset.tags.comment;
40285           return comment && comment !== "";
40286         });
40287         return callback(void 0, _userChangesets);
40288       }
40289     },
40290     // Fetch the status of the OSM API
40291     // GET /api/capabilities
40292     status: function(callback) {
40293       var url = apiUrlroot + "/api/capabilities";
40294       var errback = wrapcb(this, done, _connectionID);
40295       xml_default(url).then(function(data) {
40296         errback(null, data);
40297       }).catch(function(err) {
40298         errback(err.message);
40299       });
40300       function done(err, xml) {
40301         if (err) {
40302           return callback(err, null);
40303         }
40304         var elements = xml.getElementsByTagName("blacklist");
40305         var regexes = [];
40306         for (var i3 = 0; i3 < elements.length; i3++) {
40307           var regexString = elements[i3].getAttribute("regex");
40308           if (regexString) {
40309             try {
40310               var regex = new RegExp(regexString, "i");
40311               regexes.push(regex);
40312             } catch (e3) {
40313             }
40314           }
40315         }
40316         if (regexes.length) {
40317           _imageryBlocklists = regexes;
40318         }
40319         if (_rateLimitError) {
40320           return callback(_rateLimitError, "rateLimited");
40321         } else {
40322           var waynodes = xml.getElementsByTagName("waynodes");
40323           var maxWayNodes = waynodes.length && parseInt(waynodes[0].getAttribute("maximum"), 10);
40324           if (maxWayNodes && isFinite(maxWayNodes)) _maxWayNodes = maxWayNodes;
40325           var apiStatus = xml.getElementsByTagName("status");
40326           var val = apiStatus[0].getAttribute("api");
40327           return callback(void 0, val);
40328         }
40329       }
40330     },
40331     // Calls `status` and dispatches an `apiStatusChange` event if the returned
40332     // status differs from the cached status.
40333     reloadApiStatus: function() {
40334       if (!this.throttledReloadApiStatus) {
40335         var that = this;
40336         this.throttledReloadApiStatus = throttle_default(function() {
40337           that.status(function(err, status) {
40338             if (status !== _cachedApiStatus) {
40339               _cachedApiStatus = status;
40340               dispatch7.call("apiStatusChange", that, err, status);
40341             }
40342           });
40343         }, 500);
40344       }
40345       this.throttledReloadApiStatus();
40346     },
40347     // Returns the maximum number of nodes a single way can have
40348     maxWayNodes: function() {
40349       return _maxWayNodes;
40350     },
40351     // Load data (entities) from the API in tiles
40352     // GET /api/0.6/map?bbox=
40353     loadTiles: function(projection2, callback) {
40354       if (_off) return;
40355       var tiles = tiler5.zoomExtent([_tileZoom3, _tileZoom3]).getTiles(projection2);
40356       var hadRequests = hasInflightRequests(_tileCache);
40357       abortUnwantedRequests3(_tileCache, tiles);
40358       if (hadRequests && !hasInflightRequests(_tileCache)) {
40359         if (_rateLimitError) {
40360           _rateLimitError = void 0;
40361           dispatch7.call("change");
40362           this.reloadApiStatus();
40363         }
40364         dispatch7.call("loaded");
40365       }
40366       tiles.forEach(function(tile) {
40367         this.loadTile(tile, callback);
40368       }, this);
40369     },
40370     // Load a single data tile
40371     // GET /api/0.6/map?bbox=
40372     loadTile: function(tile, callback) {
40373       if (_off) return;
40374       if (_tileCache.loaded[tile.id] || _tileCache.inflight[tile.id]) return;
40375       if (!hasInflightRequests(_tileCache)) {
40376         dispatch7.call("loading");
40377       }
40378       var path = "/api/0.6/map.json?bbox=";
40379       var options = { skipSeen: true };
40380       _tileCache.inflight[tile.id] = this.loadFromAPI(
40381         path + tile.extent.toParam(),
40382         tileCallback.bind(this),
40383         options
40384       );
40385       function tileCallback(err, parsed) {
40386         if (!err) {
40387           delete _tileCache.inflight[tile.id];
40388           delete _tileCache.toLoad[tile.id];
40389           _tileCache.loaded[tile.id] = true;
40390           var bbox2 = tile.extent.bbox();
40391           bbox2.id = tile.id;
40392           _tileCache.rtree.insert(bbox2);
40393         } else {
40394           if (!_rateLimitError && err.status === 509 || err.status === 429) {
40395             _rateLimitError = err;
40396             dispatch7.call("change");
40397             this.reloadApiStatus();
40398           }
40399           setTimeout(() => {
40400             delete _tileCache.inflight[tile.id];
40401             this.loadTile(tile, callback);
40402           }, 8e3);
40403         }
40404         if (callback) {
40405           callback(err, Object.assign({ data: parsed }, tile));
40406         }
40407         if (!hasInflightRequests(_tileCache)) {
40408           if (_rateLimitError) {
40409             _rateLimitError = void 0;
40410             dispatch7.call("change");
40411             this.reloadApiStatus();
40412           }
40413           dispatch7.call("loaded");
40414         }
40415       }
40416     },
40417     isDataLoaded: function(loc) {
40418       var bbox2 = { minX: loc[0], minY: loc[1], maxX: loc[0], maxY: loc[1] };
40419       return _tileCache.rtree.collides(bbox2);
40420     },
40421     // load the tile that covers the given `loc`
40422     loadTileAtLoc: function(loc, callback) {
40423       if (Object.keys(_tileCache.toLoad).length > 50) return;
40424       var k3 = geoZoomToScale(_tileZoom3 + 1);
40425       var offset = geoRawMercator().scale(k3)(loc);
40426       var projection2 = geoRawMercator().transform({ k: k3, x: -offset[0], y: -offset[1] });
40427       var tiles = tiler5.zoomExtent([_tileZoom3, _tileZoom3]).getTiles(projection2);
40428       tiles.forEach(function(tile) {
40429         if (_tileCache.toLoad[tile.id] || _tileCache.loaded[tile.id] || _tileCache.inflight[tile.id]) return;
40430         _tileCache.toLoad[tile.id] = true;
40431         this.loadTile(tile, callback);
40432       }, this);
40433     },
40434     // Load notes from the API in tiles
40435     // GET /api/0.6/notes?bbox=
40436     loadNotes: function(projection2, noteOptions) {
40437       noteOptions = Object.assign({ limit: 1e4, closed: 7 }, noteOptions);
40438       if (_off) return;
40439       var that = this;
40440       var path = "/api/0.6/notes?limit=" + noteOptions.limit + "&closed=" + noteOptions.closed + "&bbox=";
40441       var throttleLoadUsers = throttle_default(function() {
40442         var uids = Object.keys(_userCache.toLoad);
40443         if (!uids.length) return;
40444         that.loadUsers(uids, function() {
40445         });
40446       }, 750);
40447       var tiles = tiler5.zoomExtent([_noteZoom, _noteZoom]).getTiles(projection2);
40448       abortUnwantedRequests3(_noteCache, tiles);
40449       tiles.forEach(function(tile) {
40450         if (_noteCache.loaded[tile.id] || _noteCache.inflight[tile.id]) return;
40451         var options = { skipSeen: false };
40452         _noteCache.inflight[tile.id] = that.loadFromAPI(
40453           path + tile.extent.toParam(),
40454           function(err) {
40455             delete _noteCache.inflight[tile.id];
40456             if (!err) {
40457               _noteCache.loaded[tile.id] = true;
40458             }
40459             throttleLoadUsers();
40460             dispatch7.call("loadedNotes");
40461           },
40462           options
40463         );
40464       });
40465     },
40466     // Create a note
40467     // POST /api/0.6/notes?params
40468     postNoteCreate: function(note, callback) {
40469       if (!this.authenticated()) {
40470         return callback({ message: "Not Authenticated", status: -3 }, note);
40471       }
40472       if (_noteCache.inflightPost[note.id]) {
40473         return callback({ message: "Note update already inflight", status: -2 }, note);
40474       }
40475       if (!note.loc[0] || !note.loc[1] || !note.newComment) return;
40476       var comment = note.newComment;
40477       if (note.newCategory && note.newCategory !== "None") {
40478         comment += " #" + note.newCategory;
40479       }
40480       var path = "/api/0.6/notes?" + utilQsString({ lon: note.loc[0], lat: note.loc[1], text: comment });
40481       _noteCache.inflightPost[note.id] = oauth.xhr({
40482         method: "POST",
40483         path
40484       }, wrapcb(this, done, _connectionID));
40485       function done(err, xml) {
40486         delete _noteCache.inflightPost[note.id];
40487         if (err) {
40488           return callback(err);
40489         }
40490         this.removeNote(note);
40491         var options = { skipSeen: false };
40492         return parseXML(xml, function(err2, results) {
40493           if (err2) {
40494             return callback(err2);
40495           } else {
40496             return callback(void 0, results[0]);
40497           }
40498         }, options);
40499       }
40500     },
40501     // Update a note
40502     // POST /api/0.6/notes/#id/comment?text=comment
40503     // POST /api/0.6/notes/#id/close?text=comment
40504     // POST /api/0.6/notes/#id/reopen?text=comment
40505     postNoteUpdate: function(note, newStatus, callback) {
40506       if (!this.authenticated()) {
40507         return callback({ message: "Not Authenticated", status: -3 }, note);
40508       }
40509       if (_noteCache.inflightPost[note.id]) {
40510         return callback({ message: "Note update already inflight", status: -2 }, note);
40511       }
40512       var action;
40513       if (note.status !== "closed" && newStatus === "closed") {
40514         action = "close";
40515       } else if (note.status !== "open" && newStatus === "open") {
40516         action = "reopen";
40517       } else {
40518         action = "comment";
40519         if (!note.newComment) return;
40520       }
40521       var path = "/api/0.6/notes/" + note.id + "/" + action;
40522       if (note.newComment) {
40523         path += "?" + utilQsString({ text: note.newComment });
40524       }
40525       _noteCache.inflightPost[note.id] = oauth.xhr({
40526         method: "POST",
40527         path
40528       }, wrapcb(this, done, _connectionID));
40529       function done(err, xml) {
40530         delete _noteCache.inflightPost[note.id];
40531         if (err) {
40532           return callback(err);
40533         }
40534         this.removeNote(note);
40535         if (action === "close") {
40536           _noteCache.closed[note.id] = true;
40537         } else if (action === "reopen") {
40538           delete _noteCache.closed[note.id];
40539         }
40540         var options = { skipSeen: false };
40541         return parseXML(xml, function(err2, results) {
40542           if (err2) {
40543             return callback(err2);
40544           } else {
40545             return callback(void 0, results[0]);
40546           }
40547         }, options);
40548       }
40549     },
40550     /* connection options for source switcher (optional) */
40551     apiConnections: function(val) {
40552       if (!arguments.length) return _apiConnections;
40553       _apiConnections = val;
40554       return this;
40555     },
40556     switch: function(newOptions) {
40557       urlroot = newOptions.url;
40558       apiUrlroot = newOptions.apiUrl || urlroot;
40559       if (newOptions.url && !newOptions.apiUrl) {
40560         newOptions = __spreadProps(__spreadValues({}, newOptions), {
40561           apiUrl: newOptions.url
40562         });
40563       }
40564       const oldOptions = utilObjectOmit(oauth.options(), "access_token");
40565       oauth.options(__spreadValues(__spreadValues({}, oldOptions), newOptions));
40566       this.reset();
40567       this.userChangesets(function() {
40568       });
40569       dispatch7.call("change");
40570       return this;
40571     },
40572     toggle: function(val) {
40573       _off = !val;
40574       return this;
40575     },
40576     isChangesetInflight: function() {
40577       return !!_changeset.inflight;
40578     },
40579     // get/set cached data
40580     // This is used to save/restore the state when entering/exiting the walkthrough
40581     // Also used for testing purposes.
40582     caches: function(obj) {
40583       function cloneCache(source) {
40584         var target = {};
40585         Object.keys(source).forEach(function(k3) {
40586           if (k3 === "rtree") {
40587             target.rtree = new RBush().fromJSON(source.rtree.toJSON());
40588           } else if (k3 === "note") {
40589             target.note = {};
40590             Object.keys(source.note).forEach(function(id2) {
40591               target.note[id2] = osmNote(source.note[id2]);
40592             });
40593           } else {
40594             target[k3] = JSON.parse(JSON.stringify(source[k3]));
40595           }
40596         });
40597         return target;
40598       }
40599       if (!arguments.length) {
40600         return {
40601           tile: cloneCache(_tileCache),
40602           note: cloneCache(_noteCache),
40603           user: cloneCache(_userCache)
40604         };
40605       }
40606       if (obj === "get") {
40607         return {
40608           tile: _tileCache,
40609           note: _noteCache,
40610           user: _userCache
40611         };
40612       }
40613       if (obj.tile) {
40614         _tileCache = obj.tile;
40615         _tileCache.inflight = {};
40616       }
40617       if (obj.note) {
40618         _noteCache = obj.note;
40619         _noteCache.inflight = {};
40620         _noteCache.inflightPost = {};
40621       }
40622       if (obj.user) {
40623         _userCache = obj.user;
40624       }
40625       return this;
40626     },
40627     logout: function() {
40628       _userChangesets = void 0;
40629       _userDetails = void 0;
40630       oauth.logout();
40631       dispatch7.call("change");
40632       return this;
40633     },
40634     authenticated: function() {
40635       return oauth.authenticated();
40636     },
40637     /** @param {import('osm-auth').LoginOptions} options */
40638     authenticate: function(callback, options) {
40639       var that = this;
40640       var cid = _connectionID;
40641       _userChangesets = void 0;
40642       _userDetails = void 0;
40643       function done(err, res) {
40644         if (err) {
40645           if (callback) callback(err);
40646           return;
40647         }
40648         if (that.getConnectionId() !== cid) {
40649           if (callback) callback({ message: "Connection Switched", status: -1 });
40650           return;
40651         }
40652         _rateLimitError = void 0;
40653         dispatch7.call("change");
40654         if (callback) callback(err, res);
40655         that.userChangesets(function() {
40656         });
40657       }
40658       oauth.options(__spreadProps(__spreadValues({}, oauth.options()), {
40659         locale: _mainLocalizer.localeCode()
40660       }));
40661       oauth.authenticate(done, options);
40662     },
40663     imageryBlocklists: function() {
40664       return _imageryBlocklists;
40665     },
40666     tileZoom: function(val) {
40667       if (!arguments.length) return _tileZoom3;
40668       _tileZoom3 = val;
40669       return this;
40670     },
40671     // get all cached notes covering the viewport
40672     notes: function(projection2) {
40673       var viewport = projection2.clipExtent();
40674       var min3 = [viewport[0][0], viewport[1][1]];
40675       var max3 = [viewport[1][0], viewport[0][1]];
40676       var bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
40677       return _noteCache.rtree.search(bbox2).map(function(d2) {
40678         return d2.data;
40679       });
40680     },
40681     // get a single note from the cache
40682     getNote: function(id2) {
40683       return _noteCache.note[id2];
40684     },
40685     // remove a single note from the cache
40686     removeNote: function(note) {
40687       if (!(note instanceof osmNote) || !note.id) return;
40688       delete _noteCache.note[note.id];
40689       updateRtree3(encodeNoteRtree(note), false);
40690     },
40691     // replace a single note in the cache
40692     replaceNote: function(note) {
40693       if (!(note instanceof osmNote) || !note.id) return;
40694       _noteCache.note[note.id] = note;
40695       updateRtree3(encodeNoteRtree(note), true);
40696       return note;
40697     },
40698     // Get an array of note IDs closed during this session.
40699     // Used to populate `closed:note` changeset tag
40700     getClosedIDs: function() {
40701       return Object.keys(_noteCache.closed).sort();
40702     }
40703   };
40704
40705   // modules/services/osm_wikibase.js
40706   var apibase3 = "https://wiki.openstreetmap.org/w/api.php";
40707   var _inflight2 = {};
40708   var _wikibaseCache = {};
40709   var _localeIDs = { en: false };
40710   var debouncedRequest = debounce_default(request, 500, { leading: false });
40711   function request(url, callback) {
40712     if (_inflight2[url]) return;
40713     var controller = new AbortController();
40714     _inflight2[url] = controller;
40715     json_default(url, { signal: controller.signal }).then(function(result) {
40716       delete _inflight2[url];
40717       if (callback) callback(null, result);
40718     }).catch(function(err) {
40719       delete _inflight2[url];
40720       if (err.name === "AbortError") return;
40721       if (callback) callback(err.message);
40722     });
40723   }
40724   var osm_wikibase_default = {
40725     init: function() {
40726       _inflight2 = {};
40727       _wikibaseCache = {};
40728       _localeIDs = {};
40729     },
40730     reset: function() {
40731       Object.values(_inflight2).forEach(function(controller) {
40732         controller.abort();
40733       });
40734       _inflight2 = {};
40735     },
40736     /**
40737      * Get the best value for the property, or undefined if not found
40738      * @param entity object from wikibase
40739      * @param property string e.g. 'P4' for image
40740      * @param langCode string e.g. 'fr' for French
40741      */
40742     claimToValue: function(entity, property, langCode) {
40743       if (!entity.claims[property]) return void 0;
40744       var locale2 = _localeIDs[langCode];
40745       var preferredPick, localePick;
40746       entity.claims[property].forEach(function(stmt) {
40747         if (!preferredPick && stmt.rank === "preferred") {
40748           preferredPick = stmt;
40749         }
40750         if (locale2 && stmt.qualifiers && stmt.qualifiers.P26 && stmt.qualifiers.P26[0].datavalue.value.id === locale2) {
40751           localePick = stmt;
40752         }
40753       });
40754       var result = localePick || preferredPick;
40755       if (result) {
40756         var datavalue = result.mainsnak.datavalue;
40757         return datavalue.type === "wikibase-entityid" ? datavalue.value.id : datavalue.value;
40758       } else {
40759         return void 0;
40760       }
40761     },
40762     /**
40763      * Convert monolingual property into a key-value object (language -> value)
40764      * @param entity object from wikibase
40765      * @param property string e.g. 'P31' for monolingual wiki page title
40766      */
40767     monolingualClaimToValueObj: function(entity, property) {
40768       if (!entity || !entity.claims[property]) return void 0;
40769       return entity.claims[property].reduce(function(acc, obj) {
40770         var value = obj.mainsnak.datavalue.value;
40771         acc[value.language] = value.text;
40772         return acc;
40773       }, {});
40774     },
40775     toSitelink: function(key, value) {
40776       var result = value ? "Tag:" + key + "=" + value : "Key:" + key;
40777       return result.replace(/_/g, " ").trim();
40778     },
40779     /**
40780      * Converts text like `tag:...=...` into clickable links
40781      *
40782      * @param {string} unsafeText - unsanitized text
40783      */
40784     linkifyWikiText(unsafeText) {
40785       return (selection2) => {
40786         const segments = unsafeText.split(/(key|tag):([\w-]+)(=([\w-]+))?/g);
40787         for (let i3 = 0; i3 < segments.length; i3 += 5) {
40788           const [plainText, , key, , value] = segments.slice(i3);
40789           if (plainText) {
40790             selection2.append("span").text(plainText);
40791           }
40792           if (key) {
40793             selection2.append("a").attr("href", "https://wiki.openstreetmap.org/wiki/".concat(this.toSitelink(key, value))).attr("target", "_blank").attr("rel", "noreferrer").append("code").text("".concat(key, "=").concat(value || "*"));
40794           }
40795         }
40796       };
40797     },
40798     //
40799     // Pass params object of the form:
40800     // {
40801     //   key: 'string',
40802     //   value: 'string',
40803     //   langCode: 'string'
40804     // }
40805     //
40806     getEntity: function(params, callback) {
40807       var doRequest = params.debounce ? debouncedRequest : request;
40808       var that = this;
40809       var titles = [];
40810       var result = {};
40811       var rtypeSitelink = params.key === "type" && params.value ? ("Relation:" + params.value).replace(/_/g, " ").trim() : false;
40812       var keySitelink = params.key ? this.toSitelink(params.key) : false;
40813       var tagSitelink = params.key && params.value ? this.toSitelink(params.key, params.value) : false;
40814       const localeSitelinks = [];
40815       if (params.langCodes) {
40816         params.langCodes.forEach(function(langCode) {
40817           if (_localeIDs[langCode] === void 0) {
40818             let localeSitelink = ("Locale:" + langCode).replace(/_/g, " ").trim();
40819             titles.push(localeSitelink);
40820             that.addLocale(langCode, false);
40821           }
40822         });
40823       }
40824       if (rtypeSitelink) {
40825         if (_wikibaseCache[rtypeSitelink]) {
40826           result.rtype = _wikibaseCache[rtypeSitelink];
40827         } else {
40828           titles.push(rtypeSitelink);
40829         }
40830       }
40831       if (keySitelink) {
40832         if (_wikibaseCache[keySitelink]) {
40833           result.key = _wikibaseCache[keySitelink];
40834         } else {
40835           titles.push(keySitelink);
40836         }
40837       }
40838       if (tagSitelink) {
40839         if (_wikibaseCache[tagSitelink]) {
40840           result.tag = _wikibaseCache[tagSitelink];
40841         } else {
40842           titles.push(tagSitelink);
40843         }
40844       }
40845       if (!titles.length) {
40846         return callback(null, result);
40847       }
40848       var obj = {
40849         action: "wbgetentities",
40850         sites: "wiki",
40851         titles: titles.join("|"),
40852         languages: params.langCodes.join("|"),
40853         languagefallback: 1,
40854         origin: "*",
40855         format: "json"
40856         // There is an MW Wikibase API bug https://phabricator.wikimedia.org/T212069
40857         // We shouldn't use v1 until it gets fixed, but should switch to it afterwards
40858         // formatversion: 2,
40859       };
40860       var url = apibase3 + "?" + utilQsString(obj);
40861       doRequest(url, function(err, d2) {
40862         if (err) {
40863           callback(err);
40864         } else if (!d2.success || d2.error) {
40865           callback(d2.error.messages.map(function(v3) {
40866             return v3.html["*"];
40867           }).join("<br>"));
40868         } else {
40869           Object.values(d2.entities).forEach(function(res) {
40870             if (res.missing !== "") {
40871               var title = res.sitelinks.wiki.title;
40872               if (title === rtypeSitelink) {
40873                 _wikibaseCache[rtypeSitelink] = res;
40874                 result.rtype = res;
40875               } else if (title === keySitelink) {
40876                 _wikibaseCache[keySitelink] = res;
40877                 result.key = res;
40878               } else if (title === tagSitelink) {
40879                 _wikibaseCache[tagSitelink] = res;
40880                 result.tag = res;
40881               } else if (localeSitelinks.includes(title)) {
40882                 const langCode = title.replace(/ /g, "_").replace(/^Locale:/, "");
40883                 that.addLocale(langCode, res.id);
40884               } else {
40885                 console.log("Unexpected title " + title);
40886               }
40887             }
40888           });
40889           callback(null, result);
40890         }
40891       });
40892     },
40893     //
40894     // Pass params object of the form:
40895     // {
40896     //   key: 'string',     // required
40897     //   value: 'string'    // optional
40898     // }
40899     //
40900     // Get an result object used to display tag documentation
40901     // {
40902     //   title:        'string',
40903     //   description:  'string',
40904     //   editURL:      'string',
40905     //   imageURL:     'string',
40906     //   wiki:         { title: 'string', text: 'string', url: 'string' }
40907     // }
40908     //
40909     getDocs: function(params, callback) {
40910       var that = this;
40911       var langCodes = _mainLocalizer.localeCodes().map(function(code) {
40912         return code.toLowerCase();
40913       });
40914       params.langCodes = langCodes;
40915       this.getEntity(params, function(err, data) {
40916         if (err) {
40917           callback(err);
40918           return;
40919         }
40920         var entity = data.rtype || data.tag || data.key;
40921         if (!entity) {
40922           callback("No entity");
40923           return;
40924         }
40925         var i3;
40926         var description;
40927         for (i3 in langCodes) {
40928           let code2 = langCodes[i3];
40929           if (entity.descriptions[code2] && entity.descriptions[code2].language === code2) {
40930             description = entity.descriptions[code2];
40931             break;
40932           }
40933         }
40934         if (!description && Object.values(entity.descriptions).length) description = Object.values(entity.descriptions)[0];
40935         var result = {
40936           title: entity.title,
40937           description: that.linkifyWikiText((description == null ? void 0 : description.value) || ""),
40938           descriptionLocaleCode: description ? description.language : "",
40939           editURL: "https://wiki.openstreetmap.org/wiki/" + entity.title
40940         };
40941         if (entity.claims) {
40942           var imageroot;
40943           var image = that.claimToValue(entity, "P4", langCodes[0]);
40944           if (image) {
40945             imageroot = "https://commons.wikimedia.org/w/index.php";
40946           } else {
40947             image = that.claimToValue(entity, "P28", langCodes[0]);
40948             if (image) {
40949               imageroot = "https://wiki.openstreetmap.org/w/index.php";
40950             }
40951           }
40952           if (imageroot && image) {
40953             result.imageURL = imageroot + "?" + utilQsString({
40954               title: "Special:Redirect/file/" + image,
40955               width: 400
40956             });
40957           }
40958         }
40959         var rtypeWiki = that.monolingualClaimToValueObj(data.rtype, "P31");
40960         var tagWiki = that.monolingualClaimToValueObj(data.tag, "P31");
40961         var keyWiki = that.monolingualClaimToValueObj(data.key, "P31");
40962         var wikis = [rtypeWiki, tagWiki, keyWiki];
40963         for (i3 in wikis) {
40964           var wiki = wikis[i3];
40965           for (var j3 in langCodes) {
40966             var code = langCodes[j3];
40967             var referenceId = langCodes[0].split("-")[0] !== "en" && code.split("-")[0] === "en" ? "inspector.wiki_en_reference" : "inspector.wiki_reference";
40968             var info = getWikiInfo(wiki, code, referenceId);
40969             if (info) {
40970               result.wiki = info;
40971               break;
40972             }
40973           }
40974           if (result.wiki) break;
40975         }
40976         callback(null, result);
40977         function getWikiInfo(wiki2, langCode, tKey) {
40978           if (wiki2 && wiki2[langCode]) {
40979             return {
40980               title: wiki2[langCode],
40981               text: tKey,
40982               url: "https://wiki.openstreetmap.org/wiki/" + wiki2[langCode]
40983             };
40984           }
40985         }
40986       });
40987     },
40988     addLocale: function(langCode, qid) {
40989       _localeIDs[langCode] = qid;
40990     },
40991     apibase: function(val) {
40992       if (!arguments.length) return apibase3;
40993       apibase3 = val;
40994       return this;
40995     }
40996   };
40997
40998   // modules/services/streetside.js
40999   var streetsideApi = "https://dev.virtualearth.net/REST/v1/Imagery/MetaData/Streetside?mapArea={bbox}&key={key}&count={count}&uriScheme=https";
41000   var maxResults2 = 500;
41001   var bubbleAppKey = utilAesDecrypt("5c875730b09c6b422433e807e1ff060b6536c791dbfffcffc4c6b18a1bdba1f14593d151adb50e19e1be1ab19aef813bf135d0f103475e5c724dec94389e45d0");
41002   var pannellumViewerCSS2 = "pannellum/pannellum.css";
41003   var pannellumViewerJS2 = "pannellum/pannellum.js";
41004   var tileZoom3 = 16.5;
41005   var tiler6 = utilTiler().zoomExtent([tileZoom3, tileZoom3]).skipNullIsland(true);
41006   var dispatch8 = dispatch_default("loadedImages", "viewerChanged");
41007   var minHfov = 10;
41008   var maxHfov = 90;
41009   var defaultHfov = 45;
41010   var _hires = false;
41011   var _resolution = 512;
41012   var _currScene = 0;
41013   var _ssCache;
41014   var _pannellumViewer;
41015   var _sceneOptions = {
41016     showFullscreenCtrl: false,
41017     autoLoad: true,
41018     compass: true,
41019     yaw: 0,
41020     minHfov,
41021     maxHfov,
41022     hfov: defaultHfov,
41023     type: "cubemap",
41024     cubeMap: []
41025   };
41026   var _loadViewerPromise4;
41027   function abortRequest5(i3) {
41028     i3.abort();
41029   }
41030   function localeTimestamp2(s2) {
41031     if (!s2) return null;
41032     const options = { day: "numeric", month: "short", year: "numeric" };
41033     const d2 = new Date(s2);
41034     if (isNaN(d2.getTime())) return null;
41035     return d2.toLocaleString(_mainLocalizer.localeCode(), options);
41036   }
41037   function loadTiles3(which, url, projection2, margin) {
41038     const tiles = tiler6.margin(margin).getTiles(projection2);
41039     const cache = _ssCache[which];
41040     Object.keys(cache.inflight).forEach((k3) => {
41041       const wanted = tiles.find((tile) => k3.indexOf(tile.id + ",") === 0);
41042       if (!wanted) {
41043         abortRequest5(cache.inflight[k3]);
41044         delete cache.inflight[k3];
41045       }
41046     });
41047     tiles.forEach((tile) => loadNextTilePage2(which, url, tile));
41048   }
41049   function loadNextTilePage2(which, url, tile) {
41050     const cache = _ssCache[which];
41051     const nextPage = cache.nextPage[tile.id] || 0;
41052     const id2 = tile.id + "," + String(nextPage);
41053     if (cache.loaded[id2] || cache.inflight[id2]) return;
41054     cache.inflight[id2] = getBubbles(url, tile, (response) => {
41055       cache.loaded[id2] = true;
41056       delete cache.inflight[id2];
41057       if (!response) return;
41058       if (response.resourceSets[0].resources.length === maxResults2) {
41059         const split = tile.extent.split();
41060         loadNextTilePage2(which, url, { id: tile.id + ",a", extent: split[0] });
41061         loadNextTilePage2(which, url, { id: tile.id + ",b", extent: split[1] });
41062         loadNextTilePage2(which, url, { id: tile.id + ",c", extent: split[2] });
41063         loadNextTilePage2(which, url, { id: tile.id + ",d", extent: split[3] });
41064       }
41065       const features = response.resourceSets[0].resources.map((bubble) => {
41066         const bubbleId = bubble.imageUrl;
41067         if (cache.points[bubbleId]) return null;
41068         const loc = [
41069           bubble.lon || bubble.longitude,
41070           bubble.lat || bubble.latitude
41071         ];
41072         const d2 = {
41073           service: "photo",
41074           loc,
41075           key: bubbleId,
41076           imageUrl: bubble.imageUrl.replace("{subdomain}", bubble.imageUrlSubdomains[0]),
41077           ca: bubble.he || bubble.heading,
41078           captured_at: bubble.vintageEnd,
41079           captured_by: "microsoft",
41080           pano: true,
41081           sequenceKey: null
41082         };
41083         cache.points[bubbleId] = d2;
41084         return {
41085           minX: loc[0],
41086           minY: loc[1],
41087           maxX: loc[0],
41088           maxY: loc[1],
41089           data: d2
41090         };
41091       }).filter(Boolean);
41092       cache.rtree.load(features);
41093       if (which === "bubbles") {
41094         dispatch8.call("loadedImages");
41095       }
41096     });
41097   }
41098   function getBubbles(url, tile, callback) {
41099     let rect = tile.extent.rectangle();
41100     let urlForRequest = url.replace("{key}", bubbleAppKey).replace("{bbox}", [rect[1], rect[0], rect[3], rect[2]].join(",")).replace("{count}", maxResults2);
41101     const controller = new AbortController();
41102     fetch(urlForRequest, { signal: controller.signal }).then(function(response) {
41103       if (!response.ok) {
41104         throw new Error(response.status + " " + response.statusText);
41105       }
41106       return response.json();
41107     }).then(function(result) {
41108       if (!result) {
41109         callback(null);
41110       }
41111       return callback(result || []);
41112     }).catch(function(err) {
41113       if (err.name === "AbortError") {
41114       } else {
41115         throw new Error(err);
41116       }
41117     });
41118     return controller;
41119   }
41120   function partitionViewport4(projection2) {
41121     let z3 = geoScaleToZoom(projection2.scale());
41122     let z22 = Math.ceil(z3 * 2) / 2 + 2.5;
41123     let tiler8 = utilTiler().zoomExtent([z22, z22]);
41124     return tiler8.getTiles(projection2).map((tile) => tile.extent);
41125   }
41126   function searchLimited4(limit, projection2, rtree) {
41127     limit = limit || 5;
41128     return partitionViewport4(projection2).reduce((result, extent) => {
41129       let found = rtree.search(extent.bbox()).slice(0, limit).map((d2) => d2.data);
41130       return found.length ? result.concat(found) : result;
41131     }, []);
41132   }
41133   function loadImage(imgInfo) {
41134     return new Promise((resolve) => {
41135       let img = new Image();
41136       img.onload = () => {
41137         let canvas = document.getElementById("ideditor-canvas" + imgInfo.face);
41138         let ctx = canvas.getContext("2d");
41139         ctx.drawImage(img, imgInfo.x, imgInfo.y);
41140         resolve({ imgInfo, status: "ok" });
41141       };
41142       img.onerror = () => {
41143         resolve({ data: imgInfo, status: "error" });
41144       };
41145       img.setAttribute("crossorigin", "");
41146       img.src = imgInfo.url;
41147     });
41148   }
41149   function loadCanvas(imageGroup) {
41150     return Promise.all(imageGroup.map(loadImage)).then((data) => {
41151       let canvas = document.getElementById("ideditor-canvas" + data[0].imgInfo.face);
41152       const which = { "01": 0, "02": 1, "03": 2, "10": 3, "11": 4, "12": 5 };
41153       let face = data[0].imgInfo.face;
41154       _sceneOptions.cubeMap[which[face]] = canvas.toDataURL("image/jpeg", 1);
41155       return { status: "loadCanvas for face " + data[0].imgInfo.face + "ok" };
41156     });
41157   }
41158   function loadFaces(faceGroup) {
41159     return Promise.all(faceGroup.map(loadCanvas)).then(() => {
41160       return { status: "loadFaces done" };
41161     });
41162   }
41163   function setupCanvas(selection2, reset) {
41164     if (reset) {
41165       selection2.selectAll("#ideditor-stitcher-canvases").remove();
41166     }
41167     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", (d2) => "ideditor-" + d2).attr("width", _resolution).attr("height", _resolution);
41168   }
41169   function qkToXY(qk) {
41170     let x3 = 0;
41171     let y3 = 0;
41172     let scale = 256;
41173     for (let i3 = qk.length; i3 > 0; i3--) {
41174       const key = qk[i3 - 1];
41175       x3 += +(key === "1" || key === "3") * scale;
41176       y3 += +(key === "2" || key === "3") * scale;
41177       scale *= 2;
41178     }
41179     return [x3, y3];
41180   }
41181   function getQuadKeys() {
41182     let dim = _resolution / 256;
41183     let quadKeys;
41184     if (dim === 16) {
41185       quadKeys = [
41186         "0000",
41187         "0001",
41188         "0010",
41189         "0011",
41190         "0100",
41191         "0101",
41192         "0110",
41193         "0111",
41194         "1000",
41195         "1001",
41196         "1010",
41197         "1011",
41198         "1100",
41199         "1101",
41200         "1110",
41201         "1111",
41202         "0002",
41203         "0003",
41204         "0012",
41205         "0013",
41206         "0102",
41207         "0103",
41208         "0112",
41209         "0113",
41210         "1002",
41211         "1003",
41212         "1012",
41213         "1013",
41214         "1102",
41215         "1103",
41216         "1112",
41217         "1113",
41218         "0020",
41219         "0021",
41220         "0030",
41221         "0031",
41222         "0120",
41223         "0121",
41224         "0130",
41225         "0131",
41226         "1020",
41227         "1021",
41228         "1030",
41229         "1031",
41230         "1120",
41231         "1121",
41232         "1130",
41233         "1131",
41234         "0022",
41235         "0023",
41236         "0032",
41237         "0033",
41238         "0122",
41239         "0123",
41240         "0132",
41241         "0133",
41242         "1022",
41243         "1023",
41244         "1032",
41245         "1033",
41246         "1122",
41247         "1123",
41248         "1132",
41249         "1133",
41250         "0200",
41251         "0201",
41252         "0210",
41253         "0211",
41254         "0300",
41255         "0301",
41256         "0310",
41257         "0311",
41258         "1200",
41259         "1201",
41260         "1210",
41261         "1211",
41262         "1300",
41263         "1301",
41264         "1310",
41265         "1311",
41266         "0202",
41267         "0203",
41268         "0212",
41269         "0213",
41270         "0302",
41271         "0303",
41272         "0312",
41273         "0313",
41274         "1202",
41275         "1203",
41276         "1212",
41277         "1213",
41278         "1302",
41279         "1303",
41280         "1312",
41281         "1313",
41282         "0220",
41283         "0221",
41284         "0230",
41285         "0231",
41286         "0320",
41287         "0321",
41288         "0330",
41289         "0331",
41290         "1220",
41291         "1221",
41292         "1230",
41293         "1231",
41294         "1320",
41295         "1321",
41296         "1330",
41297         "1331",
41298         "0222",
41299         "0223",
41300         "0232",
41301         "0233",
41302         "0322",
41303         "0323",
41304         "0332",
41305         "0333",
41306         "1222",
41307         "1223",
41308         "1232",
41309         "1233",
41310         "1322",
41311         "1323",
41312         "1332",
41313         "1333",
41314         "2000",
41315         "2001",
41316         "2010",
41317         "2011",
41318         "2100",
41319         "2101",
41320         "2110",
41321         "2111",
41322         "3000",
41323         "3001",
41324         "3010",
41325         "3011",
41326         "3100",
41327         "3101",
41328         "3110",
41329         "3111",
41330         "2002",
41331         "2003",
41332         "2012",
41333         "2013",
41334         "2102",
41335         "2103",
41336         "2112",
41337         "2113",
41338         "3002",
41339         "3003",
41340         "3012",
41341         "3013",
41342         "3102",
41343         "3103",
41344         "3112",
41345         "3113",
41346         "2020",
41347         "2021",
41348         "2030",
41349         "2031",
41350         "2120",
41351         "2121",
41352         "2130",
41353         "2131",
41354         "3020",
41355         "3021",
41356         "3030",
41357         "3031",
41358         "3120",
41359         "3121",
41360         "3130",
41361         "3131",
41362         "2022",
41363         "2023",
41364         "2032",
41365         "2033",
41366         "2122",
41367         "2123",
41368         "2132",
41369         "2133",
41370         "3022",
41371         "3023",
41372         "3032",
41373         "3033",
41374         "3122",
41375         "3123",
41376         "3132",
41377         "3133",
41378         "2200",
41379         "2201",
41380         "2210",
41381         "2211",
41382         "2300",
41383         "2301",
41384         "2310",
41385         "2311",
41386         "3200",
41387         "3201",
41388         "3210",
41389         "3211",
41390         "3300",
41391         "3301",
41392         "3310",
41393         "3311",
41394         "2202",
41395         "2203",
41396         "2212",
41397         "2213",
41398         "2302",
41399         "2303",
41400         "2312",
41401         "2313",
41402         "3202",
41403         "3203",
41404         "3212",
41405         "3213",
41406         "3302",
41407         "3303",
41408         "3312",
41409         "3313",
41410         "2220",
41411         "2221",
41412         "2230",
41413         "2231",
41414         "2320",
41415         "2321",
41416         "2330",
41417         "2331",
41418         "3220",
41419         "3221",
41420         "3230",
41421         "3231",
41422         "3320",
41423         "3321",
41424         "3330",
41425         "3331",
41426         "2222",
41427         "2223",
41428         "2232",
41429         "2233",
41430         "2322",
41431         "2323",
41432         "2332",
41433         "2333",
41434         "3222",
41435         "3223",
41436         "3232",
41437         "3233",
41438         "3322",
41439         "3323",
41440         "3332",
41441         "3333"
41442       ];
41443     } else if (dim === 8) {
41444       quadKeys = [
41445         "000",
41446         "001",
41447         "010",
41448         "011",
41449         "100",
41450         "101",
41451         "110",
41452         "111",
41453         "002",
41454         "003",
41455         "012",
41456         "013",
41457         "102",
41458         "103",
41459         "112",
41460         "113",
41461         "020",
41462         "021",
41463         "030",
41464         "031",
41465         "120",
41466         "121",
41467         "130",
41468         "131",
41469         "022",
41470         "023",
41471         "032",
41472         "033",
41473         "122",
41474         "123",
41475         "132",
41476         "133",
41477         "200",
41478         "201",
41479         "210",
41480         "211",
41481         "300",
41482         "301",
41483         "310",
41484         "311",
41485         "202",
41486         "203",
41487         "212",
41488         "213",
41489         "302",
41490         "303",
41491         "312",
41492         "313",
41493         "220",
41494         "221",
41495         "230",
41496         "231",
41497         "320",
41498         "321",
41499         "330",
41500         "331",
41501         "222",
41502         "223",
41503         "232",
41504         "233",
41505         "322",
41506         "323",
41507         "332",
41508         "333"
41509       ];
41510     } else if (dim === 4) {
41511       quadKeys = [
41512         "00",
41513         "01",
41514         "10",
41515         "11",
41516         "02",
41517         "03",
41518         "12",
41519         "13",
41520         "20",
41521         "21",
41522         "30",
41523         "31",
41524         "22",
41525         "23",
41526         "32",
41527         "33"
41528       ];
41529     } else {
41530       quadKeys = [
41531         "0",
41532         "1",
41533         "2",
41534         "3"
41535       ];
41536     }
41537     return quadKeys;
41538   }
41539   var streetside_default = {
41540     /**
41541      * init() initialize streetside.
41542      */
41543     init: function() {
41544       if (!_ssCache) {
41545         this.reset();
41546       }
41547       this.event = utilRebind(this, dispatch8, "on");
41548     },
41549     /**
41550      * reset() reset the cache.
41551      */
41552     reset: function() {
41553       if (_ssCache) {
41554         Object.values(_ssCache.bubbles.inflight).forEach(abortRequest5);
41555       }
41556       _ssCache = {
41557         bubbles: { inflight: {}, loaded: {}, nextPage: {}, rtree: new RBush(), points: {} },
41558         sequences: {}
41559       };
41560     },
41561     /**
41562      * bubbles()
41563      */
41564     bubbles: function(projection2) {
41565       const limit = 5;
41566       return searchLimited4(limit, projection2, _ssCache.bubbles.rtree);
41567     },
41568     cachedImage: function(imageKey) {
41569       return _ssCache.bubbles.points[imageKey];
41570     },
41571     sequences: function(projection2) {
41572       const viewport = projection2.clipExtent();
41573       const min3 = [viewport[0][0], viewport[1][1]];
41574       const max3 = [viewport[1][0], viewport[0][1]];
41575       const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
41576       let seen = {};
41577       let results = [];
41578       _ssCache.bubbles.rtree.search(bbox2).forEach((d2) => {
41579         const key = d2.data.sequenceKey;
41580         if (key && !seen[key]) {
41581           seen[key] = true;
41582           results.push(_ssCache.sequences[key].geojson);
41583         }
41584       });
41585       return results;
41586     },
41587     /**
41588      * loadBubbles()
41589      */
41590     loadBubbles: function(projection2, margin) {
41591       if (margin === void 0) margin = 2;
41592       loadTiles3("bubbles", streetsideApi, projection2, margin);
41593     },
41594     viewer: function() {
41595       return _pannellumViewer;
41596     },
41597     initViewer: function() {
41598       if (!window.pannellum) return;
41599       if (_pannellumViewer) return;
41600       _currScene += 1;
41601       const sceneID = _currScene.toString();
41602       const options = {
41603         "default": { firstScene: sceneID },
41604         scenes: {}
41605       };
41606       options.scenes[sceneID] = _sceneOptions;
41607       _pannellumViewer = window.pannellum.viewer("ideditor-viewer-streetside", options);
41608     },
41609     ensureViewerLoaded: function(context) {
41610       if (_loadViewerPromise4) return _loadViewerPromise4;
41611       let wrap2 = context.container().select(".photoviewer").selectAll(".ms-wrapper").data([0]);
41612       let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper ms-wrapper").classed("hide", true);
41613       let that = this;
41614       let pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
41615       wrapEnter.append("div").attr("id", "ideditor-viewer-streetside").on(pointerPrefix + "down.streetside", () => {
41616         select_default2(window).on(pointerPrefix + "move.streetside", () => {
41617           dispatch8.call("viewerChanged");
41618         }, true);
41619       }).on(pointerPrefix + "up.streetside pointercancel.streetside", () => {
41620         select_default2(window).on(pointerPrefix + "move.streetside", null);
41621         let t2 = timer((elapsed) => {
41622           dispatch8.call("viewerChanged");
41623           if (elapsed > 2e3) {
41624             t2.stop();
41625           }
41626         });
41627       }).append("div").attr("class", "photo-attribution fillD");
41628       let controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls");
41629       controlsEnter.append("button").on("click.back", step(-1)).text("\u25C4");
41630       controlsEnter.append("button").on("click.forward", step(1)).text("\u25BA");
41631       wrap2 = wrap2.merge(wrapEnter).call(setupCanvas, true);
41632       context.ui().photoviewer.on("resize.streetside", () => {
41633         if (_pannellumViewer) {
41634           _pannellumViewer.resize();
41635         }
41636       });
41637       _loadViewerPromise4 = new Promise((resolve, reject) => {
41638         let loadedCount = 0;
41639         function loaded() {
41640           loadedCount += 1;
41641           if (loadedCount === 2) resolve();
41642         }
41643         const head = select_default2("head");
41644         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() {
41645           reject();
41646         });
41647         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() {
41648           reject();
41649         });
41650       }).catch(function() {
41651         _loadViewerPromise4 = null;
41652       });
41653       return _loadViewerPromise4;
41654       function step(stepBy) {
41655         return () => {
41656           let viewer = context.container().select(".photoviewer");
41657           let selected = viewer.empty() ? void 0 : viewer.datum();
41658           if (!selected) return;
41659           let nextID = stepBy === 1 ? selected.ne : selected.pr;
41660           let yaw = _pannellumViewer.getYaw();
41661           let ca = selected.ca + yaw;
41662           let origin = selected.loc;
41663           const meters = 35;
41664           let p1 = [
41665             origin[0] + geoMetersToLon(meters / 5, origin[1]),
41666             origin[1]
41667           ];
41668           let p2 = [
41669             origin[0] + geoMetersToLon(meters / 2, origin[1]),
41670             origin[1] + geoMetersToLat(meters)
41671           ];
41672           let p3 = [
41673             origin[0] - geoMetersToLon(meters / 2, origin[1]),
41674             origin[1] + geoMetersToLat(meters)
41675           ];
41676           let p4 = [
41677             origin[0] - geoMetersToLon(meters / 5, origin[1]),
41678             origin[1]
41679           ];
41680           let poly = [p1, p2, p3, p4, p1];
41681           let angle2 = (stepBy === 1 ? ca : ca + 180) * (Math.PI / 180);
41682           poly = geoRotate(poly, -angle2, origin);
41683           let extent = poly.reduce((extent2, point) => {
41684             return extent2.extend(geoExtent(point));
41685           }, geoExtent());
41686           let minDist = Infinity;
41687           _ssCache.bubbles.rtree.search(extent.bbox()).forEach((d2) => {
41688             if (d2.data.key === selected.key) return;
41689             if (!geoPointInPolygon(d2.data.loc, poly)) return;
41690             let dist = geoVecLength(d2.data.loc, selected.loc);
41691             let theta = selected.ca - d2.data.ca;
41692             let minTheta = Math.min(Math.abs(theta), 360 - Math.abs(theta));
41693             if (minTheta > 20) {
41694               dist += 5;
41695             }
41696             if (dist < minDist) {
41697               nextID = d2.data.key;
41698               minDist = dist;
41699             }
41700           });
41701           let nextBubble = nextID && that.cachedImage(nextID);
41702           if (!nextBubble) return;
41703           context.map().centerEase(nextBubble.loc);
41704           that.selectImage(context, nextBubble.key).yaw(yaw).showViewer(context);
41705         };
41706       }
41707     },
41708     yaw: function(yaw) {
41709       if (typeof yaw !== "number") return yaw;
41710       _sceneOptions.yaw = yaw;
41711       return this;
41712     },
41713     /**
41714      * showViewer()
41715      */
41716     showViewer: function(context) {
41717       const wrap2 = context.container().select(".photoviewer");
41718       const isHidden = wrap2.selectAll(".photo-wrapper.ms-wrapper.hide").size();
41719       if (isHidden) {
41720         for (const service of Object.values(services)) {
41721           if (service === this) continue;
41722           if (typeof service.hideViewer === "function") {
41723             service.hideViewer(context);
41724           }
41725         }
41726         wrap2.classed("hide", false).selectAll(".photo-wrapper.ms-wrapper").classed("hide", false);
41727       }
41728       return this;
41729     },
41730     /**
41731      * hideViewer()
41732      */
41733     hideViewer: function(context) {
41734       let viewer = context.container().select(".photoviewer");
41735       if (!viewer.empty()) viewer.datum(null);
41736       viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
41737       context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
41738       this.updateUrlImage(null);
41739       return this.setStyles(context, null, true);
41740     },
41741     /**
41742      * selectImage().
41743      */
41744     selectImage: function(context, key) {
41745       let that = this;
41746       let d2 = this.cachedImage(key);
41747       let viewer = context.container().select(".photoviewer");
41748       if (!viewer.empty()) viewer.datum(d2);
41749       this.setStyles(context, null, true);
41750       let wrap2 = context.container().select(".photoviewer .ms-wrapper");
41751       let attribution = wrap2.selectAll(".photo-attribution").html("");
41752       wrap2.selectAll(".pnlm-load-box").style("display", "block");
41753       if (!d2) return this;
41754       this.updateUrlImage(key);
41755       _sceneOptions.northOffset = d2.ca;
41756       let line1 = attribution.append("div").attr("class", "attribution-row");
41757       const hiresDomId = utilUniqueDomId("streetside-hires");
41758       let label = line1.append("label").attr("for", hiresDomId).attr("class", "streetside-hires");
41759       label.append("input").attr("type", "checkbox").attr("id", hiresDomId).property("checked", _hires).on("click", (d3_event) => {
41760         d3_event.stopPropagation();
41761         _hires = !_hires;
41762         _resolution = _hires ? 1024 : 512;
41763         wrap2.call(setupCanvas, true);
41764         let viewstate = {
41765           yaw: _pannellumViewer.getYaw(),
41766           pitch: _pannellumViewer.getPitch(),
41767           hfov: _pannellumViewer.getHfov()
41768         };
41769         _sceneOptions = Object.assign(_sceneOptions, viewstate);
41770         that.selectImage(context, d2.key).showViewer(context);
41771       });
41772       label.append("span").call(_t.append("streetside.hires"));
41773       let captureInfo = line1.append("div").attr("class", "attribution-capture-info");
41774       if (d2.captured_by) {
41775         const yyyy = (/* @__PURE__ */ new Date()).getFullYear();
41776         captureInfo.append("a").attr("class", "captured_by").attr("target", "_blank").attr("href", "https://www.microsoft.com/en-us/maps/streetside").text("\xA9" + yyyy + " Microsoft");
41777         captureInfo.append("span").text("|");
41778       }
41779       if (d2.captured_at) {
41780         captureInfo.append("span").attr("class", "captured_at").text(localeTimestamp2(d2.captured_at));
41781       }
41782       let line2 = attribution.append("div").attr("class", "attribution-row");
41783       line2.append("a").attr("class", "image-view-link").attr("target", "_blank").attr("href", "https://www.bing.com/maps?cp=" + d2.loc[1] + "~" + d2.loc[0] + "&lvl=17&dir=" + d2.ca + "&style=x&v=2&sV=1").call(_t.append("streetside.view_on_bing"));
41784       line2.append("a").attr("class", "image-report-link").attr("target", "_blank").attr("href", "https://www.bing.com/maps/privacyreport/streetsideprivacyreport?bubbleid=" + encodeURIComponent(d2.key) + "&focus=photo&lat=" + d2.loc[1] + "&lng=" + d2.loc[0] + "&z=17").call(_t.append("streetside.report"));
41785       const faceKeys = ["01", "02", "03", "10", "11", "12"];
41786       let quadKeys = getQuadKeys();
41787       let faces = faceKeys.map((faceKey) => {
41788         return quadKeys.map((quadKey) => {
41789           const xy = qkToXY(quadKey);
41790           return {
41791             face: faceKey,
41792             url: d2.imageUrl.replace("{faceId}", faceKey).replace("{tileId}", quadKey),
41793             x: xy[0],
41794             y: xy[1]
41795           };
41796         });
41797       });
41798       loadFaces(faces).then(function() {
41799         if (!_pannellumViewer) {
41800           that.initViewer();
41801         } else {
41802           _currScene += 1;
41803           let sceneID = _currScene.toString();
41804           _pannellumViewer.addScene(sceneID, _sceneOptions).loadScene(sceneID);
41805           if (_currScene > 2) {
41806             sceneID = (_currScene - 1).toString();
41807             _pannellumViewer.removeScene(sceneID);
41808           }
41809         }
41810       });
41811       return this;
41812     },
41813     getSequenceKeyForBubble: function(d2) {
41814       return d2 && d2.sequenceKey;
41815     },
41816     // Updates the currently highlighted sequence and selected bubble.
41817     // Reset is only necessary when interacting with the viewport because
41818     // this implicitly changes the currently selected bubble/sequence
41819     setStyles: function(context, hovered, reset) {
41820       if (reset) {
41821         context.container().selectAll(".viewfield-group").classed("highlighted", false).classed("hovered", false).classed("currentView", false);
41822         context.container().selectAll(".sequence").classed("highlighted", false).classed("currentView", false);
41823       }
41824       let hoveredBubbleKey = hovered && hovered.key;
41825       let hoveredSequenceKey = this.getSequenceKeyForBubble(hovered);
41826       let hoveredSequence = hoveredSequenceKey && _ssCache.sequences[hoveredSequenceKey];
41827       let hoveredBubbleKeys = hoveredSequence && hoveredSequence.bubbles.map((d2) => d2.key) || [];
41828       let viewer = context.container().select(".photoviewer");
41829       let selected = viewer.empty() ? void 0 : viewer.datum();
41830       let selectedBubbleKey = selected && selected.key;
41831       let selectedSequenceKey = this.getSequenceKeyForBubble(selected);
41832       let selectedSequence = selectedSequenceKey && _ssCache.sequences[selectedSequenceKey];
41833       let selectedBubbleKeys = selectedSequence && selectedSequence.bubbles.map((d2) => d2.key) || [];
41834       let highlightedBubbleKeys = utilArrayUnion(hoveredBubbleKeys, selectedBubbleKeys);
41835       context.container().selectAll(".layer-streetside-images .viewfield-group").classed("highlighted", (d2) => highlightedBubbleKeys.indexOf(d2.key) !== -1).classed("hovered", (d2) => d2.key === hoveredBubbleKey).classed("currentView", (d2) => d2.key === selectedBubbleKey);
41836       context.container().selectAll(".layer-streetside-images .sequence").classed("highlighted", (d2) => d2.properties.key === hoveredSequenceKey).classed("currentView", (d2) => d2.properties.key === selectedSequenceKey);
41837       context.container().selectAll(".layer-streetside-images .viewfield-group .viewfield").attr("d", viewfieldPath);
41838       function viewfieldPath() {
41839         let d2 = this.parentNode.__data__;
41840         if (d2.pano && d2.key !== selectedBubbleKey) {
41841           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
41842         } else {
41843           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
41844         }
41845       }
41846       return this;
41847     },
41848     updateUrlImage: function(imageKey) {
41849       const hash2 = utilStringQs(window.location.hash);
41850       if (imageKey) {
41851         hash2.photo = "streetside/" + imageKey;
41852       } else {
41853         delete hash2.photo;
41854       }
41855       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
41856     },
41857     /**
41858      * cache().
41859      */
41860     cache: function() {
41861       return _ssCache;
41862     }
41863   };
41864
41865   // modules/services/taginfo.js
41866   var apibase4 = taginfoApiUrl;
41867   var _inflight3 = {};
41868   var _popularKeys = {};
41869   var _extraExcludedKeys = /^(postal_code|via|((int_|loc_|nat_|official_|old_|ref_|reg_|short_|full_|sorting_|alt_|artist_|long_|bridge:|tunnel:)?name(:left|:right)?(:[a-z]+)?))$/;
41870   var _taginfoCache = {};
41871   var tag_sorts = {
41872     point: "count_nodes",
41873     vertex: "count_nodes",
41874     area: "count_ways",
41875     line: "count_ways"
41876   };
41877   var tag_sort_members = {
41878     point: "count_node_members",
41879     vertex: "count_node_members",
41880     area: "count_way_members",
41881     line: "count_way_members",
41882     relation: "count_relation_members"
41883   };
41884   var tag_filters = {
41885     point: "nodes",
41886     vertex: "nodes",
41887     area: "ways",
41888     line: "ways"
41889   };
41890   var tag_members_fractions = {
41891     point: "count_node_members_fraction",
41892     vertex: "count_node_members_fraction",
41893     area: "count_way_members_fraction",
41894     line: "count_way_members_fraction",
41895     relation: "count_relation_members_fraction"
41896   };
41897   function sets(params, n3, o2) {
41898     if (params.geometry && o2[params.geometry]) {
41899       params[n3] = o2[params.geometry];
41900     }
41901     return params;
41902   }
41903   function setFilter(params) {
41904     return sets(params, "filter", tag_filters);
41905   }
41906   function setSort(params) {
41907     return sets(params, "sortname", tag_sorts);
41908   }
41909   function setSortMembers(params) {
41910     return sets(params, "sortname", tag_sort_members);
41911   }
41912   function clean(params) {
41913     return utilObjectOmit(params, ["geometry", "debounce"]);
41914   }
41915   function filterKeys(type2) {
41916     var count_type = type2 ? "count_" + type2 : "count_all";
41917     return function(d2) {
41918       return Number(d2[count_type]) > 2500 || d2.in_wiki;
41919     };
41920   }
41921   function filterMultikeys(prefix) {
41922     return function(d2) {
41923       var re4 = new RegExp("^" + prefix + "(.*)$", "i");
41924       var matches = d2.key.match(re4) || [];
41925       return matches.length === 2 && matches[1].indexOf(":") === -1;
41926     };
41927   }
41928   function filterValues(allowUpperCase, key) {
41929     return function(d2) {
41930       if (d2.value.match(/[;,]/) !== null) return false;
41931       if (!allowUpperCase && !(key === "type" && d2.value === "associatedStreet") && d2.value.match(/[A-Z*]/) !== null) return false;
41932       return d2.count > 100 || d2.in_wiki;
41933     };
41934   }
41935   function filterRoles(geometry) {
41936     return function(d2) {
41937       if (d2.role === "") return false;
41938       if (d2.role.match(/[A-Z*;,]/) !== null) return false;
41939       return Number(d2[tag_members_fractions[geometry]]) > 0;
41940     };
41941   }
41942   function valKey(d2) {
41943     return {
41944       value: d2.key,
41945       title: d2.key
41946     };
41947   }
41948   function valKeyDescription(d2) {
41949     var obj = {
41950       value: d2.value,
41951       title: d2.description || d2.value
41952     };
41953     return obj;
41954   }
41955   function roleKey(d2) {
41956     return {
41957       value: d2.role,
41958       title: d2.role
41959     };
41960   }
41961   function sortKeys(a2, b3) {
41962     return a2.key.indexOf(":") === -1 && b3.key.indexOf(":") !== -1 ? -1 : a2.key.indexOf(":") !== -1 && b3.key.indexOf(":") === -1 ? 1 : 0;
41963   }
41964   var debouncedRequest2 = debounce_default(request2, 300, { leading: false });
41965   function request2(url, params, exactMatch, callback, loaded) {
41966     if (_inflight3[url]) return;
41967     if (checkCache(url, params, exactMatch, callback)) return;
41968     var controller = new AbortController();
41969     _inflight3[url] = controller;
41970     json_default(url, { signal: controller.signal }).then(function(result) {
41971       delete _inflight3[url];
41972       if (loaded) loaded(null, result);
41973     }).catch(function(err) {
41974       delete _inflight3[url];
41975       if (err.name === "AbortError") return;
41976       if (loaded) loaded(err.message);
41977     });
41978   }
41979   function checkCache(url, params, exactMatch, callback) {
41980     var rp = params.rp || 25;
41981     var testQuery = params.query || "";
41982     var testUrl = url;
41983     do {
41984       var hit = _taginfoCache[testUrl];
41985       if (hit && (url === testUrl || hit.length < rp)) {
41986         callback(null, hit);
41987         return true;
41988       }
41989       if (exactMatch || !testQuery.length) return false;
41990       testQuery = testQuery.slice(0, -1);
41991       testUrl = url.replace(/&query=(.*?)&/, "&query=" + testQuery + "&");
41992     } while (testQuery.length >= 0);
41993     return false;
41994   }
41995   var taginfo_default = {
41996     init: function() {
41997       _inflight3 = {};
41998       _taginfoCache = {};
41999       _popularKeys = [];
42000       var params = {
42001         rp: 100,
42002         sortname: "values_all",
42003         sortorder: "desc",
42004         page: 1,
42005         debounce: false,
42006         lang: _mainLocalizer.languageCode()
42007       };
42008       this.keys(params, function(err, data) {
42009         if (err) return;
42010         data.forEach(function(d2) {
42011           if (d2.value === "opening_hours") return;
42012           _popularKeys[d2.value] = true;
42013         });
42014       });
42015     },
42016     reset: function() {
42017       Object.values(_inflight3).forEach(function(controller) {
42018         controller.abort();
42019       });
42020       _inflight3 = {};
42021     },
42022     keys: function(params, callback) {
42023       var doRequest = params.debounce ? debouncedRequest2 : request2;
42024       params = clean(setSort(params));
42025       params = Object.assign({
42026         rp: 10,
42027         sortname: "count_all",
42028         sortorder: "desc",
42029         page: 1,
42030         lang: _mainLocalizer.languageCode()
42031       }, params);
42032       var url = apibase4 + "keys/all?" + utilQsString(params);
42033       doRequest(url, params, false, callback, function(err, d2) {
42034         if (err) {
42035           callback(err);
42036         } else {
42037           var f2 = filterKeys(params.filter);
42038           var result = d2.data.filter(f2).sort(sortKeys).map(valKey);
42039           _taginfoCache[url] = result;
42040           callback(null, result);
42041         }
42042       });
42043     },
42044     multikeys: function(params, callback) {
42045       var doRequest = params.debounce ? debouncedRequest2 : request2;
42046       params = clean(setSort(params));
42047       params = Object.assign({
42048         rp: 25,
42049         sortname: "count_all",
42050         sortorder: "desc",
42051         page: 1,
42052         lang: _mainLocalizer.languageCode()
42053       }, params);
42054       var prefix = params.query;
42055       var url = apibase4 + "keys/all?" + utilQsString(params);
42056       doRequest(url, params, true, callback, function(err, d2) {
42057         if (err) {
42058           callback(err);
42059         } else {
42060           var f2 = filterMultikeys(prefix);
42061           var result = d2.data.filter(f2).map(valKey);
42062           _taginfoCache[url] = result;
42063           callback(null, result);
42064         }
42065       });
42066     },
42067     values: function(params, callback) {
42068       var key = params.key;
42069       if (key && _popularKeys[key] === true || _extraExcludedKeys.test(key)) {
42070         callback(null, []);
42071         return;
42072       }
42073       var doRequest = params.debounce ? debouncedRequest2 : request2;
42074       params = clean(setSort(setFilter(params)));
42075       params = Object.assign({
42076         rp: 25,
42077         sortname: "count_all",
42078         sortorder: "desc",
42079         page: 1,
42080         lang: _mainLocalizer.languageCode()
42081       }, params);
42082       var url = apibase4 + "key/values?" + utilQsString(params);
42083       doRequest(url, params, false, callback, function(err, d2) {
42084         if (err) {
42085           callback(err);
42086         } else {
42087           var allowUpperCase = allowUpperCaseTagValues.test(params.key);
42088           var f2 = filterValues(allowUpperCase, params.key);
42089           var result = d2.data.filter(f2).map(valKeyDescription);
42090           _taginfoCache[url] = result;
42091           callback(null, result);
42092         }
42093       });
42094     },
42095     roles: function(params, callback) {
42096       var doRequest = params.debounce ? debouncedRequest2 : request2;
42097       var geometry = params.geometry;
42098       params = clean(setSortMembers(params));
42099       params = Object.assign({
42100         rp: 25,
42101         sortname: "count_all_members",
42102         sortorder: "desc",
42103         page: 1,
42104         lang: _mainLocalizer.languageCode()
42105       }, params);
42106       var url = apibase4 + "relation/roles?" + utilQsString(params);
42107       doRequest(url, params, true, callback, function(err, d2) {
42108         if (err) {
42109           callback(err);
42110         } else {
42111           var f2 = filterRoles(geometry);
42112           var result = d2.data.filter(f2).map(roleKey);
42113           _taginfoCache[url] = result;
42114           callback(null, result);
42115         }
42116       });
42117     },
42118     docs: function(params, callback) {
42119       var doRequest = params.debounce ? debouncedRequest2 : request2;
42120       params = clean(setSort(params));
42121       var path = "key/wiki_pages?";
42122       if (params.value) {
42123         path = "tag/wiki_pages?";
42124       } else if (params.rtype) {
42125         path = "relation/wiki_pages?";
42126       }
42127       var url = apibase4 + path + utilQsString(params);
42128       doRequest(url, params, true, callback, function(err, d2) {
42129         if (err) {
42130           callback(err);
42131         } else {
42132           _taginfoCache[url] = d2.data;
42133           callback(null, d2.data);
42134         }
42135       });
42136     },
42137     apibase: function(_3) {
42138       if (!arguments.length) return apibase4;
42139       apibase4 = _3;
42140       return this;
42141     }
42142   };
42143
42144   // modules/services/vector_tile.js
42145   var import_fast_deep_equal4 = __toESM(require_fast_deep_equal(), 1);
42146
42147   // node_modules/@turf/helpers/dist/esm/index.js
42148   var earthRadius = 63710088e-1;
42149   var factors = {
42150     centimeters: earthRadius * 100,
42151     centimetres: earthRadius * 100,
42152     degrees: 360 / (2 * Math.PI),
42153     feet: earthRadius * 3.28084,
42154     inches: earthRadius * 39.37,
42155     kilometers: earthRadius / 1e3,
42156     kilometres: earthRadius / 1e3,
42157     meters: earthRadius,
42158     metres: earthRadius,
42159     miles: earthRadius / 1609.344,
42160     millimeters: earthRadius * 1e3,
42161     millimetres: earthRadius * 1e3,
42162     nauticalmiles: earthRadius / 1852,
42163     radians: 1,
42164     yards: earthRadius * 1.0936
42165   };
42166   function feature3(geom, properties, options = {}) {
42167     const feat = { type: "Feature" };
42168     if (options.id === 0 || options.id) {
42169       feat.id = options.id;
42170     }
42171     if (options.bbox) {
42172       feat.bbox = options.bbox;
42173     }
42174     feat.properties = properties || {};
42175     feat.geometry = geom;
42176     return feat;
42177   }
42178   function polygon(coordinates, properties, options = {}) {
42179     for (const ring of coordinates) {
42180       if (ring.length < 4) {
42181         throw new Error(
42182           "Each LinearRing of a Polygon must have 4 or more Positions."
42183         );
42184       }
42185       if (ring[ring.length - 1].length !== ring[0].length) {
42186         throw new Error("First and last Position are not equivalent.");
42187       }
42188       for (let j3 = 0; j3 < ring[ring.length - 1].length; j3++) {
42189         if (ring[ring.length - 1][j3] !== ring[0][j3]) {
42190           throw new Error("First and last Position are not equivalent.");
42191         }
42192       }
42193     }
42194     const geom = {
42195       type: "Polygon",
42196       coordinates
42197     };
42198     return feature3(geom, properties, options);
42199   }
42200   function lineString(coordinates, properties, options = {}) {
42201     if (coordinates.length < 2) {
42202       throw new Error("coordinates must be an array of two or more positions");
42203     }
42204     const geom = {
42205       type: "LineString",
42206       coordinates
42207     };
42208     return feature3(geom, properties, options);
42209   }
42210   function multiLineString(coordinates, properties, options = {}) {
42211     const geom = {
42212       type: "MultiLineString",
42213       coordinates
42214     };
42215     return feature3(geom, properties, options);
42216   }
42217   function multiPolygon(coordinates, properties, options = {}) {
42218     const geom = {
42219       type: "MultiPolygon",
42220       coordinates
42221     };
42222     return feature3(geom, properties, options);
42223   }
42224
42225   // node_modules/@turf/invariant/dist/esm/index.js
42226   function getGeom(geojson) {
42227     if (geojson.type === "Feature") {
42228       return geojson.geometry;
42229     }
42230     return geojson;
42231   }
42232
42233   // node_modules/@turf/bbox-clip/dist/esm/index.js
42234   function lineclip(points, bbox2, result) {
42235     var len = points.length, codeA = bitCode(points[0], bbox2), part = [], i3, codeB, lastCode;
42236     let a2;
42237     let b3;
42238     if (!result) result = [];
42239     for (i3 = 1; i3 < len; i3++) {
42240       a2 = points[i3 - 1];
42241       b3 = points[i3];
42242       codeB = lastCode = bitCode(b3, bbox2);
42243       while (true) {
42244         if (!(codeA | codeB)) {
42245           part.push(a2);
42246           if (codeB !== lastCode) {
42247             part.push(b3);
42248             if (i3 < len - 1) {
42249               result.push(part);
42250               part = [];
42251             }
42252           } else if (i3 === len - 1) {
42253             part.push(b3);
42254           }
42255           break;
42256         } else if (codeA & codeB) {
42257           break;
42258         } else if (codeA) {
42259           a2 = intersect(a2, b3, codeA, bbox2);
42260           codeA = bitCode(a2, bbox2);
42261         } else {
42262           b3 = intersect(a2, b3, codeB, bbox2);
42263           codeB = bitCode(b3, bbox2);
42264         }
42265       }
42266       codeA = lastCode;
42267     }
42268     if (part.length) result.push(part);
42269     return result;
42270   }
42271   function polygonclip(points, bbox2) {
42272     var result, edge, prev, prevInside, i3, p2, inside;
42273     for (edge = 1; edge <= 8; edge *= 2) {
42274       result = [];
42275       prev = points[points.length - 1];
42276       prevInside = !(bitCode(prev, bbox2) & edge);
42277       for (i3 = 0; i3 < points.length; i3++) {
42278         p2 = points[i3];
42279         inside = !(bitCode(p2, bbox2) & edge);
42280         if (inside !== prevInside) result.push(intersect(prev, p2, edge, bbox2));
42281         if (inside) result.push(p2);
42282         prev = p2;
42283         prevInside = inside;
42284       }
42285       points = result;
42286       if (!points.length) break;
42287     }
42288     return result;
42289   }
42290   function intersect(a2, b3, edge, bbox2) {
42291     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;
42292   }
42293   function bitCode(p2, bbox2) {
42294     var code = 0;
42295     if (p2[0] < bbox2[0]) code |= 1;
42296     else if (p2[0] > bbox2[2]) code |= 2;
42297     if (p2[1] < bbox2[1]) code |= 4;
42298     else if (p2[1] > bbox2[3]) code |= 8;
42299     return code;
42300   }
42301   function bboxClip(feature4, bbox2) {
42302     const geom = getGeom(feature4);
42303     const type2 = geom.type;
42304     const properties = feature4.type === "Feature" ? feature4.properties : {};
42305     let coords = geom.coordinates;
42306     switch (type2) {
42307       case "LineString":
42308       case "MultiLineString": {
42309         const lines = [];
42310         if (type2 === "LineString") {
42311           coords = [coords];
42312         }
42313         coords.forEach((line) => {
42314           lineclip(line, bbox2, lines);
42315         });
42316         if (lines.length === 1) {
42317           return lineString(lines[0], properties);
42318         }
42319         return multiLineString(lines, properties);
42320       }
42321       case "Polygon":
42322         return polygon(clipPolygon(coords, bbox2), properties);
42323       case "MultiPolygon":
42324         return multiPolygon(
42325           coords.map((poly) => {
42326             return clipPolygon(poly, bbox2);
42327           }),
42328           properties
42329         );
42330       default:
42331         throw new Error("geometry " + type2 + " not supported");
42332     }
42333   }
42334   function clipPolygon(rings, bbox2) {
42335     const outRings = [];
42336     for (const ring of rings) {
42337       const clipped = polygonclip(ring, bbox2);
42338       if (clipped.length > 0) {
42339         if (clipped[0][0] !== clipped[clipped.length - 1][0] || clipped[0][1] !== clipped[clipped.length - 1][1]) {
42340           clipped.push(clipped[0]);
42341         }
42342         if (clipped.length >= 4) {
42343           outRings.push(clipped);
42344         }
42345       }
42346     }
42347     return outRings;
42348   }
42349   var turf_bbox_clip_default = bboxClip;
42350
42351   // modules/services/vector_tile.js
42352   var import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify(), 1);
42353   var import_polygon_clipping = __toESM(require_polygon_clipping_umd(), 1);
42354   var tiler7 = utilTiler().tileSize(512).margin(1);
42355   var dispatch9 = dispatch_default("loadedData");
42356   var _vtCache;
42357   function abortRequest6(controller) {
42358     controller.abort();
42359   }
42360   function vtToGeoJSON(data, tile, mergeCache) {
42361     var vectorTile = new VectorTile(new Pbf(data));
42362     var layers = Object.keys(vectorTile.layers);
42363     if (!Array.isArray(layers)) {
42364       layers = [layers];
42365     }
42366     var features = [];
42367     layers.forEach(function(layerID) {
42368       var layer = vectorTile.layers[layerID];
42369       if (layer) {
42370         for (var i3 = 0; i3 < layer.length; i3++) {
42371           var feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
42372           var geometry = feature4.geometry;
42373           if (geometry.type === "Polygon") {
42374             geometry.type = "MultiPolygon";
42375             geometry.coordinates = [geometry.coordinates];
42376           }
42377           var isClipped = false;
42378           if (geometry.type === "MultiPolygon") {
42379             var featureClip = turf_bbox_clip_default(feature4, tile.extent.rectangle());
42380             if (!(0, import_fast_deep_equal4.default)(feature4.geometry, featureClip.geometry)) {
42381               isClipped = true;
42382             }
42383             if (!feature4.geometry.coordinates.length) continue;
42384             if (!feature4.geometry.coordinates[0].length) continue;
42385           }
42386           var featurehash = utilHashcode((0, import_fast_json_stable_stringify.default)(feature4));
42387           var propertyhash = utilHashcode((0, import_fast_json_stable_stringify.default)(feature4.properties || {}));
42388           feature4.__layerID__ = layerID.replace(/[^_a-zA-Z0-9\-]/g, "_");
42389           feature4.__featurehash__ = featurehash;
42390           feature4.__propertyhash__ = propertyhash;
42391           features.push(feature4);
42392           if (isClipped && geometry.type === "MultiPolygon") {
42393             var merged = mergeCache[propertyhash];
42394             if (merged && merged.length) {
42395               var other = merged[0];
42396               var coords = import_polygon_clipping.default.union(
42397                 feature4.geometry.coordinates,
42398                 other.geometry.coordinates
42399               );
42400               if (!coords || !coords.length) {
42401                 continue;
42402               }
42403               merged.push(feature4);
42404               for (var j3 = 0; j3 < merged.length; j3++) {
42405                 merged[j3].geometry.coordinates = coords;
42406                 merged[j3].__featurehash__ = featurehash;
42407               }
42408             } else {
42409               mergeCache[propertyhash] = [feature4];
42410             }
42411           }
42412         }
42413       }
42414     });
42415     return features;
42416   }
42417   function loadTile3(source, tile) {
42418     if (source.loaded[tile.id] || source.inflight[tile.id]) return;
42419     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) {
42420       var subdomains = r2.split(",");
42421       return subdomains[(tile.xyz[0] + tile.xyz[1]) % subdomains.length];
42422     });
42423     var controller = new AbortController();
42424     source.inflight[tile.id] = controller;
42425     fetch(url, { signal: controller.signal }).then(function(response) {
42426       if (!response.ok) {
42427         throw new Error(response.status + " " + response.statusText);
42428       }
42429       source.loaded[tile.id] = [];
42430       delete source.inflight[tile.id];
42431       return response.arrayBuffer();
42432     }).then(function(data) {
42433       if (!data) {
42434         throw new Error("No Data");
42435       }
42436       var z3 = tile.xyz[2];
42437       if (!source.canMerge[z3]) {
42438         source.canMerge[z3] = {};
42439       }
42440       source.loaded[tile.id] = vtToGeoJSON(data, tile, source.canMerge[z3]);
42441       dispatch9.call("loadedData");
42442     }).catch(function() {
42443       source.loaded[tile.id] = [];
42444       delete source.inflight[tile.id];
42445     });
42446   }
42447   var vector_tile_default = {
42448     init: function() {
42449       if (!_vtCache) {
42450         this.reset();
42451       }
42452       this.event = utilRebind(this, dispatch9, "on");
42453     },
42454     reset: function() {
42455       for (var sourceID in _vtCache) {
42456         var source = _vtCache[sourceID];
42457         if (source && source.inflight) {
42458           Object.values(source.inflight).forEach(abortRequest6);
42459         }
42460       }
42461       _vtCache = {};
42462     },
42463     addSource: function(sourceID, template) {
42464       _vtCache[sourceID] = { template, inflight: {}, loaded: {}, canMerge: {} };
42465       return _vtCache[sourceID];
42466     },
42467     data: function(sourceID, projection2) {
42468       var source = _vtCache[sourceID];
42469       if (!source) return [];
42470       var tiles = tiler7.getTiles(projection2);
42471       var seen = {};
42472       var results = [];
42473       for (var i3 = 0; i3 < tiles.length; i3++) {
42474         var features = source.loaded[tiles[i3].id];
42475         if (!features || !features.length) continue;
42476         for (var j3 = 0; j3 < features.length; j3++) {
42477           var feature4 = features[j3];
42478           var hash2 = feature4.__featurehash__;
42479           if (seen[hash2]) continue;
42480           seen[hash2] = true;
42481           results.push(Object.assign({}, feature4));
42482         }
42483       }
42484       return results;
42485     },
42486     loadTiles: function(sourceID, template, projection2) {
42487       var source = _vtCache[sourceID];
42488       if (!source) {
42489         source = this.addSource(sourceID, template);
42490       }
42491       var tiles = tiler7.getTiles(projection2);
42492       Object.keys(source.inflight).forEach(function(k3) {
42493         var wanted = tiles.find(function(tile) {
42494           return k3 === tile.id;
42495         });
42496         if (!wanted) {
42497           abortRequest6(source.inflight[k3]);
42498           delete source.inflight[k3];
42499         }
42500       });
42501       tiles.forEach(function(tile) {
42502         loadTile3(source, tile);
42503       });
42504     },
42505     cache: function() {
42506       return _vtCache;
42507     }
42508   };
42509
42510   // modules/services/wikidata.js
42511   var apibase5 = "https://www.wikidata.org/w/api.php?";
42512   var _wikidataCache = {};
42513   var wikidata_default = {
42514     init: function() {
42515     },
42516     reset: function() {
42517       _wikidataCache = {};
42518     },
42519     // Search for Wikidata items matching the query
42520     itemsForSearchQuery: function(query, callback, language) {
42521       if (!query) {
42522         if (callback) callback("No query", {});
42523         return;
42524       }
42525       var lang = this.languagesToQuery()[0];
42526       var url = apibase5 + utilQsString({
42527         action: "wbsearchentities",
42528         format: "json",
42529         formatversion: 2,
42530         search: query,
42531         type: "item",
42532         // the language to search
42533         language: language || lang,
42534         // the language for the label and description in the result
42535         uselang: lang,
42536         limit: 10,
42537         origin: "*"
42538       });
42539       json_default(url).then((result) => {
42540         if (result && result.error) {
42541           if (result.error.code === "badvalue" && result.error.info.includes(lang) && !language && lang.includes("-")) {
42542             this.itemsForSearchQuery(query, callback, lang.split("-")[0]);
42543             return;
42544           } else {
42545             throw new Error(result.error);
42546           }
42547         }
42548         if (callback) callback(null, result.search || {});
42549       }).catch(function(err) {
42550         if (callback) callback(err.message, {});
42551       });
42552     },
42553     // Given a Wikipedia language and article title,
42554     // return an array of corresponding Wikidata entities.
42555     itemsByTitle: function(lang, title, callback) {
42556       if (!title) {
42557         if (callback) callback("No title", {});
42558         return;
42559       }
42560       lang = lang || "en";
42561       var url = apibase5 + utilQsString({
42562         action: "wbgetentities",
42563         format: "json",
42564         formatversion: 2,
42565         sites: lang.replace(/-/g, "_") + "wiki",
42566         titles: title,
42567         languages: "en",
42568         // shrink response by filtering to one language
42569         origin: "*"
42570       });
42571       json_default(url).then(function(result) {
42572         if (result && result.error) {
42573           throw new Error(result.error);
42574         }
42575         if (callback) callback(null, result.entities || {});
42576       }).catch(function(err) {
42577         if (callback) callback(err.message, {});
42578       });
42579     },
42580     languagesToQuery: function() {
42581       return _mainLocalizer.localeCodes().map(function(code) {
42582         return code.toLowerCase();
42583       }).filter(function(code) {
42584         return code !== "en-us";
42585       });
42586     },
42587     entityByQID: function(qid, callback) {
42588       if (!qid) {
42589         callback("No qid", {});
42590         return;
42591       }
42592       if (_wikidataCache[qid]) {
42593         if (callback) callback(null, _wikidataCache[qid]);
42594         return;
42595       }
42596       var langs = this.languagesToQuery();
42597       var url = apibase5 + utilQsString({
42598         action: "wbgetentities",
42599         format: "json",
42600         formatversion: 2,
42601         ids: qid,
42602         props: "labels|descriptions|claims|sitelinks",
42603         sitefilter: langs.map(function(d2) {
42604           return d2 + "wiki";
42605         }).join("|"),
42606         languages: langs.join("|"),
42607         languagefallback: 1,
42608         origin: "*"
42609       });
42610       json_default(url).then(function(result) {
42611         if (result && result.error) {
42612           throw new Error(result.error);
42613         }
42614         if (callback) callback(null, result.entities[qid] || {});
42615       }).catch(function(err) {
42616         if (callback) callback(err.message, {});
42617       });
42618     },
42619     // Pass `params` object of the form:
42620     // {
42621     //   qid: 'string'      // brand wikidata  (e.g. 'Q37158')
42622     // }
42623     //
42624     // Get an result object used to display tag documentation
42625     // {
42626     //   title:        'string',
42627     //   description:  'string',
42628     //   editURL:      'string',
42629     //   imageURL:     'string',
42630     //   wiki:         { title: 'string', text: 'string', url: 'string' }
42631     // }
42632     //
42633     getDocs: function(params, callback) {
42634       var langs = this.languagesToQuery();
42635       this.entityByQID(params.qid, function(err, entity) {
42636         if (err || !entity) {
42637           callback(err || "No entity");
42638           return;
42639         }
42640         var i3;
42641         var description;
42642         for (i3 in langs) {
42643           let code = langs[i3];
42644           if (entity.descriptions[code] && entity.descriptions[code].language === code) {
42645             description = entity.descriptions[code];
42646             break;
42647           }
42648         }
42649         if (!description && Object.values(entity.descriptions).length) description = Object.values(entity.descriptions)[0];
42650         var result = {
42651           title: entity.id,
42652           description: (selection2) => selection2.text(description ? description.value : ""),
42653           descriptionLocaleCode: description ? description.language : "",
42654           editURL: "https://www.wikidata.org/wiki/" + entity.id
42655         };
42656         if (entity.claims) {
42657           var imageroot = "https://commons.wikimedia.org/w/index.php";
42658           var props = ["P154", "P18"];
42659           var prop, image;
42660           for (i3 = 0; i3 < props.length; i3++) {
42661             prop = entity.claims[props[i3]];
42662             if (prop && Object.keys(prop).length > 0) {
42663               image = prop[Object.keys(prop)[0]].mainsnak.datavalue.value;
42664               if (image) {
42665                 result.imageURL = imageroot + "?" + utilQsString({
42666                   title: "Special:Redirect/file/" + image,
42667                   width: 400
42668                 });
42669                 break;
42670               }
42671             }
42672           }
42673         }
42674         if (entity.sitelinks) {
42675           var englishLocale = _mainLocalizer.languageCode().toLowerCase() === "en";
42676           for (i3 = 0; i3 < langs.length; i3++) {
42677             var w3 = langs[i3] + "wiki";
42678             if (entity.sitelinks[w3]) {
42679               var title = entity.sitelinks[w3].title;
42680               var tKey = "inspector.wiki_reference";
42681               if (!englishLocale && langs[i3] === "en") {
42682                 tKey = "inspector.wiki_en_reference";
42683               }
42684               result.wiki = {
42685                 title,
42686                 text: tKey,
42687                 url: "https://" + langs[i3] + ".wikipedia.org/wiki/" + title.replace(/ /g, "_")
42688               };
42689               break;
42690             }
42691           }
42692         }
42693         callback(null, result);
42694       });
42695     }
42696   };
42697
42698   // modules/services/wikipedia.js
42699   var endpoint = "https://en.wikipedia.org/w/api.php?";
42700   var wikipedia_default = {
42701     init: function() {
42702     },
42703     reset: function() {
42704     },
42705     search: function(lang, query, callback) {
42706       if (!query) {
42707         if (callback) callback("No Query", []);
42708         return;
42709       }
42710       lang = lang || "en";
42711       var url = endpoint.replace("en", lang) + utilQsString({
42712         action: "query",
42713         list: "search",
42714         srlimit: "10",
42715         srinfo: "suggestion",
42716         format: "json",
42717         origin: "*",
42718         srsearch: query
42719       });
42720       json_default(url).then(function(result) {
42721         if (result && result.error) {
42722           throw new Error(result.error);
42723         } else if (!result || !result.query || !result.query.search) {
42724           throw new Error("No Results");
42725         }
42726         if (callback) {
42727           var titles = result.query.search.map(function(d2) {
42728             return d2.title;
42729           });
42730           callback(null, titles);
42731         }
42732       }).catch(function(err) {
42733         if (callback) callback(err, []);
42734       });
42735     },
42736     suggestions: function(lang, query, callback) {
42737       if (!query) {
42738         if (callback) callback("", []);
42739         return;
42740       }
42741       lang = lang || "en";
42742       var url = endpoint.replace("en", lang) + utilQsString({
42743         action: "opensearch",
42744         namespace: 0,
42745         suggest: "",
42746         format: "json",
42747         origin: "*",
42748         search: query
42749       });
42750       json_default(url).then(function(result) {
42751         if (result && result.error) {
42752           throw new Error(result.error);
42753         } else if (!result || result.length < 2) {
42754           throw new Error("No Results");
42755         }
42756         if (callback) callback(null, result[1] || []);
42757       }).catch(function(err) {
42758         if (callback) callback(err.message, []);
42759       });
42760     }
42761   };
42762
42763   // modules/services/mapilio.js
42764   var apiUrl2 = "https://end.mapilio.com";
42765   var imageBaseUrl = "https://cdn.mapilio.com/im";
42766   var baseTileUrl2 = "https://geo.mapilio.com/geoserver/gwc/service/wmts?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER=mapilio:";
42767   var pointLayer = "map_points";
42768   var lineLayer = "map_roads_line";
42769   var tileStyle = "&STYLE=&TILEMATRIX=EPSG:900913:{z}&TILEMATRIXSET=EPSG:900913&FORMAT=application/vnd.mapbox-vector-tile&TILECOL={x}&TILEROW={y}";
42770   var minZoom2 = 14;
42771   var dispatch10 = dispatch_default("loadedImages", "loadedLines");
42772   var imgZoom2 = zoom_default2().extent([[0, 0], [320, 240]]).translateExtent([[0, 0], [320, 240]]).scaleExtent([1, 15]);
42773   var pannellumViewerCSS3 = "pannellum/pannellum.css";
42774   var pannellumViewerJS3 = "pannellum/pannellum.js";
42775   var resolution = 1080;
42776   var _activeImage;
42777   var _cache3;
42778   var _loadViewerPromise5;
42779   var _pannellumViewer2;
42780   var _sceneOptions2 = {
42781     showFullscreenCtrl: false,
42782     autoLoad: true,
42783     yaw: 0,
42784     minHfov: 10,
42785     maxHfov: 90,
42786     hfov: 60
42787   };
42788   var _currScene2 = 0;
42789   function partitionViewport5(projection2) {
42790     const z3 = geoScaleToZoom(projection2.scale());
42791     const z22 = Math.ceil(z3 * 2) / 2 + 2.5;
42792     const tiler8 = utilTiler().zoomExtent([z22, z22]);
42793     return tiler8.getTiles(projection2).map(function(tile) {
42794       return tile.extent;
42795     });
42796   }
42797   function searchLimited5(limit, projection2, rtree) {
42798     limit = limit || 5;
42799     return partitionViewport5(projection2).reduce(function(result, extent) {
42800       const found = rtree.search(extent.bbox()).slice(0, limit).map(function(d2) {
42801         return d2.data;
42802       });
42803       return found.length ? result.concat(found) : result;
42804     }, []);
42805   }
42806   function loadTiles4(which, url, maxZoom2, projection2) {
42807     const tiler8 = utilTiler().zoomExtent([minZoom2, maxZoom2]).skipNullIsland(true);
42808     const tiles = tiler8.getTiles(projection2);
42809     tiles.forEach(function(tile) {
42810       loadTile4(which, url, tile);
42811     });
42812   }
42813   function loadTile4(which, url, tile) {
42814     const cache = _cache3.requests;
42815     const tileId = "".concat(tile.id, "-").concat(which);
42816     if (cache.loaded[tileId] || cache.inflight[tileId]) return;
42817     const controller = new AbortController();
42818     cache.inflight[tileId] = controller;
42819     const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
42820     fetch(requestUrl, { signal: controller.signal }).then(function(response) {
42821       if (!response.ok) {
42822         throw new Error(response.status + " " + response.statusText);
42823       }
42824       cache.loaded[tileId] = true;
42825       delete cache.inflight[tileId];
42826       return response.arrayBuffer();
42827     }).then(function(data) {
42828       if (data.byteLength === 0) {
42829         throw new Error("No Data");
42830       }
42831       loadTileDataToCache2(data, tile, which);
42832       if (which === "images") {
42833         dispatch10.call("loadedImages");
42834       } else {
42835         dispatch10.call("loadedLines");
42836       }
42837     }).catch(function(e3) {
42838       if (e3.message === "No Data") {
42839         cache.loaded[tileId] = true;
42840       } else {
42841         console.error(e3);
42842       }
42843     });
42844   }
42845   function loadTileDataToCache2(data, tile) {
42846     const vectorTile = new VectorTile(new Pbf(data));
42847     if (vectorTile.layers.hasOwnProperty(pointLayer)) {
42848       const features = [];
42849       const cache = _cache3.images;
42850       const layer = vectorTile.layers[pointLayer];
42851       for (let i3 = 0; i3 < layer.length; i3++) {
42852         const feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
42853         const loc = feature4.geometry.coordinates;
42854         let resolutionArr = feature4.properties.resolution.split("x");
42855         let sourceWidth = Math.max(resolutionArr[0], resolutionArr[1]);
42856         let sourceHeight = Math.min(resolutionArr[0], resolutionArr[1]);
42857         let isPano = sourceWidth % sourceHeight === 0;
42858         const d2 = {
42859           service: "photo",
42860           loc,
42861           capture_time: feature4.properties.capture_time,
42862           id: feature4.properties.id,
42863           sequence_id: feature4.properties.sequence_uuid,
42864           heading: feature4.properties.heading,
42865           resolution: feature4.properties.resolution,
42866           isPano
42867         };
42868         cache.forImageId[d2.id] = d2;
42869         features.push({
42870           minX: loc[0],
42871           minY: loc[1],
42872           maxX: loc[0],
42873           maxY: loc[1],
42874           data: d2
42875         });
42876       }
42877       if (cache.rtree) {
42878         cache.rtree.load(features);
42879       }
42880     }
42881     if (vectorTile.layers.hasOwnProperty(lineLayer)) {
42882       const cache = _cache3.sequences;
42883       const layer = vectorTile.layers[lineLayer];
42884       for (let i3 = 0; i3 < layer.length; i3++) {
42885         const feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
42886         if (cache.lineString[feature4.properties.sequence_uuid]) {
42887           const cacheEntry = cache.lineString[feature4.properties.sequence_uuid];
42888           if (cacheEntry.some((f2) => {
42889             const cachedCoords = f2.geometry.coordinates;
42890             const featureCoords = feature4.geometry.coordinates;
42891             return isEqual_default(cachedCoords, featureCoords);
42892           })) continue;
42893           cacheEntry.push(feature4);
42894         } else {
42895           cache.lineString[feature4.properties.sequence_uuid] = [feature4];
42896         }
42897       }
42898     }
42899   }
42900   function getImageData(imageId, sequenceId) {
42901     return fetch(apiUrl2 + "/api/sequence-detail?sequence_uuid=".concat(sequenceId), { method: "GET" }).then(function(response) {
42902       if (!response.ok) {
42903         throw new Error(response.status + " " + response.statusText);
42904       }
42905       return response.json();
42906     }).then(function(data) {
42907       let index = data.data.findIndex((feature4) => feature4.id === imageId);
42908       const { filename, uploaded_hash } = data.data[index];
42909       _sceneOptions2.panorama = imageBaseUrl + "/" + uploaded_hash + "/" + filename + "/" + resolution;
42910     });
42911   }
42912   var mapilio_default = {
42913     // Initialize Mapilio
42914     init: function() {
42915       if (!_cache3) {
42916         this.reset();
42917       }
42918       this.event = utilRebind(this, dispatch10, "on");
42919     },
42920     // Reset cache and state
42921     reset: function() {
42922       if (_cache3) {
42923         Object.values(_cache3.requests.inflight).forEach(function(request3) {
42924           request3.abort();
42925         });
42926       }
42927       _cache3 = {
42928         images: { rtree: new RBush(), forImageId: {} },
42929         sequences: { rtree: new RBush(), lineString: {} },
42930         requests: { loaded: {}, inflight: {} }
42931       };
42932     },
42933     // Get visible images
42934     images: function(projection2) {
42935       const limit = 5;
42936       return searchLimited5(limit, projection2, _cache3.images.rtree);
42937     },
42938     cachedImage: function(imageKey) {
42939       return _cache3.images.forImageId[imageKey];
42940     },
42941     // Load images in the visible area
42942     loadImages: function(projection2) {
42943       let url = baseTileUrl2 + pointLayer + tileStyle;
42944       loadTiles4("images", url, 14, projection2);
42945     },
42946     // Load line in the visible area
42947     loadLines: function(projection2) {
42948       let url = baseTileUrl2 + lineLayer + tileStyle;
42949       loadTiles4("line", url, 14, projection2);
42950     },
42951     // Get visible sequences
42952     sequences: function(projection2) {
42953       const viewport = projection2.clipExtent();
42954       const min3 = [viewport[0][0], viewport[1][1]];
42955       const max3 = [viewport[1][0], viewport[0][1]];
42956       const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
42957       const sequenceIds = {};
42958       let lineStrings = [];
42959       _cache3.images.rtree.search(bbox2).forEach(function(d2) {
42960         if (d2.data.sequence_id) {
42961           sequenceIds[d2.data.sequence_id] = true;
42962         }
42963       });
42964       Object.keys(sequenceIds).forEach(function(sequenceId) {
42965         if (_cache3.sequences.lineString[sequenceId]) {
42966           lineStrings = lineStrings.concat(_cache3.sequences.lineString[sequenceId]);
42967         }
42968       });
42969       return lineStrings;
42970     },
42971     // Set the currently visible image
42972     setActiveImage: function(image) {
42973       if (image) {
42974         _activeImage = {
42975           id: image.id,
42976           sequence_id: image.sequence_id
42977         };
42978       } else {
42979         _activeImage = null;
42980       }
42981     },
42982     // Update the currently highlighted sequence and selected bubble.
42983     setStyles: function(context, hovered) {
42984       const hoveredImageId = hovered && hovered.id;
42985       const hoveredSequenceId = hovered && hovered.sequence_id;
42986       const selectedSequenceId = _activeImage && _activeImage.sequence_id;
42987       const selectedImageId = _activeImage && _activeImage.id;
42988       const markers = context.container().selectAll(".layer-mapilio .viewfield-group");
42989       const sequences = context.container().selectAll(".layer-mapilio .sequence");
42990       markers.classed("highlighted", function(d2) {
42991         return d2.id === hoveredImageId;
42992       }).classed("hovered", function(d2) {
42993         return d2.id === hoveredImageId;
42994       }).classed("currentView", function(d2) {
42995         return d2.id === selectedImageId;
42996       });
42997       sequences.classed("highlighted", function(d2) {
42998         return d2.properties.sequence_uuid === hoveredSequenceId;
42999       }).classed("currentView", function(d2) {
43000         return d2.properties.sequence_uuid === selectedSequenceId;
43001       });
43002       return this;
43003     },
43004     updateUrlImage: function(imageKey) {
43005       const hash2 = utilStringQs(window.location.hash);
43006       if (imageKey) {
43007         hash2.photo = "mapilio/" + imageKey;
43008       } else {
43009         delete hash2.photo;
43010       }
43011       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
43012     },
43013     initViewer: function() {
43014       if (!window.pannellum) return;
43015       if (_pannellumViewer2) return;
43016       _currScene2 += 1;
43017       const sceneID = _currScene2.toString();
43018       const options = {
43019         "default": { firstScene: sceneID },
43020         scenes: {}
43021       };
43022       options.scenes[sceneID] = _sceneOptions2;
43023       _pannellumViewer2 = window.pannellum.viewer("ideditor-viewer-mapilio-pnlm", options);
43024     },
43025     selectImage: function(context, id2) {
43026       let that = this;
43027       let d2 = this.cachedImage(id2);
43028       this.setActiveImage(d2);
43029       this.updateUrlImage(d2.id);
43030       let viewer = context.container().select(".photoviewer");
43031       if (!viewer.empty()) viewer.datum(d2);
43032       this.setStyles(context, null);
43033       if (!d2) return this;
43034       let wrap2 = context.container().select(".photoviewer .mapilio-wrapper");
43035       let attribution = wrap2.selectAll(".photo-attribution").text("");
43036       if (d2.capture_time) {
43037         attribution.append("span").attr("class", "captured_at").text(localeDateString2(d2.capture_time));
43038         attribution.append("span").text("|");
43039       }
43040       attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", "https://mapilio.com/app?lat=".concat(d2.loc[1], "&lng=").concat(d2.loc[0], "&zoom=17&pId=").concat(d2.id)).text("mapilio.com");
43041       wrap2.transition().duration(100).call(imgZoom2.transform, identity3);
43042       wrap2.selectAll("img").remove();
43043       wrap2.selectAll("button.back").classed("hide", !_cache3.images.forImageId.hasOwnProperty(+id2 - 1));
43044       wrap2.selectAll("button.forward").classed("hide", !_cache3.images.forImageId.hasOwnProperty(+id2 + 1));
43045       getImageData(d2.id, d2.sequence_id).then(function() {
43046         if (d2.isPano) {
43047           if (!_pannellumViewer2) {
43048             that.initViewer();
43049           } else {
43050             _currScene2 += 1;
43051             let sceneID = _currScene2.toString();
43052             _pannellumViewer2.addScene(sceneID, _sceneOptions2).loadScene(sceneID);
43053             if (_currScene2 > 2) {
43054               sceneID = (_currScene2 - 1).toString();
43055               _pannellumViewer2.removeScene(sceneID);
43056             }
43057           }
43058         } else {
43059           that.initOnlyPhoto(context);
43060         }
43061       });
43062       function localeDateString2(s2) {
43063         if (!s2) return null;
43064         var options = { day: "numeric", month: "short", year: "numeric" };
43065         var d4 = new Date(s2);
43066         if (isNaN(d4.getTime())) return null;
43067         return d4.toLocaleDateString(_mainLocalizer.localeCode(), options);
43068       }
43069       return this;
43070     },
43071     initOnlyPhoto: function(context) {
43072       if (_pannellumViewer2) {
43073         _pannellumViewer2.destroy();
43074         _pannellumViewer2 = null;
43075       }
43076       let wrap2 = context.container().select("#ideditor-viewer-mapilio-simple");
43077       let imgWrap = wrap2.select("img");
43078       if (!imgWrap.empty()) {
43079         imgWrap.attr("src", _sceneOptions2.panorama);
43080       } else {
43081         wrap2.append("img").attr("src", _sceneOptions2.panorama);
43082       }
43083     },
43084     ensureViewerLoaded: function(context) {
43085       let that = this;
43086       let imgWrap = context.container().select("#ideditor-viewer-mapilio-simple > img");
43087       if (!imgWrap.empty()) {
43088         imgWrap.remove();
43089       }
43090       if (_loadViewerPromise5) return _loadViewerPromise5;
43091       let wrap2 = context.container().select(".photoviewer").selectAll(".mapilio-wrapper").data([0]);
43092       let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper mapilio-wrapper").classed("hide", true).on("dblclick.zoom", null);
43093       wrapEnter.append("div").attr("class", "photo-attribution fillD");
43094       const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-mapilio");
43095       controlsEnter.append("button").classed("back", true).on("click.back", step(-1)).text("\u25C4");
43096       controlsEnter.append("button").classed("forward", true).on("click.forward", step(1)).text("\u25BA");
43097       wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-pnlm");
43098       wrapEnter.append("div").attr("id", "ideditor-viewer-mapilio-simple-wrap").call(imgZoom2.on("zoom", zoomPan)).append("div").attr("id", "ideditor-viewer-mapilio-simple");
43099       context.ui().photoviewer.on("resize.mapilio", () => {
43100         if (_pannellumViewer2) {
43101           _pannellumViewer2.resize();
43102         }
43103       });
43104       _loadViewerPromise5 = new Promise((resolve, reject) => {
43105         let loadedCount = 0;
43106         function loaded() {
43107           loadedCount += 1;
43108           if (loadedCount === 2) resolve();
43109         }
43110         const head = select_default2("head");
43111         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() {
43112           reject();
43113         });
43114         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() {
43115           reject();
43116         });
43117       }).catch(function() {
43118         _loadViewerPromise5 = null;
43119       });
43120       function step(stepBy) {
43121         return function() {
43122           if (!_activeImage) return;
43123           const imageId = _activeImage.id;
43124           const nextIndex = imageId + stepBy;
43125           if (!nextIndex) return;
43126           const nextImage = _cache3.images.forImageId[nextIndex];
43127           context.map().centerEase(nextImage.loc);
43128           that.selectImage(context, nextImage.id);
43129         };
43130       }
43131       function zoomPan(d3_event) {
43132         var t2 = d3_event.transform;
43133         context.container().select(".photoviewer #ideditor-viewer-mapilio-simple").call(utilSetTransform, t2.x, t2.y, t2.k);
43134       }
43135       return _loadViewerPromise5;
43136     },
43137     showViewer: function(context) {
43138       const wrap2 = context.container().select(".photoviewer");
43139       const isHidden = wrap2.selectAll(".photo-wrapper.mapilio-wrapper.hide").size();
43140       if (isHidden) {
43141         for (const service of Object.values(services)) {
43142           if (service === this) continue;
43143           if (typeof service.hideViewer === "function") {
43144             service.hideViewer(context);
43145           }
43146         }
43147         wrap2.classed("hide", false).selectAll(".photo-wrapper.mapilio-wrapper").classed("hide", false);
43148       }
43149       return this;
43150     },
43151     /**
43152      * hideViewer()
43153      */
43154     hideViewer: function(context) {
43155       let viewer = context.container().select(".photoviewer");
43156       if (!viewer.empty()) viewer.datum(null);
43157       this.updateUrlImage(null);
43158       viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
43159       context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
43160       this.setActiveImage();
43161       return this.setStyles(context, null);
43162     },
43163     // Return the current cache
43164     cache: function() {
43165       return _cache3;
43166     }
43167   };
43168
43169   // modules/services/panoramax.js
43170   var apiUrl3 = "https://api.panoramax.xyz/";
43171   var tileUrl2 = apiUrl3 + "api/map/{z}/{x}/{y}.mvt";
43172   var imageDataUrl = apiUrl3 + "api/collections/{collectionId}/items/{itemId}";
43173   var sequenceDataUrl = apiUrl3 + "api/collections/{collectionId}/items?limit=1000";
43174   var userIdUrl = apiUrl3 + "api/users/search?q={username}";
43175   var usernameURL = apiUrl3 + "api/users/{userId}";
43176   var viewerUrl = apiUrl3;
43177   var highDefinition = "hd";
43178   var standardDefinition = "sd";
43179   var pictureLayer = "pictures";
43180   var sequenceLayer = "sequences";
43181   var minZoom3 = 10;
43182   var imageMinZoom = 15;
43183   var lineMinZoom = 10;
43184   var dispatch11 = dispatch_default("loadedImages", "loadedLines", "viewerChanged");
43185   var _cache4;
43186   var _loadViewerPromise6;
43187   var _definition = standardDefinition;
43188   var _isHD = false;
43189   var _planeFrame2;
43190   var _pannellumFrame2;
43191   var _currentFrame2;
43192   var _currentScene = {
43193     currentImage: null,
43194     nextImage: null,
43195     prevImage: null
43196   };
43197   var _activeImage2;
43198   var _isViewerOpen2 = false;
43199   function partitionViewport6(projection2) {
43200     const z3 = geoScaleToZoom(projection2.scale());
43201     const z22 = Math.ceil(z3 * 2) / 2 + 2.5;
43202     const tiler8 = utilTiler().zoomExtent([z22, z22]);
43203     return tiler8.getTiles(projection2).map(function(tile) {
43204       return tile.extent;
43205     });
43206   }
43207   function searchLimited6(limit, projection2, rtree) {
43208     limit = limit || 5;
43209     return partitionViewport6(projection2).reduce(function(result, extent) {
43210       let found = rtree.search(extent.bbox());
43211       const spacing = Math.max(1, Math.floor(found.length / limit));
43212       found = found.filter((d2, idx) => idx % spacing === 0 || d2.data.id === (_activeImage2 == null ? void 0 : _activeImage2.id)).sort((a2, b3) => {
43213         if (a2.data.id === (_activeImage2 == null ? void 0 : _activeImage2.id)) return -1;
43214         if (b3.data.id === (_activeImage2 == null ? void 0 : _activeImage2.id)) return 1;
43215         return 0;
43216       }).slice(0, limit).map((d2) => d2.data);
43217       return found.length ? result.concat(found) : result;
43218     }, []);
43219   }
43220   function loadTiles5(which, url, maxZoom2, projection2, zoom) {
43221     const tiler8 = utilTiler().zoomExtent([minZoom3, maxZoom2]).skipNullIsland(true);
43222     const tiles = tiler8.getTiles(projection2);
43223     tiles.forEach(function(tile) {
43224       loadTile5(which, url, tile, zoom);
43225     });
43226   }
43227   function loadTile5(which, url, tile, zoom) {
43228     const cache = _cache4.requests;
43229     const tileId = "".concat(tile.id, "-").concat(which);
43230     if (cache.loaded[tileId] || cache.inflight[tileId]) return;
43231     const controller = new AbortController();
43232     cache.inflight[tileId] = controller;
43233     const requestUrl = url.replace("{x}", tile.xyz[0]).replace("{y}", tile.xyz[1]).replace("{z}", tile.xyz[2]);
43234     fetch(requestUrl, { signal: controller.signal }).then(function(response) {
43235       if (!response.ok) {
43236         throw new Error(response.status + " " + response.statusText);
43237       }
43238       cache.loaded[tileId] = true;
43239       delete cache.inflight[tileId];
43240       return response.arrayBuffer();
43241     }).then(function(data) {
43242       if (data.byteLength === 0) {
43243         throw new Error("No Data");
43244       }
43245       loadTileDataToCache3(data, tile, zoom);
43246       if (which === "images") {
43247         dispatch11.call("loadedImages");
43248       } else {
43249         dispatch11.call("loadedLines");
43250       }
43251     }).catch(function(e3) {
43252       if (e3.message === "No Data") {
43253         cache.loaded[tileId] = true;
43254       } else {
43255         console.error(e3);
43256       }
43257     });
43258   }
43259   function loadTileDataToCache3(data, tile, zoom) {
43260     const vectorTile = new VectorTile(new Pbf(data));
43261     let features, cache, layer, i3, feature4, loc, d2;
43262     if (vectorTile.layers.hasOwnProperty(pictureLayer)) {
43263       features = [];
43264       cache = _cache4.images;
43265       layer = vectorTile.layers[pictureLayer];
43266       for (i3 = 0; i3 < layer.length; i3++) {
43267         feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
43268         loc = feature4.geometry.coordinates;
43269         d2 = {
43270           service: "photo",
43271           loc,
43272           capture_time: feature4.properties.ts,
43273           capture_time_parsed: new Date(feature4.properties.ts),
43274           id: feature4.properties.id,
43275           account_id: feature4.properties.account_id,
43276           sequence_id: feature4.properties.first_sequence,
43277           heading: parseInt(feature4.properties.heading, 10),
43278           image_path: "",
43279           isPano: feature4.properties.type === "equirectangular",
43280           model: feature4.properties.model
43281         };
43282         cache.forImageId[d2.id] = d2;
43283         features.push({
43284           minX: loc[0],
43285           minY: loc[1],
43286           maxX: loc[0],
43287           maxY: loc[1],
43288           data: d2
43289         });
43290       }
43291       if (cache.rtree) {
43292         cache.rtree.load(features);
43293       }
43294     }
43295     if (vectorTile.layers.hasOwnProperty(sequenceLayer)) {
43296       cache = _cache4.sequences;
43297       if (zoom >= lineMinZoom && zoom < imageMinZoom) cache = _cache4.mockSequences;
43298       layer = vectorTile.layers[sequenceLayer];
43299       for (i3 = 0; i3 < layer.length; i3++) {
43300         feature4 = layer.feature(i3).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]);
43301         if (cache.lineString[feature4.properties.id]) {
43302           cache.lineString[feature4.properties.id].push(feature4);
43303         } else {
43304           cache.lineString[feature4.properties.id] = [feature4];
43305         }
43306       }
43307     }
43308   }
43309   async function getUsername(userId) {
43310     const cache = _cache4.users;
43311     if (cache[userId]) return cache[userId].name;
43312     const requestUrl = usernameURL.replace("{userId}", userId);
43313     const response = await fetch(requestUrl, { method: "GET" });
43314     if (!response.ok) {
43315       throw new Error(response.status + " " + response.statusText);
43316     }
43317     const data = await response.json();
43318     cache[userId] = data;
43319     return data.name;
43320   }
43321   var panoramax_default = {
43322     init: function() {
43323       if (!_cache4) {
43324         this.reset();
43325       }
43326       this.event = utilRebind(this, dispatch11, "on");
43327     },
43328     reset: function() {
43329       if (_cache4) {
43330         Object.values(_cache4.requests.inflight).forEach(function(request3) {
43331           request3.abort();
43332         });
43333       }
43334       _cache4 = {
43335         images: { rtree: new RBush(), forImageId: {} },
43336         sequences: { rtree: new RBush(), lineString: {}, items: {} },
43337         users: {},
43338         mockSequences: { rtree: new RBush(), lineString: {} },
43339         requests: { loaded: {}, inflight: {} }
43340       };
43341     },
43342     /**
43343      * Get visible images from cache
43344      * @param {*} projection Current Projection
43345      * @returns images data for the current projection
43346      */
43347     images: function(projection2) {
43348       const limit = 5;
43349       return searchLimited6(limit, projection2, _cache4.images.rtree);
43350     },
43351     /**
43352      * Get a specific image from cache
43353      * @param {*} imageKey the image id
43354      * @returns
43355      */
43356     cachedImage: function(imageKey) {
43357       return _cache4.images.forImageId[imageKey];
43358     },
43359     /**
43360      * Fetches images data for the visible area
43361      * @param {*} projection Current Projection
43362      */
43363     loadImages: function(projection2) {
43364       loadTiles5("images", tileUrl2, imageMinZoom, projection2);
43365     },
43366     /**
43367      * Fetches sequences data for the visible area
43368      * @param {*} projection Current Projection
43369      */
43370     loadLines: function(projection2, zoom) {
43371       loadTiles5("line", tileUrl2, lineMinZoom, projection2, zoom);
43372     },
43373     /**
43374      * Fetches all possible userIDs from Panoramax
43375      * @param {string} usernames one or multiple usernames
43376      * @returns userIDs
43377      */
43378     getUserIds: async function(usernames) {
43379       const requestUrls = usernames.map((username) => userIdUrl.replace("{username}", username));
43380       const responses = await Promise.all(requestUrls.map((requestUrl) => fetch(requestUrl, { method: "GET" })));
43381       if (responses.some((response) => !response.ok)) {
43382         const response = responses.find((response2) => !response2.ok);
43383         throw new Error(response.status + " " + response.statusText);
43384       }
43385       const data = await Promise.all(responses.map((response) => response.json()));
43386       return data.flatMap((d2, i3) => d2.features.filter((f2) => f2.name === usernames[i3]).map((f2) => f2.id));
43387     },
43388     /**
43389      * Get visible sequences from cache
43390      * @param {*} projection Current Projection
43391      * @param {number} zoom Current zoom (if zoom < `lineMinZoom` less accurate lines will be drawn)
43392      * @returns sequences data for the current projection
43393      */
43394     sequences: function(projection2, zoom) {
43395       const viewport = projection2.clipExtent();
43396       const min3 = [viewport[0][0], viewport[1][1]];
43397       const max3 = [viewport[1][0], viewport[0][1]];
43398       const bbox2 = geoExtent(projection2.invert(min3), projection2.invert(max3)).bbox();
43399       const sequenceIds = {};
43400       let lineStrings = [];
43401       if (zoom >= imageMinZoom) {
43402         _cache4.images.rtree.search(bbox2).forEach(function(d2) {
43403           if (d2.data.sequence_id) {
43404             sequenceIds[d2.data.sequence_id] = true;
43405           }
43406         });
43407         Object.keys(sequenceIds).forEach(function(sequenceId) {
43408           if (_cache4.sequences.lineString[sequenceId]) {
43409             lineStrings = lineStrings.concat(_cache4.sequences.lineString[sequenceId]);
43410           }
43411         });
43412         return lineStrings;
43413       }
43414       if (zoom >= lineMinZoom) {
43415         Object.keys(_cache4.mockSequences.lineString).forEach(function(sequenceId) {
43416           lineStrings = lineStrings.concat(_cache4.mockSequences.lineString[sequenceId]);
43417         });
43418       }
43419       return lineStrings;
43420     },
43421     /**
43422      * Updates the data for the currently visible image
43423      * @param {*} image Image data
43424      */
43425     setActiveImage: function(image) {
43426       if (image && image.id && image.sequence_id) {
43427         _activeImage2 = {
43428           id: image.id,
43429           sequence_id: image.sequence_id,
43430           loc: image.loc
43431         };
43432       } else {
43433         _activeImage2 = null;
43434       }
43435     },
43436     getActiveImage: function() {
43437       return _activeImage2;
43438     },
43439     /**
43440      * Update the currently highlighted sequence and selected bubble
43441      * @param {*} context Current HTML context
43442      * @param {*} [hovered] The hovered bubble image
43443      */
43444     setStyles: function(context, hovered) {
43445       const hoveredImageId = hovered && hovered.id;
43446       const hoveredSequenceId = hovered && hovered.sequence_id;
43447       const selectedSequenceId = _activeImage2 && _activeImage2.sequence_id;
43448       const selectedImageId = _activeImage2 && _activeImage2.id;
43449       const markers = context.container().selectAll(".layer-panoramax .viewfield-group");
43450       const sequences = context.container().selectAll(".layer-panoramax .sequence");
43451       markers.classed("highlighted", function(d2) {
43452         return d2.sequence_id === selectedSequenceId || d2.id === hoveredImageId;
43453       }).classed("hovered", function(d2) {
43454         return d2.id === hoveredImageId;
43455       }).classed("currentView", function(d2) {
43456         return d2.id === selectedImageId;
43457       });
43458       sequences.classed("highlighted", function(d2) {
43459         return d2.properties.id === hoveredSequenceId;
43460       }).classed("currentView", function(d2) {
43461         return d2.properties.id === selectedSequenceId;
43462       });
43463       context.container().selectAll(".layer-panoramax .viewfield-group .viewfield").attr("d", viewfieldPath);
43464       function viewfieldPath() {
43465         let d2 = this.parentNode.__data__;
43466         if (d2.isPano && d2.id !== selectedImageId) {
43467           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
43468         } else {
43469           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
43470         }
43471       }
43472       return this;
43473     },
43474     // Get viewer status
43475     isViewerOpen: function() {
43476       return _isViewerOpen2;
43477     },
43478     /**
43479      * Updates the URL to save the current shown image
43480      * @param {*} imageKey
43481      */
43482     updateUrlImage: function(imageKey) {
43483       const hash2 = utilStringQs(window.location.hash);
43484       if (imageKey) {
43485         hash2.photo = "panoramax/" + imageKey;
43486       } else {
43487         delete hash2.photo;
43488       }
43489       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
43490     },
43491     /**
43492      * Loads the selected image in the frame
43493      * @param {*} context Current HTML context
43494      * @param {*} id of the selected image
43495      * @returns
43496      */
43497     selectImage: function(context, id2) {
43498       let that = this;
43499       let d2 = that.cachedImage(id2);
43500       that.setActiveImage(d2);
43501       that.updateUrlImage(d2.id);
43502       const viewerLink = "".concat(viewerUrl, "#pic=").concat(d2.id, "&focus=pic");
43503       let viewer = context.container().select(".photoviewer");
43504       if (!viewer.empty()) viewer.datum(d2);
43505       this.setStyles(context, null);
43506       if (!d2) return this;
43507       let wrap2 = context.container().select(".photoviewer .panoramax-wrapper");
43508       let attribution = wrap2.selectAll(".photo-attribution").text("");
43509       let line1 = attribution.append("div").attr("class", "attribution-row");
43510       const hdDomId = utilUniqueDomId("panoramax-hd");
43511       let label = line1.append("label").attr("for", hdDomId).attr("class", "panoramax-hd");
43512       label.append("input").attr("type", "checkbox").attr("id", hdDomId).property("checked", _isHD).on("click", (d3_event) => {
43513         d3_event.stopPropagation();
43514         _isHD = !_isHD;
43515         _definition = _isHD ? highDefinition : standardDefinition;
43516         that.selectImage(context, d2.id).showViewer(context);
43517       });
43518       label.append("span").call(_t.append("panoramax.hd"));
43519       if (d2.capture_time) {
43520         attribution.append("span").attr("class", "captured_at").text(localeDateString2(d2.capture_time));
43521         attribution.append("span").text("|");
43522       }
43523       attribution.append("a").attr("class", "report-photo").attr("href", "mailto:signalement.ign@panoramax.fr").call(_t.append("panoramax.report"));
43524       attribution.append("span").text("|");
43525       attribution.append("a").attr("class", "image-link").attr("target", "_blank").attr("href", viewerLink).text("panoramax.xyz");
43526       this.getImageData(d2.sequence_id, d2.id).then(function(data) {
43527         _currentScene = {
43528           currentImage: null,
43529           nextImage: null,
43530           prevImage: null
43531         };
43532         _currentScene.currentImage = data.assets[_definition];
43533         const nextIndex = data.links.findIndex((x3) => x3.rel === "next");
43534         const prevIndex = data.links.findIndex((x3) => x3.rel === "prev");
43535         if (nextIndex !== -1) {
43536           _currentScene.nextImage = data.links[nextIndex];
43537         }
43538         if (prevIndex !== -1) {
43539           _currentScene.prevImage = data.links[prevIndex];
43540         }
43541         d2.image_path = _currentScene.currentImage.href;
43542         wrap2.selectAll("button.back").classed("hide", _currentScene.prevImage === null);
43543         wrap2.selectAll("button.forward").classed("hide", _currentScene.nextImage === null);
43544         _currentFrame2 = d2.isPano ? _pannellumFrame2 : _planeFrame2;
43545         _currentFrame2.showPhotoFrame(wrap2).selectPhoto(d2, true);
43546       });
43547       function localeDateString2(s2) {
43548         if (!s2) return null;
43549         var options = { day: "numeric", month: "short", year: "numeric" };
43550         var d4 = new Date(s2);
43551         if (isNaN(d4.getTime())) return null;
43552         return d4.toLocaleDateString(_mainLocalizer.localeCode(), options);
43553       }
43554       if (d2.account_id) {
43555         attribution.append("span").text("|");
43556         let line2 = attribution.append("span").attr("class", "attribution-row");
43557         getUsername(d2.account_id).then(function(username) {
43558           line2.append("span").attr("class", "captured_by").text("@" + username);
43559         });
43560       }
43561       return this;
43562     },
43563     photoFrame: function() {
43564       return _currentFrame2;
43565     },
43566     /**
43567      * Fetches the data for a specific image
43568      * @param {*} collectionId
43569      * @param {*} imageId
43570      * @returns The fetched image data
43571      */
43572     getImageData: async function(collectionId, imageId) {
43573       const cache = _cache4.sequences.items;
43574       if (cache[collectionId]) {
43575         const cached = cache[collectionId].find((d2) => d2.id === imageId);
43576         if (cached) return cached;
43577       } else {
43578         const response = await fetch(
43579           sequenceDataUrl.replace("{collectionId}", collectionId),
43580           { method: "GET" }
43581         );
43582         if (!response.ok) {
43583           throw new Error(response.status + " " + response.statusText);
43584         }
43585         const data = (await response.json()).features;
43586         cache[collectionId] = data;
43587       }
43588       const result = cache[collectionId].find((d2) => d2.id === imageId);
43589       if (result) return result;
43590       const itemResponse = await fetch(
43591         imageDataUrl.replace("{collectionId}", collectionId).replace("{itemId}", imageId),
43592         { method: "GET" }
43593       );
43594       if (!itemResponse.ok) {
43595         throw new Error(itemResponse.status + " " + itemResponse.statusText);
43596       }
43597       const itemData = await itemResponse.json();
43598       cache[collectionId].push(itemData);
43599       return itemData;
43600     },
43601     ensureViewerLoaded: function(context) {
43602       let that = this;
43603       let imgWrap = context.container().select("#ideditor-viewer-panoramax-simple > img");
43604       if (!imgWrap.empty()) {
43605         imgWrap.remove();
43606       }
43607       if (_loadViewerPromise6) return _loadViewerPromise6;
43608       let wrap2 = context.container().select(".photoviewer").selectAll(".panoramax-wrapper").data([0]);
43609       let wrapEnter = wrap2.enter().append("div").attr("class", "photo-wrapper panoramax-wrapper").classed("hide", true).on("dblclick.zoom", null);
43610       wrapEnter.append("div").attr("class", "photo-attribution fillD");
43611       const controlsEnter = wrapEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-panoramax");
43612       controlsEnter.append("button").classed("back", true).on("click.back", step(-1)).text("\u25C4");
43613       controlsEnter.append("button").classed("forward", true).on("click.forward", step(1)).text("\u25BA");
43614       _loadViewerPromise6 = Promise.all([
43615         pannellumPhotoFrame(context, wrapEnter),
43616         planePhotoFrame(context, wrapEnter)
43617       ]).then(([pannellumPhotoFrame2, planePhotoFrame2]) => {
43618         _pannellumFrame2 = pannellumPhotoFrame2;
43619         _pannellumFrame2.event.on("viewerChanged", () => dispatch11.call("viewerChanged"));
43620         _planeFrame2 = planePhotoFrame2;
43621         _planeFrame2.event.on("viewerChanged", () => dispatch11.call("viewerChanged"));
43622       });
43623       function step(stepBy) {
43624         return function() {
43625           if (!_currentScene.currentImage) return;
43626           let nextId;
43627           if (stepBy === 1) nextId = _currentScene.nextImage.id;
43628           else nextId = _currentScene.prevImage.id;
43629           if (!nextId) return;
43630           const nextImage = _cache4.images.forImageId[nextId];
43631           if (nextImage) {
43632             context.map().centerEase(nextImage.loc);
43633             that.selectImage(context, nextImage.id);
43634           }
43635         };
43636       }
43637       return _loadViewerPromise6;
43638     },
43639     /**
43640      * Shows the current viewer if hidden
43641      * @param {*} context
43642      */
43643     showViewer: function(context) {
43644       const wrap2 = context.container().select(".photoviewer");
43645       const isHidden = wrap2.selectAll(".photo-wrapper.panoramax-wrapper.hide").size();
43646       if (isHidden) {
43647         for (const service of Object.values(services)) {
43648           if (service === this) continue;
43649           if (typeof service.hideViewer === "function") {
43650             service.hideViewer(context);
43651           }
43652         }
43653         wrap2.classed("hide", false).selectAll(".photo-wrapper.panoramax-wrapper").classed("hide", false);
43654       }
43655       _isViewerOpen2 = true;
43656       return this;
43657     },
43658     /**
43659      * Hides the current viewer if shown, resets the active image and sequence
43660      * @param {*} context
43661      */
43662     hideViewer: function(context) {
43663       let viewer = context.container().select(".photoviewer");
43664       if (!viewer.empty()) viewer.datum(null);
43665       this.updateUrlImage(null);
43666       viewer.classed("hide", true).selectAll(".photo-wrapper").classed("hide", true);
43667       context.container().selectAll(".viewfield-group, .sequence, .icon-sign").classed("currentView", false);
43668       this.setActiveImage(null);
43669       _isViewerOpen2 = false;
43670       return this.setStyles(context, null);
43671     },
43672     cache: function() {
43673       return _cache4;
43674     }
43675   };
43676
43677   // modules/services/index.js
43678   var services = {
43679     geocoder: nominatim_default,
43680     keepRight: keepRight_default,
43681     osmose: osmose_default,
43682     mapillary: mapillary_default,
43683     nsi: nsi_default,
43684     kartaview: kartaview_default,
43685     vegbilder: vegbilder_default,
43686     osm: osm_default,
43687     osmWikibase: osm_wikibase_default,
43688     maprules: maprules_default,
43689     streetside: streetside_default,
43690     taginfo: taginfo_default,
43691     vectorTile: vector_tile_default,
43692     wikidata: wikidata_default,
43693     wikipedia: wikipedia_default,
43694     mapilio: mapilio_default,
43695     panoramax: panoramax_default
43696   };
43697
43698   // modules/validations/almost_junction.js
43699   function validationAlmostJunction(context) {
43700     const type2 = "almost_junction";
43701     const EXTEND_TH_METERS = 5;
43702     const WELD_TH_METERS = 0.75;
43703     const CLOSE_NODE_TH = EXTEND_TH_METERS - WELD_TH_METERS;
43704     const SIG_ANGLE_TH = Math.atan(WELD_TH_METERS / EXTEND_TH_METERS);
43705     function isHighway(entity) {
43706       return entity.type === "way" && osmRoutableHighwayTagValues[entity.tags.highway];
43707     }
43708     function isTaggedAsNotContinuing(node) {
43709       return node.tags.noexit === "yes" || node.tags.amenity === "parking_entrance" || node.tags.entrance && node.tags.entrance !== "no";
43710     }
43711     const validation = function checkAlmostJunction(entity, graph) {
43712       if (!isHighway(entity)) return [];
43713       if (entity.isDegenerate()) return [];
43714       const tree = context.history().tree();
43715       const extendableNodeInfos = findConnectableEndNodesByExtension(entity);
43716       let issues = [];
43717       extendableNodeInfos.forEach((extendableNodeInfo) => {
43718         issues.push(new validationIssue({
43719           type: type2,
43720           subtype: "highway-highway",
43721           severity: "warning",
43722           message: function(context2) {
43723             const entity1 = context2.hasEntity(this.entityIds[0]);
43724             if (this.entityIds[0] === this.entityIds[2]) {
43725               return entity1 ? _t.append("issues.almost_junction.self.message", {
43726                 feature: utilDisplayLabel(entity1, context2.graph())
43727               }) : "";
43728             } else {
43729               const entity2 = context2.hasEntity(this.entityIds[2]);
43730               return entity1 && entity2 ? _t.append("issues.almost_junction.message", {
43731                 feature: utilDisplayLabel(entity1, context2.graph()),
43732                 feature2: utilDisplayLabel(entity2, context2.graph())
43733               }) : "";
43734             }
43735           },
43736           reference: showReference,
43737           entityIds: [
43738             entity.id,
43739             extendableNodeInfo.node.id,
43740             extendableNodeInfo.wid
43741           ],
43742           loc: extendableNodeInfo.node.loc,
43743           hash: JSON.stringify(extendableNodeInfo.node.loc),
43744           data: {
43745             midId: extendableNodeInfo.mid.id,
43746             edge: extendableNodeInfo.edge,
43747             cross_loc: extendableNodeInfo.cross_loc
43748           },
43749           dynamicFixes: makeFixes
43750         }));
43751       });
43752       return issues;
43753       function makeFixes(context2) {
43754         let fixes = [new validationIssueFix({
43755           icon: "iD-icon-abutment",
43756           title: _t.append("issues.fix.connect_features.title"),
43757           onClick: function(context3) {
43758             const annotation = _t("issues.fix.connect_almost_junction.annotation");
43759             const [, endNodeId, crossWayId] = this.issue.entityIds;
43760             const midNode = context3.entity(this.issue.data.midId);
43761             const endNode = context3.entity(endNodeId);
43762             const crossWay = context3.entity(crossWayId);
43763             const nearEndNodes = findNearbyEndNodes(endNode, crossWay);
43764             if (nearEndNodes.length > 0) {
43765               const collinear = findSmallJoinAngle(midNode, endNode, nearEndNodes);
43766               if (collinear) {
43767                 context3.perform(
43768                   actionMergeNodes([collinear.id, endNode.id], collinear.loc),
43769                   annotation
43770                 );
43771                 return;
43772               }
43773             }
43774             const targetEdge = this.issue.data.edge;
43775             const crossLoc = this.issue.data.cross_loc;
43776             const edgeNodes = [context3.entity(targetEdge[0]), context3.entity(targetEdge[1])];
43777             const closestNodeInfo = geoSphericalClosestNode(edgeNodes, crossLoc);
43778             if (closestNodeInfo.distance < WELD_TH_METERS) {
43779               context3.perform(
43780                 actionMergeNodes([closestNodeInfo.node.id, endNode.id], closestNodeInfo.node.loc),
43781                 annotation
43782               );
43783             } else {
43784               context3.perform(
43785                 actionAddMidpoint({ loc: crossLoc, edge: targetEdge }, endNode),
43786                 annotation
43787               );
43788             }
43789           }
43790         })];
43791         const node = context2.hasEntity(this.entityIds[1]);
43792         if (node && !node.hasInterestingTags()) {
43793           fixes.push(new validationIssueFix({
43794             icon: "maki-barrier",
43795             title: _t.append("issues.fix.tag_as_disconnected.title"),
43796             onClick: function(context3) {
43797               const nodeID = this.issue.entityIds[1];
43798               const tags = Object.assign({}, context3.entity(nodeID).tags);
43799               tags.noexit = "yes";
43800               context3.perform(
43801                 actionChangeTags(nodeID, tags),
43802                 _t("issues.fix.tag_as_disconnected.annotation")
43803               );
43804             }
43805           }));
43806         }
43807         return fixes;
43808       }
43809       function showReference(selection2) {
43810         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.almost_junction.highway-highway.reference"));
43811       }
43812       function isExtendableCandidate(node, way) {
43813         const osm = services.osm;
43814         if (osm && !osm.isDataLoaded(node.loc)) {
43815           return false;
43816         }
43817         if (isTaggedAsNotContinuing(node) || graph.parentWays(node).length !== 1) {
43818           return false;
43819         }
43820         let occurrences = 0;
43821         for (const index in way.nodes) {
43822           if (way.nodes[index] === node.id) {
43823             occurrences += 1;
43824             if (occurrences > 1) {
43825               return false;
43826             }
43827           }
43828         }
43829         return true;
43830       }
43831       function findConnectableEndNodesByExtension(way) {
43832         let results = [];
43833         if (way.isClosed()) return results;
43834         let testNodes;
43835         const indices = [0, way.nodes.length - 1];
43836         indices.forEach((nodeIndex) => {
43837           const nodeID = way.nodes[nodeIndex];
43838           const node = graph.entity(nodeID);
43839           if (!isExtendableCandidate(node, way)) return;
43840           const connectionInfo = canConnectByExtend(way, nodeIndex);
43841           if (!connectionInfo) return;
43842           testNodes = graph.childNodes(way).slice();
43843           testNodes[nodeIndex] = testNodes[nodeIndex].move(connectionInfo.cross_loc);
43844           if (geoHasSelfIntersections(testNodes, nodeID)) return;
43845           results.push(connectionInfo);
43846         });
43847         return results;
43848       }
43849       function findNearbyEndNodes(node, way) {
43850         return [
43851           way.nodes[0],
43852           way.nodes[way.nodes.length - 1]
43853         ].map((d2) => graph.entity(d2)).filter((d2) => {
43854           return d2.id !== node.id && geoSphericalDistance(node.loc, d2.loc) <= CLOSE_NODE_TH;
43855         });
43856       }
43857       function findSmallJoinAngle(midNode, tipNode, endNodes) {
43858         let joinTo;
43859         let minAngle = Infinity;
43860         endNodes.forEach((endNode) => {
43861           const a1 = geoAngle(midNode, tipNode, context.projection) + Math.PI;
43862           const a2 = geoAngle(midNode, endNode, context.projection) + Math.PI;
43863           const diff = Math.max(a1, a2) - Math.min(a1, a2);
43864           if (diff < minAngle) {
43865             joinTo = endNode;
43866             minAngle = diff;
43867           }
43868         });
43869         if (minAngle <= SIG_ANGLE_TH) return joinTo;
43870         return null;
43871       }
43872       function hasTag(tags, key) {
43873         return tags[key] !== void 0 && tags[key] !== "no";
43874       }
43875       function canConnectWays(way, way2) {
43876         if (way.id === way2.id) return true;
43877         if ((hasTag(way.tags, "bridge") || hasTag(way2.tags, "bridge")) && !(hasTag(way.tags, "bridge") && hasTag(way2.tags, "bridge"))) return false;
43878         if ((hasTag(way.tags, "tunnel") || hasTag(way2.tags, "tunnel")) && !(hasTag(way.tags, "tunnel") && hasTag(way2.tags, "tunnel"))) return false;
43879         const layer1 = way.tags.layer || "0", layer2 = way2.tags.layer || "0";
43880         if (layer1 !== layer2) return false;
43881         const level1 = way.tags.level || "0", level2 = way2.tags.level || "0";
43882         if (level1 !== level2) return false;
43883         return true;
43884       }
43885       function canConnectByExtend(way, endNodeIdx) {
43886         const tipNid = way.nodes[endNodeIdx];
43887         const midNid = endNodeIdx === 0 ? way.nodes[1] : way.nodes[way.nodes.length - 2];
43888         const tipNode = graph.entity(tipNid);
43889         const midNode = graph.entity(midNid);
43890         const lon = tipNode.loc[0];
43891         const lat = tipNode.loc[1];
43892         const lon_range = geoMetersToLon(EXTEND_TH_METERS, lat) / 2;
43893         const lat_range = geoMetersToLat(EXTEND_TH_METERS) / 2;
43894         const queryExtent = geoExtent([
43895           [lon - lon_range, lat - lat_range],
43896           [lon + lon_range, lat + lat_range]
43897         ]);
43898         const edgeLen = geoSphericalDistance(midNode.loc, tipNode.loc);
43899         const t2 = EXTEND_TH_METERS / edgeLen + 1;
43900         const extTipLoc = geoVecInterp(midNode.loc, tipNode.loc, t2);
43901         const segmentInfos = tree.waySegments(queryExtent, graph);
43902         for (let i3 = 0; i3 < segmentInfos.length; i3++) {
43903           let segmentInfo = segmentInfos[i3];
43904           let way2 = graph.entity(segmentInfo.wayId);
43905           if (!isHighway(way2)) continue;
43906           if (!canConnectWays(way, way2)) continue;
43907           let nAid = segmentInfo.nodes[0], nBid = segmentInfo.nodes[1];
43908           if (nAid === tipNid || nBid === tipNid) continue;
43909           let nA = graph.entity(nAid), nB = graph.entity(nBid);
43910           let crossLoc = geoLineIntersection([tipNode.loc, extTipLoc], [nA.loc, nB.loc]);
43911           if (crossLoc) {
43912             return {
43913               mid: midNode,
43914               node: tipNode,
43915               wid: way2.id,
43916               edge: [nA.id, nB.id],
43917               cross_loc: crossLoc
43918             };
43919           }
43920         }
43921         return null;
43922       }
43923     };
43924     validation.type = type2;
43925     return validation;
43926   }
43927
43928   // modules/validations/close_nodes.js
43929   function validationCloseNodes(context) {
43930     var type2 = "close_nodes";
43931     var pointThresholdMeters = 0.2;
43932     var validation = function(entity, graph) {
43933       if (entity.type === "node") {
43934         return getIssuesForNode(entity);
43935       } else if (entity.type === "way") {
43936         return getIssuesForWay(entity);
43937       }
43938       return [];
43939       function getIssuesForNode(node) {
43940         var parentWays = graph.parentWays(node);
43941         if (parentWays.length) {
43942           return getIssuesForVertex(node, parentWays);
43943         } else {
43944           return getIssuesForDetachedPoint(node);
43945         }
43946       }
43947       function wayTypeFor(way) {
43948         if (way.tags.boundary && way.tags.boundary !== "no") return "boundary";
43949         if (way.tags.indoor && way.tags.indoor !== "no") return "indoor";
43950         if (way.tags.building && way.tags.building !== "no" || way.tags["building:part"] && way.tags["building:part"] !== "no") return "building";
43951         if (osmPathHighwayTagValues[way.tags.highway]) return "path";
43952         var parentRelations = graph.parentRelations(way);
43953         for (var i3 in parentRelations) {
43954           var relation = parentRelations[i3];
43955           if (relation.tags.type === "boundary") return "boundary";
43956           if (relation.isMultipolygon()) {
43957             if (relation.tags.indoor && relation.tags.indoor !== "no") return "indoor";
43958             if (relation.tags.building && relation.tags.building !== "no" || relation.tags["building:part"] && relation.tags["building:part"] !== "no") return "building";
43959           }
43960         }
43961         return "other";
43962       }
43963       function shouldCheckWay(way) {
43964         if (way.nodes.length <= 2 || way.isClosed() && way.nodes.length <= 4) return false;
43965         var bbox2 = way.extent(graph).bbox();
43966         var hypotenuseMeters = geoSphericalDistance([bbox2.minX, bbox2.minY], [bbox2.maxX, bbox2.maxY]);
43967         if (hypotenuseMeters < 1.5) return false;
43968         return true;
43969       }
43970       function getIssuesForWay(way) {
43971         if (!shouldCheckWay(way)) return [];
43972         var issues = [], nodes = graph.childNodes(way);
43973         for (var i3 = 0; i3 < nodes.length - 1; i3++) {
43974           var node1 = nodes[i3];
43975           var node2 = nodes[i3 + 1];
43976           var issue = getWayIssueIfAny(node1, node2, way);
43977           if (issue) issues.push(issue);
43978         }
43979         return issues;
43980       }
43981       function getIssuesForVertex(node, parentWays) {
43982         var issues = [];
43983         function checkForCloseness(node1, node2, way) {
43984           var issue = getWayIssueIfAny(node1, node2, way);
43985           if (issue) issues.push(issue);
43986         }
43987         for (var i3 = 0; i3 < parentWays.length; i3++) {
43988           var parentWay = parentWays[i3];
43989           if (!shouldCheckWay(parentWay)) continue;
43990           var lastIndex = parentWay.nodes.length - 1;
43991           for (var j3 = 0; j3 < parentWay.nodes.length; j3++) {
43992             if (j3 !== 0) {
43993               if (parentWay.nodes[j3 - 1] === node.id) {
43994                 checkForCloseness(node, graph.entity(parentWay.nodes[j3]), parentWay);
43995               }
43996             }
43997             if (j3 !== lastIndex) {
43998               if (parentWay.nodes[j3 + 1] === node.id) {
43999                 checkForCloseness(graph.entity(parentWay.nodes[j3]), node, parentWay);
44000               }
44001             }
44002           }
44003         }
44004         return issues;
44005       }
44006       function thresholdMetersForWay(way) {
44007         if (!shouldCheckWay(way)) return 0;
44008         var wayType = wayTypeFor(way);
44009         if (wayType === "boundary") return 0;
44010         if (wayType === "indoor") return 0.01;
44011         if (wayType === "building") return 0.05;
44012         if (wayType === "path") return 0.1;
44013         return 0.2;
44014       }
44015       function getIssuesForDetachedPoint(node) {
44016         var issues = [];
44017         var lon = node.loc[0];
44018         var lat = node.loc[1];
44019         var lon_range = geoMetersToLon(pointThresholdMeters, lat) / 2;
44020         var lat_range = geoMetersToLat(pointThresholdMeters) / 2;
44021         var queryExtent = geoExtent([
44022           [lon - lon_range, lat - lat_range],
44023           [lon + lon_range, lat + lat_range]
44024         ]);
44025         var intersected = context.history().tree().intersects(queryExtent, graph);
44026         for (var j3 = 0; j3 < intersected.length; j3++) {
44027           var nearby = intersected[j3];
44028           if (nearby.id === node.id) continue;
44029           if (nearby.type !== "node" || nearby.geometry(graph) !== "point") continue;
44030           if (nearby.loc === node.loc || geoSphericalDistance(node.loc, nearby.loc) < pointThresholdMeters) {
44031             if ("memorial:type" in node.tags && "memorial:type" in nearby.tags && node.tags["memorial:type"] === "stolperstein" && nearby.tags["memorial:type"] === "stolperstein") continue;
44032             if ("memorial" in node.tags && "memorial" in nearby.tags && node.tags.memorial === "stolperstein" && nearby.tags.memorial === "stolperstein") continue;
44033             var zAxisKeys = { layer: true, level: true, "addr:housenumber": true, "addr:unit": true };
44034             var zAxisDifferentiates = false;
44035             for (var key in zAxisKeys) {
44036               var nodeValue = node.tags[key] || "0";
44037               var nearbyValue = nearby.tags[key] || "0";
44038               if (nodeValue !== nearbyValue) {
44039                 zAxisDifferentiates = true;
44040                 break;
44041               }
44042             }
44043             if (zAxisDifferentiates) continue;
44044             issues.push(new validationIssue({
44045               type: type2,
44046               subtype: "detached",
44047               severity: "warning",
44048               message: function(context2) {
44049                 var entity2 = context2.hasEntity(this.entityIds[0]), entity22 = context2.hasEntity(this.entityIds[1]);
44050                 return entity2 && entity22 ? _t.append("issues.close_nodes.detached.message", {
44051                   feature: utilDisplayLabel(entity2, context2.graph()),
44052                   feature2: utilDisplayLabel(entity22, context2.graph())
44053                 }) : "";
44054               },
44055               reference: showReference,
44056               entityIds: [node.id, nearby.id],
44057               dynamicFixes: function() {
44058                 return [
44059                   new validationIssueFix({
44060                     icon: "iD-operation-disconnect",
44061                     title: _t.append("issues.fix.move_points_apart.title")
44062                   }),
44063                   new validationIssueFix({
44064                     icon: "iD-icon-layers",
44065                     title: _t.append("issues.fix.use_different_layers_or_levels.title")
44066                   })
44067                 ];
44068               }
44069             }));
44070           }
44071         }
44072         return issues;
44073         function showReference(selection2) {
44074           var referenceText = _t("issues.close_nodes.detached.reference");
44075           selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
44076         }
44077       }
44078       function getWayIssueIfAny(node1, node2, way) {
44079         if (node1.id === node2.id || node1.hasInterestingTags() && node2.hasInterestingTags()) {
44080           return null;
44081         }
44082         if (node1.loc !== node2.loc) {
44083           var parentWays1 = graph.parentWays(node1);
44084           var parentWays2 = new Set(graph.parentWays(node2));
44085           var sharedWays = parentWays1.filter(function(parentWay) {
44086             return parentWays2.has(parentWay);
44087           });
44088           var thresholds = sharedWays.map(function(parentWay) {
44089             return thresholdMetersForWay(parentWay);
44090           });
44091           var threshold = Math.min(...thresholds);
44092           var distance = geoSphericalDistance(node1.loc, node2.loc);
44093           if (distance > threshold) return null;
44094         }
44095         return new validationIssue({
44096           type: type2,
44097           subtype: "vertices",
44098           severity: "warning",
44099           message: function(context2) {
44100             var entity2 = context2.hasEntity(this.entityIds[0]);
44101             return entity2 ? _t.append("issues.close_nodes.message", { way: utilDisplayLabel(entity2, context2.graph()) }) : "";
44102           },
44103           reference: showReference,
44104           entityIds: [way.id, node1.id, node2.id],
44105           loc: node1.loc,
44106           dynamicFixes: function() {
44107             return [
44108               new validationIssueFix({
44109                 icon: "iD-icon-plus",
44110                 title: _t.append("issues.fix.merge_points.title"),
44111                 onClick: function(context2) {
44112                   var entityIds = this.issue.entityIds;
44113                   var action = actionMergeNodes([entityIds[1], entityIds[2]]);
44114                   context2.perform(action, _t("issues.fix.merge_close_vertices.annotation"));
44115                 }
44116               }),
44117               new validationIssueFix({
44118                 icon: "iD-operation-disconnect",
44119                 title: _t.append("issues.fix.move_points_apart.title")
44120               })
44121             ];
44122           }
44123         });
44124         function showReference(selection2) {
44125           var referenceText = _t("issues.close_nodes.reference");
44126           selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").html(referenceText);
44127         }
44128       }
44129     };
44130     validation.type = type2;
44131     return validation;
44132   }
44133
44134   // modules/validations/crossing_ways.js
44135   function validationCrossingWays(context) {
44136     var type2 = "crossing_ways";
44137     function getFeatureWithFeatureTypeTagsForWay(way, graph) {
44138       if (getFeatureType(way, graph) === null) {
44139         var parentRels = graph.parentRelations(way);
44140         for (var i3 = 0; i3 < parentRels.length; i3++) {
44141           var rel = parentRels[i3];
44142           if (getFeatureType(rel, graph) !== null) {
44143             return rel;
44144           }
44145         }
44146       }
44147       return way;
44148     }
44149     function hasTag(tags, key) {
44150       return tags[key] !== void 0 && tags[key] !== "no";
44151     }
44152     function taggedAsIndoor(tags) {
44153       return hasTag(tags, "indoor") || hasTag(tags, "level") || tags.highway === "corridor";
44154     }
44155     function allowsBridge(featureType) {
44156       return featureType === "highway" || featureType === "railway" || featureType === "waterway" || featureType === "aeroway";
44157     }
44158     function allowsTunnel(featureType) {
44159       return featureType === "highway" || featureType === "railway" || featureType === "waterway";
44160     }
44161     var ignoredBuildings = {
44162       demolished: true,
44163       dismantled: true,
44164       proposed: true,
44165       razed: true
44166     };
44167     function getFeatureType(entity, graph) {
44168       var geometry = entity.geometry(graph);
44169       if (geometry !== "line" && geometry !== "area") return null;
44170       var tags = entity.tags;
44171       if (tags.aeroway in osmRoutableAerowayTags) return "aeroway";
44172       if (hasTag(tags, "building") && !ignoredBuildings[tags.building]) return "building";
44173       if (hasTag(tags, "highway") && osmRoutableHighwayTagValues[tags.highway]) return "highway";
44174       if (geometry !== "line") return null;
44175       if (hasTag(tags, "railway") && osmRailwayTrackTagValues[tags.railway]) return "railway";
44176       if (hasTag(tags, "waterway") && osmFlowingWaterwayTagValues[tags.waterway]) return "waterway";
44177       return null;
44178     }
44179     function isLegitCrossing(tags1, featureType1, tags2, featureType2) {
44180       var level1 = tags1.level || "0";
44181       var level2 = tags2.level || "0";
44182       if (taggedAsIndoor(tags1) && taggedAsIndoor(tags2) && level1 !== level2) {
44183         return true;
44184       }
44185       var layer1 = tags1.layer || "0";
44186       var layer2 = tags2.layer || "0";
44187       if (allowsBridge(featureType1) && allowsBridge(featureType2)) {
44188         if (hasTag(tags1, "bridge") && !hasTag(tags2, "bridge")) return true;
44189         if (!hasTag(tags1, "bridge") && hasTag(tags2, "bridge")) return true;
44190         if (hasTag(tags1, "bridge") && hasTag(tags2, "bridge") && layer1 !== layer2) return true;
44191       } else if (allowsBridge(featureType1) && hasTag(tags1, "bridge")) return true;
44192       else if (allowsBridge(featureType2) && hasTag(tags2, "bridge")) return true;
44193       if (allowsTunnel(featureType1) && allowsTunnel(featureType2)) {
44194         if (hasTag(tags1, "tunnel") && !hasTag(tags2, "tunnel")) return true;
44195         if (!hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel")) return true;
44196         if (hasTag(tags1, "tunnel") && hasTag(tags2, "tunnel") && layer1 !== layer2) return true;
44197       } else if (allowsTunnel(featureType1) && hasTag(tags1, "tunnel")) return true;
44198       else if (allowsTunnel(featureType2) && hasTag(tags2, "tunnel")) return true;
44199       if (featureType1 === "waterway" && featureType2 === "highway" && tags2.man_made === "pier") return true;
44200       if (featureType2 === "waterway" && featureType1 === "highway" && tags1.man_made === "pier") return true;
44201       if (featureType1 === "building" || featureType2 === "building" || taggedAsIndoor(tags1) || taggedAsIndoor(tags2)) {
44202         if (layer1 !== layer2) return true;
44203       }
44204       return false;
44205     }
44206     var highwaysDisallowingFords = {
44207       motorway: true,
44208       motorway_link: true,
44209       trunk: true,
44210       trunk_link: true,
44211       primary: true,
44212       primary_link: true,
44213       secondary: true,
44214       secondary_link: true
44215     };
44216     function tagsForConnectionNodeIfAllowed(entity1, entity2, graph, lessLikelyTags) {
44217       var featureType1 = getFeatureType(entity1, graph);
44218       var featureType2 = getFeatureType(entity2, graph);
44219       var geometry1 = entity1.geometry(graph);
44220       var geometry2 = entity2.geometry(graph);
44221       var bothLines = geometry1 === "line" && geometry2 === "line";
44222       const featureTypes = [featureType1, featureType2].sort().join("-");
44223       if (featureTypes === "aeroway-aeroway") return {};
44224       if (featureTypes === "aeroway-highway") {
44225         const isServiceRoad = entity1.tags.highway === "service" || entity2.tags.highway === "service";
44226         const isPath = entity1.tags.highway in osmPathHighwayTagValues || entity2.tags.highway in osmPathHighwayTagValues;
44227         return isServiceRoad || isPath ? {} : { aeroway: "aircraft_crossing" };
44228       }
44229       if (featureTypes === "aeroway-railway") {
44230         return { aeroway: "aircraft_crossing", railway: "level_crossing" };
44231       }
44232       if (featureTypes === "aeroway-waterway") return null;
44233       if (featureType1 === featureType2) {
44234         if (featureType1 === "highway") {
44235           var entity1IsPath = osmPathHighwayTagValues[entity1.tags.highway];
44236           var entity2IsPath = osmPathHighwayTagValues[entity2.tags.highway];
44237           if ((entity1IsPath || entity2IsPath) && entity1IsPath !== entity2IsPath) {
44238             if (!bothLines) return {};
44239             var roadFeature = entity1IsPath ? entity2 : entity1;
44240             var pathFeature = entity1IsPath ? entity1 : entity2;
44241             if (roadFeature.tags.highway === "track") {
44242               return {};
44243             }
44244             if (!lessLikelyTags && roadFeature.tags.highway === "service" && pathFeature.tags.highway === "footway" && pathFeature.tags.footway === "sidewalk") {
44245               return {};
44246             }
44247             if (["marked", "unmarked", "traffic_signals", "uncontrolled"].indexOf(pathFeature.tags.crossing) !== -1) {
44248               var tags = { highway: "crossing", crossing: pathFeature.tags.crossing };
44249               if ("crossing:markings" in pathFeature.tags) {
44250                 tags["crossing:markings"] = pathFeature.tags["crossing:markings"];
44251               }
44252               return tags;
44253             }
44254             return { highway: "crossing" };
44255           }
44256           return {};
44257         }
44258         if (featureType1 === "waterway") return {};
44259         if (featureType1 === "railway") return {};
44260       } else {
44261         if (featureTypes.indexOf("highway") !== -1) {
44262           if (featureTypes.indexOf("railway") !== -1) {
44263             if (!bothLines) return {};
44264             var isTram = entity1.tags.railway === "tram" || entity2.tags.railway === "tram";
44265             if (osmPathHighwayTagValues[entity1.tags.highway] || osmPathHighwayTagValues[entity2.tags.highway]) {
44266               if (isTram) return { railway: "tram_crossing" };
44267               return { railway: "crossing" };
44268             } else {
44269               if (isTram) return { railway: "tram_level_crossing" };
44270               return { railway: "level_crossing" };
44271             }
44272           }
44273           if (featureTypes.indexOf("waterway") !== -1) {
44274             if (hasTag(entity1.tags, "tunnel") && hasTag(entity2.tags, "tunnel")) return null;
44275             if (hasTag(entity1.tags, "bridge") && hasTag(entity2.tags, "bridge")) return null;
44276             if (highwaysDisallowingFords[entity1.tags.highway] || highwaysDisallowingFords[entity2.tags.highway]) {
44277               return null;
44278             }
44279             return bothLines ? { ford: "yes" } : {};
44280           }
44281         }
44282       }
44283       return null;
44284     }
44285     function findCrossingsByWay(way1, graph, tree) {
44286       var edgeCrossInfos = [];
44287       if (way1.type !== "way") return edgeCrossInfos;
44288       var taggedFeature1 = getFeatureWithFeatureTypeTagsForWay(way1, graph);
44289       var way1FeatureType = getFeatureType(taggedFeature1, graph);
44290       if (way1FeatureType === null) return edgeCrossInfos;
44291       var checkedSingleCrossingWays = {};
44292       var i3, j3;
44293       var extent;
44294       var n1, n22, nA, nB, nAId, nBId;
44295       var segment1, segment2;
44296       var oneOnly;
44297       var segmentInfos, segment2Info, way2, taggedFeature2, way2FeatureType;
44298       var way1Nodes = graph.childNodes(way1);
44299       var comparedWays = {};
44300       for (i3 = 0; i3 < way1Nodes.length - 1; i3++) {
44301         n1 = way1Nodes[i3];
44302         n22 = way1Nodes[i3 + 1];
44303         extent = geoExtent([
44304           [
44305             Math.min(n1.loc[0], n22.loc[0]),
44306             Math.min(n1.loc[1], n22.loc[1])
44307           ],
44308           [
44309             Math.max(n1.loc[0], n22.loc[0]),
44310             Math.max(n1.loc[1], n22.loc[1])
44311           ]
44312         ]);
44313         segmentInfos = tree.waySegments(extent, graph);
44314         for (j3 = 0; j3 < segmentInfos.length; j3++) {
44315           segment2Info = segmentInfos[j3];
44316           if (segment2Info.wayId === way1.id) continue;
44317           if (checkedSingleCrossingWays[segment2Info.wayId]) continue;
44318           comparedWays[segment2Info.wayId] = true;
44319           way2 = graph.hasEntity(segment2Info.wayId);
44320           if (!way2) continue;
44321           taggedFeature2 = getFeatureWithFeatureTypeTagsForWay(way2, graph);
44322           way2FeatureType = getFeatureType(taggedFeature2, graph);
44323           if (way2FeatureType === null || isLegitCrossing(taggedFeature1.tags, way1FeatureType, taggedFeature2.tags, way2FeatureType)) {
44324             continue;
44325           }
44326           oneOnly = way1FeatureType === "building" || way2FeatureType === "building";
44327           nAId = segment2Info.nodes[0];
44328           nBId = segment2Info.nodes[1];
44329           if (nAId === n1.id || nAId === n22.id || nBId === n1.id || nBId === n22.id) {
44330             continue;
44331           }
44332           nA = graph.hasEntity(nAId);
44333           if (!nA) continue;
44334           nB = graph.hasEntity(nBId);
44335           if (!nB) continue;
44336           segment1 = [n1.loc, n22.loc];
44337           segment2 = [nA.loc, nB.loc];
44338           var point = geoLineIntersection(segment1, segment2);
44339           if (point) {
44340             edgeCrossInfos.push({
44341               wayInfos: [
44342                 {
44343                   way: way1,
44344                   featureType: way1FeatureType,
44345                   edge: [n1.id, n22.id]
44346                 },
44347                 {
44348                   way: way2,
44349                   featureType: way2FeatureType,
44350                   edge: [nA.id, nB.id]
44351                 }
44352               ],
44353               crossPoint: point
44354             });
44355             if (oneOnly) {
44356               checkedSingleCrossingWays[way2.id] = true;
44357               break;
44358             }
44359           }
44360         }
44361       }
44362       return edgeCrossInfos;
44363     }
44364     function waysToCheck(entity, graph) {
44365       var featureType = getFeatureType(entity, graph);
44366       if (!featureType) return [];
44367       if (entity.type === "way") {
44368         return [entity];
44369       } else if (entity.type === "relation") {
44370         return entity.members.reduce(function(array2, member) {
44371           if (member.type === "way" && // only look at geometry ways
44372           (!member.role || member.role === "outer" || member.role === "inner")) {
44373             var entity2 = graph.hasEntity(member.id);
44374             if (entity2 && array2.indexOf(entity2) === -1) {
44375               array2.push(entity2);
44376             }
44377           }
44378           return array2;
44379         }, []);
44380       }
44381       return [];
44382     }
44383     var validation = function checkCrossingWays(entity, graph) {
44384       var tree = context.history().tree();
44385       var ways = waysToCheck(entity, graph);
44386       var issues = [];
44387       var wayIndex, crossingIndex, crossings;
44388       for (wayIndex in ways) {
44389         crossings = findCrossingsByWay(ways[wayIndex], graph, tree);
44390         for (crossingIndex in crossings) {
44391           issues.push(createIssue(crossings[crossingIndex], graph));
44392         }
44393       }
44394       return issues;
44395     };
44396     function createIssue(crossing, graph) {
44397       crossing.wayInfos.sort(function(way1Info, way2Info) {
44398         var type1 = way1Info.featureType;
44399         var type22 = way2Info.featureType;
44400         if (type1 === type22) {
44401           return utilDisplayLabel(way1Info.way, graph) > utilDisplayLabel(way2Info.way, graph);
44402         } else if (type1 === "waterway") {
44403           return true;
44404         } else if (type22 === "waterway") {
44405           return false;
44406         }
44407         return type1 < type22;
44408       });
44409       var entities = crossing.wayInfos.map(function(wayInfo) {
44410         return getFeatureWithFeatureTypeTagsForWay(wayInfo.way, graph);
44411       });
44412       var edges = [crossing.wayInfos[0].edge, crossing.wayInfos[1].edge];
44413       var featureTypes = [crossing.wayInfos[0].featureType, crossing.wayInfos[1].featureType];
44414       var connectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph);
44415       var featureType1 = crossing.wayInfos[0].featureType;
44416       var featureType2 = crossing.wayInfos[1].featureType;
44417       var isCrossingIndoors = taggedAsIndoor(entities[0].tags) && taggedAsIndoor(entities[1].tags);
44418       var isCrossingTunnels = allowsTunnel(featureType1) && hasTag(entities[0].tags, "tunnel") && allowsTunnel(featureType2) && hasTag(entities[1].tags, "tunnel");
44419       var isCrossingBridges = allowsBridge(featureType1) && hasTag(entities[0].tags, "bridge") && allowsBridge(featureType2) && hasTag(entities[1].tags, "bridge");
44420       var subtype = [featureType1, featureType2].sort().join("-");
44421       var crossingTypeID = subtype;
44422       if (isCrossingIndoors) {
44423         crossingTypeID = "indoor-indoor";
44424       } else if (isCrossingTunnels) {
44425         crossingTypeID = "tunnel-tunnel";
44426       } else if (isCrossingBridges) {
44427         crossingTypeID = "bridge-bridge";
44428       }
44429       if (connectionTags && (isCrossingIndoors || isCrossingTunnels || isCrossingBridges)) {
44430         crossingTypeID += "_connectable";
44431       }
44432       var uniqueID = crossing.crossPoint[0].toFixed(4) + "," + crossing.crossPoint[1].toFixed(4);
44433       return new validationIssue({
44434         type: type2,
44435         subtype,
44436         severity: "warning",
44437         message: function(context2) {
44438           var graph2 = context2.graph();
44439           var entity1 = graph2.hasEntity(this.entityIds[0]), entity2 = graph2.hasEntity(this.entityIds[1]);
44440           return entity1 && entity2 ? _t.append("issues.crossing_ways.message", {
44441             feature: utilDisplayLabel(entity1, graph2, featureType1 === "building"),
44442             feature2: utilDisplayLabel(entity2, graph2, featureType2 === "building")
44443           }) : "";
44444         },
44445         reference: showReference,
44446         entityIds: entities.map(function(entity) {
44447           return entity.id;
44448         }),
44449         data: {
44450           edges,
44451           featureTypes,
44452           connectionTags
44453         },
44454         hash: uniqueID,
44455         loc: crossing.crossPoint,
44456         dynamicFixes: function(context2) {
44457           var mode = context2.mode();
44458           if (!mode || mode.id !== "select" || mode.selectedIDs().length !== 1) return [];
44459           var selectedIndex = this.entityIds[0] === mode.selectedIDs()[0] ? 0 : 1;
44460           var selectedFeatureType = this.data.featureTypes[selectedIndex];
44461           var otherFeatureType = this.data.featureTypes[selectedIndex === 0 ? 1 : 0];
44462           var fixes = [];
44463           if (connectionTags) {
44464             fixes.push(makeConnectWaysFix(this.data.connectionTags));
44465             let lessLikelyConnectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph, true);
44466             if (lessLikelyConnectionTags && !isEqual_default(connectionTags, lessLikelyConnectionTags)) {
44467               fixes.push(makeConnectWaysFix(lessLikelyConnectionTags));
44468             }
44469           }
44470           if (isCrossingIndoors) {
44471             fixes.push(new validationIssueFix({
44472               icon: "iD-icon-layers",
44473               title: _t.append("issues.fix.use_different_levels.title")
44474             }));
44475           } else if (isCrossingTunnels || isCrossingBridges || featureType1 === "building" || featureType2 === "building") {
44476             fixes.push(makeChangeLayerFix("higher"));
44477             fixes.push(makeChangeLayerFix("lower"));
44478           } else if (context2.graph().geometry(this.entityIds[0]) === "line" && context2.graph().geometry(this.entityIds[1]) === "line") {
44479             if (allowsBridge(selectedFeatureType) && selectedFeatureType !== "waterway") {
44480               fixes.push(makeAddBridgeOrTunnelFix("add_a_bridge", "temaki-bridge", "bridge"));
44481             }
44482             var skipTunnelFix = otherFeatureType === "waterway" && selectedFeatureType !== "waterway";
44483             if (allowsTunnel(selectedFeatureType) && !skipTunnelFix) {
44484               if (selectedFeatureType === "waterway") {
44485                 fixes.push(makeAddBridgeOrTunnelFix("add_a_culvert", "temaki-waste", "tunnel"));
44486               } else {
44487                 fixes.push(makeAddBridgeOrTunnelFix("add_a_tunnel", "temaki-tunnel", "tunnel"));
44488               }
44489             }
44490           }
44491           fixes.push(new validationIssueFix({
44492             icon: "iD-operation-move",
44493             title: _t.append("issues.fix.reposition_features.title")
44494           }));
44495           return fixes;
44496         }
44497       });
44498       function showReference(selection2) {
44499         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.crossing_ways." + crossingTypeID + ".reference"));
44500       }
44501     }
44502     function makeAddBridgeOrTunnelFix(fixTitleID, iconName, bridgeOrTunnel) {
44503       return new validationIssueFix({
44504         icon: iconName,
44505         title: _t.append("issues.fix." + fixTitleID + ".title"),
44506         onClick: function(context2) {
44507           var mode = context2.mode();
44508           if (!mode || mode.id !== "select") return;
44509           var selectedIDs = mode.selectedIDs();
44510           if (selectedIDs.length !== 1) return;
44511           var selectedWayID = selectedIDs[0];
44512           if (!context2.hasEntity(selectedWayID)) return;
44513           var resultWayIDs = [selectedWayID];
44514           var edge, crossedEdge, crossedWayID;
44515           if (this.issue.entityIds[0] === selectedWayID) {
44516             edge = this.issue.data.edges[0];
44517             crossedEdge = this.issue.data.edges[1];
44518             crossedWayID = this.issue.entityIds[1];
44519           } else {
44520             edge = this.issue.data.edges[1];
44521             crossedEdge = this.issue.data.edges[0];
44522             crossedWayID = this.issue.entityIds[0];
44523           }
44524           var crossingLoc = this.issue.loc;
44525           var projection2 = context2.projection;
44526           var action = function actionAddStructure(graph) {
44527             var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
44528             var crossedWay = graph.hasEntity(crossedWayID);
44529             var structLengthMeters = crossedWay && isFinite(crossedWay.tags.width) && Number(crossedWay.tags.width);
44530             if (!structLengthMeters) {
44531               structLengthMeters = crossedWay && crossedWay.impliedLineWidthMeters();
44532             }
44533             if (structLengthMeters) {
44534               if (getFeatureType(crossedWay, graph) === "railway") {
44535                 structLengthMeters *= 2;
44536               }
44537             } else {
44538               structLengthMeters = 8;
44539             }
44540             var a1 = geoAngle(edgeNodes[0], edgeNodes[1], projection2) + Math.PI;
44541             var a2 = geoAngle(graph.entity(crossedEdge[0]), graph.entity(crossedEdge[1]), projection2) + Math.PI;
44542             var crossingAngle = Math.max(a1, a2) - Math.min(a1, a2);
44543             if (crossingAngle > Math.PI) crossingAngle -= Math.PI;
44544             structLengthMeters = structLengthMeters / 2 / Math.sin(crossingAngle) * 2;
44545             structLengthMeters += 4;
44546             structLengthMeters = Math.min(Math.max(structLengthMeters, 4), 50);
44547             function geomToProj(geoPoint) {
44548               return [
44549                 geoLonToMeters(geoPoint[0], geoPoint[1]),
44550                 geoLatToMeters(geoPoint[1])
44551               ];
44552             }
44553             function projToGeom(projPoint) {
44554               var lat = geoMetersToLat(projPoint[1]);
44555               return [
44556                 geoMetersToLon(projPoint[0], lat),
44557                 lat
44558               ];
44559             }
44560             var projEdgeNode1 = geomToProj(edgeNodes[0].loc);
44561             var projEdgeNode2 = geomToProj(edgeNodes[1].loc);
44562             var projectedAngle = geoVecAngle(projEdgeNode1, projEdgeNode2);
44563             var projectedCrossingLoc = geomToProj(crossingLoc);
44564             var linearToSphericalMetersRatio = geoVecLength(projEdgeNode1, projEdgeNode2) / geoSphericalDistance(edgeNodes[0].loc, edgeNodes[1].loc);
44565             function locSphericalDistanceFromCrossingLoc(angle2, distanceMeters) {
44566               var lengthSphericalMeters = distanceMeters * linearToSphericalMetersRatio;
44567               return projToGeom([
44568                 projectedCrossingLoc[0] + Math.cos(angle2) * lengthSphericalMeters,
44569                 projectedCrossingLoc[1] + Math.sin(angle2) * lengthSphericalMeters
44570               ]);
44571             }
44572             var endpointLocGetter1 = function(lengthMeters) {
44573               return locSphericalDistanceFromCrossingLoc(projectedAngle, lengthMeters);
44574             };
44575             var endpointLocGetter2 = function(lengthMeters) {
44576               return locSphericalDistanceFromCrossingLoc(projectedAngle + Math.PI, lengthMeters);
44577             };
44578             var minEdgeLengthMeters = 0.55;
44579             function determineEndpoint(edge2, endNode, locGetter) {
44580               var newNode;
44581               var idealLengthMeters = structLengthMeters / 2;
44582               var crossingToEdgeEndDistance = geoSphericalDistance(crossingLoc, endNode.loc);
44583               if (crossingToEdgeEndDistance - idealLengthMeters > minEdgeLengthMeters) {
44584                 var idealNodeLoc = locGetter(idealLengthMeters);
44585                 newNode = osmNode();
44586                 graph = actionAddMidpoint({ loc: idealNodeLoc, edge: edge2 }, newNode)(graph);
44587               } else {
44588                 var edgeCount = 0;
44589                 endNode.parentIntersectionWays(graph).forEach(function(way) {
44590                   way.nodes.forEach(function(nodeID) {
44591                     if (nodeID === endNode.id) {
44592                       if (endNode.id === way.first() && endNode.id !== way.last() || endNode.id === way.last() && endNode.id !== way.first()) {
44593                         edgeCount += 1;
44594                       } else {
44595                         edgeCount += 2;
44596                       }
44597                     }
44598                   });
44599                 });
44600                 if (edgeCount >= 3) {
44601                   var insetLength = crossingToEdgeEndDistance - minEdgeLengthMeters;
44602                   if (insetLength > minEdgeLengthMeters) {
44603                     var insetNodeLoc = locGetter(insetLength);
44604                     newNode = osmNode();
44605                     graph = actionAddMidpoint({ loc: insetNodeLoc, edge: edge2 }, newNode)(graph);
44606                   }
44607                 }
44608               }
44609               if (!newNode) newNode = endNode;
44610               var splitAction = actionSplit([newNode.id]).limitWays(resultWayIDs);
44611               graph = splitAction(graph);
44612               if (splitAction.getCreatedWayIDs().length) {
44613                 resultWayIDs.push(splitAction.getCreatedWayIDs()[0]);
44614               }
44615               return newNode;
44616             }
44617             var structEndNode1 = determineEndpoint(edge, edgeNodes[1], endpointLocGetter1);
44618             var structEndNode2 = determineEndpoint([edgeNodes[0].id, structEndNode1.id], edgeNodes[0], endpointLocGetter2);
44619             var structureWay = resultWayIDs.map(function(id2) {
44620               return graph.entity(id2);
44621             }).find(function(way) {
44622               return way.nodes.indexOf(structEndNode1.id) !== -1 && way.nodes.indexOf(structEndNode2.id) !== -1;
44623             });
44624             var tags = Object.assign({}, structureWay.tags);
44625             if (bridgeOrTunnel === "bridge") {
44626               tags.bridge = "yes";
44627               tags.layer = "1";
44628             } else {
44629               var tunnelValue = "yes";
44630               if (getFeatureType(structureWay, graph) === "waterway") {
44631                 tunnelValue = "culvert";
44632               }
44633               tags.tunnel = tunnelValue;
44634               tags.layer = "-1";
44635             }
44636             graph = actionChangeTags(structureWay.id, tags)(graph);
44637             return graph;
44638           };
44639           context2.perform(action, _t("issues.fix." + fixTitleID + ".annotation"));
44640           context2.enter(modeSelect(context2, resultWayIDs));
44641         }
44642       });
44643     }
44644     function makeConnectWaysFix(connectionTags) {
44645       var fixTitleID = "connect_features";
44646       var fixIcon = "iD-icon-crossing";
44647       if (connectionTags.highway === "crossing") {
44648         fixTitleID = "connect_using_crossing";
44649         fixIcon = "temaki-pedestrian";
44650       }
44651       if (connectionTags.ford) {
44652         fixTitleID = "connect_using_ford";
44653         fixIcon = "roentgen-ford";
44654       }
44655       const fix = new validationIssueFix({
44656         icon: fixIcon,
44657         title: _t.append("issues.fix." + fixTitleID + ".title"),
44658         onClick: function(context2) {
44659           var loc = this.issue.loc;
44660           var edges = this.issue.data.edges;
44661           context2.perform(
44662             function actionConnectCrossingWays(graph) {
44663               var node = osmNode({ loc, tags: connectionTags });
44664               graph = graph.replace(node);
44665               var nodesToMerge = [node.id];
44666               var mergeThresholdInMeters = 0.75;
44667               edges.forEach(function(edge) {
44668                 var edgeNodes = [graph.entity(edge[0]), graph.entity(edge[1])];
44669                 var nearby = geoSphericalClosestNode(edgeNodes, loc);
44670                 if ((!nearby.node.hasInterestingTags() || nearby.node.isCrossing()) && nearby.distance < mergeThresholdInMeters) {
44671                   nodesToMerge.push(nearby.node.id);
44672                 } else {
44673                   graph = actionAddMidpoint({ loc, edge }, node)(graph);
44674                 }
44675               });
44676               if (nodesToMerge.length > 1) {
44677                 graph = actionMergeNodes(nodesToMerge, loc)(graph);
44678               }
44679               return graph;
44680             },
44681             _t("issues.fix.connect_crossing_features.annotation")
44682           );
44683         }
44684       });
44685       fix._connectionTags = connectionTags;
44686       return fix;
44687     }
44688     function makeChangeLayerFix(higherOrLower) {
44689       return new validationIssueFix({
44690         icon: "iD-icon-" + (higherOrLower === "higher" ? "up" : "down"),
44691         title: _t.append("issues.fix.tag_this_as_" + higherOrLower + ".title"),
44692         onClick: function(context2) {
44693           var mode = context2.mode();
44694           if (!mode || mode.id !== "select") return;
44695           var selectedIDs = mode.selectedIDs();
44696           if (selectedIDs.length !== 1) return;
44697           var selectedID = selectedIDs[0];
44698           if (!this.issue.entityIds.some(function(entityId) {
44699             return entityId === selectedID;
44700           })) return;
44701           var entity = context2.hasEntity(selectedID);
44702           if (!entity) return;
44703           var tags = Object.assign({}, entity.tags);
44704           var layer = tags.layer && Number(tags.layer);
44705           if (layer && !isNaN(layer)) {
44706             if (higherOrLower === "higher") {
44707               layer += 1;
44708             } else {
44709               layer -= 1;
44710             }
44711           } else {
44712             if (higherOrLower === "higher") {
44713               layer = 1;
44714             } else {
44715               layer = -1;
44716             }
44717           }
44718           tags.layer = layer.toString();
44719           context2.perform(
44720             actionChangeTags(entity.id, tags),
44721             _t("operations.change_tags.annotation")
44722           );
44723         }
44724       });
44725     }
44726     validation.type = type2;
44727     return validation;
44728   }
44729
44730   // modules/behavior/draw_way.js
44731   function behaviorDrawWay(context, wayID, mode, startGraph) {
44732     const keybinding = utilKeybinding("drawWay");
44733     var dispatch12 = dispatch_default("rejectedSelfIntersection");
44734     var behavior = behaviorDraw(context);
44735     var _nodeIndex;
44736     var _origWay;
44737     var _wayGeometry;
44738     var _headNodeID;
44739     var _annotation;
44740     var _pointerHasMoved = false;
44741     var _drawNode;
44742     var _didResolveTempEdit = false;
44743     function createDrawNode(loc) {
44744       _drawNode = osmNode({ loc });
44745       context.pauseChangeDispatch();
44746       context.replace(function actionAddDrawNode(graph) {
44747         var way = graph.entity(wayID);
44748         return graph.replace(_drawNode).replace(way.addNode(_drawNode.id, _nodeIndex));
44749       }, _annotation);
44750       context.resumeChangeDispatch();
44751       setActiveElements();
44752     }
44753     function removeDrawNode() {
44754       context.pauseChangeDispatch();
44755       context.replace(
44756         function actionDeleteDrawNode(graph) {
44757           var way = graph.entity(wayID);
44758           return graph.replace(way.removeNode(_drawNode.id)).remove(_drawNode);
44759         },
44760         _annotation
44761       );
44762       _drawNode = void 0;
44763       context.resumeChangeDispatch();
44764     }
44765     function keydown(d3_event) {
44766       if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
44767         if (context.surface().classed("nope")) {
44768           context.surface().classed("nope-suppressed", true);
44769         }
44770         context.surface().classed("nope", false).classed("nope-disabled", true);
44771       }
44772     }
44773     function keyup(d3_event) {
44774       if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
44775         if (context.surface().classed("nope-suppressed")) {
44776           context.surface().classed("nope", true);
44777         }
44778         context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
44779       }
44780     }
44781     function allowsVertex(d2) {
44782       return d2.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(d2, context.graph());
44783     }
44784     function move(d3_event, datum2) {
44785       var loc = context.map().mouseCoordinates();
44786       if (!_drawNode) createDrawNode(loc);
44787       context.surface().classed("nope-disabled", d3_event.altKey);
44788       var targetLoc = datum2 && datum2.properties && datum2.properties.entity && allowsVertex(datum2.properties.entity) && datum2.properties.entity.loc;
44789       var targetNodes = datum2 && datum2.properties && datum2.properties.nodes;
44790       if (targetLoc) {
44791         loc = targetLoc;
44792       } else if (targetNodes) {
44793         var choice = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, _drawNode.id);
44794         if (choice) {
44795           loc = choice.loc;
44796         }
44797       }
44798       context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
44799       _drawNode = context.entity(_drawNode.id);
44800       checkGeometry(
44801         true
44802         /* includeDrawNode */
44803       );
44804     }
44805     function checkGeometry(includeDrawNode) {
44806       var nopeDisabled = context.surface().classed("nope-disabled");
44807       var isInvalid = isInvalidGeometry(includeDrawNode);
44808       if (nopeDisabled) {
44809         context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
44810       } else {
44811         context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
44812       }
44813     }
44814     function isInvalidGeometry(includeDrawNode) {
44815       var testNode = _drawNode;
44816       var parentWay = context.graph().entity(wayID);
44817       var nodes = context.graph().childNodes(parentWay).slice();
44818       if (includeDrawNode) {
44819         if (parentWay.isClosed()) {
44820           nodes.pop();
44821         }
44822       } else {
44823         if (parentWay.isClosed()) {
44824           if (nodes.length < 3) return false;
44825           if (_drawNode) nodes.splice(-2, 1);
44826           testNode = nodes[nodes.length - 2];
44827         } else {
44828           return false;
44829         }
44830       }
44831       return testNode && geoHasSelfIntersections(nodes, testNode.id);
44832     }
44833     function undone() {
44834       _didResolveTempEdit = true;
44835       context.pauseChangeDispatch();
44836       var nextMode;
44837       if (context.graph() === startGraph) {
44838         nextMode = modeSelect(context, [wayID]);
44839       } else {
44840         context.pop(1);
44841         nextMode = mode;
44842       }
44843       context.perform(actionNoop());
44844       context.pop(1);
44845       context.resumeChangeDispatch();
44846       context.enter(nextMode);
44847     }
44848     function setActiveElements() {
44849       if (!_drawNode) return;
44850       context.surface().selectAll("." + _drawNode.id).classed("active", true);
44851     }
44852     function resetToStartGraph() {
44853       while (context.graph() !== startGraph) {
44854         context.pop();
44855       }
44856     }
44857     var drawWay = function(surface) {
44858       _drawNode = void 0;
44859       _didResolveTempEdit = false;
44860       _origWay = context.entity(wayID);
44861       if (typeof _nodeIndex === "number") {
44862         _headNodeID = _origWay.nodes[_nodeIndex];
44863       } else if (_origWay.isClosed()) {
44864         _headNodeID = _origWay.nodes[_origWay.nodes.length - 2];
44865       } else {
44866         _headNodeID = _origWay.nodes[_origWay.nodes.length - 1];
44867       }
44868       _wayGeometry = _origWay.geometry(context.graph());
44869       _annotation = _t(
44870         (_origWay.nodes.length === (_origWay.isClosed() ? 2 : 1) ? "operations.start.annotation." : "operations.continue.annotation.") + _wayGeometry
44871       );
44872       _pointerHasMoved = false;
44873       context.pauseChangeDispatch();
44874       context.perform(actionNoop(), _annotation);
44875       context.resumeChangeDispatch();
44876       behavior.hover().initialNodeID(_headNodeID);
44877       behavior.on("move", function() {
44878         _pointerHasMoved = true;
44879         move.apply(this, arguments);
44880       }).on("down", function() {
44881         move.apply(this, arguments);
44882       }).on("downcancel", function() {
44883         if (_drawNode) removeDrawNode();
44884       }).on("click", drawWay.add).on("clickWay", drawWay.addWay).on("clickNode", drawWay.addNode).on("undo", context.undo).on("cancel", drawWay.cancel).on("finish", drawWay.finish);
44885       select_default2(window).on("keydown.drawWay", keydown).on("keyup.drawWay", keyup);
44886       context.map().dblclickZoomEnable(false).on("drawn.draw", setActiveElements);
44887       setActiveElements();
44888       surface.call(behavior);
44889       context.history().on("undone.draw", undone);
44890     };
44891     drawWay.off = function(surface) {
44892       if (!_didResolveTempEdit) {
44893         context.pauseChangeDispatch();
44894         resetToStartGraph();
44895         context.resumeChangeDispatch();
44896       }
44897       _drawNode = void 0;
44898       _nodeIndex = void 0;
44899       context.map().on("drawn.draw", null);
44900       surface.call(behavior.off).selectAll(".active").classed("active", false);
44901       surface.classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false);
44902       select_default2(window).on("keydown.drawWay", null).on("keyup.drawWay", null);
44903       context.history().on("undone.draw", null);
44904     };
44905     function attemptAdd(d2, loc, doAdd) {
44906       if (_drawNode) {
44907         context.replace(actionMoveNode(_drawNode.id, loc), _annotation);
44908         _drawNode = context.entity(_drawNode.id);
44909       } else {
44910         createDrawNode(loc);
44911       }
44912       checkGeometry(
44913         true
44914         /* includeDrawNode */
44915       );
44916       if (d2 && d2.properties && d2.properties.nope || context.surface().classed("nope")) {
44917         if (!_pointerHasMoved) {
44918           removeDrawNode();
44919         }
44920         dispatch12.call("rejectedSelfIntersection", this);
44921         return;
44922       }
44923       context.pauseChangeDispatch();
44924       doAdd();
44925       _didResolveTempEdit = true;
44926       context.resumeChangeDispatch();
44927       context.enter(mode);
44928     }
44929     drawWay.add = function(loc, d2) {
44930       attemptAdd(d2, loc, function() {
44931       });
44932     };
44933     drawWay.addWay = function(loc, edge, d2) {
44934       attemptAdd(d2, loc, function() {
44935         context.replace(
44936           actionAddMidpoint({ loc, edge }, _drawNode),
44937           _annotation
44938         );
44939       });
44940     };
44941     drawWay.addNode = function(node, d2) {
44942       if (node.id === _headNodeID || // or the first node when drawing an area
44943       _origWay.isClosed() && node.id === _origWay.first()) {
44944         drawWay.finish();
44945         return;
44946       }
44947       attemptAdd(d2, node.loc, function() {
44948         context.replace(
44949           function actionReplaceDrawNode(graph) {
44950             graph = graph.replace(graph.entity(wayID).removeNode(_drawNode.id)).remove(_drawNode);
44951             return graph.replace(graph.entity(wayID).addNode(node.id, _nodeIndex));
44952           },
44953           _annotation
44954         );
44955       });
44956     };
44957     function getFeatureType(ways) {
44958       if (ways.every((way) => way.isClosed())) return "area";
44959       if (ways.every((way) => !way.isClosed())) return "line";
44960       return "generic";
44961     }
44962     function followMode() {
44963       if (_didResolveTempEdit) return;
44964       try {
44965         const isDrawingArea = _origWay.nodes[0] === _origWay.nodes.slice(-1)[0];
44966         const [secondLastNodeId, lastNodeId] = _origWay.nodes.slice(isDrawingArea ? -3 : -2);
44967         const historyGraph = context.history().graph();
44968         if (!lastNodeId || !secondLastNodeId || !historyGraph.hasEntity(lastNodeId) || !historyGraph.hasEntity(secondLastNodeId)) {
44969           context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.needs_more_initial_nodes"))();
44970           return;
44971         }
44972         const lastNodesParents = historyGraph.parentWays(historyGraph.entity(lastNodeId)).filter((w3) => w3.id !== wayID);
44973         const secondLastNodesParents = historyGraph.parentWays(historyGraph.entity(secondLastNodeId)).filter((w3) => w3.id !== wayID);
44974         const featureType = getFeatureType(lastNodesParents);
44975         if (lastNodesParents.length !== 1 || secondLastNodesParents.length === 0) {
44976           context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.intersection_of_multiple_ways.".concat(featureType)))();
44977           return;
44978         }
44979         if (!secondLastNodesParents.some((n3) => n3.id === lastNodesParents[0].id)) {
44980           context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.intersection_of_different_ways.".concat(featureType)))();
44981           return;
44982         }
44983         const way = lastNodesParents[0];
44984         const indexOfLast = way.nodes.indexOf(lastNodeId);
44985         const indexOfSecondLast = way.nodes.indexOf(secondLastNodeId);
44986         const isDescendingPastZero = indexOfLast === way.nodes.length - 2 && indexOfSecondLast === 0;
44987         let nextNodeIndex = indexOfLast + (indexOfLast > indexOfSecondLast && !isDescendingPastZero ? 1 : -1);
44988         if (nextNodeIndex === -1) nextNodeIndex = indexOfSecondLast === 1 ? way.nodes.length - 2 : 1;
44989         const nextNode = historyGraph.entity(way.nodes[nextNodeIndex]);
44990         drawWay.addNode(nextNode, {
44991           geometry: { type: "Point", coordinates: nextNode.loc },
44992           id: nextNode.id,
44993           properties: { target: true, entity: nextNode }
44994         });
44995       } catch (e3) {
44996         context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("operations.follow.error.unknown"))();
44997       }
44998     }
44999     keybinding.on(_t("operations.follow.key"), followMode);
45000     select_default2(document).call(keybinding);
45001     drawWay.finish = function() {
45002       checkGeometry(
45003         false
45004         /* includeDrawNode */
45005       );
45006       if (context.surface().classed("nope")) {
45007         dispatch12.call("rejectedSelfIntersection", this);
45008         return;
45009       }
45010       context.pauseChangeDispatch();
45011       context.pop(1);
45012       _didResolveTempEdit = true;
45013       context.resumeChangeDispatch();
45014       var way = context.hasEntity(wayID);
45015       if (!way || way.isDegenerate()) {
45016         drawWay.cancel();
45017         return;
45018       }
45019       window.setTimeout(function() {
45020         context.map().dblclickZoomEnable(true);
45021       }, 1e3);
45022       var isNewFeature = !mode.isContinuing;
45023       context.enter(modeSelect(context, [wayID]).newFeature(isNewFeature));
45024     };
45025     drawWay.cancel = function() {
45026       context.pauseChangeDispatch();
45027       resetToStartGraph();
45028       context.resumeChangeDispatch();
45029       window.setTimeout(function() {
45030         context.map().dblclickZoomEnable(true);
45031       }, 1e3);
45032       context.surface().classed("nope", false).classed("nope-disabled", false).classed("nope-suppressed", false);
45033       context.enter(modeBrowse(context));
45034     };
45035     drawWay.nodeIndex = function(val) {
45036       if (!arguments.length) return _nodeIndex;
45037       _nodeIndex = val;
45038       return drawWay;
45039     };
45040     drawWay.activeID = function() {
45041       if (!arguments.length) return _drawNode && _drawNode.id;
45042       return drawWay;
45043     };
45044     return utilRebind(drawWay, dispatch12, "on");
45045   }
45046
45047   // modules/modes/draw_line.js
45048   function modeDrawLine(context, wayID, startGraph, button, affix, continuing) {
45049     var mode = {
45050       button,
45051       id: "draw-line"
45052     };
45053     var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawLine", function() {
45054       context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.lines"))();
45055     });
45056     mode.wayID = wayID;
45057     mode.isContinuing = continuing;
45058     mode.enter = function() {
45059       behavior.nodeIndex(affix === "prefix" ? 0 : void 0);
45060       context.install(behavior);
45061     };
45062     mode.exit = function() {
45063       context.uninstall(behavior);
45064     };
45065     mode.selectedIDs = function() {
45066       return [wayID];
45067     };
45068     mode.activeID = function() {
45069       return behavior && behavior.activeID() || [];
45070     };
45071     return mode;
45072   }
45073
45074   // modules/ui/cmd.js
45075   var uiCmd = function(code) {
45076     var detected = utilDetect();
45077     if (detected.os === "mac") {
45078       return code;
45079     }
45080     if (detected.os === "win") {
45081       if (code === "\u2318\u21E7Z") return "Ctrl+Y";
45082     }
45083     var result = "", replacements = {
45084       "\u2318": "Ctrl",
45085       "\u21E7": "Shift",
45086       "\u2325": "Alt",
45087       "\u232B": "Backspace",
45088       "\u2326": "Delete"
45089     };
45090     for (var i3 = 0; i3 < code.length; i3++) {
45091       if (code[i3] in replacements) {
45092         result += replacements[code[i3]] + (i3 < code.length - 1 ? "+" : "");
45093       } else {
45094         result += code[i3];
45095       }
45096     }
45097     return result;
45098   };
45099   uiCmd.display = function(code) {
45100     if (code.length !== 1) return code;
45101     var detected = utilDetect();
45102     var mac = detected.os === "mac";
45103     var replacements = {
45104       "\u2318": mac ? "\u2318 " + _t("shortcuts.key.cmd") : _t("shortcuts.key.ctrl"),
45105       "\u21E7": mac ? "\u21E7 " + _t("shortcuts.key.shift") : _t("shortcuts.key.shift"),
45106       "\u2325": mac ? "\u2325 " + _t("shortcuts.key.option") : _t("shortcuts.key.alt"),
45107       "\u2303": mac ? "\u2303 " + _t("shortcuts.key.ctrl") : _t("shortcuts.key.ctrl"),
45108       "\u232B": mac ? "\u232B " + _t("shortcuts.key.delete") : _t("shortcuts.key.backspace"),
45109       "\u2326": mac ? "\u2326 " + _t("shortcuts.key.del") : _t("shortcuts.key.del"),
45110       "\u2196": mac ? "\u2196 " + _t("shortcuts.key.pgup") : _t("shortcuts.key.pgup"),
45111       "\u2198": mac ? "\u2198 " + _t("shortcuts.key.pgdn") : _t("shortcuts.key.pgdn"),
45112       "\u21DE": mac ? "\u21DE " + _t("shortcuts.key.home") : _t("shortcuts.key.home"),
45113       "\u21DF": mac ? "\u21DF " + _t("shortcuts.key.end") : _t("shortcuts.key.end"),
45114       "\u21B5": mac ? "\u23CE " + _t("shortcuts.key.return") : _t("shortcuts.key.enter"),
45115       "\u238B": mac ? "\u238B " + _t("shortcuts.key.esc") : _t("shortcuts.key.esc"),
45116       "\u2630": mac ? "\u2630 " + _t("shortcuts.key.menu") : _t("shortcuts.key.menu")
45117     };
45118     return replacements[code] || code;
45119   };
45120
45121   // modules/operations/delete.js
45122   function operationDelete(context, selectedIDs) {
45123     var multi = selectedIDs.length === 1 ? "single" : "multiple";
45124     var action = actionDeleteMultiple(selectedIDs);
45125     var nodes = utilGetAllNodes(selectedIDs, context.graph());
45126     var coords = nodes.map(function(n3) {
45127       return n3.loc;
45128     });
45129     var extent = utilTotalExtent(selectedIDs, context.graph());
45130     var operation2 = function() {
45131       var nextSelectedID;
45132       var nextSelectedLoc;
45133       if (selectedIDs.length === 1) {
45134         var id2 = selectedIDs[0];
45135         var entity = context.entity(id2);
45136         var geometry = entity.geometry(context.graph());
45137         var parents = context.graph().parentWays(entity);
45138         var parent2 = parents[0];
45139         if (geometry === "vertex") {
45140           var nodes2 = parent2.nodes;
45141           var i3 = nodes2.indexOf(id2);
45142           if (i3 === 0) {
45143             i3++;
45144           } else if (i3 === nodes2.length - 1) {
45145             i3--;
45146           } else {
45147             var a2 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 - 1]).loc);
45148             var b3 = geoSphericalDistance(entity.loc, context.entity(nodes2[i3 + 1]).loc);
45149             i3 = a2 < b3 ? i3 - 1 : i3 + 1;
45150           }
45151           nextSelectedID = nodes2[i3];
45152           nextSelectedLoc = context.entity(nextSelectedID).loc;
45153         }
45154       }
45155       context.perform(action, operation2.annotation());
45156       context.validator().validate();
45157       if (nextSelectedID && nextSelectedLoc) {
45158         if (context.hasEntity(nextSelectedID)) {
45159           context.enter(modeSelect(context, [nextSelectedID]).follow(true));
45160         } else {
45161           context.map().centerEase(nextSelectedLoc);
45162           context.enter(modeBrowse(context));
45163         }
45164       } else {
45165         context.enter(modeBrowse(context));
45166       }
45167     };
45168     operation2.available = function() {
45169       return true;
45170     };
45171     operation2.disabled = function() {
45172       if (extent.percentContainedIn(context.map().extent()) < 0.8) {
45173         return "too_large";
45174       } else if (someMissing()) {
45175         return "not_downloaded";
45176       } else if (selectedIDs.some(context.hasHiddenConnections)) {
45177         return "connected_to_hidden";
45178       } else if (selectedIDs.some(protectedMember)) {
45179         return "part_of_relation";
45180       } else if (selectedIDs.some(incompleteRelation)) {
45181         return "incomplete_relation";
45182       } else if (selectedIDs.some(hasWikidataTag)) {
45183         return "has_wikidata_tag";
45184       }
45185       return false;
45186       function someMissing() {
45187         if (context.inIntro()) return false;
45188         var osm = context.connection();
45189         if (osm) {
45190           var missing = coords.filter(function(loc) {
45191             return !osm.isDataLoaded(loc);
45192           });
45193           if (missing.length) {
45194             missing.forEach(function(loc) {
45195               context.loadTileAtLoc(loc);
45196             });
45197             return true;
45198           }
45199         }
45200         return false;
45201       }
45202       function hasWikidataTag(id2) {
45203         var entity = context.entity(id2);
45204         return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
45205       }
45206       function incompleteRelation(id2) {
45207         var entity = context.entity(id2);
45208         return entity.type === "relation" && !entity.isComplete(context.graph());
45209       }
45210       function protectedMember(id2) {
45211         var entity = context.entity(id2);
45212         if (entity.type !== "way") return false;
45213         var parents = context.graph().parentRelations(entity);
45214         for (var i3 = 0; i3 < parents.length; i3++) {
45215           var parent2 = parents[i3];
45216           var type2 = parent2.tags.type;
45217           var role = parent2.memberById(id2).role || "outer";
45218           if (type2 === "route" || type2 === "boundary" || type2 === "multipolygon" && role === "outer") {
45219             return true;
45220           }
45221         }
45222         return false;
45223       }
45224     };
45225     operation2.tooltip = function() {
45226       var disable = operation2.disabled();
45227       return disable ? _t.append("operations.delete." + disable + "." + multi) : _t.append("operations.delete.description." + multi);
45228     };
45229     operation2.annotation = function() {
45230       return selectedIDs.length === 1 ? _t("operations.delete.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.delete.annotation.feature", { n: selectedIDs.length });
45231     };
45232     operation2.id = "delete";
45233     operation2.keys = [uiCmd("\u2318\u232B"), uiCmd("\u2318\u2326"), uiCmd("\u2326")];
45234     operation2.title = _t.append("operations.delete.title");
45235     operation2.behavior = behaviorOperation(context).which(operation2);
45236     return operation2;
45237   }
45238
45239   // modules/validations/disconnected_way.js
45240   function validationDisconnectedWay() {
45241     var type2 = "disconnected_way";
45242     function isTaggedAsHighway(entity) {
45243       return osmRoutableHighwayTagValues[entity.tags.highway];
45244     }
45245     var validation = function checkDisconnectedWay(entity, graph) {
45246       var routingIslandWays = routingIslandForEntity(entity);
45247       if (!routingIslandWays) return [];
45248       return [new validationIssue({
45249         type: type2,
45250         subtype: "highway",
45251         severity: "warning",
45252         message: function(context) {
45253           var entity2 = this.entityIds.length && context.hasEntity(this.entityIds[0]);
45254           var label = entity2 && utilDisplayLabel(entity2, context.graph());
45255           return _t.append("issues.disconnected_way.routable.message", { count: this.entityIds.length, highway: label });
45256         },
45257         reference: showReference,
45258         entityIds: Array.from(routingIslandWays).map(function(way) {
45259           return way.id;
45260         }),
45261         dynamicFixes: makeFixes
45262       })];
45263       function makeFixes(context) {
45264         var fixes = [];
45265         var singleEntity = this.entityIds.length === 1 && context.hasEntity(this.entityIds[0]);
45266         if (singleEntity) {
45267           if (singleEntity.type === "way" && !singleEntity.isClosed()) {
45268             var textDirection = _mainLocalizer.textDirection();
45269             var startFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.first(), "start");
45270             if (startFix) fixes.push(startFix);
45271             var endFix = makeContinueDrawingFixIfAllowed(textDirection, singleEntity.last(), "end");
45272             if (endFix) fixes.push(endFix);
45273           }
45274           if (!fixes.length) {
45275             fixes.push(new validationIssueFix({
45276               title: _t.append("issues.fix.connect_feature.title")
45277             }));
45278           }
45279           fixes.push(new validationIssueFix({
45280             icon: "iD-operation-delete",
45281             title: _t.append("issues.fix.delete_feature.title"),
45282             entityIds: [singleEntity.id],
45283             onClick: function(context2) {
45284               var id2 = this.issue.entityIds[0];
45285               var operation2 = operationDelete(context2, [id2]);
45286               if (!operation2.disabled()) {
45287                 operation2();
45288               }
45289             }
45290           }));
45291         } else {
45292           fixes.push(new validationIssueFix({
45293             title: _t.append("issues.fix.connect_features.title")
45294           }));
45295         }
45296         return fixes;
45297       }
45298       function showReference(selection2) {
45299         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.disconnected_way.routable.reference"));
45300       }
45301       function routingIslandForEntity(entity2) {
45302         var routingIsland = /* @__PURE__ */ new Set();
45303         var waysToCheck = [];
45304         function queueParentWays(node) {
45305           graph.parentWays(node).forEach(function(parentWay) {
45306             if (!routingIsland.has(parentWay) && // only check each feature once
45307             isRoutableWay(parentWay, false)) {
45308               routingIsland.add(parentWay);
45309               waysToCheck.push(parentWay);
45310             }
45311           });
45312         }
45313         if (entity2.type === "way" && isRoutableWay(entity2, true)) {
45314           routingIsland.add(entity2);
45315           waysToCheck.push(entity2);
45316         } else if (entity2.type === "node" && isRoutableNode(entity2)) {
45317           routingIsland.add(entity2);
45318           queueParentWays(entity2);
45319         } else {
45320           return null;
45321         }
45322         while (waysToCheck.length) {
45323           var wayToCheck = waysToCheck.pop();
45324           var childNodes = graph.childNodes(wayToCheck);
45325           for (var i3 in childNodes) {
45326             var vertex = childNodes[i3];
45327             if (isConnectedVertex(vertex)) {
45328               return null;
45329             }
45330             if (isRoutableNode(vertex)) {
45331               routingIsland.add(vertex);
45332             }
45333             queueParentWays(vertex);
45334           }
45335         }
45336         return routingIsland;
45337       }
45338       function isConnectedVertex(vertex) {
45339         var osm = services.osm;
45340         if (osm && !osm.isDataLoaded(vertex.loc)) return true;
45341         if (vertex.tags.entrance && vertex.tags.entrance !== "no") return true;
45342         if (vertex.tags.amenity === "parking_entrance") return true;
45343         return false;
45344       }
45345       function isRoutableNode(node) {
45346         if (node.tags.highway === "elevator") return true;
45347         return false;
45348       }
45349       function isRoutableWay(way, ignoreInnerWays) {
45350         if (isTaggedAsHighway(way) || way.tags.route === "ferry") return true;
45351         return graph.parentRelations(way).some(function(parentRelation) {
45352           if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry") return true;
45353           if (parentRelation.isMultipolygon() && isTaggedAsHighway(parentRelation) && (!ignoreInnerWays || parentRelation.memberById(way.id).role !== "inner")) return true;
45354           return false;
45355         });
45356       }
45357       function makeContinueDrawingFixIfAllowed(textDirection, vertexID, whichEnd) {
45358         var vertex = graph.hasEntity(vertexID);
45359         if (!vertex || vertex.tags.noexit === "yes") return null;
45360         var useLeftContinue = whichEnd === "start" && textDirection === "ltr" || whichEnd === "end" && textDirection === "rtl";
45361         return new validationIssueFix({
45362           icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
45363           title: _t.append("issues.fix.continue_from_" + whichEnd + ".title"),
45364           entityIds: [vertexID],
45365           onClick: function(context) {
45366             var wayId = this.issue.entityIds[0];
45367             var way = context.hasEntity(wayId);
45368             var vertexId = this.entityIds[0];
45369             var vertex2 = context.hasEntity(vertexId);
45370             if (!way || !vertex2) return;
45371             var map2 = context.map();
45372             if (!context.editable() || !map2.trimmedExtent().contains(vertex2.loc)) {
45373               map2.zoomToEase(vertex2);
45374             }
45375             context.enter(
45376               modeDrawLine(context, wayId, context.graph(), "line", way.affix(vertexId), true)
45377             );
45378           }
45379         });
45380       }
45381     };
45382     validation.type = type2;
45383     return validation;
45384   }
45385
45386   // modules/validations/invalid_format.js
45387   function validationFormatting() {
45388     var type2 = "invalid_format";
45389     var validation = function(entity) {
45390       var issues = [];
45391       function isValidEmail(email) {
45392         var valid_email = /^[^\(\)\\,":;<>@\[\]]+@[^\(\)\\,":;<>@\[\]\.]+(?:\.[a-z0-9-]+)*$/i;
45393         return !email || valid_email.test(email);
45394       }
45395       function showReferenceEmail(selection2) {
45396         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.invalid_format.email.reference"));
45397       }
45398       if (entity.tags.email) {
45399         var emails = entity.tags.email.split(";").map(function(s2) {
45400           return s2.trim();
45401         }).filter(function(x3) {
45402           return !isValidEmail(x3);
45403         });
45404         if (emails.length) {
45405           issues.push(new validationIssue({
45406             type: type2,
45407             subtype: "email",
45408             severity: "warning",
45409             message: function(context) {
45410               var entity2 = context.hasEntity(this.entityIds[0]);
45411               return entity2 ? _t.append(
45412                 "issues.invalid_format.email.message" + this.data,
45413                 { feature: utilDisplayLabel(entity2, context.graph()), email: emails.join(", ") }
45414               ) : "";
45415             },
45416             reference: showReferenceEmail,
45417             entityIds: [entity.id],
45418             hash: emails.join(),
45419             data: emails.length > 1 ? "_multi" : ""
45420           }));
45421         }
45422       }
45423       return issues;
45424     };
45425     validation.type = type2;
45426     return validation;
45427   }
45428
45429   // modules/validations/help_request.js
45430   function validationHelpRequest(context) {
45431     var type2 = "help_request";
45432     var validation = function checkFixmeTag(entity) {
45433       if (!entity.tags.fixme) return [];
45434       if (entity.version === void 0) return [];
45435       if (entity.v !== void 0) {
45436         var baseEntity = context.history().base().hasEntity(entity.id);
45437         if (!baseEntity || !baseEntity.tags.fixme) return [];
45438       }
45439       return [new validationIssue({
45440         type: type2,
45441         subtype: "fixme_tag",
45442         severity: "warning",
45443         message: function(context2) {
45444           var entity2 = context2.hasEntity(this.entityIds[0]);
45445           return entity2 ? _t.append("issues.fixme_tag.message", {
45446             feature: utilDisplayLabel(
45447               entity2,
45448               context2.graph(),
45449               true
45450               /* verbose */
45451             )
45452           }) : "";
45453         },
45454         dynamicFixes: function() {
45455           return [
45456             new validationIssueFix({
45457               title: _t.append("issues.fix.address_the_concern.title")
45458             })
45459           ];
45460         },
45461         reference: showReference,
45462         entityIds: [entity.id]
45463       })];
45464       function showReference(selection2) {
45465         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.fixme_tag.reference"));
45466       }
45467     };
45468     validation.type = type2;
45469     return validation;
45470   }
45471
45472   // modules/validations/impossible_oneway.js
45473   function validationImpossibleOneway() {
45474     const type2 = "impossible_oneway";
45475     const validation = function checkImpossibleOneway(entity, graph) {
45476       if (entity.type !== "way" || entity.geometry(graph) !== "line") return [];
45477       if (entity.isClosed()) return [];
45478       if (!typeForWay(entity)) return [];
45479       if (!entity.isOneWay()) return [];
45480       return [
45481         ...issuesForNode(entity, entity.first()),
45482         ...issuesForNode(entity, entity.last())
45483       ];
45484       function typeForWay(way) {
45485         if (way.geometry(graph) !== "line") return null;
45486         if (osmRoutableHighwayTagValues[way.tags.highway]) return "highway";
45487         if (osmFlowingWaterwayTagValues[way.tags.waterway]) return "waterway";
45488         return null;
45489       }
45490       function nodeOccursMoreThanOnce(way, nodeID) {
45491         let occurrences = 0;
45492         for (const index in way.nodes) {
45493           if (way.nodes[index] === nodeID) {
45494             occurrences++;
45495             if (occurrences > 1) return true;
45496           }
45497         }
45498         return false;
45499       }
45500       function isConnectedViaOtherTypes(way, node) {
45501         var wayType = typeForWay(way);
45502         if (wayType === "highway") {
45503           if (node.tags.entrance && node.tags.entrance !== "no") return true;
45504           if (node.tags.amenity === "parking_entrance") return true;
45505         } else if (wayType === "waterway") {
45506           if (node.id === way.first()) {
45507             if (node.tags.natural === "spring") return true;
45508           } else {
45509             if (node.tags.manhole === "drain") return true;
45510           }
45511         }
45512         return graph.parentWays(node).some(function(parentWay) {
45513           if (parentWay.id === way.id) return false;
45514           if (wayType === "highway") {
45515             if (parentWay.geometry(graph) === "area" && osmRoutableHighwayTagValues[parentWay.tags.highway]) return true;
45516             if (parentWay.tags.route === "ferry") return true;
45517             return graph.parentRelations(parentWay).some(function(parentRelation) {
45518               if (parentRelation.tags.type === "route" && parentRelation.tags.route === "ferry") return true;
45519               return parentRelation.isMultipolygon() && osmRoutableHighwayTagValues[parentRelation.tags.highway];
45520             });
45521           } else if (wayType === "waterway") {
45522             if (parentWay.tags.natural === "water" || parentWay.tags.natural === "coastline") return true;
45523           }
45524           return false;
45525         });
45526       }
45527       function issuesForNode(way, nodeID) {
45528         const isFirst = nodeID === way.first() ^ way.isOneWayBackwards();
45529         const wayType = typeForWay(way);
45530         if (nodeOccursMoreThanOnce(way, nodeID)) return [];
45531         const osm = services.osm;
45532         if (!osm) return [];
45533         const node = graph.hasEntity(nodeID);
45534         if (!node || !osm.isDataLoaded(node.loc)) return [];
45535         if (isConnectedViaOtherTypes(way, node)) return [];
45536         const attachedWaysOfSameType = graph.parentWays(node).filter((parentWay) => {
45537           if (parentWay.id === way.id) return false;
45538           return typeForWay(parentWay) === wayType;
45539         });
45540         if (wayType === "waterway" && attachedWaysOfSameType.length === 0) return [];
45541         const attachedOneways = attachedWaysOfSameType.filter((attachedWay) => attachedWay.isOneWay());
45542         if (attachedOneways.length < attachedWaysOfSameType.length) return [];
45543         if (attachedOneways.length) {
45544           const connectedEndpointsOkay = attachedOneways.some((attachedOneway) => {
45545             const isAttachedBackwards = attachedOneway.isOneWayBackwards();
45546             if ((isFirst ^ isAttachedBackwards ? attachedOneway.first() : attachedOneway.last()) !== nodeID) {
45547               return true;
45548             }
45549             if (nodeOccursMoreThanOnce(attachedOneway, nodeID)) return true;
45550             return false;
45551           });
45552           if (connectedEndpointsOkay) return [];
45553         }
45554         const placement = isFirst ? "start" : "end";
45555         let messageID = wayType + ".";
45556         let referenceID = wayType + ".";
45557         if (wayType === "waterway") {
45558           messageID += "connected." + placement;
45559           referenceID += "connected";
45560         } else {
45561           messageID += placement;
45562           referenceID += placement;
45563         }
45564         return [new validationIssue({
45565           type: type2,
45566           subtype: wayType,
45567           severity: "warning",
45568           message: function(context) {
45569             var entity2 = context.hasEntity(this.entityIds[0]);
45570             return entity2 ? _t.append("issues.impossible_oneway." + messageID + ".message", {
45571               feature: utilDisplayLabel(entity2, context.graph())
45572             }) : "";
45573           },
45574           reference: getReference(referenceID),
45575           entityIds: [way.id, node.id],
45576           dynamicFixes: function() {
45577             var fixes = [];
45578             if (attachedOneways.length) {
45579               fixes.push(new validationIssueFix({
45580                 icon: "iD-operation-reverse",
45581                 title: _t.append("issues.fix.reverse_feature.title"),
45582                 entityIds: [way.id],
45583                 onClick: function(context) {
45584                   var id2 = this.issue.entityIds[0];
45585                   context.perform(actionReverse(id2), _t("operations.reverse.annotation.line", { n: 1 }));
45586                 }
45587               }));
45588             }
45589             if (node.tags.noexit !== "yes") {
45590               var textDirection = _mainLocalizer.textDirection();
45591               var useLeftContinue = isFirst && textDirection === "ltr" || !isFirst && textDirection === "rtl";
45592               fixes.push(new validationIssueFix({
45593                 icon: "iD-operation-continue" + (useLeftContinue ? "-left" : ""),
45594                 title: _t.append("issues.fix.continue_from_" + (isFirst ? "start" : "end") + ".title"),
45595                 onClick: function(context) {
45596                   var entityID = this.issue.entityIds[0];
45597                   var vertexID = this.issue.entityIds[1];
45598                   var way2 = context.entity(entityID);
45599                   var vertex = context.entity(vertexID);
45600                   continueDrawing(way2, vertex, context);
45601                 }
45602               }));
45603             }
45604             return fixes;
45605           },
45606           loc: node.loc
45607         })];
45608         function getReference(referenceID2) {
45609           return function showReference(selection2) {
45610             selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.impossible_oneway." + referenceID2 + ".reference"));
45611           };
45612         }
45613       }
45614     };
45615     function continueDrawing(way, vertex, context) {
45616       var map2 = context.map();
45617       if (!context.editable() || !map2.trimmedExtent().contains(vertex.loc)) {
45618         map2.zoomToEase(vertex);
45619       }
45620       context.enter(
45621         modeDrawLine(context, way.id, context.graph(), "line", way.affix(vertex.id), true)
45622       );
45623     }
45624     validation.type = type2;
45625     return validation;
45626   }
45627
45628   // modules/validations/incompatible_source.js
45629   var incompatibleRules = [
45630     {
45631       id: "amap",
45632       regex: /(^amap$|^amap\.com|autonavi|mapabc|高德)/i
45633     },
45634     {
45635       id: "baidu",
45636       regex: /(baidu|mapbar|百度)/i
45637     },
45638     {
45639       id: "google",
45640       regex: /(google)/i,
45641       exceptRegex: /((books|drive)\.google|google\s?(books|drive|plus))|(esri\/Google_(Africa|Open)_Buildings)/i
45642     }
45643   ];
45644   function getIncompatibleSources(str) {
45645     return incompatibleRules.filter(
45646       (rule) => {
45647         var _a5;
45648         return rule.regex.test(str) && !((_a5 = rule.exceptRegex) == null ? void 0 : _a5.test(str));
45649       }
45650     );
45651   }
45652   function validationIncompatibleSource() {
45653     const type2 = "incompatible_source";
45654     const validation = function checkIncompatibleSource(entity) {
45655       const entitySources = entity.tags && entity.tags.source && entity.tags.source.split(";");
45656       if (!entitySources) return [];
45657       const entityID = entity.id;
45658       return entitySources.flatMap(
45659         (source) => getIncompatibleSources(source).map((matchRule) => new validationIssue({
45660           type: type2,
45661           severity: "warning",
45662           message: (context) => {
45663             const entity2 = context.hasEntity(entityID);
45664             return entity2 ? _t.append("issues.incompatible_source.feature.message", {
45665               feature: utilDisplayLabel(
45666                 entity2,
45667                 context.graph(),
45668                 true
45669                 /* verbose */
45670               ),
45671               value: source
45672             }) : "";
45673           },
45674           reference: getReference(matchRule.id),
45675           entityIds: [entityID],
45676           hash: source,
45677           dynamicFixes: () => {
45678             return [
45679               new validationIssueFix({ title: _t.append("issues.fix.remove_proprietary_data.title") })
45680             ];
45681           }
45682         }))
45683       );
45684       function getReference(id2) {
45685         return function showReference(selection2) {
45686           selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.incompatible_source.reference.".concat(id2)));
45687         };
45688       }
45689     };
45690     validation.type = type2;
45691     return validation;
45692   }
45693
45694   // modules/validations/maprules.js
45695   function validationMaprules() {
45696     var type2 = "maprules";
45697     var validation = function checkMaprules(entity, graph) {
45698       if (!services.maprules) return [];
45699       var rules = services.maprules.validationRules();
45700       var issues = [];
45701       for (var i3 = 0; i3 < rules.length; i3++) {
45702         var rule = rules[i3];
45703         rule.findIssues(entity, graph, issues);
45704       }
45705       return issues;
45706     };
45707     validation.type = type2;
45708     return validation;
45709   }
45710
45711   // modules/validations/mismatched_geometry.js
45712   var import_fast_deep_equal5 = __toESM(require_fast_deep_equal(), 1);
45713   function validationMismatchedGeometry() {
45714     var type2 = "mismatched_geometry";
45715     function tagSuggestingLineIsArea(entity) {
45716       if (entity.type !== "way" || entity.isClosed()) return null;
45717       var tagSuggestingArea = entity.tagSuggestingArea();
45718       if (!tagSuggestingArea) {
45719         return null;
45720       }
45721       var asLine = _mainPresetIndex.matchTags(tagSuggestingArea, "line");
45722       var asArea = _mainPresetIndex.matchTags(tagSuggestingArea, "area");
45723       if (asLine && asArea && (0, import_fast_deep_equal5.default)(asLine.tags, asArea.tags)) {
45724         return null;
45725       }
45726       if (asLine.isFallback() && asArea.isFallback() && !(0, import_fast_deep_equal5.default)(tagSuggestingArea, { area: "yes" })) {
45727         return null;
45728       }
45729       return tagSuggestingArea;
45730     }
45731     function makeConnectEndpointsFixOnClick(way, graph) {
45732       if (way.nodes.length < 3) return null;
45733       var nodes = graph.childNodes(way), testNodes;
45734       var firstToLastDistanceMeters = geoSphericalDistance(nodes[0].loc, nodes[nodes.length - 1].loc);
45735       if (firstToLastDistanceMeters < 0.75) {
45736         testNodes = nodes.slice();
45737         testNodes.pop();
45738         testNodes.push(testNodes[0]);
45739         if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
45740           return function(context) {
45741             var way2 = context.entity(this.issue.entityIds[0]);
45742             context.perform(
45743               actionMergeNodes([way2.nodes[0], way2.nodes[way2.nodes.length - 1]], nodes[0].loc),
45744               _t("issues.fix.connect_endpoints.annotation")
45745             );
45746           };
45747         }
45748       }
45749       testNodes = nodes.slice();
45750       testNodes.push(testNodes[0]);
45751       if (!geoHasSelfIntersections(testNodes, testNodes[0].id)) {
45752         return function(context) {
45753           var wayId = this.issue.entityIds[0];
45754           var way2 = context.entity(wayId);
45755           var nodeId = way2.nodes[0];
45756           var index = way2.nodes.length;
45757           context.perform(
45758             actionAddVertex(wayId, nodeId, index),
45759             _t("issues.fix.connect_endpoints.annotation")
45760           );
45761         };
45762       }
45763     }
45764     function lineTaggedAsAreaIssue(entity) {
45765       var tagSuggestingArea = tagSuggestingLineIsArea(entity);
45766       if (!tagSuggestingArea) return null;
45767       var validAsLine = false;
45768       var presetAsLine = _mainPresetIndex.matchTags(entity.tags, "line");
45769       if (presetAsLine) {
45770         validAsLine = true;
45771         var key = Object.keys(tagSuggestingArea)[0];
45772         if (presetAsLine.tags[key] && presetAsLine.tags[key] === "*") {
45773           validAsLine = false;
45774         }
45775         if (Object.keys(presetAsLine.tags).length === 0) {
45776           validAsLine = false;
45777         }
45778       }
45779       return new validationIssue({
45780         type: type2,
45781         subtype: "area_as_line",
45782         severity: "warning",
45783         message: function(context) {
45784           var entity2 = context.hasEntity(this.entityIds[0]);
45785           return entity2 ? _t.append("issues.tag_suggests_area.message", {
45786             feature: utilDisplayLabel(
45787               entity2,
45788               "area",
45789               true
45790               /* verbose */
45791             ),
45792             tag: utilTagText({ tags: tagSuggestingArea })
45793           }) : "";
45794         },
45795         reference: showReference,
45796         entityIds: [entity.id],
45797         hash: JSON.stringify(tagSuggestingArea),
45798         dynamicFixes: function(context) {
45799           var fixes = [];
45800           var entity2 = context.entity(this.entityIds[0]);
45801           var connectEndsOnClick = makeConnectEndpointsFixOnClick(entity2, context.graph());
45802           if (!validAsLine) {
45803             fixes.push(new validationIssueFix({
45804               title: _t.append("issues.fix.connect_endpoints.title"),
45805               onClick: connectEndsOnClick
45806             }));
45807           }
45808           fixes.push(new validationIssueFix({
45809             icon: "iD-operation-delete",
45810             title: _t.append("issues.fix.remove_tag.title"),
45811             onClick: function(context2) {
45812               var entityId = this.issue.entityIds[0];
45813               var entity3 = context2.entity(entityId);
45814               var tags = Object.assign({}, entity3.tags);
45815               for (var key2 in tagSuggestingArea) {
45816                 delete tags[key2];
45817               }
45818               context2.perform(
45819                 actionChangeTags(entityId, tags),
45820                 _t("issues.fix.remove_tag.annotation")
45821               );
45822             }
45823           }));
45824           return fixes;
45825         }
45826       });
45827       function showReference(selection2) {
45828         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.tag_suggests_area.reference"));
45829       }
45830     }
45831     function vertexPointIssue(entity, graph) {
45832       if (entity.type !== "node") return null;
45833       if (Object.keys(entity.tags).length === 0) return null;
45834       if (entity.isOnAddressLine(graph)) return null;
45835       var geometry = entity.geometry(graph);
45836       var allowedGeometries = osmNodeGeometriesForTags(entity.tags);
45837       if (geometry === "point" && !allowedGeometries.point && allowedGeometries.vertex) {
45838         return new validationIssue({
45839           type: type2,
45840           subtype: "vertex_as_point",
45841           severity: "warning",
45842           message: function(context) {
45843             var entity2 = context.hasEntity(this.entityIds[0]);
45844             return entity2 ? _t.append("issues.vertex_as_point.message", {
45845               feature: utilDisplayLabel(
45846                 entity2,
45847                 "vertex",
45848                 true
45849                 /* verbose */
45850               )
45851             }) : "";
45852           },
45853           reference: function showReference(selection2) {
45854             selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.vertex_as_point.reference"));
45855           },
45856           entityIds: [entity.id]
45857         });
45858       } else if (geometry === "vertex" && !allowedGeometries.vertex && allowedGeometries.point) {
45859         return new validationIssue({
45860           type: type2,
45861           subtype: "point_as_vertex",
45862           severity: "warning",
45863           message: function(context) {
45864             var entity2 = context.hasEntity(this.entityIds[0]);
45865             return entity2 ? _t.append("issues.point_as_vertex.message", {
45866               feature: utilDisplayLabel(
45867                 entity2,
45868                 "point",
45869                 true
45870                 /* verbose */
45871               )
45872             }) : "";
45873           },
45874           reference: function showReference(selection2) {
45875             selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.point_as_vertex.reference"));
45876           },
45877           entityIds: [entity.id],
45878           dynamicFixes: extractPointDynamicFixes
45879         });
45880       }
45881       return null;
45882     }
45883     function otherMismatchIssue(entity, graph) {
45884       if (!entity.hasInterestingTags()) return null;
45885       if (entity.type !== "node" && entity.type !== "way") return null;
45886       if (entity.type === "node" && entity.isOnAddressLine(graph)) return null;
45887       var sourceGeom = entity.geometry(graph);
45888       var targetGeoms = entity.type === "way" ? ["point", "vertex"] : ["line", "area"];
45889       if (sourceGeom === "area") targetGeoms.unshift("line");
45890       var asSource = _mainPresetIndex.match(entity, graph);
45891       var targetGeom = targetGeoms.find((nodeGeom) => {
45892         const asTarget = _mainPresetIndex.matchTags(
45893           entity.tags,
45894           nodeGeom,
45895           entity.extent(graph).center()
45896         );
45897         if (!asSource || !asTarget || asSource === asTarget || // sometimes there are two presets with the same tags for different geometries
45898         (0, import_fast_deep_equal5.default)(asSource.tags, asTarget.tags)) return false;
45899         if (asTarget.isFallback()) return false;
45900         var primaryKey = Object.keys(asTarget.tags)[0];
45901         if (primaryKey === "building") return false;
45902         if (asTarget.tags[primaryKey] === "*") return false;
45903         return asSource.isFallback() || asSource.tags[primaryKey] === "*";
45904       });
45905       if (!targetGeom) return null;
45906       var subtype = targetGeom + "_as_" + sourceGeom;
45907       if (targetGeom === "vertex") targetGeom = "point";
45908       if (sourceGeom === "vertex") sourceGeom = "point";
45909       var referenceId = targetGeom + "_as_" + sourceGeom;
45910       var dynamicFixes;
45911       if (targetGeom === "point") {
45912         dynamicFixes = extractPointDynamicFixes;
45913       } else if (sourceGeom === "area" && targetGeom === "line") {
45914         dynamicFixes = lineToAreaDynamicFixes;
45915       }
45916       return new validationIssue({
45917         type: type2,
45918         subtype,
45919         severity: "warning",
45920         message: function(context) {
45921           var entity2 = context.hasEntity(this.entityIds[0]);
45922           return entity2 ? _t.append("issues." + referenceId + ".message", {
45923             feature: utilDisplayLabel(
45924               entity2,
45925               targetGeom,
45926               true
45927               /* verbose */
45928             )
45929           }) : "";
45930         },
45931         reference: function showReference(selection2) {
45932           selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.mismatched_geometry.reference"));
45933         },
45934         entityIds: [entity.id],
45935         dynamicFixes
45936       });
45937     }
45938     function lineToAreaDynamicFixes(context) {
45939       var convertOnClick;
45940       var entityId = this.entityIds[0];
45941       var entity = context.entity(entityId);
45942       var tags = Object.assign({}, entity.tags);
45943       delete tags.area;
45944       if (!osmTagSuggestingArea(tags)) {
45945         convertOnClick = function(context2) {
45946           var entityId2 = this.issue.entityIds[0];
45947           var entity2 = context2.entity(entityId2);
45948           var tags2 = Object.assign({}, entity2.tags);
45949           if (tags2.area) {
45950             delete tags2.area;
45951           }
45952           context2.perform(
45953             actionChangeTags(entityId2, tags2),
45954             _t("issues.fix.convert_to_line.annotation")
45955           );
45956         };
45957       }
45958       return [
45959         new validationIssueFix({
45960           icon: "iD-icon-line",
45961           title: _t.append("issues.fix.convert_to_line.title"),
45962           onClick: convertOnClick
45963         })
45964       ];
45965     }
45966     function extractPointDynamicFixes(context) {
45967       var entityId = this.entityIds[0];
45968       var extractOnClick = null;
45969       if (!context.hasHiddenConnections(entityId)) {
45970         extractOnClick = function(context2) {
45971           var entityId2 = this.issue.entityIds[0];
45972           var action = actionExtract(entityId2, context2.projection);
45973           context2.perform(
45974             action,
45975             _t("operations.extract.annotation", { n: 1 })
45976           );
45977           context2.enter(modeSelect(context2, [action.getExtractedNodeID()]));
45978         };
45979       }
45980       return [
45981         new validationIssueFix({
45982           icon: "iD-operation-extract",
45983           title: _t.append("issues.fix.extract_point.title"),
45984           onClick: extractOnClick
45985         })
45986       ];
45987     }
45988     function unclosedMultipolygonPartIssues(entity, graph) {
45989       if (entity.type !== "relation" || !entity.isMultipolygon() || entity.isDegenerate() || // cannot determine issues for incompletely-downloaded relations
45990       !entity.isComplete(graph)) return [];
45991       var sequences = osmJoinWays(entity.members, graph);
45992       var issues = [];
45993       for (var i3 in sequences) {
45994         var sequence = sequences[i3];
45995         if (!sequence.nodes) continue;
45996         var firstNode = sequence.nodes[0];
45997         var lastNode = sequence.nodes[sequence.nodes.length - 1];
45998         if (firstNode === lastNode) continue;
45999         var issue = new validationIssue({
46000           type: type2,
46001           subtype: "unclosed_multipolygon_part",
46002           severity: "warning",
46003           message: function(context) {
46004             var entity2 = context.hasEntity(this.entityIds[0]);
46005             return entity2 ? _t.append("issues.unclosed_multipolygon_part.message", {
46006               feature: utilDisplayLabel(
46007                 entity2,
46008                 context.graph(),
46009                 true
46010                 /* verbose */
46011               )
46012             }) : "";
46013           },
46014           reference: showReference,
46015           loc: sequence.nodes[0].loc,
46016           entityIds: [entity.id],
46017           hash: sequence.map(function(way) {
46018             return way.id;
46019           }).join()
46020         });
46021         issues.push(issue);
46022       }
46023       return issues;
46024       function showReference(selection2) {
46025         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unclosed_multipolygon_part.reference"));
46026       }
46027     }
46028     var validation = function checkMismatchedGeometry(entity, graph) {
46029       var vertexPoint = vertexPointIssue(entity, graph);
46030       if (vertexPoint) return [vertexPoint];
46031       var lineAsArea = lineTaggedAsAreaIssue(entity);
46032       if (lineAsArea) return [lineAsArea];
46033       var mismatch = otherMismatchIssue(entity, graph);
46034       if (mismatch) return [mismatch];
46035       return unclosedMultipolygonPartIssues(entity, graph);
46036     };
46037     validation.type = type2;
46038     return validation;
46039   }
46040
46041   // modules/validations/missing_role.js
46042   function validationMissingRole() {
46043     var type2 = "missing_role";
46044     var validation = function checkMissingRole(entity, graph) {
46045       var issues = [];
46046       if (entity.type === "way") {
46047         graph.parentRelations(entity).forEach(function(relation) {
46048           if (!relation.isMultipolygon()) return;
46049           var member = relation.memberById(entity.id);
46050           if (member && isMissingRole(member)) {
46051             issues.push(makeIssue(entity, relation, member));
46052           }
46053         });
46054       } else if (entity.type === "relation" && entity.isMultipolygon()) {
46055         entity.indexedMembers().forEach(function(member) {
46056           var way = graph.hasEntity(member.id);
46057           if (way && isMissingRole(member)) {
46058             issues.push(makeIssue(way, entity, member));
46059           }
46060         });
46061       }
46062       return issues;
46063     };
46064     function isMissingRole(member) {
46065       return !member.role || !member.role.trim().length;
46066     }
46067     function makeIssue(way, relation, member) {
46068       return new validationIssue({
46069         type: type2,
46070         severity: "warning",
46071         message: function(context) {
46072           const member2 = context.hasEntity(this.entityIds[0]), relation2 = context.hasEntity(this.entityIds[1]);
46073           return member2 && relation2 ? _t.append("issues.missing_role.message", {
46074             member: utilDisplayLabel(member2, context.graph()),
46075             relation: utilDisplayLabel(relation2, context.graph())
46076           }) : "";
46077         },
46078         reference: showReference,
46079         entityIds: [way.id, relation.id],
46080         extent: function(graph) {
46081           return graph.entity(this.entityIds[0]).extent(graph);
46082         },
46083         data: {
46084           member
46085         },
46086         hash: member.index.toString(),
46087         dynamicFixes: function() {
46088           return [
46089             makeAddRoleFix("inner"),
46090             makeAddRoleFix("outer"),
46091             new validationIssueFix({
46092               icon: "iD-operation-delete",
46093               title: _t.append("issues.fix.remove_from_relation.title"),
46094               onClick: function(context) {
46095                 context.perform(
46096                   actionDeleteMember(this.issue.entityIds[1], this.issue.data.member.index),
46097                   _t("operations.delete_member.annotation", {
46098                     n: 1
46099                   })
46100                 );
46101               }
46102             })
46103           ];
46104         }
46105       });
46106       function showReference(selection2) {
46107         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.missing_role.multipolygon.reference"));
46108       }
46109     }
46110     function makeAddRoleFix(role) {
46111       return new validationIssueFix({
46112         title: _t.append("issues.fix.set_as_" + role + ".title"),
46113         onClick: function(context) {
46114           var oldMember = this.issue.data.member;
46115           var member = { id: this.issue.entityIds[0], type: oldMember.type, role };
46116           context.perform(
46117             actionChangeMember(this.issue.entityIds[1], member, oldMember.index),
46118             _t("operations.change_role.annotation", {
46119               n: 1
46120             })
46121           );
46122         }
46123       });
46124     }
46125     validation.type = type2;
46126     return validation;
46127   }
46128
46129   // modules/validations/missing_tag.js
46130   function validationMissingTag(context) {
46131     var type2 = "missing_tag";
46132     function hasDescriptiveTags(entity) {
46133       var onlyAttributeKeys = ["description", "name", "note", "start_date", "oneway"];
46134       var entityDescriptiveKeys = Object.keys(entity.tags).filter(function(k3) {
46135         if (k3 === "area" || !osmIsInterestingTag(k3)) return false;
46136         return !onlyAttributeKeys.some(function(attributeKey) {
46137           return k3 === attributeKey || k3.indexOf(attributeKey + ":") === 0;
46138         });
46139       });
46140       if (entity.type === "relation" && entityDescriptiveKeys.length === 1 && entity.tags.type === "multipolygon") {
46141         return false;
46142       }
46143       return entityDescriptiveKeys.length > 0;
46144     }
46145     function isUnknownRoad(entity) {
46146       return entity.type === "way" && entity.tags.highway === "road";
46147     }
46148     function isUntypedRelation(entity) {
46149       return entity.type === "relation" && !entity.tags.type;
46150     }
46151     var validation = function checkMissingTag(entity, graph) {
46152       var subtype;
46153       var osm = context.connection();
46154       var isUnloadedNode = entity.type === "node" && osm && !osm.isDataLoaded(entity.loc);
46155       if (!isUnloadedNode && // allow untagged nodes that are part of ways
46156       entity.geometry(graph) !== "vertex" && // allow untagged entities that are part of relations
46157       !entity.hasParentRelations(graph)) {
46158         if (Object.keys(entity.tags).length === 0) {
46159           subtype = "any";
46160         } else if (!hasDescriptiveTags(entity)) {
46161           subtype = "descriptive";
46162         } else if (isUntypedRelation(entity)) {
46163           subtype = "relation_type";
46164         }
46165       }
46166       if (!subtype && isUnknownRoad(entity)) {
46167         subtype = "highway_classification";
46168       }
46169       if (!subtype) return [];
46170       var messageID = subtype === "highway_classification" ? "unknown_road" : "missing_tag." + subtype;
46171       var referenceID = subtype === "highway_classification" ? "unknown_road" : "missing_tag";
46172       var canDelete = entity.version === void 0 || entity.v !== void 0;
46173       var severity = canDelete && subtype !== "highway_classification" ? "error" : "warning";
46174       return [new validationIssue({
46175         type: type2,
46176         subtype,
46177         severity,
46178         message: function(context2) {
46179           var entity2 = context2.hasEntity(this.entityIds[0]);
46180           return entity2 ? _t.append("issues." + messageID + ".message", {
46181             feature: utilDisplayLabel(entity2, context2.graph())
46182           }) : "";
46183         },
46184         reference: showReference,
46185         entityIds: [entity.id],
46186         dynamicFixes: function(context2) {
46187           var fixes = [];
46188           var selectFixType = subtype === "highway_classification" ? "select_road_type" : "select_preset";
46189           fixes.push(new validationIssueFix({
46190             icon: "iD-icon-search",
46191             title: _t.append("issues.fix." + selectFixType + ".title"),
46192             onClick: function(context3) {
46193               context3.ui().sidebar.showPresetList();
46194             }
46195           }));
46196           var deleteOnClick;
46197           var id2 = this.entityIds[0];
46198           var operation2 = operationDelete(context2, [id2]);
46199           var disabledReasonID = operation2.disabled();
46200           if (!disabledReasonID) {
46201             deleteOnClick = function(context3) {
46202               var id3 = this.issue.entityIds[0];
46203               var operation3 = operationDelete(context3, [id3]);
46204               if (!operation3.disabled()) {
46205                 operation3();
46206               }
46207             };
46208           }
46209           fixes.push(
46210             new validationIssueFix({
46211               icon: "iD-operation-delete",
46212               title: _t.append("issues.fix.delete_feature.title"),
46213               disabledReason: disabledReasonID ? _t("operations.delete." + disabledReasonID + ".single") : void 0,
46214               onClick: deleteOnClick
46215             })
46216           );
46217           return fixes;
46218         }
46219       })];
46220       function showReference(selection2) {
46221         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues." + referenceID + ".reference"));
46222       }
46223     };
46224     validation.type = type2;
46225     return validation;
46226   }
46227
46228   // modules/validations/mutually_exclusive_tags.js
46229   function validationMutuallyExclusiveTags() {
46230     const type2 = "mutually_exclusive_tags";
46231     const tagKeyPairs = osmMutuallyExclusiveTagPairs;
46232     const validation = function checkMutuallyExclusiveTags(entity) {
46233       let pairsFounds = tagKeyPairs.filter((pair3) => {
46234         return pair3[0] in entity.tags && pair3[1] in entity.tags;
46235       }).filter((pair3) => {
46236         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");
46237       });
46238       Object.keys(entity.tags).forEach((key) => {
46239         let negative_key = "not:" + key;
46240         if (negative_key in entity.tags && entity.tags[negative_key].split(";").includes(entity.tags[key])) {
46241           pairsFounds.push([negative_key, key, "same_value"]);
46242         }
46243         if (key.match(/^name:[a-z]+/)) {
46244           negative_key = "not:name";
46245           if (negative_key in entity.tags && entity.tags[negative_key].split(";").includes(entity.tags[key])) {
46246             pairsFounds.push([negative_key, key, "same_value"]);
46247           }
46248         }
46249       });
46250       let issues = pairsFounds.map((pair3) => {
46251         const subtype = pair3[2] || "default";
46252         return new validationIssue({
46253           type: type2,
46254           subtype,
46255           severity: "warning",
46256           message: function(context) {
46257             let entity2 = context.hasEntity(this.entityIds[0]);
46258             return entity2 ? _t.append("issues.".concat(type2, ".").concat(subtype, ".message"), {
46259               feature: utilDisplayLabel(entity2, context.graph()),
46260               tag1: pair3[0],
46261               tag2: pair3[1]
46262             }) : "";
46263           },
46264           reference: (selection2) => showReference(selection2, pair3, subtype),
46265           entityIds: [entity.id],
46266           dynamicFixes: () => pair3.slice(0, 2).map((tagToRemove) => createIssueFix(tagToRemove))
46267         });
46268       });
46269       function createIssueFix(tagToRemove) {
46270         return new validationIssueFix({
46271           icon: "iD-operation-delete",
46272           title: _t.append("issues.fix.remove_named_tag.title", { tag: tagToRemove }),
46273           onClick: function(context) {
46274             const entityId = this.issue.entityIds[0];
46275             const entity2 = context.entity(entityId);
46276             let tags = Object.assign({}, entity2.tags);
46277             delete tags[tagToRemove];
46278             context.perform(
46279               actionChangeTags(entityId, tags),
46280               _t("issues.fix.remove_named_tag.annotation", { tag: tagToRemove })
46281             );
46282           }
46283         });
46284       }
46285       function showReference(selection2, pair3, subtype) {
46286         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.".concat(type2, ".").concat(subtype, ".reference"), { tag1: pair3[0], tag2: pair3[1] }));
46287       }
46288       return issues;
46289     };
46290     validation.type = type2;
46291     return validation;
46292   }
46293
46294   // modules/operations/split.js
46295   function operationSplit(context, selectedIDs) {
46296     var _vertexIds = selectedIDs.filter(function(id2) {
46297       return context.graph().geometry(id2) === "vertex";
46298     });
46299     var _selectedWayIds = selectedIDs.filter(function(id2) {
46300       var entity = context.graph().hasEntity(id2);
46301       return entity && entity.type === "way";
46302     });
46303     var _isAvailable = _vertexIds.length > 0 && _vertexIds.length + _selectedWayIds.length === selectedIDs.length;
46304     var _action = actionSplit(_vertexIds);
46305     var _ways = [];
46306     var _geometry = "feature";
46307     var _waysAmount = "single";
46308     var _nodesAmount = _vertexIds.length === 1 ? "single" : "multiple";
46309     if (_isAvailable) {
46310       if (_selectedWayIds.length) _action.limitWays(_selectedWayIds);
46311       _ways = _action.ways(context.graph());
46312       var geometries = {};
46313       _ways.forEach(function(way) {
46314         geometries[way.geometry(context.graph())] = true;
46315       });
46316       if (Object.keys(geometries).length === 1) {
46317         _geometry = Object.keys(geometries)[0];
46318       }
46319       _waysAmount = _ways.length === 1 ? "single" : "multiple";
46320     }
46321     var operation2 = function() {
46322       var difference2 = context.perform(_action, operation2.annotation());
46323       var idsToSelect = _vertexIds.concat(difference2.extantIDs().filter(function(id2) {
46324         return context.entity(id2).type === "way";
46325       }));
46326       context.enter(modeSelect(context, idsToSelect));
46327     };
46328     operation2.relatedEntityIds = function() {
46329       return _selectedWayIds.length ? [] : _ways.map((way) => way.id);
46330     };
46331     operation2.available = function() {
46332       return _isAvailable;
46333     };
46334     operation2.disabled = function() {
46335       var reason = _action.disabled(context.graph());
46336       if (reason) {
46337         return reason;
46338       } else if (selectedIDs.some(context.hasHiddenConnections)) {
46339         return "connected_to_hidden";
46340       }
46341       return false;
46342     };
46343     operation2.tooltip = function() {
46344       var disable = operation2.disabled();
46345       return disable ? _t.append("operations.split." + disable) : _t.append("operations.split.description." + _geometry + "." + _waysAmount + "." + _nodesAmount + "_node");
46346     };
46347     operation2.annotation = function() {
46348       return _t("operations.split.annotation." + _geometry, { n: _ways.length });
46349     };
46350     operation2.icon = function() {
46351       if (_waysAmount === "multiple") {
46352         return "#iD-operation-split-multiple";
46353       } else {
46354         return "#iD-operation-split";
46355       }
46356     };
46357     operation2.id = "split";
46358     operation2.keys = [_t("operations.split.key")];
46359     operation2.title = _t.append("operations.split.title");
46360     operation2.behavior = behaviorOperation(context).which(operation2);
46361     return operation2;
46362   }
46363
46364   // modules/validations/osm_api_limits.js
46365   function validationOsmApiLimits(context) {
46366     const type2 = "osm_api_limits";
46367     const validation = function checkOsmApiLimits(entity) {
46368       const issues = [];
46369       const osm = context.connection();
46370       if (!osm) return issues;
46371       const maxWayNodes = osm.maxWayNodes();
46372       if (entity.type === "way") {
46373         if (entity.nodes.length > maxWayNodes) {
46374           issues.push(new validationIssue({
46375             type: type2,
46376             subtype: "exceededMaxWayNodes",
46377             severity: "error",
46378             message: function() {
46379               return _t.append("issues.osm_api_limits.max_way_nodes.message");
46380             },
46381             reference: function(selection2) {
46382               selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.osm_api_limits.max_way_nodes.reference", { maxWayNodes }));
46383             },
46384             entityIds: [entity.id],
46385             dynamicFixes: splitWayIntoSmallChunks
46386           }));
46387         }
46388       }
46389       return issues;
46390     };
46391     function splitWayIntoSmallChunks() {
46392       const fix = new validationIssueFix({
46393         icon: "iD-operation-split",
46394         title: _t.append("issues.fix.split_way.title"),
46395         entityIds: this.entityIds,
46396         onClick: function(context2) {
46397           const maxWayNodes = context2.connection().maxWayNodes();
46398           const g3 = context2.graph();
46399           const entityId = this.entityIds[0];
46400           const entity = context2.graph().entities[entityId];
46401           const numberOfParts = Math.ceil(entity.nodes.length / maxWayNodes);
46402           let splitVertices;
46403           if (numberOfParts === 2) {
46404             const splitIntersections = entity.nodes.map((nid) => g3.entity(nid)).filter((n3) => g3.parentWays(n3).length > 1).map((n3) => n3.id).filter((nid) => {
46405               const splitIndex = entity.nodes.indexOf(nid);
46406               return splitIndex < maxWayNodes && entity.nodes.length - splitIndex < maxWayNodes;
46407             });
46408             if (splitIntersections.length > 0) {
46409               splitVertices = [
46410                 splitIntersections[Math.floor(splitIntersections.length / 2)]
46411               ];
46412             }
46413           }
46414           if (splitVertices === void 0) {
46415             splitVertices = [...Array(numberOfParts - 1)].map((_3, i3) => entity.nodes[Math.floor(entity.nodes.length * (i3 + 1) / numberOfParts)]);
46416           }
46417           if (entity.isClosed()) {
46418             splitVertices.push(entity.nodes[0]);
46419           }
46420           const operation2 = operationSplit(context2, splitVertices.concat(entityId));
46421           if (!operation2.disabled()) {
46422             operation2();
46423           }
46424         }
46425       });
46426       return [fix];
46427     }
46428     validation.type = type2;
46429     return validation;
46430   }
46431
46432   // modules/osm/deprecated.js
46433   function getDeprecatedTags(tags, dataDeprecated) {
46434     if (Object.keys(tags).length === 0) return [];
46435     var deprecated = [];
46436     dataDeprecated.forEach((d2) => {
46437       var oldKeys = Object.keys(d2.old);
46438       if (d2.replace) {
46439         var hasExistingValues = Object.keys(d2.replace).some((replaceKey) => {
46440           if (!tags[replaceKey] || d2.old[replaceKey]) return false;
46441           var replaceValue = d2.replace[replaceKey];
46442           if (replaceValue === "*") return false;
46443           if (replaceValue === tags[replaceKey]) return false;
46444           return true;
46445         });
46446         if (hasExistingValues) return;
46447       }
46448       var matchesDeprecatedTags = oldKeys.every((oldKey) => {
46449         if (!tags[oldKey]) return false;
46450         if (d2.old[oldKey] === "*") return true;
46451         if (d2.old[oldKey] === tags[oldKey]) return true;
46452         var vals = tags[oldKey].split(";").filter(Boolean);
46453         if (vals.length === 0) {
46454           return false;
46455         } else if (vals.length > 1) {
46456           return vals.indexOf(d2.old[oldKey]) !== -1;
46457         } else {
46458           if (tags[oldKey] === d2.old[oldKey]) {
46459             if (d2.replace && d2.old[oldKey] === d2.replace[oldKey]) {
46460               var replaceKeys = Object.keys(d2.replace);
46461               return !replaceKeys.every((replaceKey) => {
46462                 return tags[replaceKey] === d2.replace[replaceKey];
46463               });
46464             } else {
46465               return true;
46466             }
46467           }
46468         }
46469         return false;
46470       });
46471       if (matchesDeprecatedTags) {
46472         deprecated.push(d2);
46473       }
46474     });
46475     return deprecated;
46476   }
46477   var _deprecatedTagValuesByKey;
46478   function deprecatedTagValuesByKey(dataDeprecated) {
46479     if (!_deprecatedTagValuesByKey) {
46480       _deprecatedTagValuesByKey = {};
46481       dataDeprecated.forEach((d2) => {
46482         var oldKeys = Object.keys(d2.old);
46483         if (oldKeys.length === 1) {
46484           var oldKey = oldKeys[0];
46485           var oldValue = d2.old[oldKey];
46486           if (oldValue !== "*") {
46487             if (!_deprecatedTagValuesByKey[oldKey]) {
46488               _deprecatedTagValuesByKey[oldKey] = [oldValue];
46489             } else {
46490               _deprecatedTagValuesByKey[oldKey].push(oldValue);
46491             }
46492           }
46493         }
46494       });
46495     }
46496     return _deprecatedTagValuesByKey;
46497   }
46498
46499   // modules/validations/outdated_tags.js
46500   function validationOutdatedTags() {
46501     const type2 = "outdated_tags";
46502     let _waitingForDeprecated = true;
46503     let _dataDeprecated;
46504     _mainFileFetcher.get("deprecated").then((d2) => _dataDeprecated = d2).catch(() => {
46505     }).finally(() => _waitingForDeprecated = false);
46506     function oldTagIssues(entity, graph) {
46507       if (!entity.hasInterestingTags()) return [];
46508       let preset = _mainPresetIndex.match(entity, graph);
46509       if (!preset) return [];
46510       const oldTags = Object.assign({}, entity.tags);
46511       if (preset.replacement) {
46512         const newPreset = _mainPresetIndex.item(preset.replacement);
46513         graph = actionChangePreset(
46514           entity.id,
46515           preset,
46516           newPreset,
46517           true
46518           /* skip field defaults */
46519         )(graph);
46520         entity = graph.entity(entity.id);
46521         preset = newPreset;
46522       }
46523       const nsi = services.nsi;
46524       let waitingForNsi = false;
46525       let nsiResult;
46526       if (nsi) {
46527         waitingForNsi = nsi.status() === "loading";
46528         if (!waitingForNsi) {
46529           const loc = entity.extent(graph).center();
46530           nsiResult = nsi.upgradeTags(oldTags, loc);
46531         }
46532       }
46533       const nsiDiff = nsiResult ? utilTagDiff(oldTags, nsiResult.newTags) : [];
46534       let deprecatedTags;
46535       if (_dataDeprecated) {
46536         deprecatedTags = getDeprecatedTags(entity.tags, _dataDeprecated);
46537         if (entity.type === "way" && entity.isClosed() && entity.tags.traffic_calming === "island" && !entity.tags.highway) {
46538           deprecatedTags.push({
46539             old: { traffic_calming: "island" },
46540             replace: { "area:highway": "traffic_island" }
46541           });
46542         }
46543         if (deprecatedTags.length) {
46544           deprecatedTags.forEach((tag) => {
46545             graph = actionUpgradeTags(entity.id, tag.old, tag.replace)(graph);
46546           });
46547           entity = graph.entity(entity.id);
46548         }
46549       }
46550       let newTags = Object.assign({}, entity.tags);
46551       if (preset.tags !== preset.addTags) {
46552         Object.keys(preset.addTags).filter((k3) => {
46553           return !(nsiResult == null ? void 0 : nsiResult.newTags[k3]);
46554         }).forEach((k3) => {
46555           if (!newTags[k3]) {
46556             if (preset.addTags[k3] === "*") {
46557               newTags[k3] = "yes";
46558             } else if (preset.addTags[k3]) {
46559               newTags[k3] = preset.addTags[k3];
46560             }
46561           }
46562         });
46563       }
46564       const deprecationDiff = utilTagDiff(oldTags, newTags);
46565       const deprecationDiffContext = Object.keys(oldTags).filter((key) => deprecatedTags == null ? void 0 : deprecatedTags.some((deprecated) => {
46566         var _a5;
46567         return ((_a5 = deprecated.replace) == null ? void 0 : _a5[key]) !== void 0;
46568       })).filter((key) => newTags[key] === oldTags[key]).map((key) => ({
46569         type: "~",
46570         key,
46571         oldVal: oldTags[key],
46572         newVal: newTags[key],
46573         display: "&nbsp; " + key + "=" + oldTags[key]
46574       }));
46575       let issues = [];
46576       issues.provisional = _waitingForDeprecated || waitingForNsi;
46577       if (deprecationDiff.length) {
46578         const isOnlyAddingTags = !deprecationDiff.some((d2) => d2.type === "-");
46579         const prefix = isOnlyAddingTags ? "incomplete." : "";
46580         issues.push(new validationIssue({
46581           type: type2,
46582           subtype: isOnlyAddingTags ? "incomplete_tags" : "deprecated_tags",
46583           severity: "warning",
46584           message: (context) => {
46585             const currEntity = context.hasEntity(entity.id);
46586             if (!currEntity) return "";
46587             const feature4 = utilDisplayLabel(
46588               currEntity,
46589               context.graph(),
46590               /* verbose */
46591               true
46592             );
46593             return _t.append("issues.outdated_tags.".concat(prefix, "message"), { feature: feature4 });
46594           },
46595           reference: (selection2) => showReference(
46596             selection2,
46597             _t.append("issues.outdated_tags.".concat(prefix, "reference")),
46598             [...deprecationDiff, ...deprecationDiffContext]
46599           ),
46600           entityIds: [entity.id],
46601           hash: utilHashcode(JSON.stringify(deprecationDiff)),
46602           dynamicFixes: () => {
46603             let fixes = [
46604               new validationIssueFix({
46605                 title: _t.append("issues.fix.upgrade_tags.title"),
46606                 onClick: (context) => {
46607                   context.perform((graph2) => doUpgrade(graph2, deprecationDiff), _t("issues.fix.upgrade_tags.annotation"));
46608                 }
46609               })
46610             ];
46611             return fixes;
46612           }
46613         }));
46614       }
46615       if (nsiDiff.length) {
46616         const isOnlyAddingTags = nsiDiff.every((d2) => d2.type === "+");
46617         issues.push(new validationIssue({
46618           type: type2,
46619           subtype: "noncanonical_brand",
46620           severity: "warning",
46621           message: (context) => {
46622             const currEntity = context.hasEntity(entity.id);
46623             if (!currEntity) return "";
46624             const feature4 = utilDisplayLabel(
46625               currEntity,
46626               context.graph(),
46627               /* verbose */
46628               true
46629             );
46630             return isOnlyAddingTags ? _t.append("issues.outdated_tags.noncanonical_brand.message_incomplete", { feature: feature4 }) : _t.append("issues.outdated_tags.noncanonical_brand.message", { feature: feature4 });
46631           },
46632           reference: (selection2) => showReference(
46633             selection2,
46634             _t.append("issues.outdated_tags.noncanonical_brand.reference"),
46635             nsiDiff
46636           ),
46637           entityIds: [entity.id],
46638           hash: utilHashcode(JSON.stringify(nsiDiff)),
46639           dynamicFixes: () => {
46640             let fixes = [
46641               new validationIssueFix({
46642                 title: _t.append("issues.fix.upgrade_tags.title"),
46643                 onClick: (context) => {
46644                   context.perform((graph2) => doUpgrade(graph2, nsiDiff), _t("issues.fix.upgrade_tags.annotation"));
46645                 }
46646               }),
46647               new validationIssueFix({
46648                 title: _t.append("issues.fix.tag_as_not.title", { name: nsiResult.matched.displayName }),
46649                 onClick: (context) => {
46650                   context.perform(addNotTag, _t("issues.fix.tag_as_not.annotation"));
46651                 }
46652               })
46653             ];
46654             return fixes;
46655           }
46656         }));
46657       }
46658       return issues;
46659       function doUpgrade(graph2, diff) {
46660         const currEntity = graph2.hasEntity(entity.id);
46661         if (!currEntity) return graph2;
46662         let newTags2 = Object.assign({}, currEntity.tags);
46663         diff.forEach((diff2) => {
46664           if (diff2.type === "-") {
46665             delete newTags2[diff2.key];
46666           } else if (diff2.type === "+") {
46667             newTags2[diff2.key] = diff2.newVal;
46668           }
46669         });
46670         return actionChangeTags(currEntity.id, newTags2)(graph2);
46671       }
46672       function addNotTag(graph2) {
46673         const currEntity = graph2.hasEntity(entity.id);
46674         if (!currEntity) return graph2;
46675         const item = nsiResult && nsiResult.matched;
46676         if (!item) return graph2;
46677         let newTags2 = Object.assign({}, currEntity.tags);
46678         const wd = item.mainTag;
46679         const notwd = "not:".concat(wd);
46680         const qid = item.tags[wd];
46681         newTags2[notwd] = qid;
46682         if (newTags2[wd] === qid) {
46683           const wp = item.mainTag.replace("wikidata", "wikipedia");
46684           delete newTags2[wd];
46685           delete newTags2[wp];
46686         }
46687         return actionChangeTags(currEntity.id, newTags2)(graph2);
46688       }
46689       function showReference(selection2, reference, tagDiff) {
46690         let enter = selection2.selectAll(".issue-reference").data([0]).enter();
46691         enter.append("div").attr("class", "issue-reference").call(reference);
46692         enter.append("strong").call(_t.append("issues.suggested"));
46693         enter.append("table").attr("class", "tagDiff-table").selectAll(".tagDiff-row").data(tagDiff).enter().append("tr").attr("class", "tagDiff-row").append("td").attr("class", (d2) => {
46694           const klass = "tagDiff-cell";
46695           switch (d2.type) {
46696             case "+":
46697               return "".concat(klass, " tagDiff-cell-add");
46698             case "-":
46699               return "".concat(klass, " tagDiff-cell-remove");
46700             default:
46701               return "".concat(klass, " tagDiff-cell-unchanged");
46702           }
46703         }).html((d2) => d2.display);
46704       }
46705     }
46706     let validation = oldTagIssues;
46707     validation.type = type2;
46708     return validation;
46709   }
46710
46711   // modules/validations/private_data.js
46712   function validationPrivateData() {
46713     var type2 = "private_data";
46714     var privateBuildingValues = {
46715       detached: true,
46716       farm: true,
46717       house: true,
46718       houseboat: true,
46719       residential: true,
46720       semidetached_house: true,
46721       static_caravan: true
46722     };
46723     var publicKeys = {
46724       amenity: true,
46725       craft: true,
46726       historic: true,
46727       leisure: true,
46728       office: true,
46729       shop: true,
46730       tourism: true
46731     };
46732     var personalTags = {
46733       "contact:email": true,
46734       "contact:fax": true,
46735       "contact:phone": true,
46736       email: true,
46737       fax: true,
46738       phone: true
46739     };
46740     var validation = function checkPrivateData(entity) {
46741       var tags = entity.tags;
46742       if (!tags.building || !privateBuildingValues[tags.building]) return [];
46743       var keepTags = {};
46744       for (var k3 in tags) {
46745         if (publicKeys[k3]) return [];
46746         if (!personalTags[k3]) {
46747           keepTags[k3] = tags[k3];
46748         }
46749       }
46750       var tagDiff = utilTagDiff(tags, keepTags);
46751       if (!tagDiff.length) return [];
46752       var fixID = tagDiff.length === 1 ? "remove_tag" : "remove_tags";
46753       return [new validationIssue({
46754         type: type2,
46755         severity: "warning",
46756         message: showMessage,
46757         reference: showReference,
46758         entityIds: [entity.id],
46759         dynamicFixes: function() {
46760           return [
46761             new validationIssueFix({
46762               icon: "iD-operation-delete",
46763               title: _t.append("issues.fix." + fixID + ".title"),
46764               onClick: function(context) {
46765                 context.perform(doUpgrade, _t("issues.fix.remove_tag.annotation"));
46766               }
46767             })
46768           ];
46769         }
46770       })];
46771       function doUpgrade(graph) {
46772         var currEntity = graph.hasEntity(entity.id);
46773         if (!currEntity) return graph;
46774         var newTags = Object.assign({}, currEntity.tags);
46775         tagDiff.forEach(function(diff) {
46776           if (diff.type === "-") {
46777             delete newTags[diff.key];
46778           } else if (diff.type === "+") {
46779             newTags[diff.key] = diff.newVal;
46780           }
46781         });
46782         return actionChangeTags(currEntity.id, newTags)(graph);
46783       }
46784       function showMessage(context) {
46785         var currEntity = context.hasEntity(this.entityIds[0]);
46786         if (!currEntity) return "";
46787         return _t.append(
46788           "issues.private_data.contact.message",
46789           { feature: utilDisplayLabel(currEntity, context.graph()) }
46790         );
46791       }
46792       function showReference(selection2) {
46793         var enter = selection2.selectAll(".issue-reference").data([0]).enter();
46794         enter.append("div").attr("class", "issue-reference").call(_t.append("issues.private_data.reference"));
46795         enter.append("strong").call(_t.append("issues.suggested"));
46796         enter.append("table").attr("class", "tagDiff-table").selectAll(".tagDiff-row").data(tagDiff).enter().append("tr").attr("class", "tagDiff-row").append("td").attr("class", function(d2) {
46797           var klass = d2.type === "+" ? "add" : "remove";
46798           return "tagDiff-cell tagDiff-cell-" + klass;
46799         }).html(function(d2) {
46800           return d2.display;
46801         });
46802       }
46803     };
46804     validation.type = type2;
46805     return validation;
46806   }
46807
46808   // modules/validations/suspicious_name.js
46809   function validationSuspiciousName(context) {
46810     const type2 = "suspicious_name";
46811     const keysToTestForGenericValues = [
46812       "aerialway",
46813       "aeroway",
46814       "amenity",
46815       "building",
46816       "craft",
46817       "highway",
46818       "leisure",
46819       "railway",
46820       "man_made",
46821       "office",
46822       "shop",
46823       "tourism",
46824       "waterway"
46825     ];
46826     const ignoredPresets = /* @__PURE__ */ new Set([
46827       "amenity/place_of_worship/christian/jehovahs_witness",
46828       "__test__ignored_preset"
46829       // for unit tests
46830     ]);
46831     let _waitingForNsi = false;
46832     function isGenericMatchInNsi(tags) {
46833       const nsi = services.nsi;
46834       if (nsi) {
46835         _waitingForNsi = nsi.status() === "loading";
46836         if (!_waitingForNsi) {
46837           return nsi.isGenericName(tags);
46838         }
46839       }
46840       return false;
46841     }
46842     function nameMatchesRawTag(lowercaseName, tags) {
46843       for (let i3 = 0; i3 < keysToTestForGenericValues.length; i3++) {
46844         let key = keysToTestForGenericValues[i3];
46845         let val = tags[key];
46846         if (val) {
46847           val = val.toLowerCase();
46848           if (key === lowercaseName || val === lowercaseName || key.replace(/\_/g, " ") === lowercaseName || val.replace(/\_/g, " ") === lowercaseName) {
46849             return true;
46850           }
46851         }
46852       }
46853       return false;
46854     }
46855     function nameMatchesPresetName(name, preset) {
46856       if (!preset) return false;
46857       if (ignoredPresets.has(preset.id)) return false;
46858       name = name.toLowerCase();
46859       return name === preset.name().toLowerCase() || preset.aliases().some((alias) => name === alias.toLowerCase());
46860     }
46861     function isGenericName(name, tags, preset) {
46862       name = name.toLowerCase();
46863       return nameMatchesRawTag(name, tags) || nameMatchesPresetName(name, preset) || isGenericMatchInNsi(tags);
46864     }
46865     function makeGenericNameIssue(entityId, nameKey, genericName, langCode) {
46866       return new validationIssue({
46867         type: type2,
46868         subtype: "generic_name",
46869         severity: "warning",
46870         message: function(context2) {
46871           let entity = context2.hasEntity(this.entityIds[0]);
46872           if (!entity) return "";
46873           let preset = _mainPresetIndex.match(entity, context2.graph());
46874           let langName = langCode && _mainLocalizer.languageName(langCode);
46875           return _t.append(
46876             "issues.generic_name.message" + (langName ? "_language" : ""),
46877             { feature: preset.name(), name: genericName, language: langName }
46878           );
46879         },
46880         reference: showReference,
46881         entityIds: [entityId],
46882         hash: "".concat(nameKey, "=").concat(genericName),
46883         dynamicFixes: function() {
46884           return [
46885             new validationIssueFix({
46886               icon: "iD-operation-delete",
46887               title: _t.append("issues.fix.remove_the_name.title"),
46888               onClick: function(context2) {
46889                 let entityId2 = this.issue.entityIds[0];
46890                 let entity = context2.entity(entityId2);
46891                 let tags = Object.assign({}, entity.tags);
46892                 delete tags[nameKey];
46893                 context2.perform(
46894                   actionChangeTags(entityId2, tags),
46895                   _t("issues.fix.remove_generic_name.annotation")
46896                 );
46897               }
46898             })
46899           ];
46900         }
46901       });
46902       function showReference(selection2) {
46903         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.generic_name.reference"));
46904       }
46905     }
46906     let validation = function checkGenericName(entity) {
46907       const tags = entity.tags;
46908       const hasWikidata = !!tags.wikidata || !!tags["brand:wikidata"] || !!tags["operator:wikidata"];
46909       if (hasWikidata) return [];
46910       let issues = [];
46911       const preset = _mainPresetIndex.match(entity, context.graph());
46912       for (let key in tags) {
46913         const m3 = key.match(/^name(?:(?::)([a-zA-Z_-]+))?$/);
46914         if (!m3) continue;
46915         const langCode = m3.length >= 2 ? m3[1] : null;
46916         const value = tags[key];
46917         if (isGenericName(value, tags, preset)) {
46918           issues.provisional = _waitingForNsi;
46919           issues.push(makeGenericNameIssue(entity.id, key, value, langCode));
46920         }
46921       }
46922       return issues;
46923     };
46924     validation.type = type2;
46925     return validation;
46926   }
46927
46928   // modules/validations/unsquare_way.js
46929   function validationUnsquareWay(context) {
46930     var type2 = "unsquare_way";
46931     var DEFAULT_DEG_THRESHOLD = 5;
46932     var epsilon3 = 0.05;
46933     var nodeThreshold = 10;
46934     function isBuilding(entity, graph) {
46935       if (entity.type !== "way" || entity.geometry(graph) !== "area") return false;
46936       return entity.tags.building && entity.tags.building !== "no";
46937     }
46938     var validation = function checkUnsquareWay(entity, graph) {
46939       if (!isBuilding(entity, graph)) return [];
46940       if (entity.tags.nonsquare === "yes") return [];
46941       var isClosed = entity.isClosed();
46942       if (!isClosed) return [];
46943       var nodes = graph.childNodes(entity).slice();
46944       if (nodes.length > nodeThreshold + 1) return [];
46945       var osm = services.osm;
46946       if (!osm || nodes.some(function(node) {
46947         return !osm.isDataLoaded(node.loc);
46948       })) return [];
46949       var hasConnectedSquarableWays = nodes.some(function(node) {
46950         return graph.parentWays(node).some(function(way) {
46951           if (way.id === entity.id) return false;
46952           if (isBuilding(way, graph)) return true;
46953           return graph.parentRelations(way).some(function(parentRelation) {
46954             return parentRelation.isMultipolygon() && parentRelation.tags.building && parentRelation.tags.building !== "no";
46955           });
46956         });
46957       });
46958       if (hasConnectedSquarableWays) return [];
46959       var storedDegreeThreshold = corePreferences("validate-square-degrees");
46960       var degreeThreshold = isFinite(storedDegreeThreshold) ? Number(storedDegreeThreshold) : DEFAULT_DEG_THRESHOLD;
46961       var points = nodes.map(function(node) {
46962         return context.projection(node.loc);
46963       });
46964       if (!geoOrthoCanOrthogonalize(points, isClosed, epsilon3, degreeThreshold, true)) return [];
46965       return [new validationIssue({
46966         type: type2,
46967         subtype: "building",
46968         severity: "suggestion",
46969         message: function(context2) {
46970           var entity2 = context2.hasEntity(this.entityIds[0]);
46971           return entity2 ? _t.append("issues.unsquare_way.message", {
46972             feature: utilDisplayLabel(entity2, context2.graph())
46973           }) : "";
46974         },
46975         reference: showReference,
46976         entityIds: [entity.id],
46977         hash: degreeThreshold,
46978         dynamicFixes: function() {
46979           return [
46980             new validationIssueFix({
46981               icon: "iD-operation-orthogonalize",
46982               title: _t.append("issues.fix.square_feature.title"),
46983               onClick: function(context2, completionHandler) {
46984                 var entityId = this.issue.entityIds[0];
46985                 context2.perform(
46986                   actionOrthogonalize(entityId, context2.projection, void 0, degreeThreshold),
46987                   _t("operations.orthogonalize.annotation.feature", { n: 1 })
46988                 );
46989                 window.setTimeout(function() {
46990                   completionHandler();
46991                 }, 175);
46992               }
46993             })
46994             /*
46995             new validationIssueFix({
46996                 title: t.append('issues.fix.tag_as_unsquare.title'),
46997                 onClick: function(context) {
46998                     var entityId = this.issue.entityIds[0];
46999                     var entity = context.entity(entityId);
47000                     var tags = Object.assign({}, entity.tags);  // shallow copy
47001                     tags.nonsquare = 'yes';
47002                     context.perform(
47003                         actionChangeTags(entityId, tags),
47004                         t('issues.fix.tag_as_unsquare.annotation')
47005                     );
47006                 }
47007             })
47008             */
47009           ];
47010         }
47011       })];
47012       function showReference(selection2) {
47013         selection2.selectAll(".issue-reference").data([0]).enter().append("div").attr("class", "issue-reference").call(_t.append("issues.unsquare_way.buildings.reference"));
47014       }
47015     };
47016     validation.type = type2;
47017     return validation;
47018   }
47019
47020   // modules/core/validator.js
47021   function coreValidator(context) {
47022     let dispatch12 = dispatch_default("validated", "focusedIssue");
47023     const validator = {};
47024     let _rules = {};
47025     let _disabledRules = {};
47026     let _ignoredIssueIDs = /* @__PURE__ */ new Set();
47027     let _resolvedIssueIDs = /* @__PURE__ */ new Set();
47028     let _baseCache = validationCache("base");
47029     let _headCache = validationCache("head");
47030     let _completeDiff = {};
47031     let _headIsCurrent = false;
47032     let _deferredRIC = {};
47033     let _deferredST = /* @__PURE__ */ new Set();
47034     let _headPromise;
47035     const RETRY = 5e3;
47036     const _errorOverrides = parseHashParam(context.initialHashParams.validationError);
47037     const _warningOverrides = parseHashParam(context.initialHashParams.validationWarning);
47038     const _suggestionOverrides = parseHashParam(context.initialHashParams.validationSuggestion);
47039     const _disableOverrides = parseHashParam(context.initialHashParams.validationDisable);
47040     function parseHashParam(param) {
47041       let result = [];
47042       let rules = (param || "").split(",");
47043       rules.forEach((rule) => {
47044         rule = rule.trim();
47045         const parts = rule.split("/", 2);
47046         const type2 = parts[0];
47047         const subtype = parts[1] || "*";
47048         if (!type2 || !subtype) return;
47049         result.push({ type: makeRegExp(type2), subtype: makeRegExp(subtype) });
47050       });
47051       return result;
47052       function makeRegExp(str) {
47053         const escaped = str.replace(/[-\/\\^$+?.()|[\]{}]/g, "\\$&").replace(/\*/g, ".*");
47054         return new RegExp("^" + escaped + "$");
47055       }
47056     }
47057     validator.init = () => {
47058       Object.values(validations_exports).forEach((validation) => {
47059         if (typeof validation !== "function") return;
47060         const fn = validation(context);
47061         const key = fn.type;
47062         _rules[key] = fn;
47063       });
47064       let disabledRules = corePreferences("validate-disabledRules");
47065       if (disabledRules) {
47066         disabledRules.split(",").forEach((k3) => _disabledRules[k3] = true);
47067       }
47068     };
47069     function reset(resetIgnored) {
47070       _baseCache.queue = [];
47071       _headCache.queue = [];
47072       Object.keys(_deferredRIC).forEach((key) => {
47073         window.cancelIdleCallback(key);
47074         _deferredRIC[key]();
47075       });
47076       _deferredRIC = {};
47077       _deferredST.forEach(window.clearTimeout);
47078       _deferredST.clear();
47079       if (resetIgnored) _ignoredIssueIDs.clear();
47080       _resolvedIssueIDs.clear();
47081       _baseCache = validationCache("base");
47082       _headCache = validationCache("head");
47083       _completeDiff = {};
47084       _headIsCurrent = false;
47085     }
47086     validator.reset = () => {
47087       reset(true);
47088     };
47089     validator.resetIgnoredIssues = () => {
47090       _ignoredIssueIDs.clear();
47091       dispatch12.call("validated");
47092     };
47093     validator.revalidateUnsquare = () => {
47094       revalidateUnsquare(_headCache);
47095       revalidateUnsquare(_baseCache);
47096       dispatch12.call("validated");
47097     };
47098     function revalidateUnsquare(cache) {
47099       const checkUnsquareWay = _rules.unsquare_way;
47100       if (!cache.graph || typeof checkUnsquareWay !== "function") return;
47101       cache.uncacheIssuesOfType("unsquare_way");
47102       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");
47103       buildings.forEach((entity) => {
47104         const detected = checkUnsquareWay(entity, cache.graph);
47105         if (!detected.length) return;
47106         cache.cacheIssues(detected);
47107       });
47108     }
47109     validator.getIssues = (options) => {
47110       const opts = Object.assign({ what: "all", where: "all", includeIgnored: false, includeDisabledRules: false }, options);
47111       const view = context.map().extent();
47112       let seen = /* @__PURE__ */ new Set();
47113       let results = [];
47114       if (_headCache.graph && _headCache.graph !== _baseCache.graph) {
47115         Object.values(_headCache.issuesByIssueID).forEach((issue) => {
47116           const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
47117           if (opts.what === "edited" && !userModified) return;
47118           if (!filter2(issue)) return;
47119           seen.add(issue.id);
47120           results.push(issue);
47121         });
47122       }
47123       if (opts.what === "all") {
47124         Object.values(_baseCache.issuesByIssueID).forEach((issue) => {
47125           if (!filter2(issue)) return;
47126           seen.add(issue.id);
47127           results.push(issue);
47128         });
47129       }
47130       return results;
47131       function filter2(issue) {
47132         if (!issue) return false;
47133         if (seen.has(issue.id)) return false;
47134         if (_resolvedIssueIDs.has(issue.id)) return false;
47135         if (opts.includeDisabledRules === "only" && !_disabledRules[issue.type]) return false;
47136         if (!opts.includeDisabledRules && _disabledRules[issue.type]) return false;
47137         if (opts.includeIgnored === "only" && !_ignoredIssueIDs.has(issue.id)) return false;
47138         if (!opts.includeIgnored && _ignoredIssueIDs.has(issue.id)) return false;
47139         if ((issue.entityIds || []).some((id2) => !context.hasEntity(id2))) return false;
47140         if (opts.where === "visible") {
47141           const extent = issue.extent(context.graph());
47142           if (!view.intersects(extent)) return false;
47143         }
47144         return true;
47145       }
47146     };
47147     validator.getResolvedIssues = () => {
47148       return Array.from(_resolvedIssueIDs).map((issueID) => _baseCache.issuesByIssueID[issueID]).filter(Boolean);
47149     };
47150     validator.focusIssue = (issue) => {
47151       const graph = context.graph();
47152       let selectID;
47153       let issueExtent = issue.extent(graph);
47154       if (issue.entityIds && issue.entityIds.length) {
47155         selectID = issue.entityIds[0];
47156         if (selectID && selectID.charAt(0) === "r") {
47157           const ids = utilEntityAndDeepMemberIDs([selectID], graph);
47158           let nodeID = ids.find((id2) => id2.charAt(0) === "n" && graph.hasEntity(id2));
47159           if (!nodeID) {
47160             const wayID = ids.find((id2) => id2.charAt(0) === "w" && graph.hasEntity(id2));
47161             if (wayID) {
47162               nodeID = graph.entity(wayID).first();
47163             }
47164           }
47165           if (nodeID) {
47166             issueExtent = graph.entity(nodeID).extent(graph);
47167           }
47168         }
47169       }
47170       context.map().zoomToEase(issueExtent);
47171       if (selectID) {
47172         window.setTimeout(() => {
47173           context.enter(modeSelect(context, [selectID]));
47174           dispatch12.call("focusedIssue", this, issue);
47175         }, 250);
47176       }
47177     };
47178     validator.getIssuesBySeverity = (options) => {
47179       let groups = utilArrayGroupBy(validator.getIssues(options), "severity");
47180       groups.error = groups.error || [];
47181       groups.warning = groups.warning || [];
47182       groups.suggestion = groups.suggestion || [];
47183       return groups;
47184     };
47185     validator.getSharedEntityIssues = (entityIDs, options) => {
47186       const orderedIssueTypes = [
47187         // Show some issue types in a particular order:
47188         "missing_tag",
47189         "missing_role",
47190         // - missing data first
47191         "outdated_tags",
47192         "mismatched_geometry",
47193         // - identity issues
47194         "crossing_ways",
47195         "almost_junction",
47196         // - geometry issues where fixing them might solve connectivity issues
47197         "disconnected_way",
47198         "impossible_oneway"
47199         // - finally connectivity issues
47200       ];
47201       const allIssues = validator.getIssues(options);
47202       const forEntityIDs = new Set(entityIDs);
47203       return allIssues.filter((issue) => (issue.entityIds || []).some((entityID) => forEntityIDs.has(entityID))).sort((issue1, issue2) => {
47204         if (issue1.type === issue2.type) {
47205           return issue1.id < issue2.id ? -1 : 1;
47206         }
47207         const index1 = orderedIssueTypes.indexOf(issue1.type);
47208         const index2 = orderedIssueTypes.indexOf(issue2.type);
47209         if (index1 !== -1 && index2 !== -1) {
47210           return index1 - index2;
47211         } else if (index1 === -1 && index2 === -1) {
47212           return issue1.type < issue2.type ? -1 : 1;
47213         } else {
47214           return index1 !== -1 ? -1 : 1;
47215         }
47216       });
47217     };
47218     validator.getEntityIssues = (entityID, options) => {
47219       return validator.getSharedEntityIssues([entityID], options);
47220     };
47221     validator.getRuleKeys = () => {
47222       return Object.keys(_rules);
47223     };
47224     validator.isRuleEnabled = (key) => {
47225       return !_disabledRules[key];
47226     };
47227     validator.toggleRule = (key) => {
47228       if (_disabledRules[key]) {
47229         delete _disabledRules[key];
47230       } else {
47231         _disabledRules[key] = true;
47232       }
47233       corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
47234       validator.validate();
47235     };
47236     validator.disableRules = (keys2) => {
47237       _disabledRules = {};
47238       keys2.forEach((k3) => _disabledRules[k3] = true);
47239       corePreferences("validate-disabledRules", Object.keys(_disabledRules).join(","));
47240       validator.validate();
47241     };
47242     validator.ignoreIssue = (issueID) => {
47243       _ignoredIssueIDs.add(issueID);
47244     };
47245     validator.validate = () => {
47246       const baseGraph = context.history().base();
47247       if (!_headCache.graph) _headCache.graph = baseGraph;
47248       if (!_baseCache.graph) _baseCache.graph = baseGraph;
47249       const prevGraph = _headCache.graph;
47250       const currGraph = context.graph();
47251       if (currGraph === prevGraph) {
47252         _headIsCurrent = true;
47253         dispatch12.call("validated");
47254         return Promise.resolve();
47255       }
47256       if (_headPromise) {
47257         _headIsCurrent = false;
47258         return _headPromise;
47259       }
47260       _headCache.graph = currGraph;
47261       _completeDiff = context.history().difference().complete();
47262       const incrementalDiff = coreDifference(prevGraph, currGraph);
47263       const diff = Object.keys(incrementalDiff.complete());
47264       const entityIDs = _headCache.withAllRelatedEntities(diff);
47265       if (!entityIDs.size) {
47266         dispatch12.call("validated");
47267         return Promise.resolve();
47268       }
47269       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));
47270       addConnectedWays(currGraph);
47271       addConnectedWays(prevGraph);
47272       Object.values(__spreadValues(__spreadValues({}, incrementalDiff.created()), incrementalDiff.deleted())).filter((e3) => e3.type === "relation").flatMap((r2) => r2.members).forEach((m3) => entityIDs.add(m3.id));
47273       Object.values(incrementalDiff.modified()).filter((e3) => e3.type === "relation").map((r2) => ({ baseEntity: prevGraph.entity(r2.id), headEntity: r2 })).forEach(({ baseEntity, headEntity }) => {
47274         const bm = baseEntity.members.map((m3) => m3.id);
47275         const hm = headEntity.members.map((m3) => m3.id);
47276         const symDiff = utilArrayDifference(utilArrayUnion(bm, hm), utilArrayIntersection(bm, hm));
47277         symDiff.forEach((id2) => entityIDs.add(id2));
47278       });
47279       _headPromise = validateEntitiesAsync(entityIDs, _headCache).then(() => updateResolvedIssues(entityIDs)).then(() => dispatch12.call("validated")).catch(() => {
47280       }).then(() => {
47281         _headPromise = null;
47282         if (!_headIsCurrent) {
47283           validator.validate();
47284         }
47285       });
47286       return _headPromise;
47287     };
47288     context.history().on("restore.validator", validator.validate).on("undone.validator", validator.validate).on("redone.validator", validator.validate).on("reset.validator", () => {
47289       reset(false);
47290       validator.validate();
47291     });
47292     context.on("exit.validator", validator.validate);
47293     context.history().on("merge.validator", (entities) => {
47294       if (!entities) return;
47295       const baseGraph = context.history().base();
47296       if (!_headCache.graph) _headCache.graph = baseGraph;
47297       if (!_baseCache.graph) _baseCache.graph = baseGraph;
47298       let entityIDs = entities.map((entity) => entity.id);
47299       entityIDs = _baseCache.withAllRelatedEntities(entityIDs);
47300       validateEntitiesAsync(entityIDs, _baseCache);
47301     });
47302     function validateEntity(entity, graph) {
47303       let result = { issues: [], provisional: false };
47304       Object.keys(_rules).forEach(runValidation);
47305       return result;
47306       function runValidation(key) {
47307         const fn = _rules[key];
47308         if (typeof fn !== "function") {
47309           console.error("no such validation rule = " + key);
47310           return;
47311         }
47312         let detected = fn(entity, graph);
47313         if (detected.provisional) {
47314           result.provisional = true;
47315         }
47316         detected = detected.filter(applySeverityOverrides);
47317         result.issues = result.issues.concat(detected);
47318         function applySeverityOverrides(issue) {
47319           const type2 = issue.type;
47320           const subtype = issue.subtype || "";
47321           let i3;
47322           for (i3 = 0; i3 < _errorOverrides.length; i3++) {
47323             if (_errorOverrides[i3].type.test(type2) && _errorOverrides[i3].subtype.test(subtype)) {
47324               issue.severity = "error";
47325               return true;
47326             }
47327           }
47328           for (i3 = 0; i3 < _warningOverrides.length; i3++) {
47329             if (_warningOverrides[i3].type.test(type2) && _warningOverrides[i3].subtype.test(subtype)) {
47330               issue.severity = "warning";
47331               return true;
47332             }
47333           }
47334           for (i3 = 0; i3 < _suggestionOverrides.length; i3++) {
47335             if (_suggestionOverrides[i3].type.test(type2) && _suggestionOverrides[i3].subtype.test(subtype)) {
47336               issue.severity = "suggestion";
47337               return true;
47338             }
47339           }
47340           for (i3 = 0; i3 < _disableOverrides.length; i3++) {
47341             if (_disableOverrides[i3].type.test(type2) && _disableOverrides[i3].subtype.test(subtype)) {
47342               return false;
47343             }
47344           }
47345           return true;
47346         }
47347       }
47348     }
47349     function updateResolvedIssues(entityIDs) {
47350       entityIDs.forEach((entityID) => {
47351         const baseIssues = _baseCache.issuesByEntityID[entityID];
47352         if (!baseIssues) return;
47353         baseIssues.forEach((issueID) => {
47354           const issue = _baseCache.issuesByIssueID[issueID];
47355           const userModified = (issue.entityIds || []).some((id2) => _completeDiff.hasOwnProperty(id2));
47356           if (userModified && !_headCache.issuesByIssueID[issueID]) {
47357             _resolvedIssueIDs.add(issueID);
47358           } else {
47359             _resolvedIssueIDs.delete(issueID);
47360           }
47361         });
47362       });
47363     }
47364     function validateEntitiesAsync(entityIDs, cache) {
47365       const jobs = Array.from(entityIDs).map((entityID) => {
47366         if (cache.queuedEntityIDs.has(entityID)) return null;
47367         cache.queuedEntityIDs.add(entityID);
47368         cache.uncacheEntityID(entityID);
47369         return () => {
47370           cache.queuedEntityIDs.delete(entityID);
47371           const graph = cache.graph;
47372           if (!graph) return;
47373           const entity = graph.hasEntity(entityID);
47374           if (!entity) return;
47375           const result = validateEntity(entity, graph);
47376           if (result.provisional) {
47377             cache.provisionalEntityIDs.add(entityID);
47378           }
47379           cache.cacheIssues(result.issues);
47380         };
47381       }).filter(Boolean);
47382       cache.queue = cache.queue.concat(utilArrayChunk(jobs, 100));
47383       if (cache.queuePromise) return cache.queuePromise;
47384       cache.queuePromise = processQueue(cache).then(() => revalidateProvisionalEntities(cache)).catch(() => {
47385       }).finally(() => cache.queuePromise = null);
47386       return cache.queuePromise;
47387     }
47388     function revalidateProvisionalEntities(cache) {
47389       if (!cache.provisionalEntityIDs.size) return;
47390       const handle = window.setTimeout(() => {
47391         _deferredST.delete(handle);
47392         if (!cache.provisionalEntityIDs.size) return;
47393         validateEntitiesAsync(Array.from(cache.provisionalEntityIDs), cache);
47394       }, RETRY);
47395       _deferredST.add(handle);
47396     }
47397     function processQueue(cache) {
47398       if (!cache.queue.length) return Promise.resolve();
47399       const chunk = cache.queue.pop();
47400       return new Promise((resolvePromise, rejectPromise) => {
47401         const handle = window.requestIdleCallback(() => {
47402           delete _deferredRIC[handle];
47403           chunk.forEach((job) => job());
47404           resolvePromise();
47405         });
47406         _deferredRIC[handle] = rejectPromise;
47407       }).then(() => {
47408         if (cache.queue.length % 25 === 0) dispatch12.call("validated");
47409       }).then(() => processQueue(cache));
47410     }
47411     return utilRebind(validator, dispatch12, "on");
47412   }
47413   function validationCache(which) {
47414     let cache = {
47415       which,
47416       graph: null,
47417       queue: [],
47418       queuePromise: null,
47419       queuedEntityIDs: /* @__PURE__ */ new Set(),
47420       provisionalEntityIDs: /* @__PURE__ */ new Set(),
47421       issuesByIssueID: {},
47422       // issue.id -> issue
47423       issuesByEntityID: {}
47424       // entity.id -> Set(issue.id)
47425     };
47426     cache.cacheIssue = (issue) => {
47427       (issue.entityIds || []).forEach((entityID) => {
47428         if (!cache.issuesByEntityID[entityID]) {
47429           cache.issuesByEntityID[entityID] = /* @__PURE__ */ new Set();
47430         }
47431         cache.issuesByEntityID[entityID].add(issue.id);
47432       });
47433       cache.issuesByIssueID[issue.id] = issue;
47434     };
47435     cache.uncacheIssue = (issue) => {
47436       (issue.entityIds || []).forEach((entityID) => {
47437         if (cache.issuesByEntityID[entityID]) {
47438           cache.issuesByEntityID[entityID].delete(issue.id);
47439         }
47440       });
47441       delete cache.issuesByIssueID[issue.id];
47442     };
47443     cache.cacheIssues = (issues) => {
47444       issues.forEach(cache.cacheIssue);
47445     };
47446     cache.uncacheIssues = (issues) => {
47447       issues.forEach(cache.uncacheIssue);
47448     };
47449     cache.uncacheIssuesOfType = (type2) => {
47450       const issuesOfType = Object.values(cache.issuesByIssueID).filter((issue) => issue.type === type2);
47451       cache.uncacheIssues(issuesOfType);
47452     };
47453     cache.uncacheEntityID = (entityID) => {
47454       const entityIssueIDs = cache.issuesByEntityID[entityID];
47455       if (entityIssueIDs) {
47456         entityIssueIDs.forEach((issueID) => {
47457           const issue = cache.issuesByIssueID[issueID];
47458           if (issue) {
47459             cache.uncacheIssue(issue);
47460           } else {
47461             delete cache.issuesByIssueID[issueID];
47462           }
47463         });
47464       }
47465       delete cache.issuesByEntityID[entityID];
47466       cache.provisionalEntityIDs.delete(entityID);
47467     };
47468     cache.withAllRelatedEntities = (entityIDs) => {
47469       let result = /* @__PURE__ */ new Set();
47470       (entityIDs || []).forEach((entityID) => {
47471         result.add(entityID);
47472         const entityIssueIDs = cache.issuesByEntityID[entityID];
47473         if (entityIssueIDs) {
47474           entityIssueIDs.forEach((issueID) => {
47475             const issue = cache.issuesByIssueID[issueID];
47476             if (issue) {
47477               (issue.entityIds || []).forEach((relatedID) => result.add(relatedID));
47478             } else {
47479               delete cache.issuesByIssueID[issueID];
47480             }
47481           });
47482         }
47483       });
47484       return result;
47485     };
47486     return cache;
47487   }
47488
47489   // modules/core/uploader.js
47490   function coreUploader(context) {
47491     var dispatch12 = dispatch_default(
47492       // Start and end events are dispatched exactly once each per legitimate outside call to `save`
47493       "saveStarted",
47494       // dispatched as soon as a call to `save` has been deemed legitimate
47495       "saveEnded",
47496       // dispatched after the result event has been dispatched
47497       "willAttemptUpload",
47498       // dispatched before the actual upload call occurs, if it will
47499       "progressChanged",
47500       // Each save results in one of these outcomes:
47501       "resultNoChanges",
47502       // upload wasn't attempted since there were no edits
47503       "resultErrors",
47504       // upload failed due to errors
47505       "resultConflicts",
47506       // upload failed due to data conflicts
47507       "resultSuccess"
47508       // upload completed without errors
47509     );
47510     var _isSaving = false;
47511     let _anyConflictsAutomaticallyResolved = false;
47512     var _conflicts = [];
47513     var _errors = [];
47514     var _origChanges;
47515     var _discardTags = {};
47516     _mainFileFetcher.get("discarded").then(function(d2) {
47517       _discardTags = d2;
47518     }).catch(function() {
47519     });
47520     const uploader = {};
47521     uploader.isSaving = function() {
47522       return _isSaving;
47523     };
47524     uploader.save = function(changeset, tryAgain, checkConflicts) {
47525       if (_isSaving && !tryAgain) {
47526         return;
47527       }
47528       var osm = context.connection();
47529       if (!osm) return;
47530       if (!osm.authenticated()) {
47531         osm.authenticate(function(err) {
47532           if (!err) {
47533             uploader.save(changeset, tryAgain, checkConflicts);
47534           }
47535         });
47536         return;
47537       }
47538       if (!_isSaving) {
47539         _isSaving = true;
47540         dispatch12.call("saveStarted", this);
47541       }
47542       var history = context.history();
47543       _anyConflictsAutomaticallyResolved = false;
47544       _conflicts = [];
47545       _errors = [];
47546       _origChanges = history.changes(actionDiscardTags(history.difference(), _discardTags));
47547       if (!tryAgain) {
47548         history.perform(actionNoop());
47549       }
47550       if (!checkConflicts) {
47551         upload(changeset);
47552       } else {
47553         performFullConflictCheck(changeset);
47554       }
47555     };
47556     function performFullConflictCheck(changeset) {
47557       var osm = context.connection();
47558       if (!osm) return;
47559       var history = context.history();
47560       var localGraph = context.graph();
47561       var remoteGraph = coreGraph(history.base(), true);
47562       var summary = history.difference().summary();
47563       var _toCheck = [];
47564       for (var i3 = 0; i3 < summary.length; i3++) {
47565         var item = summary[i3];
47566         if (item.changeType === "modified") {
47567           _toCheck.push(item.entity.id);
47568         }
47569       }
47570       var _toLoad = withChildNodes(_toCheck, localGraph);
47571       var _loaded = {};
47572       var _toLoadCount = 0;
47573       var _toLoadTotal = _toLoad.length;
47574       if (_toCheck.length) {
47575         dispatch12.call("progressChanged", this, _toLoadCount, _toLoadTotal);
47576         _toLoad.forEach(function(id2) {
47577           _loaded[id2] = false;
47578         });
47579         osm.loadMultiple(_toLoad, loaded);
47580       } else {
47581         upload(changeset);
47582       }
47583       return;
47584       function withChildNodes(ids, graph) {
47585         var s2 = new Set(ids);
47586         ids.forEach(function(id2) {
47587           var entity = graph.entity(id2);
47588           if (entity.type !== "way") return;
47589           graph.childNodes(entity).forEach(function(child) {
47590             if (child.version !== void 0) {
47591               s2.add(child.id);
47592             }
47593           });
47594         });
47595         return Array.from(s2);
47596       }
47597       function loaded(err, result) {
47598         if (_errors.length) return;
47599         if (err) {
47600           _errors.push({
47601             msg: err.message || err.responseText,
47602             details: [_t("save.status_code", { code: err.status })]
47603           });
47604           didResultInErrors();
47605         } else {
47606           var loadMore = [];
47607           result.data.forEach(function(entity) {
47608             remoteGraph.replace(entity);
47609             _loaded[entity.id] = true;
47610             _toLoad = _toLoad.filter(function(val) {
47611               return val !== entity.id;
47612             });
47613             if (!entity.visible) return;
47614             var i4, id2;
47615             if (entity.type === "way") {
47616               for (i4 = 0; i4 < entity.nodes.length; i4++) {
47617                 id2 = entity.nodes[i4];
47618                 if (_loaded[id2] === void 0) {
47619                   _loaded[id2] = false;
47620                   loadMore.push(id2);
47621                 }
47622               }
47623             } else if (entity.type === "relation" && entity.isMultipolygon()) {
47624               for (i4 = 0; i4 < entity.members.length; i4++) {
47625                 id2 = entity.members[i4].id;
47626                 if (_loaded[id2] === void 0) {
47627                   _loaded[id2] = false;
47628                   loadMore.push(id2);
47629                 }
47630               }
47631             }
47632           });
47633           _toLoadCount += result.data.length;
47634           _toLoadTotal += loadMore.length;
47635           dispatch12.call("progressChanged", this, _toLoadCount, _toLoadTotal);
47636           if (loadMore.length) {
47637             _toLoad.push.apply(_toLoad, loadMore);
47638             osm.loadMultiple(loadMore, loaded);
47639           }
47640           if (!_toLoad.length) {
47641             detectConflicts();
47642             upload(changeset);
47643           }
47644         }
47645       }
47646       function detectConflicts() {
47647         function choice(id2, text, action) {
47648           return {
47649             id: id2,
47650             text,
47651             action: function() {
47652               history.replace(action);
47653             }
47654           };
47655         }
47656         function formatUser(d2) {
47657           return '<a href="' + osm.userURL(d2) + '" target="_blank">' + escape_default(d2) + "</a>";
47658         }
47659         function entityName(entity) {
47660           return utilDisplayName(entity) || utilDisplayType(entity.id) + " " + entity.id;
47661         }
47662         function sameVersions(local, remote) {
47663           if (local.version !== remote.version) return false;
47664           if (local.type === "way") {
47665             var children2 = utilArrayUnion(local.nodes, remote.nodes);
47666             for (var i4 = 0; i4 < children2.length; i4++) {
47667               var a2 = localGraph.hasEntity(children2[i4]);
47668               var b3 = remoteGraph.hasEntity(children2[i4]);
47669               if (a2 && b3 && a2.version !== b3.version) return false;
47670             }
47671           }
47672           return true;
47673         }
47674         _toCheck.forEach(function(id2) {
47675           var local = localGraph.entity(id2);
47676           var remote = remoteGraph.entity(id2);
47677           if (sameVersions(local, remote)) return;
47678           var merge3 = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags, formatUser);
47679           history.replace(merge3);
47680           var mergeConflicts = merge3.conflicts();
47681           if (!mergeConflicts.length) {
47682             _anyConflictsAutomaticallyResolved = true;
47683             return;
47684           }
47685           var forceLocal = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_local");
47686           var forceRemote = actionMergeRemoteChanges(id2, localGraph, remoteGraph, _discardTags).withOption("force_remote");
47687           var keepMine = _t("save.conflict." + (remote.visible ? "keep_local" : "restore"));
47688           var keepTheirs = _t("save.conflict." + (remote.visible ? "keep_remote" : "delete"));
47689           _conflicts.push({
47690             id: id2,
47691             name: entityName(local),
47692             details: mergeConflicts,
47693             chosen: 1,
47694             choices: [
47695               choice(id2, keepMine, forceLocal),
47696               choice(id2, keepTheirs, forceRemote)
47697             ]
47698           });
47699         });
47700       }
47701     }
47702     async function upload(changeset) {
47703       var osm = context.connection();
47704       if (!osm) {
47705         _errors.push({ msg: "No OSM Service" });
47706       }
47707       if (_conflicts.length) {
47708         didResultInConflicts(changeset);
47709       } else if (_errors.length) {
47710         didResultInErrors();
47711       } else {
47712         if (_anyConflictsAutomaticallyResolved) {
47713           changeset.tags.merge_conflict_resolved = "automatically";
47714           await osm.updateChangesetTags(changeset);
47715         }
47716         var history = context.history();
47717         var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
47718         if (changes.modified.length || changes.created.length || changes.deleted.length) {
47719           dispatch12.call("willAttemptUpload", this);
47720           osm.putChangeset(changeset, changes, uploadCallback);
47721         } else {
47722           didResultInNoChanges();
47723         }
47724       }
47725     }
47726     function uploadCallback(err, changeset) {
47727       if (err) {
47728         if (err.status === 409) {
47729           uploader.save(changeset, true, true);
47730         } else {
47731           _errors.push({
47732             msg: err.message || err.responseText,
47733             details: [_t("save.status_code", { code: err.status })]
47734           });
47735           didResultInErrors();
47736         }
47737       } else {
47738         didResultInSuccess(changeset);
47739       }
47740     }
47741     function didResultInNoChanges() {
47742       dispatch12.call("resultNoChanges", this);
47743       endSave();
47744       context.flush();
47745     }
47746     function didResultInErrors() {
47747       context.history().pop();
47748       dispatch12.call("resultErrors", this, _errors);
47749       endSave();
47750     }
47751     function didResultInConflicts(changeset) {
47752       changeset.tags.merge_conflict_resolved = "manually";
47753       context.connection().updateChangesetTags(changeset);
47754       _conflicts.sort(function(a2, b3) {
47755         return b3.id.localeCompare(a2.id);
47756       });
47757       dispatch12.call("resultConflicts", this, changeset, _conflicts, _origChanges);
47758       endSave();
47759     }
47760     function didResultInSuccess(changeset) {
47761       context.history().clearSaved();
47762       dispatch12.call("resultSuccess", this, changeset);
47763       window.setTimeout(function() {
47764         endSave();
47765         context.flush();
47766       }, 2500);
47767     }
47768     function endSave() {
47769       _isSaving = false;
47770       dispatch12.call("saveEnded", this);
47771     }
47772     uploader.cancelConflictResolution = function() {
47773       context.history().pop();
47774     };
47775     uploader.processResolvedConflicts = function(changeset) {
47776       var history = context.history();
47777       for (var i3 = 0; i3 < _conflicts.length; i3++) {
47778         if (_conflicts[i3].chosen === 1) {
47779           var entity = context.hasEntity(_conflicts[i3].id);
47780           if (entity && entity.type === "way") {
47781             var children2 = utilArrayUniq(entity.nodes);
47782             for (var j3 = 0; j3 < children2.length; j3++) {
47783               history.replace(actionRevert(children2[j3]));
47784             }
47785           }
47786           history.replace(actionRevert(_conflicts[i3].id));
47787         }
47788       }
47789       uploader.save(changeset, true, false);
47790     };
47791     uploader.reset = function() {
47792     };
47793     return utilRebind(uploader, dispatch12, "on");
47794   }
47795
47796   // modules/modes/draw_area.js
47797   function modeDrawArea(context, wayID, startGraph, button) {
47798     var mode = {
47799       button,
47800       id: "draw-area"
47801     };
47802     var behavior = behaviorDrawWay(context, wayID, mode, startGraph).on("rejectedSelfIntersection.modeDrawArea", function() {
47803       context.ui().flash.iconName("#iD-icon-no").label(_t.append("self_intersection.error.areas"))();
47804     });
47805     mode.wayID = wayID;
47806     mode.enter = function() {
47807       context.install(behavior);
47808     };
47809     mode.exit = function() {
47810       context.uninstall(behavior);
47811     };
47812     mode.selectedIDs = function() {
47813       return [wayID];
47814     };
47815     mode.activeID = function() {
47816       return behavior && behavior.activeID() || [];
47817     };
47818     return mode;
47819   }
47820
47821   // modules/modes/add_area.js
47822   function modeAddArea(context, mode) {
47823     mode.id = "add-area";
47824     var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
47825     function defaultTags(loc) {
47826       var defaultTags2 = { area: "yes" };
47827       if (mode.preset) defaultTags2 = mode.preset.setTags(defaultTags2, "area", false, loc);
47828       return defaultTags2;
47829     }
47830     function actionClose(wayId) {
47831       return function(graph) {
47832         return graph.replace(graph.entity(wayId).close());
47833       };
47834     }
47835     function start2(loc) {
47836       var startGraph = context.graph();
47837       var node = osmNode({ loc });
47838       var way = osmWay({ tags: defaultTags(loc) });
47839       context.perform(
47840         actionAddEntity(node),
47841         actionAddEntity(way),
47842         actionAddVertex(way.id, node.id),
47843         actionClose(way.id)
47844       );
47845       context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
47846     }
47847     function startFromWay(loc, edge) {
47848       var startGraph = context.graph();
47849       var node = osmNode({ loc });
47850       var way = osmWay({ tags: defaultTags(loc) });
47851       context.perform(
47852         actionAddEntity(node),
47853         actionAddEntity(way),
47854         actionAddVertex(way.id, node.id),
47855         actionClose(way.id),
47856         actionAddMidpoint({ loc, edge }, node)
47857       );
47858       context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
47859     }
47860     function startFromNode(node) {
47861       var startGraph = context.graph();
47862       var way = osmWay({ tags: defaultTags(node.loc) });
47863       context.perform(
47864         actionAddEntity(way),
47865         actionAddVertex(way.id, node.id),
47866         actionClose(way.id)
47867       );
47868       context.enter(modeDrawArea(context, way.id, startGraph, mode.button));
47869     }
47870     mode.enter = function() {
47871       context.install(behavior);
47872     };
47873     mode.exit = function() {
47874       context.uninstall(behavior);
47875     };
47876     return mode;
47877   }
47878
47879   // modules/modes/add_line.js
47880   function modeAddLine(context, mode) {
47881     mode.id = "add-line";
47882     var behavior = behaviorAddWay(context).on("start", start2).on("startFromWay", startFromWay).on("startFromNode", startFromNode);
47883     function defaultTags(loc) {
47884       var defaultTags2 = {};
47885       if (mode.preset) defaultTags2 = mode.preset.setTags(defaultTags2, "line", false, loc);
47886       return defaultTags2;
47887     }
47888     function start2(loc) {
47889       var startGraph = context.graph();
47890       var node = osmNode({ loc });
47891       var way = osmWay({ tags: defaultTags(loc) });
47892       context.perform(
47893         actionAddEntity(node),
47894         actionAddEntity(way),
47895         actionAddVertex(way.id, node.id)
47896       );
47897       context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
47898     }
47899     function startFromWay(loc, edge) {
47900       var startGraph = context.graph();
47901       var node = osmNode({ loc });
47902       var way = osmWay({ tags: defaultTags(loc) });
47903       context.perform(
47904         actionAddEntity(node),
47905         actionAddEntity(way),
47906         actionAddVertex(way.id, node.id),
47907         actionAddMidpoint({ loc, edge }, node)
47908       );
47909       context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
47910     }
47911     function startFromNode(node) {
47912       var startGraph = context.graph();
47913       var way = osmWay({ tags: defaultTags(node.loc) });
47914       context.perform(
47915         actionAddEntity(way),
47916         actionAddVertex(way.id, node.id)
47917       );
47918       context.enter(modeDrawLine(context, way.id, startGraph, mode.button));
47919     }
47920     mode.enter = function() {
47921       context.install(behavior);
47922     };
47923     mode.exit = function() {
47924       context.uninstall(behavior);
47925     };
47926     return mode;
47927   }
47928
47929   // modules/modes/add_point.js
47930   function modeAddPoint(context, mode) {
47931     mode.id = "add-point";
47932     var behavior = behaviorDraw(context).on("click", add).on("clickWay", addWay).on("clickNode", addNode).on("cancel", cancel).on("finish", cancel);
47933     function defaultTags(loc) {
47934       var defaultTags2 = {};
47935       if (mode.preset) defaultTags2 = mode.preset.setTags(defaultTags2, "point", false, loc);
47936       return defaultTags2;
47937     }
47938     function add(loc) {
47939       var node = osmNode({ loc, tags: defaultTags(loc) });
47940       context.perform(
47941         actionAddEntity(node),
47942         _t("operations.add.annotation.point")
47943       );
47944       enterSelectMode(node);
47945     }
47946     function addWay(loc, edge) {
47947       var node = osmNode({ tags: defaultTags(loc) });
47948       context.perform(
47949         actionAddMidpoint({ loc, edge }, node),
47950         _t("operations.add.annotation.vertex")
47951       );
47952       enterSelectMode(node);
47953     }
47954     function enterSelectMode(node) {
47955       context.enter(
47956         modeSelect(context, [node.id]).newFeature(true)
47957       );
47958     }
47959     function addNode(node) {
47960       const _defaultTags = defaultTags(node.loc);
47961       if (Object.keys(_defaultTags).length === 0) {
47962         enterSelectMode(node);
47963         return;
47964       }
47965       var tags = Object.assign({}, node.tags);
47966       for (var key in _defaultTags) {
47967         tags[key] = _defaultTags[key];
47968       }
47969       context.perform(
47970         actionChangeTags(node.id, tags),
47971         _t("operations.add.annotation.point")
47972       );
47973       enterSelectMode(node);
47974     }
47975     function cancel() {
47976       context.enter(modeBrowse(context));
47977     }
47978     mode.enter = function() {
47979       context.install(behavior);
47980     };
47981     mode.exit = function() {
47982       context.uninstall(behavior);
47983     };
47984     return mode;
47985   }
47986
47987   // modules/behavior/drag.js
47988   function behaviorDrag() {
47989     var dispatch12 = dispatch_default("start", "move", "end");
47990     var _tolerancePx = 1;
47991     var _penTolerancePx = 4;
47992     var _origin = null;
47993     var _selector = "";
47994     var _targetNode;
47995     var _targetEntity;
47996     var _surface;
47997     var _pointerId;
47998     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
47999     var d3_event_userSelectProperty = utilPrefixCSSProperty("UserSelect");
48000     var d3_event_userSelectSuppress = function() {
48001       var selection2 = selection_default();
48002       var select = selection2.style(d3_event_userSelectProperty);
48003       selection2.style(d3_event_userSelectProperty, "none");
48004       return function() {
48005         selection2.style(d3_event_userSelectProperty, select);
48006       };
48007     };
48008     function pointerdown(d3_event) {
48009       if (_pointerId) return;
48010       _pointerId = d3_event.pointerId || "mouse";
48011       _targetNode = this;
48012       var pointerLocGetter = utilFastMouse(_surface || _targetNode.parentNode);
48013       var offset;
48014       var startOrigin = pointerLocGetter(d3_event);
48015       var started = false;
48016       var selectEnable = d3_event_userSelectSuppress();
48017       select_default2(window).on(_pointerPrefix + "move.drag", pointermove).on(_pointerPrefix + "up.drag pointercancel.drag", pointerup, true);
48018       if (_origin) {
48019         offset = _origin.call(_targetNode, _targetEntity);
48020         offset = [offset[0] - startOrigin[0], offset[1] - startOrigin[1]];
48021       } else {
48022         offset = [0, 0];
48023       }
48024       d3_event.stopPropagation();
48025       function pointermove(d3_event2) {
48026         if (_pointerId !== (d3_event2.pointerId || "mouse")) return;
48027         var p2 = pointerLocGetter(d3_event2);
48028         if (!started) {
48029           var dist = geoVecLength(startOrigin, p2);
48030           var tolerance = d3_event2.pointerType === "pen" ? _penTolerancePx : _tolerancePx;
48031           if (dist < tolerance) return;
48032           started = true;
48033           dispatch12.call("start", this, d3_event2, _targetEntity);
48034         } else {
48035           startOrigin = p2;
48036           d3_event2.stopPropagation();
48037           d3_event2.preventDefault();
48038           var dx = p2[0] - startOrigin[0];
48039           var dy = p2[1] - startOrigin[1];
48040           dispatch12.call("move", this, d3_event2, _targetEntity, [p2[0] + offset[0], p2[1] + offset[1]], [dx, dy]);
48041         }
48042       }
48043       function pointerup(d3_event2) {
48044         if (_pointerId !== (d3_event2.pointerId || "mouse")) return;
48045         _pointerId = null;
48046         if (started) {
48047           dispatch12.call("end", this, d3_event2, _targetEntity);
48048           d3_event2.preventDefault();
48049         }
48050         select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
48051         selectEnable();
48052       }
48053     }
48054     function behavior(selection2) {
48055       var matchesSelector = utilPrefixDOMProperty("matchesSelector");
48056       var delegate = pointerdown;
48057       if (_selector) {
48058         delegate = function(d3_event) {
48059           var root3 = this;
48060           var target = d3_event.target;
48061           for (; target && target !== root3; target = target.parentNode) {
48062             var datum2 = target.__data__;
48063             _targetEntity = datum2 instanceof osmNote ? datum2 : datum2 && datum2.properties && datum2.properties.entity;
48064             if (_targetEntity && target[matchesSelector](_selector)) {
48065               return pointerdown.call(target, d3_event);
48066             }
48067           }
48068         };
48069       }
48070       selection2.on(_pointerPrefix + "down.drag" + _selector, delegate);
48071     }
48072     behavior.off = function(selection2) {
48073       selection2.on(_pointerPrefix + "down.drag" + _selector, null);
48074     };
48075     behavior.selector = function(_3) {
48076       if (!arguments.length) return _selector;
48077       _selector = _3;
48078       return behavior;
48079     };
48080     behavior.origin = function(_3) {
48081       if (!arguments.length) return _origin;
48082       _origin = _3;
48083       return behavior;
48084     };
48085     behavior.cancel = function() {
48086       select_default2(window).on(_pointerPrefix + "move.drag", null).on(_pointerPrefix + "up.drag pointercancel.drag", null);
48087       return behavior;
48088     };
48089     behavior.targetNode = function(_3) {
48090       if (!arguments.length) return _targetNode;
48091       _targetNode = _3;
48092       return behavior;
48093     };
48094     behavior.targetEntity = function(_3) {
48095       if (!arguments.length) return _targetEntity;
48096       _targetEntity = _3;
48097       return behavior;
48098     };
48099     behavior.surface = function(_3) {
48100       if (!arguments.length) return _surface;
48101       _surface = _3;
48102       return behavior;
48103     };
48104     return utilRebind(behavior, dispatch12, "on");
48105   }
48106
48107   // modules/modes/drag_node.js
48108   function modeDragNode(context) {
48109     var mode = {
48110       id: "drag-node",
48111       button: "browse"
48112     };
48113     var hover = behaviorHover(context).altDisables(true).on("hover", context.ui().sidebar.hover);
48114     var edit = behaviorEdit(context);
48115     var _nudgeInterval;
48116     var _restoreSelectedIDs = [];
48117     var _wasMidpoint = false;
48118     var _isCancelled = false;
48119     var _activeEntity;
48120     var _startLoc;
48121     var _lastLoc;
48122     function startNudge(d3_event, entity, nudge) {
48123       if (_nudgeInterval) window.clearInterval(_nudgeInterval);
48124       _nudgeInterval = window.setInterval(function() {
48125         context.map().pan(nudge);
48126         doMove(d3_event, entity, nudge);
48127       }, 50);
48128     }
48129     function stopNudge() {
48130       if (_nudgeInterval) {
48131         window.clearInterval(_nudgeInterval);
48132         _nudgeInterval = null;
48133       }
48134     }
48135     function moveAnnotation(entity) {
48136       return _t("operations.move.annotation." + entity.geometry(context.graph()));
48137     }
48138     function connectAnnotation(nodeEntity, targetEntity) {
48139       var nodeGeometry = nodeEntity.geometry(context.graph());
48140       var targetGeometry = targetEntity.geometry(context.graph());
48141       if (nodeGeometry === "vertex" && targetGeometry === "vertex") {
48142         var nodeParentWayIDs = context.graph().parentWays(nodeEntity);
48143         var targetParentWayIDs = context.graph().parentWays(targetEntity);
48144         var sharedParentWays = utilArrayIntersection(nodeParentWayIDs, targetParentWayIDs);
48145         if (sharedParentWays.length !== 0) {
48146           if (sharedParentWays[0].areAdjacent(nodeEntity.id, targetEntity.id)) {
48147             return _t("operations.connect.annotation.from_vertex.to_adjacent_vertex");
48148           }
48149           return _t("operations.connect.annotation.from_vertex.to_sibling_vertex");
48150         }
48151       }
48152       return _t("operations.connect.annotation.from_" + nodeGeometry + ".to_" + targetGeometry);
48153     }
48154     function shouldSnapToNode(target) {
48155       if (!_activeEntity) return false;
48156       return _activeEntity.geometry(context.graph()) !== "vertex" || (target.geometry(context.graph()) === "vertex" || _mainPresetIndex.allowsVertex(target, context.graph()));
48157     }
48158     function origin(entity) {
48159       return context.projection(entity.loc);
48160     }
48161     function keydown(d3_event) {
48162       if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
48163         if (context.surface().classed("nope")) {
48164           context.surface().classed("nope-suppressed", true);
48165         }
48166         context.surface().classed("nope", false).classed("nope-disabled", true);
48167       }
48168     }
48169     function keyup(d3_event) {
48170       if (d3_event.keyCode === utilKeybinding.modifierCodes.alt) {
48171         if (context.surface().classed("nope-suppressed")) {
48172           context.surface().classed("nope", true);
48173         }
48174         context.surface().classed("nope-suppressed", false).classed("nope-disabled", false);
48175       }
48176     }
48177     function start2(d3_event, entity) {
48178       _wasMidpoint = entity.type === "midpoint";
48179       var hasHidden = context.features().hasHiddenConnections(entity, context.graph());
48180       _isCancelled = !context.editable() || d3_event.shiftKey || hasHidden;
48181       if (_isCancelled) {
48182         if (hasHidden) {
48183           context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append("modes.drag_node.connected_to_hidden"))();
48184         }
48185         return drag.cancel();
48186       }
48187       if (_wasMidpoint) {
48188         var midpoint = entity;
48189         entity = osmNode();
48190         context.perform(actionAddMidpoint(midpoint, entity));
48191         entity = context.entity(entity.id);
48192         var vertex = context.surface().selectAll("." + entity.id);
48193         drag.targetNode(vertex.node()).targetEntity(entity);
48194       } else {
48195         context.perform(actionNoop());
48196       }
48197       _activeEntity = entity;
48198       _startLoc = entity.loc;
48199       hover.ignoreVertex(entity.geometry(context.graph()) === "vertex");
48200       context.surface().selectAll("." + _activeEntity.id).classed("active", true);
48201       context.enter(mode);
48202     }
48203     function datum2(d3_event) {
48204       if (!d3_event || d3_event.altKey) {
48205         return {};
48206       } else {
48207         var d2 = d3_event.target.__data__;
48208         return d2 && d2.properties && d2.properties.target ? d2 : {};
48209       }
48210     }
48211     function doMove(d3_event, entity, nudge) {
48212       nudge = nudge || [0, 0];
48213       var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
48214       var currMouse = geoVecSubtract(currPoint, nudge);
48215       var loc = context.projection.invert(currMouse);
48216       var target, edge;
48217       if (!_nudgeInterval) {
48218         var d2 = datum2(d3_event);
48219         target = d2 && d2.properties && d2.properties.entity;
48220         var targetLoc = target && target.loc;
48221         var targetNodes = d2 && d2.properties && d2.properties.nodes;
48222         if (targetLoc) {
48223           if (shouldSnapToNode(target)) {
48224             loc = targetLoc;
48225           }
48226         } else if (targetNodes) {
48227           edge = geoChooseEdge(targetNodes, context.map().mouse(), context.projection, end.id);
48228           if (edge) {
48229             loc = edge.loc;
48230           }
48231         }
48232       }
48233       context.replace(
48234         actionMoveNode(entity.id, loc)
48235       );
48236       var isInvalid = false;
48237       if (target) {
48238         isInvalid = hasRelationConflict(entity, target, edge, context.graph());
48239       }
48240       if (!isInvalid) {
48241         isInvalid = hasInvalidGeometry(entity, context.graph());
48242       }
48243       var nope = context.surface().classed("nope");
48244       if (isInvalid === "relation" || isInvalid === "restriction") {
48245         if (!nope) {
48246           context.ui().flash.duration(4e3).iconName("#iD-icon-no").label(_t.append(
48247             "operations.connect." + isInvalid,
48248             { relation: _mainPresetIndex.item("type/restriction").name() }
48249           ))();
48250         }
48251       } else if (isInvalid) {
48252         var errorID = isInvalid === "line" ? "lines" : "areas";
48253         context.ui().flash.duration(3e3).iconName("#iD-icon-no").label(_t.append("self_intersection.error." + errorID))();
48254       } else {
48255         if (nope) {
48256           context.ui().flash.duration(1).label("")();
48257         }
48258       }
48259       var nopeDisabled = context.surface().classed("nope-disabled");
48260       if (nopeDisabled) {
48261         context.surface().classed("nope", false).classed("nope-suppressed", isInvalid);
48262       } else {
48263         context.surface().classed("nope", isInvalid).classed("nope-suppressed", false);
48264       }
48265       _lastLoc = loc;
48266     }
48267     function hasRelationConflict(entity, target, edge, graph) {
48268       var testGraph = graph.update();
48269       if (edge) {
48270         var midpoint = osmNode();
48271         var action = actionAddMidpoint({
48272           loc: edge.loc,
48273           edge: [target.nodes[edge.index - 1], target.nodes[edge.index]]
48274         }, midpoint);
48275         testGraph = action(testGraph);
48276         target = midpoint;
48277       }
48278       var ids = [entity.id, target.id];
48279       return actionConnect(ids).disabled(testGraph);
48280     }
48281     function hasInvalidGeometry(entity, graph) {
48282       var parents = graph.parentWays(entity);
48283       var i3, j3, k3;
48284       for (i3 = 0; i3 < parents.length; i3++) {
48285         var parent2 = parents[i3];
48286         var nodes = [];
48287         var activeIndex = null;
48288         var relations = graph.parentRelations(parent2);
48289         for (j3 = 0; j3 < relations.length; j3++) {
48290           if (!relations[j3].isMultipolygon()) continue;
48291           var rings = osmJoinWays(relations[j3].members, graph);
48292           for (k3 = 0; k3 < rings.length; k3++) {
48293             nodes = rings[k3].nodes;
48294             if (nodes.find(function(n3) {
48295               return n3.id === entity.id;
48296             })) {
48297               activeIndex = k3;
48298               if (geoHasSelfIntersections(nodes, entity.id)) {
48299                 return "multipolygonMember";
48300               }
48301             }
48302             rings[k3].coords = nodes.map(function(n3) {
48303               return n3.loc;
48304             });
48305           }
48306           for (k3 = 0; k3 < rings.length; k3++) {
48307             if (k3 === activeIndex) continue;
48308             if (geoHasLineIntersections(rings[activeIndex].nodes, rings[k3].nodes, entity.id)) {
48309               return "multipolygonRing";
48310             }
48311           }
48312         }
48313         if (activeIndex === null) {
48314           nodes = parent2.nodes.map(function(nodeID) {
48315             return graph.entity(nodeID);
48316           });
48317           if (nodes.length && geoHasSelfIntersections(nodes, entity.id)) {
48318             return parent2.geometry(graph);
48319           }
48320         }
48321       }
48322       return false;
48323     }
48324     function move(d3_event, entity, point) {
48325       if (_isCancelled) return;
48326       d3_event.stopPropagation();
48327       context.surface().classed("nope-disabled", d3_event.altKey);
48328       _lastLoc = context.projection.invert(point);
48329       doMove(d3_event, entity);
48330       var nudge = geoViewportEdge(point, context.map().dimensions());
48331       if (nudge) {
48332         startNudge(d3_event, entity, nudge);
48333       } else {
48334         stopNudge();
48335       }
48336     }
48337     function end(d3_event, entity) {
48338       if (_isCancelled) return;
48339       var wasPoint = entity.geometry(context.graph()) === "point";
48340       var d2 = datum2(d3_event);
48341       var nope = d2 && d2.properties && d2.properties.nope || context.surface().classed("nope");
48342       var target = d2 && d2.properties && d2.properties.entity;
48343       if (nope) {
48344         context.perform(
48345           _actionBounceBack(entity.id, _startLoc)
48346         );
48347       } else if (target && target.type === "way") {
48348         var choice = geoChooseEdge(context.graph().childNodes(target), context.map().mouse(), context.projection, entity.id);
48349         context.replace(
48350           actionAddMidpoint({
48351             loc: choice.loc,
48352             edge: [target.nodes[choice.index - 1], target.nodes[choice.index]]
48353           }, entity),
48354           connectAnnotation(entity, target)
48355         );
48356       } else if (target && target.type === "node" && shouldSnapToNode(target)) {
48357         context.replace(
48358           actionConnect([target.id, entity.id]),
48359           connectAnnotation(entity, target)
48360         );
48361       } else if (_wasMidpoint) {
48362         context.replace(
48363           actionNoop(),
48364           _t("operations.add.annotation.vertex")
48365         );
48366       } else {
48367         context.replace(
48368           actionNoop(),
48369           moveAnnotation(entity)
48370         );
48371       }
48372       if (wasPoint) {
48373         context.enter(modeSelect(context, [entity.id]));
48374       } else {
48375         var reselection = _restoreSelectedIDs.filter(function(id2) {
48376           return context.graph().hasEntity(id2);
48377         });
48378         if (reselection.length) {
48379           context.enter(modeSelect(context, reselection));
48380         } else {
48381           context.enter(modeBrowse(context));
48382         }
48383       }
48384     }
48385     function _actionBounceBack(nodeID, toLoc) {
48386       var moveNode = actionMoveNode(nodeID, toLoc);
48387       var action = function(graph, t2) {
48388         if (t2 === 1) context.pop();
48389         return moveNode(graph, t2);
48390       };
48391       action.transitionable = true;
48392       return action;
48393     }
48394     function cancel() {
48395       drag.cancel();
48396       context.enter(modeBrowse(context));
48397     }
48398     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);
48399     mode.enter = function() {
48400       context.install(hover);
48401       context.install(edit);
48402       select_default2(window).on("keydown.dragNode", keydown).on("keyup.dragNode", keyup);
48403       context.history().on("undone.drag-node", cancel);
48404     };
48405     mode.exit = function() {
48406       context.ui().sidebar.hover.cancel();
48407       context.uninstall(hover);
48408       context.uninstall(edit);
48409       select_default2(window).on("keydown.dragNode", null).on("keyup.dragNode", null);
48410       context.history().on("undone.drag-node", null);
48411       _activeEntity = null;
48412       context.surface().classed("nope", false).classed("nope-suppressed", false).classed("nope-disabled", false).selectAll(".active").classed("active", false);
48413       stopNudge();
48414     };
48415     mode.selectedIDs = function() {
48416       if (!arguments.length) return _activeEntity ? [_activeEntity.id] : [];
48417       return mode;
48418     };
48419     mode.activeID = function() {
48420       if (!arguments.length) return _activeEntity && _activeEntity.id;
48421       return mode;
48422     };
48423     mode.restoreSelectedIDs = function(_3) {
48424       if (!arguments.length) return _restoreSelectedIDs;
48425       _restoreSelectedIDs = _3;
48426       return mode;
48427     };
48428     mode.behavior = drag;
48429     return mode;
48430   }
48431
48432   // modules/modes/drag_note.js
48433   function modeDragNote(context) {
48434     var mode = {
48435       id: "drag-note",
48436       button: "browse"
48437     };
48438     var edit = behaviorEdit(context);
48439     var _nudgeInterval;
48440     var _lastLoc;
48441     var _note;
48442     function startNudge(d3_event, nudge) {
48443       if (_nudgeInterval) window.clearInterval(_nudgeInterval);
48444       _nudgeInterval = window.setInterval(function() {
48445         context.map().pan(nudge);
48446         doMove(d3_event, nudge);
48447       }, 50);
48448     }
48449     function stopNudge() {
48450       if (_nudgeInterval) {
48451         window.clearInterval(_nudgeInterval);
48452         _nudgeInterval = null;
48453       }
48454     }
48455     function origin(note) {
48456       return context.projection(note.loc);
48457     }
48458     function start2(d3_event, note) {
48459       _note = note;
48460       var osm = services.osm;
48461       if (osm) {
48462         _note = osm.getNote(_note.id);
48463       }
48464       context.surface().selectAll(".note-" + _note.id).classed("active", true);
48465       context.perform(actionNoop());
48466       context.enter(mode);
48467       context.selectedNoteID(_note.id);
48468     }
48469     function move(d3_event, entity, point) {
48470       d3_event.stopPropagation();
48471       _lastLoc = context.projection.invert(point);
48472       doMove(d3_event);
48473       var nudge = geoViewportEdge(point, context.map().dimensions());
48474       if (nudge) {
48475         startNudge(d3_event, nudge);
48476       } else {
48477         stopNudge();
48478       }
48479     }
48480     function doMove(d3_event, nudge) {
48481       nudge = nudge || [0, 0];
48482       var currPoint = d3_event && d3_event.point || context.projection(_lastLoc);
48483       var currMouse = geoVecSubtract(currPoint, nudge);
48484       var loc = context.projection.invert(currMouse);
48485       _note = _note.move(loc);
48486       var osm = services.osm;
48487       if (osm) {
48488         osm.replaceNote(_note);
48489       }
48490       context.replace(actionNoop());
48491     }
48492     function end() {
48493       context.replace(actionNoop());
48494       context.selectedNoteID(_note.id).enter(modeSelectNote(context, _note.id));
48495     }
48496     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);
48497     mode.enter = function() {
48498       context.install(edit);
48499     };
48500     mode.exit = function() {
48501       context.ui().sidebar.hover.cancel();
48502       context.uninstall(edit);
48503       context.surface().selectAll(".active").classed("active", false);
48504       stopNudge();
48505     };
48506     mode.behavior = drag;
48507     return mode;
48508   }
48509
48510   // modules/ui/data_header.js
48511   function uiDataHeader() {
48512     var _datum;
48513     function dataHeader(selection2) {
48514       var header = selection2.selectAll(".data-header").data(
48515         _datum ? [_datum] : [],
48516         function(d2) {
48517           return d2.__featurehash__;
48518         }
48519       );
48520       header.exit().remove();
48521       var headerEnter = header.enter().append("div").attr("class", "data-header");
48522       var iconEnter = headerEnter.append("div").attr("class", "data-header-icon");
48523       iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-data", "note-fill"));
48524       headerEnter.append("div").attr("class", "data-header-label").call(_t.append("map_data.layers.custom.title"));
48525     }
48526     dataHeader.datum = function(val) {
48527       if (!arguments.length) return _datum;
48528       _datum = val;
48529       return this;
48530     };
48531     return dataHeader;
48532   }
48533
48534   // modules/ui/combobox.js
48535   var _comboHideTimerID;
48536   function uiCombobox(context, klass) {
48537     var dispatch12 = dispatch_default("accept", "cancel", "update");
48538     var container = context.container();
48539     var _suggestions = [];
48540     var _data = [];
48541     var _fetched = {};
48542     var _selected = null;
48543     var _canAutocomplete = true;
48544     var _caseSensitive = false;
48545     var _cancelFetch = false;
48546     var _minItems = 2;
48547     var _tDown = 0;
48548     var _mouseEnterHandler, _mouseLeaveHandler;
48549     var _fetcher = function(val, cb) {
48550       cb(_data.filter(function(d2) {
48551         var terms = d2.terms || [];
48552         terms.push(d2.value);
48553         if (d2.key) {
48554           terms.push(d2.key);
48555         }
48556         return terms.some(function(term) {
48557           return term.toString().toLowerCase().indexOf(val.toLowerCase()) !== -1;
48558         });
48559       }));
48560     };
48561     var combobox = function(input, attachTo) {
48562       if (!input || input.empty()) return;
48563       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() {
48564         var parent2 = this.parentNode;
48565         var sibling = this.nextSibling;
48566         select_default2(parent2).selectAll(".combobox-caret").filter(function(d2) {
48567           return d2 === input.node();
48568         }).data([input.node()]).enter().insert("div", function() {
48569           return sibling;
48570         }).attr("class", "combobox-caret").on("mousedown.combo-caret", function(d3_event) {
48571           d3_event.preventDefault();
48572           input.node().focus();
48573           mousedown(d3_event);
48574         }).on("mouseup.combo-caret", function(d3_event) {
48575           d3_event.preventDefault();
48576           mouseup(d3_event);
48577         });
48578       });
48579       function mousedown(d3_event) {
48580         if (d3_event.button !== 0) return;
48581         if (input.classed("disabled")) return;
48582         _tDown = +/* @__PURE__ */ new Date();
48583         d3_event.stopPropagation();
48584         var start2 = input.property("selectionStart");
48585         var end = input.property("selectionEnd");
48586         if (start2 !== end) {
48587           var val = utilGetSetValue(input);
48588           input.node().setSelectionRange(val.length, val.length);
48589           return;
48590         }
48591         input.on("mouseup.combo-input", mouseup);
48592       }
48593       function mouseup(d3_event) {
48594         input.on("mouseup.combo-input", null);
48595         if (d3_event.button !== 0) return;
48596         if (input.classed("disabled")) return;
48597         if (input.node() !== document.activeElement) return;
48598         var start2 = input.property("selectionStart");
48599         var end = input.property("selectionEnd");
48600         if (start2 !== end) return;
48601         var combo = container.selectAll(".combobox");
48602         if (combo.empty() || combo.datum() !== input.node()) {
48603           var tOrig = _tDown;
48604           window.setTimeout(function() {
48605             if (tOrig !== _tDown) return;
48606             fetchComboData("", function() {
48607               show();
48608               render();
48609             });
48610           }, 250);
48611         } else {
48612           hide();
48613         }
48614       }
48615       function focus() {
48616         fetchComboData("");
48617       }
48618       function blur() {
48619         _comboHideTimerID = window.setTimeout(hide, 75);
48620       }
48621       function show() {
48622         hide();
48623         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) {
48624           d3_event.preventDefault();
48625         });
48626         container.on("scroll.combo-scroll", render, true);
48627       }
48628       function hide() {
48629         _hide(container);
48630       }
48631       function keydown(d3_event) {
48632         var shown = !container.selectAll(".combobox").empty();
48633         var tagName = input.node() ? input.node().tagName.toLowerCase() : "";
48634         switch (d3_event.keyCode) {
48635           case 8:
48636           // ⌫ Backspace
48637           case 46:
48638             d3_event.stopPropagation();
48639             _selected = null;
48640             render();
48641             input.on("input.combo-input", function() {
48642               var start2 = input.property("selectionStart");
48643               input.node().setSelectionRange(start2, start2);
48644               input.on("input.combo-input", change);
48645               change(false);
48646             });
48647             break;
48648           case 9:
48649             accept(d3_event);
48650             break;
48651           case 13:
48652             d3_event.preventDefault();
48653             d3_event.stopPropagation();
48654             accept(d3_event);
48655             break;
48656           case 38:
48657             if (tagName === "textarea" && !shown) return;
48658             d3_event.preventDefault();
48659             if (tagName === "input" && !shown) {
48660               show();
48661             }
48662             nav(-1);
48663             break;
48664           case 40:
48665             if (tagName === "textarea" && !shown) return;
48666             d3_event.preventDefault();
48667             if (tagName === "input" && !shown) {
48668               show();
48669             }
48670             nav(1);
48671             break;
48672         }
48673       }
48674       function keyup(d3_event) {
48675         switch (d3_event.keyCode) {
48676           case 27:
48677             cancel();
48678             break;
48679         }
48680       }
48681       function change(doAutoComplete) {
48682         if (doAutoComplete === void 0) doAutoComplete = true;
48683         fetchComboData(value(), function(skipAutosuggest) {
48684           _selected = null;
48685           var val = input.property("value");
48686           if (_suggestions.length) {
48687             if (doAutoComplete && !skipAutosuggest && input.property("selectionEnd") === val.length) {
48688               _selected = tryAutocomplete();
48689             }
48690             if (!_selected) {
48691               _selected = val;
48692             }
48693           }
48694           if (val.length) {
48695             var combo = container.selectAll(".combobox");
48696             if (combo.empty()) {
48697               show();
48698             }
48699           } else {
48700             hide();
48701           }
48702           render();
48703         });
48704       }
48705       function nav(dir) {
48706         if (_suggestions.length) {
48707           var index = -1;
48708           for (var i3 = 0; i3 < _suggestions.length; i3++) {
48709             if (_selected && _suggestions[i3].value === _selected) {
48710               index = i3;
48711               break;
48712             }
48713           }
48714           index = Math.max(Math.min(index + dir, _suggestions.length - 1), 0);
48715           _selected = _suggestions[index].value;
48716           utilGetSetValue(input, _selected);
48717           dispatch12.call("update");
48718         }
48719         render();
48720         ensureVisible();
48721       }
48722       function ensureVisible() {
48723         var _a5;
48724         var combo = container.selectAll(".combobox");
48725         if (combo.empty()) return;
48726         var containerRect = container.node().getBoundingClientRect();
48727         var comboRect = combo.node().getBoundingClientRect();
48728         if (comboRect.bottom > containerRect.bottom) {
48729           var node = attachTo ? attachTo.node() : input.node();
48730           node.scrollIntoView({ behavior: "instant", block: "center" });
48731           render();
48732         }
48733         var selected = combo.selectAll(".combobox-option.selected").node();
48734         if (selected) {
48735           (_a5 = selected.scrollIntoView) == null ? void 0 : _a5.call(selected, { behavior: "smooth", block: "nearest" });
48736         }
48737       }
48738       function value() {
48739         var value2 = input.property("value");
48740         var start2 = input.property("selectionStart");
48741         var end = input.property("selectionEnd");
48742         if (start2 && end) {
48743           value2 = value2.substring(0, start2);
48744         }
48745         return value2;
48746       }
48747       function fetchComboData(v3, cb) {
48748         _cancelFetch = false;
48749         _fetcher.call(input, v3, function(results, skipAutosuggest) {
48750           if (_cancelFetch) return;
48751           _suggestions = results;
48752           results.forEach(function(d2) {
48753             _fetched[d2.value] = d2;
48754           });
48755           if (cb) {
48756             cb(skipAutosuggest);
48757           }
48758         });
48759       }
48760       function tryAutocomplete() {
48761         if (!_canAutocomplete) return;
48762         var val = _caseSensitive ? value() : value().toLowerCase();
48763         if (!val) return;
48764         if (isFinite(val)) return;
48765         const suggestionValues = [];
48766         _suggestions.forEach((s2) => {
48767           suggestionValues.push(s2.value);
48768           if (s2.key && s2.key !== s2.value) {
48769             suggestionValues.push(s2.key);
48770           }
48771         });
48772         var bestIndex = -1;
48773         for (var i3 = 0; i3 < suggestionValues.length; i3++) {
48774           var suggestion = suggestionValues[i3];
48775           var compare2 = _caseSensitive ? suggestion : suggestion.toLowerCase();
48776           if (compare2 === val) {
48777             bestIndex = i3;
48778             break;
48779           } else if (bestIndex === -1 && compare2.indexOf(val) === 0) {
48780             bestIndex = i3;
48781           }
48782         }
48783         if (bestIndex !== -1) {
48784           var bestVal = suggestionValues[bestIndex];
48785           input.property("value", bestVal);
48786           input.node().setSelectionRange(val.length, bestVal.length);
48787           dispatch12.call("update");
48788           return bestVal;
48789         }
48790       }
48791       function render() {
48792         if (_suggestions.length < _minItems || document.activeElement !== input.node()) {
48793           hide();
48794           return;
48795         }
48796         var shown = !container.selectAll(".combobox").empty();
48797         if (!shown) return;
48798         var combo = container.selectAll(".combobox");
48799         var options = combo.selectAll(".combobox-option").data(_suggestions, function(d2) {
48800           return d2.value;
48801         });
48802         options.exit().remove();
48803         options.enter().append("a").attr("class", function(d2) {
48804           return "combobox-option " + (d2.klass || "");
48805         }).attr("title", function(d2) {
48806           return d2.title;
48807         }).each(function(d2) {
48808           if (d2.display) {
48809             d2.display(select_default2(this));
48810           } else {
48811             select_default2(this).text(d2.value);
48812           }
48813         }).on("mouseenter", _mouseEnterHandler).on("mouseleave", _mouseLeaveHandler).merge(options).classed("selected", function(d2) {
48814           return d2.value === _selected || d2.key === _selected;
48815         }).on("click.combo-option", accept).order();
48816         var node = attachTo ? attachTo.node() : input.node();
48817         var containerRect = container.node().getBoundingClientRect();
48818         var rect = node.getBoundingClientRect();
48819         combo.style("left", rect.left + 5 - containerRect.left + "px").style("width", rect.width - 10 + "px").style("top", rect.height + rect.top - containerRect.top + "px");
48820       }
48821       function accept(d3_event, d2) {
48822         _cancelFetch = true;
48823         var thiz = input.node();
48824         if (d2) {
48825           utilGetSetValue(input, d2.value);
48826           utilTriggerEvent(input, "change");
48827         }
48828         var val = utilGetSetValue(input);
48829         thiz.setSelectionRange(val.length, val.length);
48830         if (!d2) {
48831           d2 = _fetched[val];
48832         }
48833         dispatch12.call("accept", thiz, d2, val);
48834         hide();
48835       }
48836       function cancel() {
48837         _cancelFetch = true;
48838         var thiz = input.node();
48839         var val = utilGetSetValue(input);
48840         var start2 = input.property("selectionStart");
48841         var end = input.property("selectionEnd");
48842         val = val.slice(0, start2) + val.slice(end);
48843         utilGetSetValue(input, val);
48844         thiz.setSelectionRange(val.length, val.length);
48845         dispatch12.call("cancel", thiz);
48846         hide();
48847       }
48848     };
48849     combobox.canAutocomplete = function(val) {
48850       if (!arguments.length) return _canAutocomplete;
48851       _canAutocomplete = val;
48852       return combobox;
48853     };
48854     combobox.caseSensitive = function(val) {
48855       if (!arguments.length) return _caseSensitive;
48856       _caseSensitive = val;
48857       return combobox;
48858     };
48859     combobox.data = function(val) {
48860       if (!arguments.length) return _data;
48861       _data = val;
48862       return combobox;
48863     };
48864     combobox.fetcher = function(val) {
48865       if (!arguments.length) return _fetcher;
48866       _fetcher = val;
48867       return combobox;
48868     };
48869     combobox.minItems = function(val) {
48870       if (!arguments.length) return _minItems;
48871       _minItems = val;
48872       return combobox;
48873     };
48874     combobox.itemsMouseEnter = function(val) {
48875       if (!arguments.length) return _mouseEnterHandler;
48876       _mouseEnterHandler = val;
48877       return combobox;
48878     };
48879     combobox.itemsMouseLeave = function(val) {
48880       if (!arguments.length) return _mouseLeaveHandler;
48881       _mouseLeaveHandler = val;
48882       return combobox;
48883     };
48884     return utilRebind(combobox, dispatch12, "on");
48885   }
48886   function _hide(container) {
48887     if (_comboHideTimerID) {
48888       window.clearTimeout(_comboHideTimerID);
48889       _comboHideTimerID = void 0;
48890     }
48891     container.selectAll(".combobox").remove();
48892     container.on("scroll.combo-scroll", null);
48893   }
48894   uiCombobox.off = function(input, context) {
48895     _hide(context.container());
48896     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);
48897     context.container().on("scroll.combo-scroll", null);
48898   };
48899
48900   // modules/ui/toggle.js
48901   function uiToggle(show, callback) {
48902     return function(selection2) {
48903       selection2.style("opacity", show ? 0 : 1).classed("hide", false).transition().style("opacity", show ? 1 : 0).on("end", function() {
48904         select_default2(this).classed("hide", !show).style("opacity", null);
48905         if (callback) callback.apply(this);
48906       });
48907     };
48908   }
48909
48910   // modules/ui/disclosure.js
48911   function uiDisclosure(context, key, expandedDefault) {
48912     var dispatch12 = dispatch_default("toggled");
48913     var _expanded;
48914     var _label = utilFunctor("");
48915     var _updatePreference = true;
48916     var _content = function() {
48917     };
48918     var disclosure = function(selection2) {
48919       if (_expanded === void 0 || _expanded === null) {
48920         var preference = corePreferences("disclosure." + key + ".expanded");
48921         _expanded = preference === null ? !!expandedDefault : preference === "true";
48922       }
48923       var hideToggle = selection2.selectAll(".hide-toggle-" + key).data([0]);
48924       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"));
48925       hideToggleEnter.append("span").attr("class", "hide-toggle-text");
48926       hideToggle = hideToggleEnter.merge(hideToggle);
48927       hideToggle.on("click", toggle).attr("title", _t("icons.".concat(_expanded ? "collapse" : "expand"))).attr("aria-expanded", _expanded).classed("expanded", _expanded);
48928       const label = _label();
48929       const labelSelection = hideToggle.selectAll(".hide-toggle-text");
48930       if (typeof label !== "function") {
48931         labelSelection.text(_label());
48932       } else {
48933         labelSelection.text("").call(label);
48934       }
48935       hideToggle.selectAll(".hide-toggle-icon").attr(
48936         "xlink:href",
48937         _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
48938       );
48939       var wrap2 = selection2.selectAll(".disclosure-wrap").data([0]);
48940       wrap2 = wrap2.enter().append("div").attr("class", "disclosure-wrap disclosure-wrap-" + key).merge(wrap2).classed("hide", !_expanded);
48941       if (_expanded) {
48942         wrap2.call(_content);
48943       }
48944       function toggle(d3_event) {
48945         d3_event.preventDefault();
48946         _expanded = !_expanded;
48947         if (_updatePreference) {
48948           corePreferences("disclosure." + key + ".expanded", _expanded);
48949         }
48950         hideToggle.classed("expanded", _expanded).attr("aria-expanded", _expanded).attr("title", _t("icons.".concat(_expanded ? "collapse" : "expand")));
48951         hideToggle.selectAll(".hide-toggle-icon").attr(
48952           "xlink:href",
48953           _expanded ? "#iD-icon-down" : _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward"
48954         );
48955         wrap2.call(uiToggle(_expanded));
48956         if (_expanded) {
48957           wrap2.call(_content);
48958         }
48959         dispatch12.call("toggled", this, _expanded);
48960       }
48961     };
48962     disclosure.label = function(val) {
48963       if (!arguments.length) return _label;
48964       _label = utilFunctor(val);
48965       return disclosure;
48966     };
48967     disclosure.expanded = function(val) {
48968       if (!arguments.length) return _expanded;
48969       _expanded = val;
48970       return disclosure;
48971     };
48972     disclosure.updatePreference = function(val) {
48973       if (!arguments.length) return _updatePreference;
48974       _updatePreference = val;
48975       return disclosure;
48976     };
48977     disclosure.content = function(val) {
48978       if (!arguments.length) return _content;
48979       _content = val;
48980       return disclosure;
48981     };
48982     return utilRebind(disclosure, dispatch12, "on");
48983   }
48984
48985   // modules/ui/section.js
48986   function uiSection(id2, context) {
48987     var _classes = utilFunctor("");
48988     var _shouldDisplay;
48989     var _content;
48990     var _disclosure;
48991     var _label;
48992     var _expandedByDefault = utilFunctor(true);
48993     var _disclosureContent;
48994     var _disclosureExpanded;
48995     var _containerSelection = select_default2(null);
48996     var section = {
48997       id: id2
48998     };
48999     section.classes = function(val) {
49000       if (!arguments.length) return _classes;
49001       _classes = utilFunctor(val);
49002       return section;
49003     };
49004     section.label = function(val) {
49005       if (!arguments.length) return _label;
49006       _label = utilFunctor(val);
49007       return section;
49008     };
49009     section.expandedByDefault = function(val) {
49010       if (!arguments.length) return _expandedByDefault;
49011       _expandedByDefault = utilFunctor(val);
49012       return section;
49013     };
49014     section.shouldDisplay = function(val) {
49015       if (!arguments.length) return _shouldDisplay;
49016       _shouldDisplay = utilFunctor(val);
49017       return section;
49018     };
49019     section.content = function(val) {
49020       if (!arguments.length) return _content;
49021       _content = val;
49022       return section;
49023     };
49024     section.disclosureContent = function(val) {
49025       if (!arguments.length) return _disclosureContent;
49026       _disclosureContent = val;
49027       return section;
49028     };
49029     section.disclosureExpanded = function(val) {
49030       if (!arguments.length) return _disclosureExpanded;
49031       _disclosureExpanded = val;
49032       return section;
49033     };
49034     section.render = function(selection2) {
49035       _containerSelection = selection2.selectAll(".section-" + id2).data([0]);
49036       var sectionEnter = _containerSelection.enter().append("div").attr("class", "section section-" + id2 + " " + (_classes && _classes() || ""));
49037       _containerSelection = sectionEnter.merge(_containerSelection);
49038       _containerSelection.call(renderContent);
49039     };
49040     section.reRender = function() {
49041       _containerSelection.call(renderContent);
49042     };
49043     section.selection = function() {
49044       return _containerSelection;
49045     };
49046     section.disclosure = function() {
49047       return _disclosure;
49048     };
49049     function renderContent(selection2) {
49050       if (_shouldDisplay) {
49051         var shouldDisplay = _shouldDisplay();
49052         selection2.classed("hide", !shouldDisplay);
49053         if (!shouldDisplay) {
49054           selection2.html("");
49055           return;
49056         }
49057       }
49058       if (_disclosureContent) {
49059         if (!_disclosure) {
49060           _disclosure = uiDisclosure(context, id2.replace(/-/g, "_"), _expandedByDefault()).label(_label || "").content(_disclosureContent);
49061         }
49062         if (_disclosureExpanded !== void 0) {
49063           _disclosure.expanded(_disclosureExpanded);
49064           _disclosureExpanded = void 0;
49065         }
49066         selection2.call(_disclosure);
49067         return;
49068       }
49069       if (_content) {
49070         selection2.call(_content);
49071       }
49072     }
49073     return section;
49074   }
49075
49076   // modules/ui/tag_reference.js
49077   function uiTagReference(what) {
49078     var wikibase = what.qid ? services.wikidata : services.osmWikibase;
49079     var tagReference = {};
49080     var _button = select_default2(null);
49081     var _body = select_default2(null);
49082     var _loaded;
49083     var _showing;
49084     function load() {
49085       if (!wikibase) return;
49086       _button.classed("tag-reference-loading", true);
49087       wikibase.getDocs(what, gotDocs);
49088     }
49089     function gotDocs(err, docs) {
49090       _body.html("");
49091       if (!docs || !docs.title) {
49092         _body.append("p").attr("class", "tag-reference-description").call(_t.append("inspector.no_documentation_key"));
49093         done();
49094         return;
49095       }
49096       if (docs.imageURL) {
49097         _body.append("img").attr("class", "tag-reference-wiki-image").attr("alt", docs.title).attr("src", docs.imageURL).on("load", function() {
49098           done();
49099         }).on("error", function() {
49100           select_default2(this).remove();
49101           done();
49102         });
49103       } else {
49104         done();
49105       }
49106       var tagReferenceDescription = _body.append("p").attr("class", "tag-reference-description").append("span");
49107       if (docs.description) {
49108         tagReferenceDescription = tagReferenceDescription.attr("class", "localized-text").attr("lang", docs.descriptionLocaleCode || "und").call(docs.description);
49109       } else {
49110         tagReferenceDescription = tagReferenceDescription.call(_t.append("inspector.no_documentation_key"));
49111       }
49112       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"));
49113       if (docs.wiki) {
49114         _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));
49115       }
49116       if (what.key === "comment") {
49117         _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"));
49118       }
49119     }
49120     function done() {
49121       _loaded = true;
49122       _button.classed("tag-reference-loading", false);
49123       _body.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1");
49124       _showing = true;
49125       _button.selectAll("svg.icon use").each(function() {
49126         var iconUse = select_default2(this);
49127         if (iconUse.attr("href") === "#iD-icon-info") {
49128           iconUse.attr("href", "#iD-icon-info-filled");
49129         }
49130       });
49131     }
49132     function hide() {
49133       _body.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
49134         _body.classed("expanded", false);
49135       });
49136       _showing = false;
49137       _button.selectAll("svg.icon use").each(function() {
49138         var iconUse = select_default2(this);
49139         if (iconUse.attr("href") === "#iD-icon-info-filled") {
49140           iconUse.attr("href", "#iD-icon-info");
49141         }
49142       });
49143     }
49144     tagReference.button = function(selection2, klass, iconName) {
49145       _button = selection2.selectAll(".tag-reference-button").data([0]);
49146       _button = _button.enter().append("button").attr("class", "tag-reference-button " + (klass || "")).attr("title", _t("icons.information")).call(svgIcon("#iD-icon-" + (iconName || "inspect"))).merge(_button);
49147       _button.on("click", function(d3_event) {
49148         d3_event.stopPropagation();
49149         d3_event.preventDefault();
49150         this.blur();
49151         if (_showing) {
49152           hide();
49153         } else if (_loaded) {
49154           done();
49155         } else {
49156           load();
49157         }
49158       });
49159     };
49160     tagReference.body = function(selection2) {
49161       var itemID = what.qid || what.key + "-" + (what.value || "");
49162       _body = selection2.selectAll(".tag-reference-body").data([itemID], function(d2) {
49163         return d2;
49164       });
49165       _body.exit().remove();
49166       _body = _body.enter().append("div").attr("class", "tag-reference-body").style("max-height", "0").style("opacity", "0").merge(_body);
49167       if (_showing === false) {
49168         hide();
49169       }
49170     };
49171     tagReference.showing = function(val) {
49172       if (!arguments.length) return _showing;
49173       _showing = val;
49174       return tagReference;
49175     };
49176     return tagReference;
49177   }
49178
49179   // modules/ui/sections/raw_tag_editor.js
49180   function uiSectionRawTagEditor(id2, context) {
49181     var section = uiSection(id2, context).classes("raw-tag-editor").label(function() {
49182       var count = Object.keys(_tags).filter(function(d2) {
49183         return d2;
49184       }).length;
49185       return _t.append("inspector.title_count", { title: _t("inspector.tags"), count });
49186     }).expandedByDefault(false).disclosureContent(renderDisclosureContent);
49187     var taginfo = services.taginfo;
49188     var dispatch12 = dispatch_default("change");
49189     var availableViews = [
49190       { id: "list", icon: "#fas-th-list" },
49191       { id: "text", icon: "#fas-i-cursor" }
49192     ];
49193     let _discardTags = {};
49194     _mainFileFetcher.get("discarded").then((d2) => {
49195       _discardTags = d2;
49196     }).catch(() => {
49197     });
49198     var _tagView = corePreferences("raw-tag-editor-view") || "list";
49199     var _readOnlyTags = [];
49200     var _orderedKeys = [];
49201     var _pendingChange = null;
49202     var _state;
49203     var _presets;
49204     var _tags;
49205     var _entityIDs;
49206     var _didInteract = false;
49207     function interacted() {
49208       _didInteract = true;
49209     }
49210     function renderDisclosureContent(wrap2) {
49211       _orderedKeys = _orderedKeys.filter(function(key) {
49212         return _tags[key] !== void 0;
49213       });
49214       var all = Object.keys(_tags).sort();
49215       var missingKeys = utilArrayDifference(all, _orderedKeys);
49216       for (var i3 in missingKeys) {
49217         _orderedKeys.push(missingKeys[i3]);
49218       }
49219       var rowData = _orderedKeys.map(function(key, i4) {
49220         return { index: i4, key, value: _tags[key] };
49221       });
49222       rowData.push({ index: rowData.length, key: "", value: "" });
49223       var options = wrap2.selectAll(".raw-tag-options").data([0]);
49224       options.exit().remove();
49225       var optionsEnter = options.enter().insert("div", ":first-child").attr("class", "raw-tag-options").attr("role", "tablist");
49226       var optionEnter = optionsEnter.selectAll(".raw-tag-option").data(availableViews, function(d2) {
49227         return d2.id;
49228       }).enter();
49229       optionEnter.append("button").attr("class", function(d2) {
49230         return "raw-tag-option raw-tag-option-" + d2.id + (_tagView === d2.id ? " selected" : "");
49231       }).attr("aria-selected", function(d2) {
49232         return _tagView === d2.id;
49233       }).attr("role", "tab").attr("title", function(d2) {
49234         return _t("icons." + d2.id);
49235       }).on("click", function(d3_event, d2) {
49236         _tagView = d2.id;
49237         corePreferences("raw-tag-editor-view", d2.id);
49238         wrap2.selectAll(".raw-tag-option").classed("selected", function(datum2) {
49239           return datum2 === d2;
49240         }).attr("aria-selected", function(datum2) {
49241           return datum2 === d2;
49242         });
49243         wrap2.selectAll(".tag-text").classed("hide", d2.id !== "text").each(setTextareaHeight);
49244         wrap2.selectAll(".tag-list, .add-row").classed("hide", d2.id !== "list");
49245       }).each(function(d2) {
49246         select_default2(this).call(svgIcon(d2.icon));
49247       });
49248       var textData = rowsToText(rowData);
49249       var textarea = wrap2.selectAll(".tag-text").data([0]);
49250       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);
49251       textarea.call(utilGetSetValue, textData).each(setTextareaHeight).on("input", setTextareaHeight).on("focus", interacted).on("blur", textChanged).on("change", textChanged);
49252       var list = wrap2.selectAll(".tag-list").data([0]);
49253       list = list.enter().append("ul").attr("class", "tag-list" + (_tagView !== "list" ? " hide" : "")).merge(list);
49254       var items = list.selectAll(".tag-row").data(rowData, (d2) => d2.key);
49255       items.exit().each(unbind).remove();
49256       var itemsEnter = items.enter().append("li").attr("class", "tag-row").classed("readonly", isReadOnly);
49257       var innerWrap = itemsEnter.append("div").attr("class", "inner-wrap");
49258       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);
49259       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);
49260       innerWrap.append("button").attr("tabindex", -1).attr("class", "form-field-button remove").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
49261       items = items.merge(itemsEnter).sort(function(a2, b3) {
49262         return a2.index - b3.index;
49263       });
49264       items.classed("add-tag", (d2) => d2.key === "").each(function(d2) {
49265         var row = select_default2(this);
49266         var key = row.select("input.key");
49267         var value = row.select("input.value");
49268         if (_entityIDs && taginfo && _state !== "hover") {
49269           bindTypeahead(key, value);
49270         }
49271         var referenceOptions = { key: d2.key };
49272         if (typeof d2.value === "string") {
49273           referenceOptions.value = d2.value;
49274         }
49275         var reference = uiTagReference(referenceOptions, context);
49276         if (_state === "hover") {
49277           reference.showing(false);
49278         }
49279         row.select(".inner-wrap").call(reference.button).select(".tag-reference-button").attr("tabindex", -1).classed("disabled", (d4) => d4.key === "").attr("disabled", (d4) => d4.key === "" ? "disabled" : null);
49280         row.call(reference.body);
49281         row.select("button.remove");
49282       });
49283       items.selectAll("input.key").attr("title", function(d2) {
49284         return d2.key;
49285       }).attr("placeholder", function(d2) {
49286         return d2.key === "" ? _t("inspector.add_tag") : null;
49287       }).attr("readonly", function(d2) {
49288         return isReadOnly(d2) || null;
49289       }).call(
49290         utilGetSetValue,
49291         (d2) => d2.key,
49292         (_3, newKey) => _pendingChange === null || isEmpty_default(_pendingChange) || _pendingChange[newKey]
49293         // if there are pending changes: skip untouched tags
49294       );
49295       items.selectAll("input.value").attr("title", function(d2) {
49296         return Array.isArray(d2.value) ? d2.value.filter(Boolean).join("\n") : d2.value;
49297       }).classed("mixed", function(d2) {
49298         return Array.isArray(d2.value);
49299       }).attr("placeholder", function(d2) {
49300         return Array.isArray(d2.value) ? _t("inspector.multiple_values") : null;
49301       }).attr("readonly", function(d2) {
49302         return isReadOnly(d2) || null;
49303       }).call(utilGetSetValue, (d2) => {
49304         if (_pendingChange !== null && !isEmpty_default(_pendingChange) && !_pendingChange[d2.key]) {
49305           return null;
49306         }
49307         return Array.isArray(d2.value) ? "" : d2.value;
49308       });
49309       items.selectAll("button.remove").classed("disabled", (d2) => d2.key === "").on(
49310         ("PointerEvent" in window ? "pointer" : "mouse") + "down",
49311         // 'click' fires too late - #5878
49312         (d3_event, d2) => {
49313           if (d3_event.button !== 0) return;
49314           removeTag(d3_event, d2);
49315         }
49316       );
49317     }
49318     function isReadOnly(d2) {
49319       for (var i3 = 0; i3 < _readOnlyTags.length; i3++) {
49320         if (d2.key.match(_readOnlyTags[i3]) !== null) {
49321           return true;
49322         }
49323       }
49324       return false;
49325     }
49326     function setTextareaHeight() {
49327       if (_tagView !== "text") return;
49328       var selection2 = select_default2(this);
49329       var matches = selection2.node().value.match(/\n/g);
49330       var lineCount = 2 + Number(matches && matches.length);
49331       var lineHeight = 20;
49332       selection2.style("height", lineCount * lineHeight + "px");
49333     }
49334     function stringify3(s2) {
49335       const stringified = JSON.stringify(s2).slice(1, -1);
49336       if (stringified !== s2) {
49337         return '"'.concat(stringified, '"');
49338       } else {
49339         return s2;
49340       }
49341     }
49342     function unstringify(s2) {
49343       const isQuoted = s2.length > 1 && s2.charAt(0) === '"' && s2.charAt(s2.length - 1) === '"';
49344       if (isQuoted) {
49345         try {
49346           return JSON.parse(s2);
49347         } catch (e3) {
49348           return s2;
49349         }
49350       } else {
49351         return s2;
49352       }
49353     }
49354     function rowsToText(rows) {
49355       var str = rows.filter(function(row) {
49356         return row.key && row.key.trim() !== "";
49357       }).map(function(row) {
49358         var rawVal = row.value;
49359         if (Array.isArray(rawVal)) rawVal = "*";
49360         var val = rawVal ? stringify3(rawVal) : "";
49361         return stringify3(row.key) + "=" + val;
49362       }).join("\n");
49363       if (_state !== "hover" && str.length) {
49364         return str + "\n";
49365       }
49366       return str;
49367     }
49368     function textChanged() {
49369       var newText = this.value.trim();
49370       var newTags = {};
49371       newText.split("\n").forEach(function(row) {
49372         var m3 = row.match(/^\s*([^=]+)=(.*)$/);
49373         if (m3 !== null) {
49374           var k3 = context.cleanTagKey(unstringify(m3[1].trim()));
49375           var v3 = context.cleanTagValue(unstringify(m3[2].trim()));
49376           newTags[k3] = v3;
49377         }
49378       });
49379       var tagDiff = utilTagDiff(_tags, newTags);
49380       _pendingChange = _pendingChange || {};
49381       tagDiff.forEach(function(change) {
49382         if (isReadOnly({ key: change.key })) return;
49383         if (change.newVal === "*" && Array.isArray(change.oldVal)) return;
49384         if (change.type === "-") {
49385           _pendingChange[change.key] = void 0;
49386         } else if (change.type === "+") {
49387           _pendingChange[change.key] = change.newVal || "";
49388         }
49389       });
49390       if (isEmpty_default(_pendingChange)) {
49391         _pendingChange = null;
49392         section.reRender();
49393         return;
49394       }
49395       scheduleChange();
49396     }
49397     function bindTypeahead(key, value) {
49398       if (isReadOnly(key.datum())) return;
49399       if (Array.isArray(value.datum().value)) {
49400         value.call(uiCombobox(context, "tag-value").minItems(1).fetcher(function(value2, callback) {
49401           var keyString = utilGetSetValue(key);
49402           if (!_tags[keyString]) return;
49403           var data = _tags[keyString].map(function(tagValue) {
49404             if (!tagValue) {
49405               return {
49406                 value: " ",
49407                 title: _t("inspector.empty"),
49408                 display: (selection2) => selection2.text("").classed("virtual-option", true).call(_t.append("inspector.empty"))
49409               };
49410             }
49411             return {
49412               value: tagValue,
49413               title: tagValue
49414             };
49415           });
49416           callback(data);
49417         }));
49418         return;
49419       }
49420       var geometry = context.graph().geometry(_entityIDs[0]);
49421       key.call(uiCombobox(context, "tag-key").fetcher(function(value2, callback) {
49422         taginfo.keys({
49423           debounce: true,
49424           geometry,
49425           query: value2
49426         }, function(err, data) {
49427           if (!err) {
49428             const filtered = data.filter((d2) => _tags[d2.value] === void 0).filter((d2) => !(d2.value in _discardTags)).filter((d2) => !/_\d$/.test(d2)).filter((d2) => d2.value.toLowerCase().includes(value2.toLowerCase()));
49429             callback(sort(value2, filtered));
49430           }
49431         });
49432       }));
49433       value.call(uiCombobox(context, "tag-value").fetcher(function(value2, callback) {
49434         taginfo.values({
49435           debounce: true,
49436           key: utilGetSetValue(key),
49437           geometry,
49438           query: value2
49439         }, function(err, data) {
49440           if (!err) {
49441             const filtered = data.filter((d2) => d2.value.toLowerCase().includes(value2.toLowerCase()));
49442             callback(sort(value2, filtered));
49443           }
49444         });
49445       }).caseSensitive(allowUpperCaseTagValues.test(utilGetSetValue(key))));
49446       function sort(value2, data) {
49447         var sameletter = [];
49448         var other = [];
49449         for (var i3 = 0; i3 < data.length; i3++) {
49450           if (data[i3].value.substring(0, value2.length) === value2) {
49451             sameletter.push(data[i3]);
49452           } else {
49453             other.push(data[i3]);
49454           }
49455         }
49456         return sameletter.concat(other);
49457       }
49458     }
49459     function unbind() {
49460       var row = select_default2(this);
49461       row.selectAll("input.key").call(uiCombobox.off, context);
49462       row.selectAll("input.value").call(uiCombobox.off, context);
49463     }
49464     function keyChange(d3_event, d2) {
49465       const input = select_default2(this);
49466       if (input.attr("readonly")) return;
49467       var kOld = d2.key;
49468       if (_pendingChange && _pendingChange.hasOwnProperty(kOld) && _pendingChange[kOld] === void 0) return;
49469       var kNew = context.cleanTagKey(this.value.trim());
49470       if (isReadOnly({ key: kNew })) {
49471         this.value = kOld;
49472         return;
49473       }
49474       if (kNew !== this.value) {
49475         utilGetSetValue(input, kNew);
49476       }
49477       if (kNew && kNew !== kOld && _tags[kNew] !== void 0) {
49478         this.value = kOld;
49479         section.selection().selectAll(".tag-list input.value").each(function(d4) {
49480           if (d4.key === kNew) {
49481             var input2 = select_default2(this).node();
49482             input2.focus();
49483             input2.select();
49484           }
49485         });
49486         return;
49487       }
49488       _pendingChange = _pendingChange || {};
49489       if (kOld) {
49490         if (kOld === kNew) return;
49491         _pendingChange[kNew] = _pendingChange[kOld] || { oldKey: kOld };
49492         _pendingChange[kOld] = void 0;
49493       } else {
49494         let row = this.parentNode.parentNode;
49495         let inputVal = select_default2(row).selectAll("input.value");
49496         let vNew = context.cleanTagValue(utilGetSetValue(inputVal));
49497         _pendingChange[kNew] = vNew;
49498         utilGetSetValue(inputVal, vNew);
49499       }
49500       var existingKeyIndex = _orderedKeys.indexOf(kOld);
49501       if (existingKeyIndex !== -1) _orderedKeys[existingKeyIndex] = kNew;
49502       d2.key = kNew;
49503       this.value = kNew;
49504       scheduleChange();
49505     }
49506     function valueChange(d3_event, d2) {
49507       if (isReadOnly(d2)) return;
49508       if (Array.isArray(d2.value) && !this.value) return;
49509       if (_pendingChange && _pendingChange.hasOwnProperty(d2.key) && _pendingChange[d2.key] === void 0) return;
49510       _pendingChange = _pendingChange || {};
49511       const vNew = context.cleanTagValue(this.value);
49512       if (vNew !== this.value) {
49513         utilGetSetValue(select_default2(this), vNew);
49514       }
49515       _pendingChange[d2.key] = vNew;
49516       scheduleChange();
49517     }
49518     function removeTag(d3_event, d2) {
49519       if (isReadOnly(d2)) return;
49520       _orderedKeys = _orderedKeys.filter(function(key) {
49521         return key !== d2.key;
49522       });
49523       _pendingChange = _pendingChange || {};
49524       _pendingChange[d2.key] = void 0;
49525       scheduleChange();
49526     }
49527     function scheduleChange() {
49528       if (!_pendingChange) return;
49529       for (const key in _pendingChange) {
49530         _tags[key] = _pendingChange[key];
49531       }
49532       dispatch12.call("change", this, _entityIDs, _pendingChange);
49533       _pendingChange = null;
49534     }
49535     section.state = function(val) {
49536       if (!arguments.length) return _state;
49537       if (_state !== val) {
49538         _orderedKeys = [];
49539         _state = val;
49540       }
49541       return section;
49542     };
49543     section.presets = function(val) {
49544       if (!arguments.length) return _presets;
49545       _presets = val;
49546       if (_presets && _presets.length && _presets[0].isFallback()) {
49547         section.disclosureExpanded(true);
49548       } else if (!_didInteract) {
49549         section.disclosureExpanded(null);
49550       }
49551       return section;
49552     };
49553     section.tags = function(val) {
49554       if (!arguments.length) return _tags;
49555       _tags = val;
49556       return section;
49557     };
49558     section.entityIDs = function(val) {
49559       if (!arguments.length) return _entityIDs;
49560       if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
49561         _entityIDs = val;
49562         _orderedKeys = [];
49563       }
49564       return section;
49565     };
49566     section.readOnlyTags = function(val) {
49567       if (!arguments.length) return _readOnlyTags;
49568       _readOnlyTags = val;
49569       return section;
49570     };
49571     return utilRebind(section, dispatch12, "on");
49572   }
49573
49574   // modules/ui/data_editor.js
49575   function uiDataEditor(context) {
49576     var dataHeader = uiDataHeader();
49577     var rawTagEditor = uiSectionRawTagEditor("custom-data-tag-editor", context).expandedByDefault(true).readOnlyTags([/./]);
49578     var _datum;
49579     function dataEditor(selection2) {
49580       var header = selection2.selectAll(".header").data([0]);
49581       var headerEnter = header.enter().append("div").attr("class", "header fillL");
49582       headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
49583         context.enter(modeBrowse(context));
49584       }).call(svgIcon("#iD-icon-close"));
49585       headerEnter.append("h2").call(_t.append("map_data.title"));
49586       var body = selection2.selectAll(".body").data([0]);
49587       body = body.enter().append("div").attr("class", "body").merge(body);
49588       var editor = body.selectAll(".data-editor").data([0]);
49589       editor.enter().append("div").attr("class", "modal-section data-editor").merge(editor).call(dataHeader.datum(_datum));
49590       var rte = body.selectAll(".raw-tag-editor").data([0]);
49591       rte.enter().append("div").attr("class", "raw-tag-editor data-editor").merge(rte).call(
49592         rawTagEditor.tags(_datum && _datum.properties || {}).state("hover").render
49593       ).selectAll("textarea.tag-text").attr("readonly", true).classed("readonly", true);
49594     }
49595     dataEditor.datum = function(val) {
49596       if (!arguments.length) return _datum;
49597       _datum = val;
49598       return this;
49599     };
49600     return dataEditor;
49601   }
49602
49603   // modules/modes/select_data.js
49604   function modeSelectData(context, selectedDatum) {
49605     var mode = {
49606       id: "select-data",
49607       button: "browse"
49608     };
49609     var keybinding = utilKeybinding("select-data");
49610     var dataEditor = uiDataEditor(context);
49611     var behaviors = [
49612       behaviorBreathe(context),
49613       behaviorHover(context),
49614       behaviorSelect(context),
49615       behaviorLasso(context),
49616       modeDragNode(context).behavior,
49617       modeDragNote(context).behavior
49618     ];
49619     function selectData(d3_event, drawn) {
49620       var selection2 = context.surface().selectAll(".layer-mapdata .data" + selectedDatum.__featurehash__);
49621       if (selection2.empty()) {
49622         var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
49623         if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
49624           context.enter(modeBrowse(context));
49625         }
49626       } else {
49627         selection2.classed("selected", true);
49628       }
49629     }
49630     function esc() {
49631       if (context.container().select(".combobox").size()) return;
49632       context.enter(modeBrowse(context));
49633     }
49634     mode.zoomToSelected = function() {
49635       var extent = geoExtent(bounds_default(selectedDatum));
49636       context.map().centerZoomEase(extent.center(), context.map().trimmedExtentZoom(extent));
49637     };
49638     mode.enter = function() {
49639       behaviors.forEach(context.install);
49640       keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
49641       select_default2(document).call(keybinding);
49642       selectData();
49643       var sidebar = context.ui().sidebar;
49644       sidebar.show(dataEditor.datum(selectedDatum));
49645       var extent = geoExtent(bounds_default(selectedDatum));
49646       sidebar.expand(sidebar.intersects(extent));
49647       context.map().on("drawn.select-data", selectData);
49648     };
49649     mode.exit = function() {
49650       behaviors.forEach(context.uninstall);
49651       select_default2(document).call(keybinding.unbind);
49652       context.surface().selectAll(".layer-mapdata .selected").classed("selected hover", false);
49653       context.map().on("drawn.select-data", null);
49654       context.ui().sidebar.hide();
49655     };
49656     return mode;
49657   }
49658
49659   // modules/ui/keepRight_details.js
49660   function uiKeepRightDetails(context) {
49661     let _qaItem;
49662     function issueDetail(d2) {
49663       const { itemType, parentIssueType } = d2;
49664       const unknown = { html: _t.html("inspector.unknown") };
49665       let replacements = d2.replacements || {};
49666       replacements.default = unknown;
49667       if (_mainLocalizer.hasTextForStringId("QA.keepRight.errorTypes.".concat(itemType, ".title"))) {
49668         return _t.html("QA.keepRight.errorTypes.".concat(itemType, ".description"), replacements);
49669       } else {
49670         return _t.html("QA.keepRight.errorTypes.".concat(parentIssueType, ".description"), replacements);
49671       }
49672     }
49673     function keepRightDetails(selection2) {
49674       const details = selection2.selectAll(".error-details").data(
49675         _qaItem ? [_qaItem] : [],
49676         (d2) => "".concat(d2.id, "-").concat(d2.status || 0)
49677       );
49678       details.exit().remove();
49679       const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
49680       const descriptionEnter = detailsEnter.append("div").attr("class", "qa-details-subsection");
49681       descriptionEnter.append("h4").call(_t.append("QA.keepRight.detail_description"));
49682       descriptionEnter.append("div").attr("class", "qa-details-description-text").html(issueDetail);
49683       let relatedEntities = [];
49684       descriptionEnter.selectAll(".error_entity_link, .error_object_link").attr("href", "#").each(function() {
49685         const link2 = select_default2(this);
49686         const isObjectLink = link2.classed("error_object_link");
49687         const entityID = isObjectLink ? utilEntityRoot(_qaItem.objectType) + _qaItem.objectId : this.textContent;
49688         const entity = context.hasEntity(entityID);
49689         relatedEntities.push(entityID);
49690         link2.on("mouseenter", () => {
49691           utilHighlightEntities([entityID], true, context);
49692         }).on("mouseleave", () => {
49693           utilHighlightEntities([entityID], false, context);
49694         }).on("click", (d3_event) => {
49695           d3_event.preventDefault();
49696           utilHighlightEntities([entityID], false, context);
49697           const osmlayer = context.layers().layer("osm");
49698           if (!osmlayer.enabled()) {
49699             osmlayer.enabled(true);
49700           }
49701           context.map().centerZoomEase(_qaItem.loc, 20);
49702           if (entity) {
49703             context.enter(modeSelect(context, [entityID]));
49704           } else {
49705             context.loadEntity(entityID, (err, result) => {
49706               if (err) return;
49707               const entity2 = result.data.find((e3) => e3.id === entityID);
49708               if (entity2) context.enter(modeSelect(context, [entityID]));
49709             });
49710           }
49711         });
49712         if (entity) {
49713           let name = utilDisplayName(entity);
49714           if (!name && !isObjectLink) {
49715             const preset = _mainPresetIndex.match(entity, context.graph());
49716             name = preset && !preset.isFallback() && preset.name();
49717           }
49718           if (name) {
49719             this.innerText = name;
49720           }
49721         }
49722       });
49723       context.features().forceVisible(relatedEntities);
49724       context.map().pan([0, 0]);
49725     }
49726     keepRightDetails.issue = function(val) {
49727       if (!arguments.length) return _qaItem;
49728       _qaItem = val;
49729       return keepRightDetails;
49730     };
49731     return keepRightDetails;
49732   }
49733
49734   // modules/ui/keepRight_header.js
49735   function uiKeepRightHeader() {
49736     let _qaItem;
49737     function issueTitle(d2) {
49738       const { itemType, parentIssueType } = d2;
49739       const unknown = _t.html("inspector.unknown");
49740       let replacements = d2.replacements || {};
49741       replacements.default = { html: unknown };
49742       if (_mainLocalizer.hasTextForStringId("QA.keepRight.errorTypes.".concat(itemType, ".title"))) {
49743         return _t.html("QA.keepRight.errorTypes.".concat(itemType, ".title"), replacements);
49744       } else {
49745         return _t.html("QA.keepRight.errorTypes.".concat(parentIssueType, ".title"), replacements);
49746       }
49747     }
49748     function keepRightHeader(selection2) {
49749       const header = selection2.selectAll(".qa-header").data(
49750         _qaItem ? [_qaItem] : [],
49751         (d2) => "".concat(d2.id, "-").concat(d2.status || 0)
49752       );
49753       header.exit().remove();
49754       const headerEnter = header.enter().append("div").attr("class", "qa-header");
49755       const iconEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d2) => d2.id < 0);
49756       iconEnter.append("div").attr("class", (d2) => "preset-icon-28 qaItem ".concat(d2.service, " itemId-").concat(d2.id, " itemType-").concat(d2.parentIssueType)).call(svgIcon("#iD-icon-bolt", "qaItem-fill"));
49757       headerEnter.append("div").attr("class", "qa-header-label").html(issueTitle);
49758     }
49759     keepRightHeader.issue = function(val) {
49760       if (!arguments.length) return _qaItem;
49761       _qaItem = val;
49762       return keepRightHeader;
49763     };
49764     return keepRightHeader;
49765   }
49766
49767   // modules/ui/view_on_keepRight.js
49768   function uiViewOnKeepRight() {
49769     let _qaItem;
49770     function viewOnKeepRight(selection2) {
49771       let url;
49772       if (services.keepRight && _qaItem instanceof QAItem) {
49773         url = services.keepRight.issueURL(_qaItem);
49774       }
49775       const link2 = selection2.selectAll(".view-on-keepRight").data(url ? [url] : []);
49776       link2.exit().remove();
49777       const linkEnter = link2.enter().append("a").attr("class", "view-on-keepRight").attr("target", "_blank").attr("rel", "noopener").attr("href", (d2) => d2).call(svgIcon("#iD-icon-out-link", "inline"));
49778       linkEnter.append("span").call(_t.append("inspector.view_on_keepRight"));
49779     }
49780     viewOnKeepRight.what = function(val) {
49781       if (!arguments.length) return _qaItem;
49782       _qaItem = val;
49783       return viewOnKeepRight;
49784     };
49785     return viewOnKeepRight;
49786   }
49787
49788   // modules/ui/keepRight_editor.js
49789   function uiKeepRightEditor(context) {
49790     const dispatch12 = dispatch_default("change");
49791     const qaDetails = uiKeepRightDetails(context);
49792     const qaHeader = uiKeepRightHeader(context);
49793     let _qaItem;
49794     function keepRightEditor(selection2) {
49795       const headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
49796       headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
49797       headerEnter.append("h2").call(_t.append("QA.keepRight.title"));
49798       let body = selection2.selectAll(".body").data([0]);
49799       body = body.enter().append("div").attr("class", "body").merge(body);
49800       const editor = body.selectAll(".qa-editor").data([0]);
49801       editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(keepRightSaveSection);
49802       const footer = selection2.selectAll(".footer").data([0]);
49803       footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnKeepRight(context).what(_qaItem));
49804     }
49805     function keepRightSaveSection(selection2) {
49806       const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
49807       const isShown = _qaItem && (isSelected || _qaItem.newComment || _qaItem.comment);
49808       let saveSection = selection2.selectAll(".qa-save").data(
49809         isShown ? [_qaItem] : [],
49810         (d2) => "".concat(d2.id, "-").concat(d2.status || 0)
49811       );
49812       saveSection.exit().remove();
49813       const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
49814       saveSectionEnter.append("h4").attr("class", ".qa-save-header").call(_t.append("QA.keepRight.comment"));
49815       saveSectionEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("QA.keepRight.comment_placeholder")).attr("maxlength", 1e3).property("value", (d2) => d2.newComment || d2.comment).call(utilNoAuto).on("input", changeInput).on("blur", changeInput);
49816       saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
49817       function changeInput() {
49818         const input = select_default2(this);
49819         let val = input.property("value").trim();
49820         if (val === _qaItem.comment) {
49821           val = void 0;
49822         }
49823         _qaItem = _qaItem.update({ newComment: val });
49824         const qaService = services.keepRight;
49825         if (qaService) {
49826           qaService.replaceItem(_qaItem);
49827         }
49828         saveSection.call(qaSaveButtons);
49829       }
49830     }
49831     function qaSaveButtons(selection2) {
49832       const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
49833       let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
49834       buttonSection.exit().remove();
49835       const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
49836       buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("QA.keepRight.save_comment"));
49837       buttonEnter.append("button").attr("class", "button close-button action");
49838       buttonEnter.append("button").attr("class", "button ignore-button action");
49839       buttonSection = buttonSection.merge(buttonEnter);
49840       buttonSection.select(".comment-button").attr("disabled", (d2) => d2.newComment ? null : true).on("click.comment", function(d3_event, d2) {
49841         this.blur();
49842         const qaService = services.keepRight;
49843         if (qaService) {
49844           qaService.postUpdate(d2, (err, item) => dispatch12.call("change", item));
49845         }
49846       });
49847       buttonSection.select(".close-button").html((d2) => {
49848         const andComment = d2.newComment ? "_comment" : "";
49849         return _t.html("QA.keepRight.close".concat(andComment));
49850       }).on("click.close", function(d3_event, d2) {
49851         this.blur();
49852         const qaService = services.keepRight;
49853         if (qaService) {
49854           d2.newStatus = "ignore_t";
49855           qaService.postUpdate(d2, (err, item) => dispatch12.call("change", item));
49856         }
49857       });
49858       buttonSection.select(".ignore-button").html((d2) => {
49859         const andComment = d2.newComment ? "_comment" : "";
49860         return _t.html("QA.keepRight.ignore".concat(andComment));
49861       }).on("click.ignore", function(d3_event, d2) {
49862         this.blur();
49863         const qaService = services.keepRight;
49864         if (qaService) {
49865           d2.newStatus = "ignore";
49866           qaService.postUpdate(d2, (err, item) => dispatch12.call("change", item));
49867         }
49868       });
49869     }
49870     keepRightEditor.error = function(val) {
49871       if (!arguments.length) return _qaItem;
49872       _qaItem = val;
49873       return keepRightEditor;
49874     };
49875     return utilRebind(keepRightEditor, dispatch12, "on");
49876   }
49877
49878   // modules/ui/osmose_details.js
49879   function uiOsmoseDetails(context) {
49880     let _qaItem;
49881     function issueString(d2, type2) {
49882       if (!d2) return "";
49883       const s2 = services.osmose.getStrings(d2.itemType);
49884       return type2 in s2 ? s2[type2] : "";
49885     }
49886     function osmoseDetails(selection2) {
49887       const details = selection2.selectAll(".error-details").data(
49888         _qaItem ? [_qaItem] : [],
49889         (d2) => "".concat(d2.id, "-").concat(d2.status || 0)
49890       );
49891       details.exit().remove();
49892       const detailsEnter = details.enter().append("div").attr("class", "error-details qa-details-container");
49893       if (issueString(_qaItem, "detail")) {
49894         const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
49895         div.append("h4").call(_t.append("QA.keepRight.detail_description"));
49896         div.append("p").attr("class", "qa-details-description-text").html((d2) => issueString(d2, "detail")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49897       }
49898       const detailsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
49899       const elemsDiv = detailsEnter.append("div").attr("class", "qa-details-subsection");
49900       if (issueString(_qaItem, "fix")) {
49901         const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
49902         div.append("h4").call(_t.append("QA.osmose.fix_title"));
49903         div.append("p").html((d2) => issueString(d2, "fix")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49904       }
49905       if (issueString(_qaItem, "trap")) {
49906         const div = detailsEnter.append("div").attr("class", "qa-details-subsection");
49907         div.append("h4").call(_t.append("QA.osmose.trap_title"));
49908         div.append("p").html((d2) => issueString(d2, "trap")).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49909       }
49910       const thisItem = _qaItem;
49911       services.osmose.loadIssueDetail(_qaItem).then((d2) => {
49912         if (!d2.elems || d2.elems.length === 0) return;
49913         if (context.selectedErrorID() !== thisItem.id && context.container().selectAll(".qaItem.osmose.hover.itemId-".concat(thisItem.id)).empty()) return;
49914         if (d2.detail) {
49915           detailsDiv.append("h4").call(_t.append("QA.osmose.detail_title"));
49916           detailsDiv.append("p").html((d4) => d4.detail).selectAll("a").attr("rel", "noopener").attr("target", "_blank");
49917         }
49918         elemsDiv.append("h4").call(_t.append("QA.osmose.elems_title"));
49919         elemsDiv.append("ul").selectAll("li").data(d2.elems).enter().append("li").append("a").attr("href", "#").attr("class", "error_entity_link").text((d4) => d4).each(function() {
49920           const link2 = select_default2(this);
49921           const entityID = this.textContent;
49922           const entity = context.hasEntity(entityID);
49923           link2.on("mouseenter", () => {
49924             utilHighlightEntities([entityID], true, context);
49925           }).on("mouseleave", () => {
49926             utilHighlightEntities([entityID], false, context);
49927           }).on("click", (d3_event) => {
49928             d3_event.preventDefault();
49929             utilHighlightEntities([entityID], false, context);
49930             const osmlayer = context.layers().layer("osm");
49931             if (!osmlayer.enabled()) {
49932               osmlayer.enabled(true);
49933             }
49934             context.map().centerZoom(d2.loc, 20);
49935             if (entity) {
49936               context.enter(modeSelect(context, [entityID]));
49937             } else {
49938               context.loadEntity(entityID, (err, result) => {
49939                 if (err) return;
49940                 const entity2 = result.data.find((e3) => e3.id === entityID);
49941                 if (entity2) context.enter(modeSelect(context, [entityID]));
49942               });
49943             }
49944           });
49945           if (entity) {
49946             let name = utilDisplayName(entity);
49947             if (!name) {
49948               const preset = _mainPresetIndex.match(entity, context.graph());
49949               name = preset && !preset.isFallback() && preset.name();
49950             }
49951             if (name) {
49952               this.innerText = name;
49953             }
49954           }
49955         });
49956         context.features().forceVisible(d2.elems);
49957         context.map().pan([0, 0]);
49958       }).catch((err) => {
49959         console.log(err);
49960       });
49961     }
49962     osmoseDetails.issue = function(val) {
49963       if (!arguments.length) return _qaItem;
49964       _qaItem = val;
49965       return osmoseDetails;
49966     };
49967     return osmoseDetails;
49968   }
49969
49970   // modules/ui/osmose_header.js
49971   function uiOsmoseHeader() {
49972     let _qaItem;
49973     function issueTitle(d2) {
49974       const unknown = _t("inspector.unknown");
49975       if (!d2) return unknown;
49976       const s2 = services.osmose.getStrings(d2.itemType);
49977       return "title" in s2 ? s2.title : unknown;
49978     }
49979     function osmoseHeader(selection2) {
49980       const header = selection2.selectAll(".qa-header").data(
49981         _qaItem ? [_qaItem] : [],
49982         (d2) => "".concat(d2.id, "-").concat(d2.status || 0)
49983       );
49984       header.exit().remove();
49985       const headerEnter = header.enter().append("div").attr("class", "qa-header");
49986       const svgEnter = headerEnter.append("div").attr("class", "qa-header-icon").classed("new", (d2) => d2.id < 0).append("svg").attr("width", "20px").attr("height", "30px").attr("viewbox", "0 0 20 30").attr("class", (d2) => "preset-icon-28 qaItem ".concat(d2.service, " itemId-").concat(d2.id, " itemType-").concat(d2.itemType));
49987       svgEnter.append("polygon").attr("fill", (d2) => services.osmose.getColor(d2.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");
49988       svgEnter.append("use").attr("class", "icon-annotation").attr("width", "12px").attr("height", "12px").attr("transform", "translate(4, 5.5)").attr("xlink:href", (d2) => d2.icon ? "#" + d2.icon : "");
49989       headerEnter.append("div").attr("class", "qa-header-label").text(issueTitle);
49990     }
49991     osmoseHeader.issue = function(val) {
49992       if (!arguments.length) return _qaItem;
49993       _qaItem = val;
49994       return osmoseHeader;
49995     };
49996     return osmoseHeader;
49997   }
49998
49999   // modules/ui/view_on_osmose.js
50000   function uiViewOnOsmose() {
50001     let _qaItem;
50002     function viewOnOsmose(selection2) {
50003       let url;
50004       if (services.osmose && _qaItem instanceof QAItem) {
50005         url = services.osmose.itemURL(_qaItem);
50006       }
50007       const link2 = selection2.selectAll(".view-on-osmose").data(url ? [url] : []);
50008       link2.exit().remove();
50009       const linkEnter = link2.enter().append("a").attr("class", "view-on-osmose").attr("target", "_blank").attr("rel", "noopener").attr("href", (d2) => d2).call(svgIcon("#iD-icon-out-link", "inline"));
50010       linkEnter.append("span").call(_t.append("inspector.view_on_osmose"));
50011     }
50012     viewOnOsmose.what = function(val) {
50013       if (!arguments.length) return _qaItem;
50014       _qaItem = val;
50015       return viewOnOsmose;
50016     };
50017     return viewOnOsmose;
50018   }
50019
50020   // modules/ui/osmose_editor.js
50021   function uiOsmoseEditor(context) {
50022     const dispatch12 = dispatch_default("change");
50023     const qaDetails = uiOsmoseDetails(context);
50024     const qaHeader = uiOsmoseHeader(context);
50025     let _qaItem;
50026     function osmoseEditor(selection2) {
50027       const header = selection2.selectAll(".header").data([0]);
50028       const headerEnter = header.enter().append("div").attr("class", "header fillL");
50029       headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => context.enter(modeBrowse(context))).call(svgIcon("#iD-icon-close"));
50030       headerEnter.append("h2").call(_t.append("QA.osmose.title"));
50031       let body = selection2.selectAll(".body").data([0]);
50032       body = body.enter().append("div").attr("class", "body").merge(body);
50033       let editor = body.selectAll(".qa-editor").data([0]);
50034       editor.enter().append("div").attr("class", "modal-section qa-editor").merge(editor).call(qaHeader.issue(_qaItem)).call(qaDetails.issue(_qaItem)).call(osmoseSaveSection);
50035       const footer = selection2.selectAll(".footer").data([0]);
50036       footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOsmose(context).what(_qaItem));
50037     }
50038     function osmoseSaveSection(selection2) {
50039       const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
50040       const isShown = _qaItem && isSelected;
50041       let saveSection = selection2.selectAll(".qa-save").data(
50042         isShown ? [_qaItem] : [],
50043         (d2) => "".concat(d2.id, "-").concat(d2.status || 0)
50044       );
50045       saveSection.exit().remove();
50046       const saveSectionEnter = saveSection.enter().append("div").attr("class", "qa-save save-section cf");
50047       saveSection = saveSectionEnter.merge(saveSection).call(qaSaveButtons);
50048     }
50049     function qaSaveButtons(selection2) {
50050       const isSelected = _qaItem && _qaItem.id === context.selectedErrorID();
50051       let buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_qaItem] : [], (d2) => d2.status + d2.id);
50052       buttonSection.exit().remove();
50053       const buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
50054       buttonEnter.append("button").attr("class", "button close-button action");
50055       buttonEnter.append("button").attr("class", "button ignore-button action");
50056       buttonSection = buttonSection.merge(buttonEnter);
50057       buttonSection.select(".close-button").call(_t.append("QA.keepRight.close")).on("click.close", function(d3_event, d2) {
50058         this.blur();
50059         const qaService = services.osmose;
50060         if (qaService) {
50061           d2.newStatus = "done";
50062           qaService.postUpdate(d2, (err, item) => dispatch12.call("change", item));
50063         }
50064       });
50065       buttonSection.select(".ignore-button").call(_t.append("QA.keepRight.ignore")).on("click.ignore", function(d3_event, d2) {
50066         this.blur();
50067         const qaService = services.osmose;
50068         if (qaService) {
50069           d2.newStatus = "false";
50070           qaService.postUpdate(d2, (err, item) => dispatch12.call("change", item));
50071         }
50072       });
50073     }
50074     osmoseEditor.error = function(val) {
50075       if (!arguments.length) return _qaItem;
50076       _qaItem = val;
50077       return osmoseEditor;
50078     };
50079     return utilRebind(osmoseEditor, dispatch12, "on");
50080   }
50081
50082   // modules/modes/select_error.js
50083   function modeSelectError(context, selectedErrorID, selectedErrorService) {
50084     var mode = {
50085       id: "select-error",
50086       button: "browse"
50087     };
50088     var keybinding = utilKeybinding("select-error");
50089     var errorService = services[selectedErrorService];
50090     var errorEditor;
50091     switch (selectedErrorService) {
50092       case "keepRight":
50093         errorEditor = uiKeepRightEditor(context).on("change", function() {
50094           context.map().pan([0, 0]);
50095           var error = checkSelectedID();
50096           if (!error) return;
50097           context.ui().sidebar.show(errorEditor.error(error));
50098         });
50099         break;
50100       case "osmose":
50101         errorEditor = uiOsmoseEditor(context).on("change", function() {
50102           context.map().pan([0, 0]);
50103           var error = checkSelectedID();
50104           if (!error) return;
50105           context.ui().sidebar.show(errorEditor.error(error));
50106         });
50107         break;
50108     }
50109     var behaviors = [
50110       behaviorBreathe(context),
50111       behaviorHover(context),
50112       behaviorSelect(context),
50113       behaviorLasso(context),
50114       modeDragNode(context).behavior,
50115       modeDragNote(context).behavior
50116     ];
50117     function checkSelectedID() {
50118       if (!errorService) return;
50119       var error = errorService.getError(selectedErrorID);
50120       if (!error) {
50121         context.enter(modeBrowse(context));
50122       }
50123       return error;
50124     }
50125     mode.zoomToSelected = function() {
50126       if (!errorService) return;
50127       var error = errorService.getError(selectedErrorID);
50128       if (error) {
50129         context.map().centerZoomEase(error.loc, 20);
50130       }
50131     };
50132     mode.enter = function() {
50133       var error = checkSelectedID();
50134       if (!error) return;
50135       behaviors.forEach(context.install);
50136       keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
50137       select_default2(document).call(keybinding);
50138       selectError();
50139       var sidebar = context.ui().sidebar;
50140       sidebar.show(errorEditor.error(error));
50141       context.map().on("drawn.select-error", selectError);
50142       function selectError(d3_event, drawn) {
50143         if (!checkSelectedID()) return;
50144         var selection2 = context.surface().selectAll(".itemId-" + selectedErrorID + "." + selectedErrorService);
50145         if (selection2.empty()) {
50146           var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
50147           if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
50148             context.enter(modeBrowse(context));
50149           }
50150         } else {
50151           selection2.classed("selected", true);
50152           context.selectedErrorID(selectedErrorID);
50153         }
50154       }
50155       function esc() {
50156         if (context.container().select(".combobox").size()) return;
50157         context.enter(modeBrowse(context));
50158       }
50159     };
50160     mode.exit = function() {
50161       behaviors.forEach(context.uninstall);
50162       select_default2(document).call(keybinding.unbind);
50163       context.surface().selectAll(".qaItem.selected").classed("selected hover", false);
50164       context.map().on("drawn.select-error", null);
50165       context.ui().sidebar.hide();
50166       context.selectedErrorID(null);
50167       context.features().forceVisible([]);
50168     };
50169     return mode;
50170   }
50171
50172   // modules/behavior/select.js
50173   function behaviorSelect(context) {
50174     var _tolerancePx = 4;
50175     var _lastMouseEvent = null;
50176     var _showMenu = false;
50177     var _downPointers = {};
50178     var _longPressTimeout = null;
50179     var _lastInteractionType = null;
50180     var _multiselectionPointerId = null;
50181     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
50182     function keydown(d3_event) {
50183       if (d3_event.keyCode === 32) {
50184         var activeNode = document.activeElement;
50185         if (activeNode && (/* @__PURE__ */ new Set(["INPUT", "TEXTAREA"])).has(activeNode.nodeName)) return;
50186       }
50187       if (d3_event.keyCode === 93 || // context menu key
50188       d3_event.keyCode === 32) {
50189         d3_event.preventDefault();
50190       }
50191       if (d3_event.repeat) return;
50192       cancelLongPress();
50193       if (d3_event.shiftKey) {
50194         context.surface().classed("behavior-multiselect", true);
50195       }
50196       if (d3_event.keyCode === 32) {
50197         if (!_downPointers.spacebar && _lastMouseEvent) {
50198           cancelLongPress();
50199           _longPressTimeout = window.setTimeout(didLongPress, 500, "spacebar", "spacebar");
50200           _downPointers.spacebar = {
50201             firstEvent: _lastMouseEvent,
50202             lastEvent: _lastMouseEvent
50203           };
50204         }
50205       }
50206     }
50207     function keyup(d3_event) {
50208       cancelLongPress();
50209       if (!d3_event.shiftKey) {
50210         context.surface().classed("behavior-multiselect", false);
50211       }
50212       if (d3_event.keyCode === 93) {
50213         d3_event.preventDefault();
50214         _lastInteractionType = "menukey";
50215         contextmenu(d3_event);
50216       } else if (d3_event.keyCode === 32) {
50217         var pointer = _downPointers.spacebar;
50218         if (pointer) {
50219           delete _downPointers.spacebar;
50220           if (pointer.done) return;
50221           d3_event.preventDefault();
50222           _lastInteractionType = "spacebar";
50223           click(pointer.firstEvent, pointer.lastEvent, "spacebar");
50224         }
50225       }
50226     }
50227     function pointerdown(d3_event) {
50228       var id2 = (d3_event.pointerId || "mouse").toString();
50229       cancelLongPress();
50230       if (d3_event.buttons && d3_event.buttons !== 1) return;
50231       context.ui().closeEditMenu();
50232       if (d3_event.pointerType !== "mouse") {
50233         _longPressTimeout = window.setTimeout(didLongPress, 500, id2, "longdown-" + (d3_event.pointerType || "mouse"));
50234       }
50235       _downPointers[id2] = {
50236         firstEvent: d3_event,
50237         lastEvent: d3_event
50238       };
50239     }
50240     function didLongPress(id2, interactionType) {
50241       var pointer = _downPointers[id2];
50242       if (!pointer) return;
50243       for (var i3 in _downPointers) {
50244         _downPointers[i3].done = true;
50245       }
50246       _longPressTimeout = null;
50247       _lastInteractionType = interactionType;
50248       _showMenu = true;
50249       click(pointer.firstEvent, pointer.lastEvent, id2);
50250     }
50251     function pointermove(d3_event) {
50252       var id2 = (d3_event.pointerId || "mouse").toString();
50253       if (_downPointers[id2]) {
50254         _downPointers[id2].lastEvent = d3_event;
50255       }
50256       if (!d3_event.pointerType || d3_event.pointerType === "mouse") {
50257         _lastMouseEvent = d3_event;
50258         if (_downPointers.spacebar) {
50259           _downPointers.spacebar.lastEvent = d3_event;
50260         }
50261       }
50262     }
50263     function pointerup(d3_event) {
50264       var id2 = (d3_event.pointerId || "mouse").toString();
50265       var pointer = _downPointers[id2];
50266       if (!pointer) return;
50267       delete _downPointers[id2];
50268       if (_multiselectionPointerId === id2) {
50269         _multiselectionPointerId = null;
50270       }
50271       if (pointer.done) return;
50272       click(pointer.firstEvent, d3_event, id2);
50273     }
50274     function pointercancel(d3_event) {
50275       var id2 = (d3_event.pointerId || "mouse").toString();
50276       if (!_downPointers[id2]) return;
50277       delete _downPointers[id2];
50278       if (_multiselectionPointerId === id2) {
50279         _multiselectionPointerId = null;
50280       }
50281     }
50282     function contextmenu(d3_event) {
50283       d3_event.preventDefault();
50284       if (!+d3_event.clientX && !+d3_event.clientY) {
50285         if (_lastMouseEvent) {
50286           d3_event = _lastMouseEvent;
50287         } else {
50288           return;
50289         }
50290       } else {
50291         _lastMouseEvent = d3_event;
50292         if (d3_event.pointerType === "touch" || d3_event.pointerType === "pen" || d3_event.mozInputSource && // firefox doesn't give a pointerType on contextmenu events
50293         (d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_TOUCH || d3_event.mozInputSource === MouseEvent.MOZ_SOURCE_PEN)) {
50294           _lastInteractionType = "touch";
50295         } else {
50296           _lastInteractionType = "rightclick";
50297         }
50298       }
50299       _showMenu = true;
50300       click(d3_event, d3_event);
50301     }
50302     function click(firstEvent, lastEvent, pointerId) {
50303       cancelLongPress();
50304       var mapNode = context.container().select(".main-map").node();
50305       var pointGetter = utilFastMouse(mapNode);
50306       var p1 = pointGetter(firstEvent);
50307       var p2 = pointGetter(lastEvent);
50308       var dist = geoVecLength(p1, p2);
50309       if (dist > _tolerancePx || !mapContains(lastEvent)) {
50310         resetProperties();
50311         return;
50312       }
50313       var targetDatum = lastEvent.target.__data__;
50314       if (targetDatum === 0 && lastEvent.target.parentNode.__data__) {
50315         targetDatum = lastEvent.target.parentNode.__data__;
50316       }
50317       var multiselectEntityId;
50318       if (!_multiselectionPointerId) {
50319         var selectPointerInfo = pointerDownOnSelection(pointerId);
50320         if (selectPointerInfo) {
50321           _multiselectionPointerId = selectPointerInfo.pointerId;
50322           multiselectEntityId = !selectPointerInfo.selected && selectPointerInfo.entityId;
50323           _downPointers[selectPointerInfo.pointerId].done = true;
50324         }
50325       }
50326       var isMultiselect = context.mode().id === "select" && // and shift key is down
50327       (lastEvent && lastEvent.shiftKey || // or we're lasso-selecting
50328       context.surface().select(".lasso").node() || // or a pointer is down over a selected feature
50329       _multiselectionPointerId && !multiselectEntityId);
50330       processClick(targetDatum, isMultiselect, p2, multiselectEntityId);
50331       function mapContains(event) {
50332         var rect = mapNode.getBoundingClientRect();
50333         return event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;
50334       }
50335       function pointerDownOnSelection(skipPointerId) {
50336         var mode = context.mode();
50337         var selectedIDs = mode.id === "select" ? mode.selectedIDs() : [];
50338         for (var pointerId2 in _downPointers) {
50339           if (pointerId2 === "spacebar" || pointerId2 === skipPointerId) continue;
50340           var pointerInfo = _downPointers[pointerId2];
50341           var p12 = pointGetter(pointerInfo.firstEvent);
50342           var p22 = pointGetter(pointerInfo.lastEvent);
50343           if (geoVecLength(p12, p22) > _tolerancePx) continue;
50344           var datum2 = pointerInfo.firstEvent.target.__data__;
50345           var entity = datum2 && datum2.properties && datum2.properties.entity || datum2;
50346           if (context.graph().hasEntity(entity.id)) {
50347             return {
50348               pointerId: pointerId2,
50349               entityId: entity.id,
50350               selected: selectedIDs.indexOf(entity.id) !== -1
50351             };
50352           }
50353         }
50354         return null;
50355       }
50356     }
50357     function processClick(datum2, isMultiselect, point, alsoSelectId) {
50358       var mode = context.mode();
50359       var showMenu = _showMenu;
50360       var interactionType = _lastInteractionType;
50361       var entity = datum2 && datum2.properties && datum2.properties.entity;
50362       if (entity) datum2 = entity;
50363       if (datum2 && datum2.type === "midpoint") {
50364         datum2 = datum2.parents[0];
50365       }
50366       var newMode;
50367       if (datum2 instanceof osmEntity) {
50368         var selectedIDs = context.selectedIDs();
50369         context.selectedNoteID(null);
50370         context.selectedErrorID(null);
50371         if (!isMultiselect) {
50372           if (!showMenu || selectedIDs.length <= 1 || selectedIDs.indexOf(datum2.id) === -1) {
50373             if (alsoSelectId === datum2.id) alsoSelectId = null;
50374             selectedIDs = (alsoSelectId ? [alsoSelectId] : []).concat([datum2.id]);
50375             newMode = mode.id === "select" ? mode.selectedIDs(selectedIDs) : modeSelect(context, selectedIDs).selectBehavior(behavior);
50376             context.enter(newMode);
50377           }
50378         } else {
50379           if (selectedIDs.indexOf(datum2.id) !== -1) {
50380             if (!showMenu) {
50381               selectedIDs = selectedIDs.filter(function(id2) {
50382                 return id2 !== datum2.id;
50383               });
50384               newMode = selectedIDs.length ? mode.selectedIDs(selectedIDs) : modeBrowse(context).selectBehavior(behavior);
50385               context.enter(newMode);
50386             }
50387           } else {
50388             selectedIDs = selectedIDs.concat([datum2.id]);
50389             newMode = mode.selectedIDs(selectedIDs);
50390             context.enter(newMode);
50391           }
50392         }
50393       } else if (datum2 && datum2.__featurehash__ && !isMultiselect) {
50394         context.selectedNoteID(null).enter(modeSelectData(context, datum2));
50395       } else if (datum2 instanceof osmNote && !isMultiselect) {
50396         context.selectedNoteID(datum2.id).enter(modeSelectNote(context, datum2.id));
50397       } else if (datum2 instanceof QAItem && !isMultiselect) {
50398         context.selectedErrorID(datum2.id).enter(modeSelectError(context, datum2.id, datum2.service));
50399       } else if (datum2.service === "photo") {
50400       } else {
50401         context.selectedNoteID(null);
50402         context.selectedErrorID(null);
50403         if (!isMultiselect && mode.id !== "browse") {
50404           context.enter(modeBrowse(context));
50405         }
50406       }
50407       context.ui().closeEditMenu();
50408       if (showMenu) context.ui().showEditMenu(point, interactionType);
50409       resetProperties();
50410     }
50411     function cancelLongPress() {
50412       if (_longPressTimeout) window.clearTimeout(_longPressTimeout);
50413       _longPressTimeout = null;
50414     }
50415     function resetProperties() {
50416       cancelLongPress();
50417       _showMenu = false;
50418       _lastInteractionType = null;
50419     }
50420     function behavior(selection2) {
50421       resetProperties();
50422       _lastMouseEvent = context.map().lastPointerEvent();
50423       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) {
50424         var e3 = d3_event;
50425         if (+e3.clientX === 0 && +e3.clientY === 0) {
50426           d3_event.preventDefault();
50427         }
50428       });
50429       selection2.on(_pointerPrefix + "down.select", pointerdown).on("contextmenu.select", contextmenu);
50430     }
50431     behavior.off = function(selection2) {
50432       cancelLongPress();
50433       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);
50434       selection2.on(_pointerPrefix + "down.select", null).on("contextmenu.select", null);
50435       context.surface().classed("behavior-multiselect", false);
50436     };
50437     return behavior;
50438   }
50439
50440   // modules/ui/note_comments.js
50441   function uiNoteComments() {
50442     var _note;
50443     function noteComments(selection2) {
50444       if (_note.isNew()) return;
50445       var comments = selection2.selectAll(".comments-container").data([0]);
50446       comments = comments.enter().append("div").attr("class", "comments-container").merge(comments);
50447       var commentEnter = comments.selectAll(".comment").data(_note.comments).enter().append("div").attr("class", "comment");
50448       commentEnter.append("div").attr("class", function(d2) {
50449         return "comment-avatar user-" + d2.uid;
50450       }).call(svgIcon("#iD-icon-avatar", "comment-avatar-icon"));
50451       var mainEnter = commentEnter.append("div").attr("class", "comment-main");
50452       var metadataEnter = mainEnter.append("div").attr("class", "comment-metadata");
50453       metadataEnter.append("div").attr("class", "comment-author").each(function(d2) {
50454         var selection3 = select_default2(this);
50455         var osm = services.osm;
50456         if (osm && d2.user) {
50457           selection3 = selection3.append("a").attr("class", "comment-author-link").attr("href", osm.userURL(d2.user)).attr("target", "_blank");
50458         }
50459         if (d2.user) {
50460           selection3.text(d2.user);
50461         } else {
50462           selection3.call(_t.append("note.anonymous"));
50463         }
50464       });
50465       metadataEnter.append("div").attr("class", "comment-date").html(function(d2) {
50466         return _t.html("note.status." + d2.action, { when: localeDateString2(d2.date) });
50467       });
50468       mainEnter.append("div").attr("class", "comment-text").html(function(d2) {
50469         return d2.html;
50470       }).selectAll("a").attr("rel", "noopener nofollow").attr("target", "_blank");
50471       comments.call(replaceAvatars);
50472     }
50473     function replaceAvatars(selection2) {
50474       var showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
50475       var osm = services.osm;
50476       if (showThirdPartyIcons !== "true" || !osm) return;
50477       var uids = {};
50478       _note.comments.forEach(function(d2) {
50479         if (d2.uid) uids[d2.uid] = true;
50480       });
50481       Object.keys(uids).forEach(function(uid) {
50482         osm.loadUser(uid, function(err, user) {
50483           if (!user || !user.image_url) return;
50484           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);
50485         });
50486       });
50487     }
50488     function localeDateString2(s2) {
50489       if (!s2) return null;
50490       var options = { day: "numeric", month: "short", year: "numeric" };
50491       s2 = s2.replace(/-/g, "/");
50492       var d2 = new Date(s2);
50493       if (isNaN(d2.getTime())) return null;
50494       return d2.toLocaleDateString(_mainLocalizer.localeCode(), options);
50495     }
50496     noteComments.note = function(val) {
50497       if (!arguments.length) return _note;
50498       _note = val;
50499       return noteComments;
50500     };
50501     return noteComments;
50502   }
50503
50504   // modules/ui/note_header.js
50505   function uiNoteHeader() {
50506     var _note;
50507     function noteHeader(selection2) {
50508       var header = selection2.selectAll(".note-header").data(
50509         _note ? [_note] : [],
50510         function(d2) {
50511           return d2.status + d2.id;
50512         }
50513       );
50514       header.exit().remove();
50515       var headerEnter = header.enter().append("div").attr("class", "note-header");
50516       var iconEnter = headerEnter.append("div").attr("class", function(d2) {
50517         return "note-header-icon " + d2.status;
50518       }).classed("new", function(d2) {
50519         return d2.id < 0;
50520       });
50521       iconEnter.append("div").attr("class", "preset-icon-28").call(svgIcon("#iD-icon-note", "note-fill"));
50522       iconEnter.each(function(d2) {
50523         var statusIcon;
50524         if (d2.id < 0) {
50525           statusIcon = "#iD-icon-plus";
50526         } else if (d2.status === "open") {
50527           statusIcon = "#iD-icon-close";
50528         } else {
50529           statusIcon = "#iD-icon-apply";
50530         }
50531         iconEnter.append("div").attr("class", "note-icon-annotation").attr("title", _t("icons.close")).call(svgIcon(statusIcon, "icon-annotation"));
50532       });
50533       headerEnter.append("div").attr("class", "note-header-label").html(function(d2) {
50534         if (_note.isNew()) {
50535           return _t.html("note.new");
50536         }
50537         return _t.html("note.note") + " " + d2.id + " " + (d2.status === "closed" ? _t.html("note.closed") : "");
50538       });
50539     }
50540     noteHeader.note = function(val) {
50541       if (!arguments.length) return _note;
50542       _note = val;
50543       return noteHeader;
50544     };
50545     return noteHeader;
50546   }
50547
50548   // modules/ui/note_report.js
50549   function uiNoteReport() {
50550     var _note;
50551     function noteReport(selection2) {
50552       var url;
50553       if (services.osm && _note instanceof osmNote && !_note.isNew()) {
50554         url = services.osm.noteReportURL(_note);
50555       }
50556       var link2 = selection2.selectAll(".note-report").data(url ? [url] : []);
50557       link2.exit().remove();
50558       var linkEnter = link2.enter().append("a").attr("class", "note-report").attr("target", "_blank").attr("href", function(d2) {
50559         return d2;
50560       }).call(svgIcon("#iD-icon-out-link", "inline"));
50561       linkEnter.append("span").call(_t.append("note.report"));
50562     }
50563     noteReport.note = function(val) {
50564       if (!arguments.length) return _note;
50565       _note = val;
50566       return noteReport;
50567     };
50568     return noteReport;
50569   }
50570
50571   // modules/util/date.ts
50572   function timeSince(date) {
50573     const seconds = Math.floor((+/* @__PURE__ */ new Date() - +date) / 1e3);
50574     const s2 = (n3) => Math.floor(seconds / n3);
50575     if (s2(60 * 60 * 24 * 365) > 1) return [s2(60 * 60 * 24 * 365), "years"];
50576     if (s2(60 * 60 * 24 * 30) > 1) return [s2(60 * 60 * 24 * 30), "months"];
50577     if (s2(60 * 60 * 24) > 1) return [s2(60 * 60 * 24), "days"];
50578     if (s2(60 * 60) > 1) return [s2(60 * 60), "hours"];
50579     if (s2(60) > 1) return [s2(60), "minutes"];
50580     return [s2(1), "seconds"];
50581   }
50582   function getRelativeDate(date) {
50583     const preferredLanguage = _mainLocalizer.localeCode();
50584     if (typeof Intl === "undefined" || typeof Intl.RelativeTimeFormat === "undefined") {
50585       return "on ".concat(date.toLocaleDateString(preferredLanguage));
50586     }
50587     const [number3, units] = timeSince(date);
50588     if (!Number.isFinite(number3)) return "-";
50589     return new Intl.RelativeTimeFormat(preferredLanguage).format(-number3, units);
50590   }
50591
50592   // modules/ui/view_on_osm.js
50593   function uiViewOnOSM(context) {
50594     var _what;
50595     function viewOnOSM(selection2) {
50596       var url;
50597       if (_what instanceof osmEntity) {
50598         url = context.connection().historyURL(_what);
50599       } else if (_what instanceof osmNote) {
50600         url = context.connection().noteURL(_what);
50601       }
50602       var data = !_what || _what.isNew() ? [] : [_what];
50603       var link2 = selection2.selectAll(".view-on-osm").data(data, function(d2) {
50604         return d2.id;
50605       });
50606       link2.exit().remove();
50607       var linkEnter = link2.enter().append("a").attr("class", "view-on-osm").attr("target", "_blank").attr("href", url).call(svgIcon("#iD-icon-out-link", "inline"));
50608       if (_what && !(_what instanceof osmNote)) {
50609         const { user, timestamp } = uiViewOnOSM.findLastModifiedChild(context.history().base(), _what);
50610         linkEnter.call(_t.append("inspector.last_modified", {
50611           timeago: getRelativeDate(new Date(timestamp)),
50612           user
50613         })).attr("title", _t("inspector.view_on_osm"));
50614       } else {
50615         linkEnter.append("span").call(_t.append("inspector.view_on_osm"));
50616       }
50617     }
50618     viewOnOSM.what = function(_3) {
50619       if (!arguments.length) return _what;
50620       _what = _3;
50621       return viewOnOSM;
50622     };
50623     return viewOnOSM;
50624   }
50625   uiViewOnOSM.findLastModifiedChild = (graph, feature4) => {
50626     let latest = feature4;
50627     function recurseChilds(obj) {
50628       if (obj.timestamp > latest.timestamp) {
50629         latest = obj;
50630       }
50631       if (obj instanceof osmWay) {
50632         obj.nodes.map((id2) => graph.hasEntity(id2)).filter(Boolean).forEach(recurseChilds);
50633       } else if (obj instanceof osmRelation) {
50634         obj.members.map((m3) => graph.hasEntity(m3.id)).filter((e3) => e3 instanceof osmWay || e3 instanceof osmRelation).forEach(recurseChilds);
50635       }
50636     }
50637     recurseChilds(feature4);
50638     return latest;
50639   };
50640
50641   // modules/ui/note_editor.js
50642   function uiNoteEditor(context) {
50643     var dispatch12 = dispatch_default("change");
50644     var noteComments = uiNoteComments(context);
50645     var noteHeader = uiNoteHeader();
50646     var _note;
50647     var _newNote;
50648     function noteEditor(selection2) {
50649       var header = selection2.selectAll(".header").data([0]);
50650       var headerEnter = header.enter().append("div").attr("class", "header fillL");
50651       headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
50652         context.enter(modeBrowse(context));
50653       }).call(svgIcon("#iD-icon-close"));
50654       headerEnter.append("h2").call(_t.append("note.title"));
50655       var body = selection2.selectAll(".body").data([0]);
50656       body = body.enter().append("div").attr("class", "body").merge(body);
50657       var editor = body.selectAll(".note-editor").data([0]);
50658       editor.enter().append("div").attr("class", "modal-section note-editor").merge(editor).call(noteHeader.note(_note)).call(noteComments.note(_note)).call(noteSaveSection);
50659       var footer = selection2.selectAll(".footer").data([0]);
50660       footer.enter().append("div").attr("class", "footer").merge(footer).call(uiViewOnOSM(context).what(_note)).call(uiNoteReport(context).note(_note));
50661       var osm = services.osm;
50662       if (osm) {
50663         osm.on("change.note-save", function() {
50664           selection2.call(noteEditor);
50665         });
50666       }
50667     }
50668     function noteSaveSection(selection2) {
50669       var isSelected = _note && _note.id === context.selectedNoteID();
50670       var noteSave = selection2.selectAll(".note-save").data(isSelected ? [_note] : [], function(d2) {
50671         return d2.status + d2.id;
50672       });
50673       noteSave.exit().remove();
50674       var noteSaveEnter = noteSave.enter().append("div").attr("class", "note-save save-section cf");
50675       noteSaveEnter.append("h4").attr("class", ".note-save-header").text("").each(function() {
50676         if (_note.isNew()) {
50677           _t.append("note.newDescription")(select_default2(this));
50678         } else {
50679           _t.append("note.newComment")(select_default2(this));
50680         }
50681       });
50682       var commentTextarea = noteSaveEnter.append("textarea").attr("class", "new-comment-input").attr("placeholder", _t("note.inputPlaceholder")).attr("maxlength", 1e3).property("value", function(d2) {
50683         return d2.newComment;
50684       }).call(utilNoAuto).on("keydown.note-input", keydown).on("input.note-input", changeInput).on("blur.note-input", changeInput);
50685       if (!commentTextarea.empty() && _newNote) {
50686         commentTextarea.node().focus();
50687       }
50688       noteSave = noteSaveEnter.merge(noteSave).call(userDetails).call(noteSaveButtons);
50689       function keydown(d3_event) {
50690         if (!(d3_event.keyCode === 13 && // ↩ Return
50691         d3_event.metaKey)) return;
50692         var osm = services.osm;
50693         if (!osm) return;
50694         var hasAuth = osm.authenticated();
50695         if (!hasAuth) return;
50696         if (!_note.newComment) return;
50697         d3_event.preventDefault();
50698         select_default2(this).on("keydown.note-input", null);
50699         window.setTimeout(function() {
50700           if (_note.isNew()) {
50701             noteSave.selectAll(".save-button").node().focus();
50702             clickSave(_note);
50703           } else {
50704             noteSave.selectAll(".comment-button").node().focus();
50705             clickComment(_note);
50706           }
50707         }, 10);
50708       }
50709       function changeInput() {
50710         var input = select_default2(this);
50711         var val = input.property("value").trim() || void 0;
50712         _note = _note.update({ newComment: val });
50713         var osm = services.osm;
50714         if (osm) {
50715           osm.replaceNote(_note);
50716         }
50717         noteSave.call(noteSaveButtons);
50718       }
50719     }
50720     function userDetails(selection2) {
50721       var detailSection = selection2.selectAll(".detail-section").data([0]);
50722       detailSection = detailSection.enter().append("div").attr("class", "detail-section").merge(detailSection);
50723       var osm = services.osm;
50724       if (!osm) return;
50725       var hasAuth = osm.authenticated();
50726       var authWarning = detailSection.selectAll(".auth-warning").data(hasAuth ? [] : [0]);
50727       authWarning.exit().transition().duration(200).style("opacity", 0).remove();
50728       var authEnter = authWarning.enter().insert("div", ".tag-reference-body").attr("class", "field-warning auth-warning").style("opacity", 0);
50729       authEnter.call(svgIcon("#iD-icon-alert", "inline"));
50730       authEnter.append("span").call(_t.append("note.login"));
50731       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) {
50732         d3_event.preventDefault();
50733         osm.authenticate();
50734       });
50735       authEnter.transition().duration(200).style("opacity", 1);
50736       var prose = detailSection.selectAll(".note-save-prose").data(hasAuth ? [0] : []);
50737       prose.exit().remove();
50738       prose = prose.enter().append("p").attr("class", "note-save-prose").call(_t.append("note.upload_explanation")).merge(prose);
50739       osm.userDetails(function(err, user) {
50740         if (err) return;
50741         var userLink = select_default2(document.createElement("div"));
50742         if (user.image_url) {
50743           userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
50744         }
50745         userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
50746         prose.html(_t.html("note.upload_explanation_with_user", { user: { html: userLink.html() } }));
50747       });
50748     }
50749     function noteSaveButtons(selection2) {
50750       var osm = services.osm;
50751       var hasAuth = osm && osm.authenticated();
50752       var isSelected = _note && _note.id === context.selectedNoteID();
50753       var buttonSection = selection2.selectAll(".buttons").data(isSelected ? [_note] : [], function(d2) {
50754         return d2.status + d2.id;
50755       });
50756       buttonSection.exit().remove();
50757       var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons");
50758       if (_note.isNew()) {
50759         buttonEnter.append("button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
50760         buttonEnter.append("button").attr("class", "button save-button action").call(_t.append("note.save"));
50761       } else {
50762         buttonEnter.append("button").attr("class", "button status-button action");
50763         buttonEnter.append("button").attr("class", "button comment-button action").call(_t.append("note.comment"));
50764       }
50765       buttonSection = buttonSection.merge(buttonEnter);
50766       buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
50767       buttonSection.select(".save-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
50768       buttonSection.select(".status-button").attr("disabled", hasAuth ? null : true).each(function(d2) {
50769         var action = d2.status === "open" ? "close" : "open";
50770         var andComment = d2.newComment ? "_comment" : "";
50771         _t.addOrUpdate("note." + action + andComment)(select_default2(this));
50772       }).on("click.status", clickStatus);
50773       buttonSection.select(".comment-button").attr("disabled", isSaveDisabled).on("click.comment", clickComment);
50774       function isSaveDisabled(d2) {
50775         return hasAuth && d2.status === "open" && d2.newComment ? null : true;
50776       }
50777     }
50778     function clickCancel(d3_event, d2) {
50779       this.blur();
50780       var osm = services.osm;
50781       if (osm) {
50782         osm.removeNote(d2);
50783       }
50784       context.enter(modeBrowse(context));
50785       dispatch12.call("change");
50786     }
50787     function clickSave(d3_event, d2) {
50788       this.blur();
50789       var osm = services.osm;
50790       if (osm) {
50791         osm.postNoteCreate(d2, function(err, note) {
50792           dispatch12.call("change", note);
50793         });
50794       }
50795     }
50796     function clickStatus(d3_event, d2) {
50797       this.blur();
50798       var osm = services.osm;
50799       if (osm) {
50800         var setStatus = d2.status === "open" ? "closed" : "open";
50801         osm.postNoteUpdate(d2, setStatus, function(err, note) {
50802           dispatch12.call("change", note);
50803         });
50804       }
50805     }
50806     function clickComment(d3_event, d2) {
50807       this.blur();
50808       var osm = services.osm;
50809       if (osm) {
50810         osm.postNoteUpdate(d2, d2.status, function(err, note) {
50811           dispatch12.call("change", note);
50812         });
50813       }
50814     }
50815     noteEditor.note = function(val) {
50816       if (!arguments.length) return _note;
50817       _note = val;
50818       return noteEditor;
50819     };
50820     noteEditor.newNote = function(val) {
50821       if (!arguments.length) return _newNote;
50822       _newNote = val;
50823       return noteEditor;
50824     };
50825     return utilRebind(noteEditor, dispatch12, "on");
50826   }
50827
50828   // modules/modes/select_note.js
50829   function modeSelectNote(context, selectedNoteID) {
50830     var mode = {
50831       id: "select-note",
50832       button: "browse"
50833     };
50834     var _keybinding = utilKeybinding("select-note");
50835     var _noteEditor = uiNoteEditor(context).on("change", function() {
50836       context.map().pan([0, 0]);
50837       var note = checkSelectedID();
50838       if (!note) return;
50839       context.ui().sidebar.show(_noteEditor.note(note));
50840     });
50841     var _behaviors = [
50842       behaviorBreathe(context),
50843       behaviorHover(context),
50844       behaviorSelect(context),
50845       behaviorLasso(context),
50846       modeDragNode(context).behavior,
50847       modeDragNote(context).behavior
50848     ];
50849     var _newFeature = false;
50850     function checkSelectedID() {
50851       if (!services.osm) return;
50852       var note = services.osm.getNote(selectedNoteID);
50853       if (!note) {
50854         context.enter(modeBrowse(context));
50855       }
50856       return note;
50857     }
50858     function selectNote(d3_event, drawn) {
50859       if (!checkSelectedID()) return;
50860       var selection2 = context.surface().selectAll(".layer-notes .note-" + selectedNoteID);
50861       if (selection2.empty()) {
50862         var source = d3_event && d3_event.type === "zoom" && d3_event.sourceEvent;
50863         if (drawn && source && (source.type === "pointermove" || source.type === "mousemove" || source.type === "touchmove")) {
50864           context.enter(modeBrowse(context));
50865         }
50866       } else {
50867         selection2.classed("selected", true);
50868         context.selectedNoteID(selectedNoteID);
50869       }
50870     }
50871     function esc() {
50872       if (context.container().select(".combobox").size()) return;
50873       context.enter(modeBrowse(context));
50874     }
50875     mode.zoomToSelected = function() {
50876       if (!services.osm) return;
50877       var note = services.osm.getNote(selectedNoteID);
50878       if (note) {
50879         context.map().centerZoomEase(note.loc, 20);
50880       }
50881     };
50882     mode.newFeature = function(val) {
50883       if (!arguments.length) return _newFeature;
50884       _newFeature = val;
50885       return mode;
50886     };
50887     mode.enter = function() {
50888       var note = checkSelectedID();
50889       if (!note) return;
50890       _behaviors.forEach(context.install);
50891       _keybinding.on(_t("inspector.zoom_to.key"), mode.zoomToSelected).on("\u238B", esc, true);
50892       select_default2(document).call(_keybinding);
50893       selectNote();
50894       var sidebar = context.ui().sidebar;
50895       sidebar.show(_noteEditor.note(note).newNote(_newFeature));
50896       sidebar.expand(sidebar.intersects(note.extent()));
50897       context.map().on("drawn.select", selectNote);
50898     };
50899     mode.exit = function() {
50900       _behaviors.forEach(context.uninstall);
50901       select_default2(document).call(_keybinding.unbind);
50902       context.surface().selectAll(".layer-notes .selected").classed("selected hover", false);
50903       context.map().on("drawn.select", null);
50904       context.ui().sidebar.hide();
50905       context.selectedNoteID(null);
50906     };
50907     return mode;
50908   }
50909
50910   // modules/modes/add_note.js
50911   function modeAddNote(context) {
50912     var mode = {
50913       id: "add-note",
50914       button: "note",
50915       description: _t.append("modes.add_note.description"),
50916       key: _t("modes.add_note.key")
50917     };
50918     var behavior = behaviorDraw(context).on("click", add).on("cancel", cancel).on("finish", cancel);
50919     function add(loc) {
50920       var osm = services.osm;
50921       if (!osm) return;
50922       var note = osmNote({ loc, status: "open", comments: [] });
50923       osm.replaceNote(note);
50924       context.map().pan([0, 0]);
50925       context.selectedNoteID(note.id).enter(modeSelectNote(context, note.id).newFeature(true));
50926     }
50927     function cancel() {
50928       context.enter(modeBrowse(context));
50929     }
50930     mode.enter = function() {
50931       context.install(behavior);
50932     };
50933     mode.exit = function() {
50934       context.uninstall(behavior);
50935     };
50936     return mode;
50937   }
50938
50939   // modules/operations/move.js
50940   function operationMove(context, selectedIDs) {
50941     var multi = selectedIDs.length === 1 ? "single" : "multiple";
50942     var nodes = utilGetAllNodes(selectedIDs, context.graph());
50943     var coords = nodes.map(function(n3) {
50944       return n3.loc;
50945     });
50946     var extent = utilTotalExtent(selectedIDs, context.graph());
50947     var operation2 = function() {
50948       context.enter(modeMove(context, selectedIDs));
50949     };
50950     operation2.available = function() {
50951       return selectedIDs.length > 0;
50952     };
50953     operation2.disabled = function() {
50954       if (extent.percentContainedIn(context.map().extent()) < 0.8) {
50955         return "too_large";
50956       } else if (someMissing()) {
50957         return "not_downloaded";
50958       } else if (selectedIDs.some(context.hasHiddenConnections)) {
50959         return "connected_to_hidden";
50960       } else if (selectedIDs.some(incompleteRelation)) {
50961         return "incomplete_relation";
50962       }
50963       return false;
50964       function someMissing() {
50965         if (context.inIntro()) return false;
50966         var osm = context.connection();
50967         if (osm) {
50968           var missing = coords.filter(function(loc) {
50969             return !osm.isDataLoaded(loc);
50970           });
50971           if (missing.length) {
50972             missing.forEach(function(loc) {
50973               context.loadTileAtLoc(loc);
50974             });
50975             return true;
50976           }
50977         }
50978         return false;
50979       }
50980       function incompleteRelation(id2) {
50981         var entity = context.entity(id2);
50982         return entity.type === "relation" && !entity.isComplete(context.graph());
50983       }
50984     };
50985     operation2.tooltip = function() {
50986       var disable = operation2.disabled();
50987       return disable ? _t.append("operations.move." + disable + "." + multi) : _t.append("operations.move.description." + multi);
50988     };
50989     operation2.annotation = function() {
50990       return selectedIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.move.annotation.feature", { n: selectedIDs.length });
50991     };
50992     operation2.id = "move";
50993     operation2.keys = [_t("operations.move.key")];
50994     operation2.title = _t.append("operations.move.title");
50995     operation2.behavior = behaviorOperation(context).which(operation2);
50996     operation2.mouseOnly = true;
50997     return operation2;
50998   }
50999
51000   // modules/operations/orthogonalize.js
51001   function operationOrthogonalize(context, selectedIDs) {
51002     var _extent;
51003     var _type;
51004     var _actions = selectedIDs.map(chooseAction).filter(Boolean);
51005     var _amount = _actions.length === 1 ? "single" : "multiple";
51006     var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
51007       return n3.loc;
51008     });
51009     function chooseAction(entityID) {
51010       var entity = context.entity(entityID);
51011       var geometry = entity.geometry(context.graph());
51012       if (!_extent) {
51013         _extent = entity.extent(context.graph());
51014       } else {
51015         _extent = _extent.extend(entity.extent(context.graph()));
51016       }
51017       if (entity.type === "way" && new Set(entity.nodes).size > 2) {
51018         if (_type && _type !== "feature") return null;
51019         _type = "feature";
51020         return actionOrthogonalize(entityID, context.projection);
51021       } else if (geometry === "vertex") {
51022         if (_type && _type !== "corner") return null;
51023         _type = "corner";
51024         var graph = context.graph();
51025         var parents = graph.parentWays(entity);
51026         if (parents.length === 1) {
51027           var way = parents[0];
51028           if (way.nodes.indexOf(entityID) !== -1) {
51029             return actionOrthogonalize(way.id, context.projection, entityID);
51030           }
51031         }
51032       }
51033       return null;
51034     }
51035     var operation2 = function() {
51036       if (!_actions.length) return;
51037       var combinedAction = function(graph, t2) {
51038         _actions.forEach(function(action) {
51039           if (!action.disabled(graph)) {
51040             graph = action(graph, t2);
51041           }
51042         });
51043         return graph;
51044       };
51045       combinedAction.transitionable = true;
51046       context.perform(combinedAction, operation2.annotation());
51047       window.setTimeout(function() {
51048         context.validator().validate();
51049       }, 300);
51050     };
51051     operation2.available = function() {
51052       return _actions.length && selectedIDs.length === _actions.length;
51053     };
51054     operation2.disabled = function() {
51055       if (!_actions.length) return "";
51056       var actionDisableds = _actions.map(function(action) {
51057         return action.disabled(context.graph());
51058       }).filter(Boolean);
51059       if (actionDisableds.length === _actions.length) {
51060         if (new Set(actionDisableds).size > 1) {
51061           return "multiple_blockers";
51062         }
51063         return actionDisableds[0];
51064       } else if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
51065         return "too_large";
51066       } else if (someMissing()) {
51067         return "not_downloaded";
51068       } else if (selectedIDs.some(context.hasHiddenConnections)) {
51069         return "connected_to_hidden";
51070       }
51071       return false;
51072       function someMissing() {
51073         if (context.inIntro()) return false;
51074         var osm = context.connection();
51075         if (osm) {
51076           var missing = _coords.filter(function(loc) {
51077             return !osm.isDataLoaded(loc);
51078           });
51079           if (missing.length) {
51080             missing.forEach(function(loc) {
51081               context.loadTileAtLoc(loc);
51082             });
51083             return true;
51084           }
51085         }
51086         return false;
51087       }
51088     };
51089     operation2.tooltip = function() {
51090       var disable = operation2.disabled();
51091       return disable ? _t.append("operations.orthogonalize." + disable + "." + _amount) : _t.append("operations.orthogonalize.description." + _type + "." + _amount);
51092     };
51093     operation2.annotation = function() {
51094       return _t("operations.orthogonalize.annotation." + _type, { n: _actions.length });
51095     };
51096     operation2.id = "orthogonalize";
51097     operation2.keys = [_t("operations.orthogonalize.key")];
51098     operation2.title = _t.append("operations.orthogonalize.title");
51099     operation2.behavior = behaviorOperation(context).which(operation2);
51100     return operation2;
51101   }
51102
51103   // modules/operations/reflect.js
51104   function operationReflectShort(context, selectedIDs) {
51105     return operationReflect(context, selectedIDs, "short");
51106   }
51107   function operationReflectLong(context, selectedIDs) {
51108     return operationReflect(context, selectedIDs, "long");
51109   }
51110   function operationReflect(context, selectedIDs, axis) {
51111     axis = axis || "long";
51112     var multi = selectedIDs.length === 1 ? "single" : "multiple";
51113     var nodes = utilGetAllNodes(selectedIDs, context.graph());
51114     var coords = nodes.map(function(n3) {
51115       return n3.loc;
51116     });
51117     var extent = utilTotalExtent(selectedIDs, context.graph());
51118     var operation2 = function() {
51119       var action = actionReflect(selectedIDs, context.projection).useLongAxis(Boolean(axis === "long"));
51120       context.perform(action, operation2.annotation());
51121       window.setTimeout(function() {
51122         context.validator().validate();
51123       }, 300);
51124     };
51125     operation2.available = function() {
51126       return nodes.length >= 3;
51127     };
51128     operation2.disabled = function() {
51129       if (extent.percentContainedIn(context.map().extent()) < 0.8) {
51130         return "too_large";
51131       } else if (someMissing()) {
51132         return "not_downloaded";
51133       } else if (selectedIDs.some(context.hasHiddenConnections)) {
51134         return "connected_to_hidden";
51135       } else if (selectedIDs.some(incompleteRelation)) {
51136         return "incomplete_relation";
51137       }
51138       return false;
51139       function someMissing() {
51140         if (context.inIntro()) return false;
51141         var osm = context.connection();
51142         if (osm) {
51143           var missing = coords.filter(function(loc) {
51144             return !osm.isDataLoaded(loc);
51145           });
51146           if (missing.length) {
51147             missing.forEach(function(loc) {
51148               context.loadTileAtLoc(loc);
51149             });
51150             return true;
51151           }
51152         }
51153         return false;
51154       }
51155       function incompleteRelation(id2) {
51156         var entity = context.entity(id2);
51157         return entity.type === "relation" && !entity.isComplete(context.graph());
51158       }
51159     };
51160     operation2.tooltip = function() {
51161       var disable = operation2.disabled();
51162       return disable ? _t.append("operations.reflect." + disable + "." + multi) : _t.append("operations.reflect.description." + axis + "." + multi);
51163     };
51164     operation2.annotation = function() {
51165       return _t("operations.reflect.annotation." + axis + ".feature", { n: selectedIDs.length });
51166     };
51167     operation2.id = "reflect-" + axis;
51168     operation2.keys = [_t("operations.reflect.key." + axis)];
51169     operation2.title = _t.append("operations.reflect.title." + axis);
51170     operation2.behavior = behaviorOperation(context).which(operation2);
51171     return operation2;
51172   }
51173
51174   // modules/modes/rotate.js
51175   function modeRotate(context, entityIDs) {
51176     var _tolerancePx = 4;
51177     var mode = {
51178       id: "rotate",
51179       button: "browse"
51180     };
51181     var keybinding = utilKeybinding("rotate");
51182     var behaviors = [
51183       behaviorEdit(context),
51184       operationCircularize(context, entityIDs).behavior,
51185       operationDelete(context, entityIDs).behavior,
51186       operationMove(context, entityIDs).behavior,
51187       operationOrthogonalize(context, entityIDs).behavior,
51188       operationReflectLong(context, entityIDs).behavior,
51189       operationReflectShort(context, entityIDs).behavior
51190     ];
51191     var annotation = entityIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.rotate.annotation.feature", { n: entityIDs.length });
51192     var _prevGraph;
51193     var _prevAngle;
51194     var _prevTransform;
51195     var _pivot;
51196     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
51197     function doRotate(d3_event) {
51198       var fn;
51199       if (context.graph() !== _prevGraph) {
51200         fn = context.perform;
51201       } else {
51202         fn = context.replace;
51203       }
51204       var projection2 = context.projection;
51205       var currTransform = projection2.transform();
51206       if (!_prevTransform || currTransform.k !== _prevTransform.k || currTransform.x !== _prevTransform.x || currTransform.y !== _prevTransform.y) {
51207         var nodes = utilGetAllNodes(entityIDs, context.graph());
51208         var points = nodes.map(function(n3) {
51209           return projection2(n3.loc);
51210         });
51211         _pivot = getPivot(points);
51212         _prevAngle = void 0;
51213       }
51214       var currMouse = context.map().mouse(d3_event);
51215       var currAngle = Math.atan2(currMouse[1] - _pivot[1], currMouse[0] - _pivot[0]);
51216       if (typeof _prevAngle === "undefined") _prevAngle = currAngle;
51217       var delta = currAngle - _prevAngle;
51218       fn(actionRotate(entityIDs, _pivot, delta, projection2));
51219       _prevTransform = currTransform;
51220       _prevAngle = currAngle;
51221       _prevGraph = context.graph();
51222     }
51223     function getPivot(points) {
51224       var _pivot2;
51225       if (points.length === 1) {
51226         _pivot2 = points[0];
51227       } else if (points.length === 2) {
51228         _pivot2 = geoVecInterp(points[0], points[1], 0.5);
51229       } else {
51230         var polygonHull = hull_default(points);
51231         if (polygonHull.length === 2) {
51232           _pivot2 = geoVecInterp(points[0], points[1], 0.5);
51233         } else {
51234           _pivot2 = centroid_default(hull_default(points));
51235         }
51236       }
51237       return _pivot2;
51238     }
51239     function finish(d3_event) {
51240       d3_event.stopPropagation();
51241       context.replace(actionNoop(), annotation);
51242       context.enter(modeSelect(context, entityIDs));
51243     }
51244     function cancel() {
51245       if (_prevGraph) context.pop();
51246       context.enter(modeSelect(context, entityIDs));
51247     }
51248     function undone() {
51249       context.enter(modeBrowse(context));
51250     }
51251     mode.enter = function() {
51252       _prevGraph = null;
51253       context.features().forceVisible(entityIDs);
51254       behaviors.forEach(context.install);
51255       var downEvent;
51256       context.surface().on(_pointerPrefix + "down.modeRotate", function(d3_event) {
51257         downEvent = d3_event;
51258       });
51259       select_default2(window).on(_pointerPrefix + "move.modeRotate", doRotate, true).on(_pointerPrefix + "up.modeRotate", function(d3_event) {
51260         if (!downEvent) return;
51261         var mapNode = context.container().select(".main-map").node();
51262         var pointGetter = utilFastMouse(mapNode);
51263         var p1 = pointGetter(downEvent);
51264         var p2 = pointGetter(d3_event);
51265         var dist = geoVecLength(p1, p2);
51266         if (dist <= _tolerancePx) finish(d3_event);
51267         downEvent = null;
51268       }, true);
51269       context.history().on("undone.modeRotate", undone);
51270       keybinding.on("\u238B", cancel).on("\u21A9", finish);
51271       select_default2(document).call(keybinding);
51272     };
51273     mode.exit = function() {
51274       behaviors.forEach(context.uninstall);
51275       context.surface().on(_pointerPrefix + "down.modeRotate", null);
51276       select_default2(window).on(_pointerPrefix + "move.modeRotate", null, true).on(_pointerPrefix + "up.modeRotate", null, true);
51277       context.history().on("undone.modeRotate", null);
51278       select_default2(document).call(keybinding.unbind);
51279       context.features().forceVisible([]);
51280     };
51281     mode.selectedIDs = function() {
51282       if (!arguments.length) return entityIDs;
51283       return mode;
51284     };
51285     return mode;
51286   }
51287
51288   // modules/ui/conflicts.js
51289   function uiConflicts(context) {
51290     var dispatch12 = dispatch_default("cancel", "save");
51291     var keybinding = utilKeybinding("conflicts");
51292     var _origChanges;
51293     var _conflictList;
51294     var _shownConflictIndex;
51295     function keybindingOn() {
51296       select_default2(document).call(keybinding.on("\u238B", cancel, true));
51297     }
51298     function keybindingOff() {
51299       select_default2(document).call(keybinding.unbind);
51300     }
51301     function tryAgain() {
51302       keybindingOff();
51303       dispatch12.call("save");
51304     }
51305     function cancel() {
51306       keybindingOff();
51307       dispatch12.call("cancel");
51308     }
51309     function conflicts(selection2) {
51310       keybindingOn();
51311       var headerEnter = selection2.selectAll(".header").data([0]).enter().append("div").attr("class", "header fillL");
51312       headerEnter.append("button").attr("class", "fr").attr("title", _t("icons.close")).on("click", cancel).call(svgIcon("#iD-icon-close"));
51313       headerEnter.append("h2").call(_t.append("save.conflict.header"));
51314       var bodyEnter = selection2.selectAll(".body").data([0]).enter().append("div").attr("class", "body fillL");
51315       var conflictsHelpEnter = bodyEnter.append("div").attr("class", "conflicts-help").call(_t.append("save.conflict.help"));
51316       var changeset = new osmChangeset();
51317       delete changeset.id;
51318       var data = JXON.stringify(changeset.osmChangeJXON(_origChanges));
51319       var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
51320       var fileName = "changes.osc";
51321       var linkEnter = conflictsHelpEnter.selectAll(".download-changes").append("a").attr("class", "download-changes");
51322       linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
51323       linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("save.conflict.download_changes"));
51324       bodyEnter.append("div").attr("class", "conflict-container fillL3").call(showConflict, 0);
51325       bodyEnter.append("div").attr("class", "conflicts-done").attr("opacity", 0).style("display", "none").call(_t.append("save.conflict.done"));
51326       var buttonsEnter = bodyEnter.append("div").attr("class", "buttons col12 joined conflicts-buttons");
51327       buttonsEnter.append("button").attr("disabled", _conflictList.length > 1).attr("class", "action conflicts-button col6").call(_t.append("save.title")).on("click.try_again", tryAgain);
51328       buttonsEnter.append("button").attr("class", "secondary-action conflicts-button col6").call(_t.append("confirm.cancel")).on("click.cancel", cancel);
51329     }
51330     function showConflict(selection2, index) {
51331       index = utilWrap(index, _conflictList.length);
51332       _shownConflictIndex = index;
51333       var parent2 = select_default2(selection2.node().parentNode);
51334       if (index === _conflictList.length - 1) {
51335         window.setTimeout(function() {
51336           parent2.select(".conflicts-button").attr("disabled", null);
51337           parent2.select(".conflicts-done").transition().attr("opacity", 1).style("display", "block");
51338         }, 250);
51339       }
51340       var conflict = selection2.selectAll(".conflict").data([_conflictList[index]]);
51341       conflict.exit().remove();
51342       var conflictEnter = conflict.enter().append("div").attr("class", "conflict");
51343       conflictEnter.append("h4").attr("class", "conflict-count").call(_t.append("save.conflict.count", { num: index + 1, total: _conflictList.length }));
51344       conflictEnter.append("a").attr("class", "conflict-description").attr("href", "#").text(function(d2) {
51345         return d2.name;
51346       }).on("click", function(d3_event, d2) {
51347         d3_event.preventDefault();
51348         zoomToEntity(d2.id);
51349       });
51350       var details = conflictEnter.append("div").attr("class", "conflict-detail-container");
51351       details.append("ul").attr("class", "conflict-detail-list").selectAll("li").data(function(d2) {
51352         return d2.details || [];
51353       }).enter().append("li").attr("class", "conflict-detail-item").html(function(d2) {
51354         return d2;
51355       });
51356       details.append("div").attr("class", "conflict-choices").call(addChoices);
51357       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(d2, i3) {
51358         return i3 === 0 && index === 0 || i3 === 1 && index === _conflictList.length - 1 || null;
51359       }).on("click", function(d3_event, d2) {
51360         d3_event.preventDefault();
51361         var container = parent2.selectAll(".conflict-container");
51362         var sign2 = d2 === "previous" ? -1 : 1;
51363         container.selectAll(".conflict").remove();
51364         container.call(showConflict, index + sign2);
51365       }).each(function(d2) {
51366         _t.append("save.conflict." + d2)(select_default2(this));
51367       });
51368     }
51369     function addChoices(selection2) {
51370       var choices = selection2.append("ul").attr("class", "layer-list").selectAll("li").data(function(d2) {
51371         return d2.choices || [];
51372       });
51373       var choicesEnter = choices.enter().append("li").attr("class", "layer");
51374       var labelEnter = choicesEnter.append("label");
51375       labelEnter.append("input").attr("type", "radio").attr("name", function(d2) {
51376         return d2.id;
51377       }).on("change", function(d3_event, d2) {
51378         var ul = this.parentNode.parentNode.parentNode;
51379         ul.__data__.chosen = d2.id;
51380         choose(d3_event, ul, d2);
51381       });
51382       labelEnter.append("span").text(function(d2) {
51383         return d2.text;
51384       });
51385       choicesEnter.merge(choices).each(function(d2) {
51386         var ul = this.parentNode;
51387         if (ul.__data__.chosen === d2.id) {
51388           choose(null, ul, d2);
51389         }
51390       });
51391     }
51392     function choose(d3_event, ul, datum2) {
51393       if (d3_event) d3_event.preventDefault();
51394       select_default2(ul).selectAll("li").classed("active", function(d2) {
51395         return d2 === datum2;
51396       }).selectAll("input").property("checked", function(d2) {
51397         return d2 === datum2;
51398       });
51399       var extent = geoExtent();
51400       var entity;
51401       entity = context.graph().hasEntity(datum2.id);
51402       if (entity) extent._extend(entity.extent(context.graph()));
51403       datum2.action();
51404       entity = context.graph().hasEntity(datum2.id);
51405       if (entity) extent._extend(entity.extent(context.graph()));
51406       zoomToEntity(datum2.id, extent);
51407     }
51408     function zoomToEntity(id2, extent) {
51409       context.surface().selectAll(".hover").classed("hover", false);
51410       var entity = context.graph().hasEntity(id2);
51411       if (entity) {
51412         if (extent) {
51413           context.map().trimmedExtent(extent);
51414         } else {
51415           context.map().zoomToEase(entity);
51416         }
51417         context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
51418       }
51419     }
51420     conflicts.conflictList = function(_3) {
51421       if (!arguments.length) return _conflictList;
51422       _conflictList = _3;
51423       return conflicts;
51424     };
51425     conflicts.origChanges = function(_3) {
51426       if (!arguments.length) return _origChanges;
51427       _origChanges = _3;
51428       return conflicts;
51429     };
51430     conflicts.shownEntityIds = function() {
51431       if (_conflictList && typeof _shownConflictIndex === "number") {
51432         return [_conflictList[_shownConflictIndex].id];
51433       }
51434       return [];
51435     };
51436     return utilRebind(conflicts, dispatch12, "on");
51437   }
51438
51439   // modules/ui/confirm.js
51440   function uiConfirm(selection2) {
51441     var modalSelection = uiModal(selection2);
51442     modalSelection.select(".modal").classed("modal-alert", true);
51443     var section = modalSelection.select(".content");
51444     section.append("div").attr("class", "modal-section header");
51445     section.append("div").attr("class", "modal-section message-text");
51446     var buttons = section.append("div").attr("class", "modal-section buttons cf");
51447     modalSelection.okButton = function() {
51448       buttons.append("button").attr("class", "button ok-button action").on("click.confirm", function() {
51449         modalSelection.remove();
51450       }).call(_t.append("confirm.okay")).node().focus();
51451       return modalSelection;
51452     };
51453     return modalSelection;
51454   }
51455
51456   // modules/ui/commit.js
51457   var import_fast_deep_equal11 = __toESM(require_fast_deep_equal(), 1);
51458
51459   // modules/ui/popover.js
51460   var _popoverID = 0;
51461   function uiPopover(klass) {
51462     var _id = _popoverID++;
51463     var _anchorSelection = select_default2(null);
51464     var popover = function(selection2) {
51465       _anchorSelection = selection2;
51466       selection2.each(setup);
51467     };
51468     var _animation = utilFunctor(false);
51469     var _placement = utilFunctor("top");
51470     var _alignment = utilFunctor("center");
51471     var _scrollContainer = utilFunctor(select_default2(null));
51472     var _content;
51473     var _displayType = utilFunctor("");
51474     var _hasArrow = utilFunctor(true);
51475     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
51476     popover.displayType = function(val) {
51477       if (arguments.length) {
51478         _displayType = utilFunctor(val);
51479         return popover;
51480       } else {
51481         return _displayType;
51482       }
51483     };
51484     popover.hasArrow = function(val) {
51485       if (arguments.length) {
51486         _hasArrow = utilFunctor(val);
51487         return popover;
51488       } else {
51489         return _hasArrow;
51490       }
51491     };
51492     popover.placement = function(val) {
51493       if (arguments.length) {
51494         _placement = utilFunctor(val);
51495         return popover;
51496       } else {
51497         return _placement;
51498       }
51499     };
51500     popover.alignment = function(val) {
51501       if (arguments.length) {
51502         _alignment = utilFunctor(val);
51503         return popover;
51504       } else {
51505         return _alignment;
51506       }
51507     };
51508     popover.scrollContainer = function(val) {
51509       if (arguments.length) {
51510         _scrollContainer = utilFunctor(val);
51511         return popover;
51512       } else {
51513         return _scrollContainer;
51514       }
51515     };
51516     popover.content = function(val) {
51517       if (arguments.length) {
51518         _content = val;
51519         return popover;
51520       } else {
51521         return _content;
51522       }
51523     };
51524     popover.isShown = function() {
51525       var popoverSelection = _anchorSelection.select(".popover-" + _id);
51526       return !popoverSelection.empty() && popoverSelection.classed("in");
51527     };
51528     popover.show = function() {
51529       _anchorSelection.each(show);
51530     };
51531     popover.updateContent = function() {
51532       _anchorSelection.each(updateContent);
51533     };
51534     popover.hide = function() {
51535       _anchorSelection.each(hide);
51536     };
51537     popover.toggle = function() {
51538       _anchorSelection.each(toggle);
51539     };
51540     popover.destroy = function(selection2, selector) {
51541       selector = selector || ".popover-" + _id;
51542       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() {
51543         return this.getAttribute("data-original-title") || this.getAttribute("title");
51544       }).attr("data-original-title", null).selectAll(selector).remove();
51545     };
51546     popover.destroyAny = function(selection2) {
51547       selection2.call(popover.destroy, ".popover");
51548     };
51549     function setup() {
51550       var anchor = select_default2(this);
51551       var animate = _animation.apply(this, arguments);
51552       var popoverSelection = anchor.selectAll(".popover-" + _id).data([0]);
51553       var enter = popoverSelection.enter().append("div").attr("class", "popover popover-" + _id + " " + (klass ? klass : "")).classed("arrowed", _hasArrow.apply(this, arguments));
51554       enter.append("div").attr("class", "popover-arrow");
51555       enter.append("div").attr("class", "popover-inner");
51556       popoverSelection = enter.merge(popoverSelection);
51557       if (animate) {
51558         popoverSelection.classed("fade", true);
51559       }
51560       var display = _displayType.apply(this, arguments);
51561       if (display === "hover") {
51562         var _lastNonMouseEnterTime;
51563         anchor.on(_pointerPrefix + "enter.popover", function(d3_event) {
51564           if (d3_event.pointerType) {
51565             if (d3_event.pointerType !== "mouse") {
51566               _lastNonMouseEnterTime = d3_event.timeStamp;
51567               return;
51568             } else if (_lastNonMouseEnterTime && d3_event.timeStamp - _lastNonMouseEnterTime < 1500) {
51569               return;
51570             }
51571           }
51572           if (d3_event.buttons !== 0) return;
51573           show.apply(this, arguments);
51574         }).on(_pointerPrefix + "leave.popover", function() {
51575           hide.apply(this, arguments);
51576         }).on("focus.popover", function() {
51577           show.apply(this, arguments);
51578         }).on("blur.popover", function() {
51579           hide.apply(this, arguments);
51580         });
51581       } else if (display === "clickFocus") {
51582         anchor.on(_pointerPrefix + "down.popover", function(d3_event) {
51583           d3_event.preventDefault();
51584           d3_event.stopPropagation();
51585         }).on(_pointerPrefix + "up.popover", function(d3_event) {
51586           d3_event.preventDefault();
51587           d3_event.stopPropagation();
51588         }).on("click.popover", toggle);
51589         popoverSelection.attr("tabindex", 0).on("blur.popover", function() {
51590           anchor.each(function() {
51591             hide.apply(this, arguments);
51592           });
51593         });
51594       }
51595     }
51596     function show() {
51597       var anchor = select_default2(this);
51598       var popoverSelection = anchor.selectAll(".popover-" + _id);
51599       if (popoverSelection.empty()) {
51600         anchor.call(popover.destroy);
51601         anchor.each(setup);
51602         popoverSelection = anchor.selectAll(".popover-" + _id);
51603       }
51604       popoverSelection.classed("in", true);
51605       var displayType = _displayType.apply(this, arguments);
51606       if (displayType === "clickFocus") {
51607         anchor.classed("active", true);
51608         popoverSelection.node().focus();
51609       }
51610       anchor.each(updateContent);
51611     }
51612     function updateContent() {
51613       var anchor = select_default2(this);
51614       if (_content) {
51615         anchor.selectAll(".popover-" + _id + " > .popover-inner").call(_content.apply(this, arguments));
51616       }
51617       updatePosition.apply(this, arguments);
51618       updatePosition.apply(this, arguments);
51619       updatePosition.apply(this, arguments);
51620     }
51621     function updatePosition() {
51622       var anchor = select_default2(this);
51623       var popoverSelection = anchor.selectAll(".popover-" + _id);
51624       var scrollContainer = _scrollContainer && _scrollContainer.apply(this, arguments);
51625       var scrollNode = scrollContainer && !scrollContainer.empty() && scrollContainer.node();
51626       var scrollLeft = scrollNode ? scrollNode.scrollLeft : 0;
51627       var scrollTop = scrollNode ? scrollNode.scrollTop : 0;
51628       var placement = _placement.apply(this, arguments);
51629       popoverSelection.classed("left", false).classed("right", false).classed("top", false).classed("bottom", false).classed(placement, true);
51630       var alignment = _alignment.apply(this, arguments);
51631       var alignFactor = 0.5;
51632       if (alignment === "leading") {
51633         alignFactor = 0;
51634       } else if (alignment === "trailing") {
51635         alignFactor = 1;
51636       }
51637       var anchorFrame = getFrame(anchor.node());
51638       var popoverFrame = getFrame(popoverSelection.node());
51639       var position;
51640       switch (placement) {
51641         case "top":
51642           position = {
51643             x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
51644             y: anchorFrame.y - popoverFrame.h
51645           };
51646           break;
51647         case "bottom":
51648           position = {
51649             x: anchorFrame.x + (anchorFrame.w - popoverFrame.w) * alignFactor,
51650             y: anchorFrame.y + anchorFrame.h
51651           };
51652           break;
51653         case "left":
51654           position = {
51655             x: anchorFrame.x - popoverFrame.w,
51656             y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
51657           };
51658           break;
51659         case "right":
51660           position = {
51661             x: anchorFrame.x + anchorFrame.w,
51662             y: anchorFrame.y + (anchorFrame.h - popoverFrame.h) * alignFactor
51663           };
51664           break;
51665       }
51666       if (position) {
51667         if (scrollNode && (placement === "top" || placement === "bottom")) {
51668           var initialPosX = position.x;
51669           if (position.x + popoverFrame.w > scrollNode.offsetWidth - 10) {
51670             position.x = scrollNode.offsetWidth - 10 - popoverFrame.w;
51671           } else if (position.x < 10) {
51672             position.x = 10;
51673           }
51674           var arrow = anchor.selectAll(".popover-" + _id + " > .popover-arrow");
51675           var arrowPosX = Math.min(Math.max(popoverFrame.w / 2 - (position.x - initialPosX), 10), popoverFrame.w - 10);
51676           arrow.style("left", ~~arrowPosX + "px");
51677         }
51678         popoverSelection.style("left", ~~position.x + "px").style("top", ~~position.y + "px");
51679       } else {
51680         popoverSelection.style("left", null).style("top", null);
51681       }
51682       function getFrame(node) {
51683         var positionStyle = select_default2(node).style("position");
51684         if (positionStyle === "absolute" || positionStyle === "static") {
51685           return {
51686             x: node.offsetLeft - scrollLeft,
51687             y: node.offsetTop - scrollTop,
51688             w: node.offsetWidth,
51689             h: node.offsetHeight
51690           };
51691         } else {
51692           return {
51693             x: 0,
51694             y: 0,
51695             w: node.offsetWidth,
51696             h: node.offsetHeight
51697           };
51698         }
51699       }
51700     }
51701     function hide() {
51702       var anchor = select_default2(this);
51703       if (_displayType.apply(this, arguments) === "clickFocus") {
51704         anchor.classed("active", false);
51705       }
51706       anchor.selectAll(".popover-" + _id).classed("in", false);
51707     }
51708     function toggle() {
51709       if (select_default2(this).select(".popover-" + _id).classed("in")) {
51710         hide.apply(this, arguments);
51711       } else {
51712         show.apply(this, arguments);
51713       }
51714     }
51715     return popover;
51716   }
51717
51718   // modules/ui/tooltip.js
51719   function uiTooltip(klass) {
51720     var tooltip = uiPopover((klass || "") + " tooltip").displayType("hover");
51721     var _title = function() {
51722       var title = this.getAttribute("data-original-title");
51723       if (title) {
51724         return title;
51725       } else {
51726         title = this.getAttribute("title");
51727         this.removeAttribute("title");
51728         this.setAttribute("data-original-title", title);
51729       }
51730       return title;
51731     };
51732     var _heading = utilFunctor(null);
51733     var _keys = utilFunctor(null);
51734     tooltip.title = function(val) {
51735       if (!arguments.length) return _title;
51736       _title = utilFunctor(val);
51737       return tooltip;
51738     };
51739     tooltip.heading = function(val) {
51740       if (!arguments.length) return _heading;
51741       _heading = utilFunctor(val);
51742       return tooltip;
51743     };
51744     tooltip.keys = function(val) {
51745       if (!arguments.length) return _keys;
51746       _keys = utilFunctor(val);
51747       return tooltip;
51748     };
51749     tooltip.content(function() {
51750       var heading = _heading.apply(this, arguments);
51751       var text = _title.apply(this, arguments);
51752       var keys2 = _keys.apply(this, arguments);
51753       var headingCallback = typeof heading === "function" ? heading : (s2) => s2.text(heading);
51754       var textCallback = typeof text === "function" ? text : (s2) => s2.text(text);
51755       return function(selection2) {
51756         var headingSelect = selection2.selectAll(".tooltip-heading").data(heading ? [heading] : []);
51757         headingSelect.exit().remove();
51758         headingSelect.enter().append("div").attr("class", "tooltip-heading").merge(headingSelect).text("").call(headingCallback);
51759         var textSelect = selection2.selectAll(".tooltip-text").data(text ? [text] : []);
51760         textSelect.exit().remove();
51761         textSelect.enter().append("div").attr("class", "tooltip-text").merge(textSelect).text("").call(textCallback);
51762         var keyhintWrap = selection2.selectAll(".keyhint-wrap").data(keys2 && keys2.length ? [0] : []);
51763         keyhintWrap.exit().remove();
51764         var keyhintWrapEnter = keyhintWrap.enter().append("div").attr("class", "keyhint-wrap");
51765         keyhintWrapEnter.append("span").call(_t.append("tooltip_keyhint"));
51766         keyhintWrap = keyhintWrapEnter.merge(keyhintWrap);
51767         keyhintWrap.selectAll("kbd.shortcut").data(keys2 && keys2.length ? keys2 : []).enter().append("kbd").attr("class", "shortcut").text(function(d2) {
51768           return d2;
51769         });
51770       };
51771     });
51772     return tooltip;
51773   }
51774
51775   // modules/ui/intro/helper.js
51776   function pointBox(loc, context) {
51777     var rect = context.surfaceRect();
51778     var point = context.curtainProjection(loc);
51779     return {
51780       left: point[0] + rect.left - 40,
51781       top: point[1] + rect.top - 60,
51782       width: 80,
51783       height: 90
51784     };
51785   }
51786   function pad(locOrBox, padding, context) {
51787     var box;
51788     if (locOrBox instanceof Array) {
51789       var rect = context.surfaceRect();
51790       var point = context.curtainProjection(locOrBox);
51791       box = {
51792         left: point[0] + rect.left,
51793         top: point[1] + rect.top
51794       };
51795     } else {
51796       box = locOrBox;
51797     }
51798     return {
51799       left: box.left - padding,
51800       top: box.top - padding,
51801       width: (box.width || 0) + 2 * padding,
51802       height: (box.width || 0) + 2 * padding
51803     };
51804   }
51805   function icon(name, svgklass, useklass) {
51806     return '<svg class="icon ' + (svgklass || "") + '"><use xlink:href="' + name + '"' + (useklass ? ' class="' + useklass + '"' : "") + "></use></svg>";
51807   }
51808   var helpStringReplacements;
51809   function helpHtml(id2, replacements) {
51810     if (!helpStringReplacements) {
51811       helpStringReplacements = {
51812         // insert icons corresponding to various UI elements
51813         point_icon: icon("#iD-icon-point", "inline"),
51814         line_icon: icon("#iD-icon-line", "inline"),
51815         area_icon: icon("#iD-icon-area", "inline"),
51816         note_icon: icon("#iD-icon-note", "inline add-note"),
51817         plus: icon("#iD-icon-plus", "inline"),
51818         minus: icon("#iD-icon-minus", "inline"),
51819         layers_icon: icon("#iD-icon-layers", "inline"),
51820         data_icon: icon("#iD-icon-data", "inline"),
51821         inspect: icon("#iD-icon-inspect", "inline"),
51822         help_icon: icon("#iD-icon-help", "inline"),
51823         undo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo", "inline"),
51824         redo_icon: icon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-undo" : "#iD-icon-redo", "inline"),
51825         save_icon: icon("#iD-icon-save", "inline"),
51826         // operation icons
51827         circularize_icon: icon("#iD-operation-circularize", "inline operation"),
51828         continue_icon: icon("#iD-operation-continue", "inline operation"),
51829         copy_icon: icon("#iD-operation-copy", "inline operation"),
51830         delete_icon: icon("#iD-operation-delete", "inline operation"),
51831         disconnect_icon: icon("#iD-operation-disconnect", "inline operation"),
51832         downgrade_icon: icon("#iD-operation-downgrade", "inline operation"),
51833         extract_icon: icon("#iD-operation-extract", "inline operation"),
51834         merge_icon: icon("#iD-operation-merge", "inline operation"),
51835         move_icon: icon("#iD-operation-move", "inline operation"),
51836         orthogonalize_icon: icon("#iD-operation-orthogonalize", "inline operation"),
51837         paste_icon: icon("#iD-operation-paste", "inline operation"),
51838         reflect_long_icon: icon("#iD-operation-reflect-long", "inline operation"),
51839         reflect_short_icon: icon("#iD-operation-reflect-short", "inline operation"),
51840         reverse_icon: icon("#iD-operation-reverse", "inline operation"),
51841         rotate_icon: icon("#iD-operation-rotate", "inline operation"),
51842         split_icon: icon("#iD-operation-split", "inline operation"),
51843         straighten_icon: icon("#iD-operation-straighten", "inline operation"),
51844         // interaction icons
51845         leftclick: icon("#iD-walkthrough-mouse-left", "inline operation"),
51846         rightclick: icon("#iD-walkthrough-mouse-right", "inline operation"),
51847         mousewheel_icon: icon("#iD-walkthrough-mousewheel", "inline operation"),
51848         tap_icon: icon("#iD-walkthrough-tap", "inline operation"),
51849         doubletap_icon: icon("#iD-walkthrough-doubletap", "inline operation"),
51850         longpress_icon: icon("#iD-walkthrough-longpress", "inline operation"),
51851         touchdrag_icon: icon("#iD-walkthrough-touchdrag", "inline operation"),
51852         pinch_icon: icon("#iD-walkthrough-pinch-apart", "inline operation"),
51853         // insert keys; may be localized and platform-dependent
51854         shift: uiCmd.display("\u21E7"),
51855         alt: uiCmd.display("\u2325"),
51856         return: uiCmd.display("\u21B5"),
51857         esc: _t.html("shortcuts.key.esc"),
51858         space: _t.html("shortcuts.key.space"),
51859         add_note_key: _t.html("modes.add_note.key"),
51860         help_key: _t.html("help.key"),
51861         shortcuts_key: _t.html("shortcuts.toggle.key"),
51862         // reference localized UI labels directly so that they'll always match
51863         save: _t.html("save.title"),
51864         undo: _t.html("undo.title"),
51865         redo: _t.html("redo.title"),
51866         upload: _t.html("commit.save"),
51867         point: _t.html("modes.add_point.title"),
51868         line: _t.html("modes.add_line.title"),
51869         area: _t.html("modes.add_area.title"),
51870         note: _t.html("modes.add_note.label"),
51871         circularize: _t.html("operations.circularize.title"),
51872         continue: _t.html("operations.continue.title"),
51873         copy: _t.html("operations.copy.title"),
51874         delete: _t.html("operations.delete.title"),
51875         disconnect: _t.html("operations.disconnect.title"),
51876         downgrade: _t.html("operations.downgrade.title"),
51877         extract: _t.html("operations.extract.title"),
51878         merge: _t.html("operations.merge.title"),
51879         move: _t.html("operations.move.title"),
51880         orthogonalize: _t.html("operations.orthogonalize.title"),
51881         paste: _t.html("operations.paste.title"),
51882         reflect_long: _t.html("operations.reflect.title.long"),
51883         reflect_short: _t.html("operations.reflect.title.short"),
51884         reverse: _t.html("operations.reverse.title"),
51885         rotate: _t.html("operations.rotate.title"),
51886         split: _t.html("operations.split.title"),
51887         straighten: _t.html("operations.straighten.title"),
51888         map_data: _t.html("map_data.title"),
51889         osm_notes: _t.html("map_data.layers.notes.title"),
51890         fields: _t.html("inspector.fields"),
51891         tags: _t.html("inspector.tags"),
51892         relations: _t.html("inspector.relations"),
51893         new_relation: _t.html("inspector.new_relation"),
51894         turn_restrictions: _t.html("_tagging.presets.fields.restrictions.label"),
51895         background_settings: _t.html("background.description"),
51896         imagery_offset: _t.html("background.fix_misalignment"),
51897         start_the_walkthrough: _t.html("splash.walkthrough"),
51898         help: _t.html("help.title"),
51899         ok: _t.html("intro.ok")
51900       };
51901       for (var key in helpStringReplacements) {
51902         helpStringReplacements[key] = { html: helpStringReplacements[key] };
51903       }
51904     }
51905     var reps;
51906     if (replacements) {
51907       reps = Object.assign(replacements, helpStringReplacements);
51908     } else {
51909       reps = helpStringReplacements;
51910     }
51911     return _t.html(id2, reps).replace(/\`(.*?)\`/g, "<kbd>$1</kbd>");
51912   }
51913   function slugify(text) {
51914     return text.toString().toLowerCase().replace(/\s+/g, "-").replace(/[^\w\-]+/g, "").replace(/\-\-+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
51915   }
51916   var missingStrings = {};
51917   function checkKey(key, text) {
51918     if (_t(key, { default: void 0 }) === void 0) {
51919       if (missingStrings.hasOwnProperty(key)) return;
51920       missingStrings[key] = text;
51921       var missing = key + ": " + text;
51922       if (typeof console !== "undefined") console.log(missing);
51923     }
51924   }
51925   function localize(obj) {
51926     var key;
51927     var name = obj.tags && obj.tags.name;
51928     if (name) {
51929       key = "intro.graph.name." + slugify(name);
51930       obj.tags.name = _t(key, { default: name });
51931       checkKey(key, name);
51932     }
51933     var street = obj.tags && obj.tags["addr:street"];
51934     if (street) {
51935       key = "intro.graph.name." + slugify(street);
51936       obj.tags["addr:street"] = _t(key, { default: street });
51937       checkKey(key, street);
51938       var addrTags = [
51939         "block_number",
51940         "city",
51941         "county",
51942         "district",
51943         "hamlet",
51944         "neighbourhood",
51945         "postcode",
51946         "province",
51947         "quarter",
51948         "state",
51949         "subdistrict",
51950         "suburb"
51951       ];
51952       addrTags.forEach(function(k3) {
51953         var key2 = "intro.graph." + k3;
51954         var tag = "addr:" + k3;
51955         var val = obj.tags && obj.tags[tag];
51956         var str = _t(key2, { default: val });
51957         if (str) {
51958           if (str.match(/^<.*>$/) !== null) {
51959             delete obj.tags[tag];
51960           } else {
51961             obj.tags[tag] = str;
51962           }
51963         }
51964       });
51965     }
51966     return obj;
51967   }
51968   function isMostlySquare(points) {
51969     var threshold = 15;
51970     var lowerBound = Math.cos((90 - threshold) * Math.PI / 180);
51971     var upperBound = Math.cos(threshold * Math.PI / 180);
51972     for (var i3 = 0; i3 < points.length; i3++) {
51973       var a2 = points[(i3 - 1 + points.length) % points.length];
51974       var origin = points[i3];
51975       var b3 = points[(i3 + 1) % points.length];
51976       var dotp = geoVecNormalizedDot(a2, b3, origin);
51977       var mag = Math.abs(dotp);
51978       if (mag > lowerBound && mag < upperBound) {
51979         return false;
51980       }
51981     }
51982     return true;
51983   }
51984   function selectMenuItem(context, operation2) {
51985     return context.container().select(".edit-menu .edit-menu-item-" + operation2);
51986   }
51987   function transitionTime(point1, point2) {
51988     var distance = geoSphericalDistance(point1, point2);
51989     if (distance === 0) {
51990       return 0;
51991     } else if (distance < 80) {
51992       return 500;
51993     } else {
51994       return 1e3;
51995     }
51996   }
51997
51998   // modules/ui/field_help.js
51999   function uiFieldHelp(context, fieldName) {
52000     var fieldHelp = {};
52001     var _inspector = select_default2(null);
52002     var _wrap = select_default2(null);
52003     var _body = select_default2(null);
52004     var fieldHelpKeys = {
52005       restrictions: [
52006         ["about", [
52007           "about",
52008           "from_via_to",
52009           "maxdist",
52010           "maxvia"
52011         ]],
52012         ["inspecting", [
52013           "about",
52014           "from_shadow",
52015           "allow_shadow",
52016           "restrict_shadow",
52017           "only_shadow",
52018           "restricted",
52019           "only"
52020         ]],
52021         ["modifying", [
52022           "about",
52023           "indicators",
52024           "allow_turn",
52025           "restrict_turn",
52026           "only_turn"
52027         ]],
52028         ["tips", [
52029           "simple",
52030           "simple_example",
52031           "indirect",
52032           "indirect_example",
52033           "indirect_noedit"
52034         ]]
52035       ]
52036     };
52037     var fieldHelpHeadings = {};
52038     var replacements = {
52039       distField: { html: _t.html("restriction.controls.distance") },
52040       viaField: { html: _t.html("restriction.controls.via") },
52041       fromShadow: { html: icon("#iD-turn-shadow", "inline shadow from") },
52042       allowShadow: { html: icon("#iD-turn-shadow", "inline shadow allow") },
52043       restrictShadow: { html: icon("#iD-turn-shadow", "inline shadow restrict") },
52044       onlyShadow: { html: icon("#iD-turn-shadow", "inline shadow only") },
52045       allowTurn: { html: icon("#iD-turn-yes", "inline turn") },
52046       restrictTurn: { html: icon("#iD-turn-no", "inline turn") },
52047       onlyTurn: { html: icon("#iD-turn-only", "inline turn") }
52048     };
52049     var docs = fieldHelpKeys[fieldName].map(function(key) {
52050       var helpkey = "help.field." + fieldName + "." + key[0];
52051       var text = key[1].reduce(function(all, part) {
52052         var subkey = helpkey + "." + part;
52053         var depth = fieldHelpHeadings[subkey];
52054         var hhh = depth ? Array(depth + 1).join("#") + " " : "";
52055         return all + hhh + _t.html(subkey, replacements) + "\n\n";
52056       }, "");
52057       return {
52058         key: helpkey,
52059         title: _t.html(helpkey + ".title"),
52060         html: k(text.trim())
52061       };
52062     });
52063     function show() {
52064       updatePosition();
52065       _body.classed("hide", false).style("opacity", "0").transition().duration(200).style("opacity", "1");
52066     }
52067     function hide() {
52068       _body.classed("hide", true).transition().duration(200).style("opacity", "0").on("end", function() {
52069         _body.classed("hide", true);
52070       });
52071     }
52072     function clickHelp(index) {
52073       var d2 = docs[index];
52074       var tkeys = fieldHelpKeys[fieldName][index][1];
52075       _body.selectAll(".field-help-nav-item").classed("active", function(d4, i3) {
52076         return i3 === index;
52077       });
52078       var content = _body.selectAll(".field-help-content").html(d2.html);
52079       content.selectAll("p").attr("class", function(d4, i3) {
52080         return tkeys[i3];
52081       });
52082       if (d2.key === "help.field.restrictions.inspecting") {
52083         content.insert("img", "p.from_shadow").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_inspect.gif"));
52084       } else if (d2.key === "help.field.restrictions.modifying") {
52085         content.insert("img", "p.allow_turn").attr("class", "field-help-image cf").attr("src", context.imagePath("tr_modify.gif"));
52086       }
52087     }
52088     fieldHelp.button = function(selection2) {
52089       if (_body.empty()) return;
52090       var button = selection2.selectAll(".field-help-button").data([0]);
52091       button.enter().append("button").attr("class", "field-help-button").call(svgIcon("#iD-icon-help")).merge(button).on("click", function(d3_event) {
52092         d3_event.stopPropagation();
52093         d3_event.preventDefault();
52094         if (_body.classed("hide")) {
52095           show();
52096         } else {
52097           hide();
52098         }
52099       });
52100     };
52101     function updatePosition() {
52102       var wrap2 = _wrap.node();
52103       var inspector = _inspector.node();
52104       var wRect = wrap2.getBoundingClientRect();
52105       var iRect = inspector.getBoundingClientRect();
52106       _body.style("top", wRect.top + inspector.scrollTop - iRect.top + "px");
52107     }
52108     fieldHelp.body = function(selection2) {
52109       _wrap = selection2.selectAll(".form-field-input-wrap");
52110       if (_wrap.empty()) return;
52111       _inspector = context.container().select(".sidebar .entity-editor-pane .inspector-body");
52112       if (_inspector.empty()) return;
52113       _body = _inspector.selectAll(".field-help-body").data([0]);
52114       var enter = _body.enter().append("div").attr("class", "field-help-body hide");
52115       var titleEnter = enter.append("div").attr("class", "field-help-title cf");
52116       titleEnter.append("h2").attr("class", _mainLocalizer.textDirection() === "rtl" ? "fr" : "fl").call(_t.append("help.field." + fieldName + ".title"));
52117       titleEnter.append("button").attr("class", "fr close").attr("title", _t("icons.close")).on("click", function(d3_event) {
52118         d3_event.stopPropagation();
52119         d3_event.preventDefault();
52120         hide();
52121       }).call(svgIcon("#iD-icon-close"));
52122       var navEnter = enter.append("div").attr("class", "field-help-nav cf");
52123       var titles = docs.map(function(d2) {
52124         return d2.title;
52125       });
52126       navEnter.selectAll(".field-help-nav-item").data(titles).enter().append("div").attr("class", "field-help-nav-item").html(function(d2) {
52127         return d2;
52128       }).on("click", function(d3_event, d2) {
52129         d3_event.stopPropagation();
52130         d3_event.preventDefault();
52131         clickHelp(titles.indexOf(d2));
52132       });
52133       enter.append("div").attr("class", "field-help-content");
52134       _body = _body.merge(enter);
52135       clickHelp(0);
52136     };
52137     return fieldHelp;
52138   }
52139
52140   // modules/ui/fields/check.js
52141   function uiFieldCheck(field, context) {
52142     var dispatch12 = dispatch_default("change");
52143     var options = field.options;
52144     var values = [];
52145     var texts = [];
52146     var _tags;
52147     var input = select_default2(null);
52148     var text = select_default2(null);
52149     var label = select_default2(null);
52150     var reverser = select_default2(null);
52151     var _impliedYes;
52152     var _entityIDs = [];
52153     var _value;
52154     var stringsField = field.resolveReference("stringsCrossReference");
52155     if (!options && stringsField.options) {
52156       options = stringsField.options;
52157     }
52158     if (options) {
52159       for (var i3 in options) {
52160         var v3 = options[i3];
52161         values.push(v3 === "undefined" ? void 0 : v3);
52162         texts.push(stringsField.t.html("options." + v3, { "default": v3 }));
52163       }
52164     } else {
52165       values = [void 0, "yes"];
52166       texts = [_t.html("inspector.unknown"), _t.html("inspector.check.yes")];
52167       if (field.type !== "defaultCheck") {
52168         values.push("no");
52169         texts.push(_t.html("inspector.check.no"));
52170       }
52171     }
52172     function checkImpliedYes() {
52173       _impliedYes = field.id === "oneway_yes";
52174       if (field.id === "oneway") {
52175         var entity = context.entity(_entityIDs[0]);
52176         if (entity.type === "way" && !!utilCheckTagDictionary(entity.tags, omit_default(osmOneWayTags, "oneway"))) {
52177           _impliedYes = true;
52178           texts[0] = _t.html("_tagging.presets.fields.oneway_yes.options.undefined");
52179         }
52180       }
52181     }
52182     function reverserHidden() {
52183       if (!context.container().select("div.inspector-hover").empty()) return true;
52184       return !(_value === "yes" || _impliedYes && !_value);
52185     }
52186     function reverserSetText(selection2) {
52187       var entity = _entityIDs.length && context.hasEntity(_entityIDs[0]);
52188       if (reverserHidden() || !entity) return selection2;
52189       var first = entity.first();
52190       var last2 = entity.isClosed() ? entity.nodes[entity.nodes.length - 2] : entity.last();
52191       var pseudoDirection = first < last2;
52192       var icon2 = pseudoDirection ? "#iD-icon-forward" : "#iD-icon-backward";
52193       selection2.selectAll(".reverser-span").html("").call(_t.append("inspector.check.reverser")).call(svgIcon(icon2, "inline"));
52194       return selection2;
52195     }
52196     var check = function(selection2) {
52197       checkImpliedYes();
52198       label = selection2.selectAll(".form-field-input-wrap").data([0]);
52199       var enter = label.enter().append("label").attr("class", "form-field-input-wrap form-field-input-check");
52200       enter.append("input").property("indeterminate", field.type !== "defaultCheck").attr("type", "checkbox").attr("id", field.domId);
52201       enter.append("span").html(texts[0]).attr("class", "value");
52202       if (field.type === "onewayCheck") {
52203         enter.append("button").attr("class", "reverser" + (reverserHidden() ? " hide" : "")).append("span").attr("class", "reverser-span");
52204       }
52205       label = label.merge(enter);
52206       input = label.selectAll("input");
52207       text = label.selectAll("span.value");
52208       input.on("click", function(d3_event) {
52209         d3_event.stopPropagation();
52210         var t2 = {};
52211         if (Array.isArray(_tags[field.key])) {
52212           if (values.indexOf("yes") !== -1) {
52213             t2[field.key] = "yes";
52214           } else {
52215             t2[field.key] = values[0];
52216           }
52217         } else {
52218           t2[field.key] = values[(values.indexOf(_value) + 1) % values.length];
52219         }
52220         if (t2[field.key] === "reversible" || t2[field.key] === "alternating") {
52221           t2[field.key] = values[0];
52222         }
52223         dispatch12.call("change", this, t2);
52224       });
52225       if (field.type === "onewayCheck") {
52226         reverser = label.selectAll(".reverser");
52227         reverser.call(reverserSetText).on("click", function(d3_event) {
52228           d3_event.preventDefault();
52229           d3_event.stopPropagation();
52230           context.perform(
52231             function(graph) {
52232               for (var i4 in _entityIDs) {
52233                 graph = actionReverse(_entityIDs[i4])(graph);
52234               }
52235               return graph;
52236             },
52237             _t("operations.reverse.annotation.line", { n: 1 })
52238           );
52239           context.validator().validate();
52240           select_default2(this).call(reverserSetText);
52241         });
52242       }
52243     };
52244     check.entityIDs = function(val) {
52245       if (!arguments.length) return _entityIDs;
52246       _entityIDs = val;
52247       return check;
52248     };
52249     check.tags = function(tags) {
52250       _tags = tags;
52251       function isChecked(val) {
52252         return val !== "no" && val !== "" && val !== void 0 && val !== null;
52253       }
52254       function textFor(val) {
52255         if (val === "") val = void 0;
52256         var index = values.indexOf(val);
52257         return index !== -1 ? texts[index] : '"' + val + '"';
52258       }
52259       checkImpliedYes();
52260       var isMixed = Array.isArray(tags[field.key]);
52261       _value = !isMixed && tags[field.key] && tags[field.key].toLowerCase();
52262       if (field.type === "onewayCheck" && (_value === "1" || _value === "-1")) {
52263         _value = "yes";
52264       }
52265       input.property("indeterminate", isMixed || field.type !== "defaultCheck" && !_value).property("checked", isChecked(_value));
52266       text.html(isMixed ? _t.html("inspector.multiple_values") : textFor(_value)).classed("mixed", isMixed);
52267       label.classed("set", !!_value);
52268       if (field.type === "onewayCheck") {
52269         reverser.classed("hide", reverserHidden()).call(reverserSetText);
52270       }
52271     };
52272     check.focus = function() {
52273       input.node().focus();
52274     };
52275     return utilRebind(check, dispatch12, "on");
52276   }
52277
52278   // modules/svg/areas.js
52279   var import_fast_deep_equal6 = __toESM(require_fast_deep_equal(), 1);
52280
52281   // modules/svg/helpers.js
52282   function svgPassiveVertex(node, graph, activeID) {
52283     if (!activeID) return 1;
52284     if (activeID === node.id) return 0;
52285     var parents = graph.parentWays(node);
52286     var i3, j3, nodes, isClosed, ix1, ix2, ix3, ix4, max3;
52287     for (i3 = 0; i3 < parents.length; i3++) {
52288       nodes = parents[i3].nodes;
52289       isClosed = parents[i3].isClosed();
52290       for (j3 = 0; j3 < nodes.length; j3++) {
52291         if (nodes[j3] === node.id) {
52292           ix1 = j3 - 2;
52293           ix2 = j3 - 1;
52294           ix3 = j3 + 1;
52295           ix4 = j3 + 2;
52296           if (isClosed) {
52297             max3 = nodes.length - 1;
52298             if (ix1 < 0) ix1 = max3 + ix1;
52299             if (ix2 < 0) ix2 = max3 + ix2;
52300             if (ix3 > max3) ix3 = ix3 - max3;
52301             if (ix4 > max3) ix4 = ix4 - max3;
52302           }
52303           if (nodes[ix1] === activeID) return 0;
52304           else if (nodes[ix2] === activeID) return 2;
52305           else if (nodes[ix3] === activeID) return 2;
52306           else if (nodes[ix4] === activeID) return 0;
52307           else if (isClosed && nodes.indexOf(activeID) !== -1) return 0;
52308         }
52309       }
52310     }
52311     return 1;
52312   }
52313   function svgMarkerSegments(projection2, graph, dt2, shouldReverse = () => false, bothDirections = () => false) {
52314     return function(entity) {
52315       let i3 = 0;
52316       let offset = dt2 / 2;
52317       const segments = [];
52318       const clip = paddedClipExtent(projection2);
52319       const coordinates = graph.childNodes(entity).map(function(n3) {
52320         return n3.loc;
52321       });
52322       let a2, b3;
52323       const _shouldReverse = shouldReverse(entity);
52324       const _bothDirections = bothDirections(entity);
52325       stream_default({
52326         type: "LineString",
52327         coordinates
52328       }, projection2.stream(clip({
52329         lineStart: function() {
52330         },
52331         lineEnd: function() {
52332           a2 = null;
52333         },
52334         point: function(x3, y3) {
52335           b3 = [x3, y3];
52336           if (a2) {
52337             let span = geoVecLength(a2, b3) - offset;
52338             if (span >= 0) {
52339               const heading = geoVecAngle(a2, b3);
52340               const dx = dt2 * Math.cos(heading);
52341               const dy = dt2 * Math.sin(heading);
52342               let p2 = [
52343                 a2[0] + offset * Math.cos(heading),
52344                 a2[1] + offset * Math.sin(heading)
52345               ];
52346               const coord2 = [a2, p2];
52347               for (span -= dt2; span >= 0; span -= dt2) {
52348                 p2 = geoVecAdd(p2, [dx, dy]);
52349                 coord2.push(p2);
52350               }
52351               coord2.push(b3);
52352               let segment = "";
52353               if (!_shouldReverse || _bothDirections) {
52354                 for (let j3 = 0; j3 < coord2.length; j3++) {
52355                   segment += (j3 === 0 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
52356                 }
52357                 segments.push({ id: entity.id, index: i3++, d: segment });
52358               }
52359               if (_shouldReverse || _bothDirections) {
52360                 segment = "";
52361                 for (let j3 = coord2.length - 1; j3 >= 0; j3--) {
52362                   segment += (j3 === coord2.length - 1 ? "M" : "L") + coord2[j3][0] + "," + coord2[j3][1];
52363                 }
52364                 segments.push({ id: entity.id, index: i3++, d: segment });
52365               }
52366             }
52367             offset = -span;
52368           }
52369           a2 = b3;
52370         }
52371       })));
52372       return segments;
52373     };
52374   }
52375   function svgPath(projection2, graph, isArea) {
52376     const cache = {};
52377     const project = projection2.stream;
52378     const clip = paddedClipExtent(projection2, isArea);
52379     const path = path_default().projection({ stream: function(output) {
52380       return project(clip(output));
52381     } });
52382     const svgpath = function(entity) {
52383       if (entity.id in cache) {
52384         return cache[entity.id];
52385       } else {
52386         return cache[entity.id] = path(entity.asGeoJSON(graph));
52387       }
52388     };
52389     svgpath.geojson = function(d2) {
52390       if (d2.__featurehash__ !== void 0) {
52391         if (d2.__featurehash__ in cache) {
52392           return cache[d2.__featurehash__];
52393         } else {
52394           return cache[d2.__featurehash__] = path(d2);
52395         }
52396       } else {
52397         return path(d2);
52398       }
52399     };
52400     return svgpath;
52401   }
52402   function svgPointTransform(projection2) {
52403     var svgpoint = function(entity) {
52404       var pt2 = projection2(entity.loc);
52405       return "translate(" + pt2[0] + "," + pt2[1] + ")";
52406     };
52407     svgpoint.geojson = function(d2) {
52408       return svgpoint(d2.properties.entity);
52409     };
52410     return svgpoint;
52411   }
52412   function svgRelationMemberTags(graph) {
52413     return function(entity) {
52414       var tags = entity.tags;
52415       var shouldCopyMultipolygonTags = !entity.hasInterestingTags();
52416       graph.parentRelations(entity).forEach(function(relation) {
52417         var type2 = relation.tags.type;
52418         if (type2 === "multipolygon" && shouldCopyMultipolygonTags || type2 === "boundary") {
52419           tags = Object.assign({}, relation.tags, tags);
52420         }
52421       });
52422       return tags;
52423     };
52424   }
52425   function svgSegmentWay(way, graph, activeID) {
52426     if (activeID === void 0) {
52427       return graph.transient(way, "waySegments", getWaySegments);
52428     } else {
52429       return getWaySegments();
52430     }
52431     function getWaySegments() {
52432       var isActiveWay = way.nodes.indexOf(activeID) !== -1;
52433       var features = { passive: [], active: [] };
52434       var start2 = {};
52435       var end = {};
52436       var node, type2;
52437       for (var i3 = 0; i3 < way.nodes.length; i3++) {
52438         node = graph.entity(way.nodes[i3]);
52439         type2 = svgPassiveVertex(node, graph, activeID);
52440         end = { node, type: type2 };
52441         if (start2.type !== void 0) {
52442           if (start2.node.id === activeID || end.node.id === activeID) {
52443           } else if (isActiveWay && (start2.type === 2 || end.type === 2)) {
52444             pushActive(start2, end, i3);
52445           } else if (start2.type === 0 && end.type === 0) {
52446             pushActive(start2, end, i3);
52447           } else {
52448             pushPassive(start2, end, i3);
52449           }
52450         }
52451         start2 = end;
52452       }
52453       return features;
52454       function pushActive(start3, end2, index) {
52455         features.active.push({
52456           type: "Feature",
52457           id: way.id + "-" + index + "-nope",
52458           properties: {
52459             nope: true,
52460             target: true,
52461             entity: way,
52462             nodes: [start3.node, end2.node],
52463             index
52464           },
52465           geometry: {
52466             type: "LineString",
52467             coordinates: [start3.node.loc, end2.node.loc]
52468           }
52469         });
52470       }
52471       function pushPassive(start3, end2, index) {
52472         features.passive.push({
52473           type: "Feature",
52474           id: way.id + "-" + index,
52475           properties: {
52476             target: true,
52477             entity: way,
52478             nodes: [start3.node, end2.node],
52479             index
52480           },
52481           geometry: {
52482             type: "LineString",
52483             coordinates: [start3.node.loc, end2.node.loc]
52484           }
52485         });
52486       }
52487     }
52488   }
52489   function paddedClipExtent(projection2, isArea = false) {
52490     var padding = isArea ? 65 : 5;
52491     var viewport = projection2.clipExtent();
52492     var paddedExtent = [
52493       [viewport[0][0] - padding, viewport[0][1] - padding],
52494       [viewport[1][0] + padding, viewport[1][1] + padding]
52495     ];
52496     return identity_default4().clipExtent(paddedExtent).stream;
52497   }
52498
52499   // modules/svg/tag_classes.js
52500   function svgTagClasses() {
52501     var primaries = [
52502       "building",
52503       "highway",
52504       "railway",
52505       "waterway",
52506       "aeroway",
52507       "aerialway",
52508       "piste:type",
52509       "boundary",
52510       "power",
52511       "amenity",
52512       "natural",
52513       "landuse",
52514       "leisure",
52515       "military",
52516       "place",
52517       "man_made",
52518       "route",
52519       "attraction",
52520       "roller_coaster",
52521       "building:part",
52522       "indoor",
52523       "climbing"
52524     ];
52525     var statuses = Object.keys(osmLifecyclePrefixes);
52526     var secondaries = [
52527       "oneway",
52528       "bridge",
52529       "tunnel",
52530       "embankment",
52531       "cutting",
52532       "barrier",
52533       "surface",
52534       "tracktype",
52535       "footway",
52536       "crossing",
52537       "service",
52538       "sport",
52539       "public_transport",
52540       "location",
52541       "parking",
52542       "golf",
52543       "type",
52544       "leisure",
52545       "man_made",
52546       "indoor",
52547       "construction",
52548       "proposed"
52549     ];
52550     var _tags = function(entity) {
52551       return entity.tags;
52552     };
52553     var tagClasses = function(selection2) {
52554       selection2.each(function tagClassesEach(entity) {
52555         var value = this.className;
52556         if (value.baseVal !== void 0) {
52557           value = value.baseVal;
52558         }
52559         var t2 = _tags(entity);
52560         var computed = tagClasses.getClassesString(t2, value);
52561         if (computed !== value) {
52562           select_default2(this).attr("class", computed);
52563         }
52564       });
52565     };
52566     tagClasses.getClassesString = function(t2, value) {
52567       var primary, status;
52568       var i3, j3, k3, v3;
52569       var overrideGeometry;
52570       if (/\bstroke\b/.test(value)) {
52571         if (!!t2.barrier && t2.barrier !== "no") {
52572           overrideGeometry = "line";
52573         }
52574       }
52575       var classes = value.trim().split(/\s+/).filter(function(klass) {
52576         return klass.length && !/^tag-/.test(klass);
52577       }).map(function(klass) {
52578         return klass === "line" || klass === "area" ? overrideGeometry || klass : klass;
52579       });
52580       for (i3 = 0; i3 < primaries.length; i3++) {
52581         k3 = primaries[i3];
52582         v3 = t2[k3];
52583         if (!v3 || v3 === "no") continue;
52584         if (k3 === "piste:type") {
52585           k3 = "piste";
52586         } else if (k3 === "building:part") {
52587           k3 = "building_part";
52588         }
52589         primary = k3;
52590         if (statuses.indexOf(v3) !== -1) {
52591           status = v3;
52592           classes.push("tag-" + k3);
52593         } else {
52594           classes.push("tag-" + k3);
52595           classes.push("tag-" + k3 + "-" + v3);
52596         }
52597         break;
52598       }
52599       if (!primary) {
52600         for (i3 = 0; i3 < statuses.length; i3++) {
52601           for (j3 = 0; j3 < primaries.length; j3++) {
52602             k3 = statuses[i3] + ":" + primaries[j3];
52603             v3 = t2[k3];
52604             if (!v3 || v3 === "no") continue;
52605             status = statuses[i3];
52606             break;
52607           }
52608         }
52609       }
52610       if (!status) {
52611         for (i3 = 0; i3 < statuses.length; i3++) {
52612           k3 = statuses[i3];
52613           v3 = t2[k3];
52614           if (!v3 || v3 === "no") continue;
52615           if (v3 === "yes") {
52616             status = k3;
52617           } else if (primary && primary === v3) {
52618             status = k3;
52619           } else if (!primary && primaries.indexOf(v3) !== -1) {
52620             status = k3;
52621             primary = v3;
52622             classes.push("tag-" + v3);
52623           }
52624           if (status) break;
52625         }
52626       }
52627       if (status) {
52628         classes.push("tag-status");
52629         classes.push("tag-status-" + status);
52630       }
52631       for (i3 = 0; i3 < secondaries.length; i3++) {
52632         k3 = secondaries[i3];
52633         v3 = t2[k3];
52634         if (!v3 || v3 === "no" || k3 === primary) continue;
52635         classes.push("tag-" + k3);
52636         classes.push("tag-" + k3 + "-" + v3);
52637       }
52638       if (primary === "highway" && !osmPathHighwayTagValues[t2.highway] || primary === "aeroway") {
52639         var surface = t2.highway === "track" ? "unpaved" : "paved";
52640         for (k3 in t2) {
52641           v3 = t2[k3];
52642           if (k3 in osmPavedTags) {
52643             surface = osmPavedTags[k3][v3] ? "paved" : "unpaved";
52644           }
52645           if (k3 in osmSemipavedTags && !!osmSemipavedTags[k3][v3]) {
52646             surface = "semipaved";
52647           }
52648         }
52649         classes.push("tag-" + surface);
52650       }
52651       var qid = t2.wikidata || t2["flag:wikidata"] || t2["brand:wikidata"] || t2["network:wikidata"] || t2["operator:wikidata"];
52652       if (qid) {
52653         classes.push("tag-wikidata");
52654       }
52655       return classes.filter((klass) => /^[-_a-z0-9]+$/.test(klass)).join(" ").trim();
52656     };
52657     tagClasses.tags = function(val) {
52658       if (!arguments.length) return _tags;
52659       _tags = val;
52660       return tagClasses;
52661     };
52662     return tagClasses;
52663   }
52664
52665   // modules/svg/tag_pattern.js
52666   var patterns = {
52667     // tag - pattern name
52668     // -or-
52669     // tag - value - pattern name
52670     // -or-
52671     // tag - value - rules (optional tag-values, pattern name)
52672     // (matches earlier rules first, so fallback should be last entry)
52673     amenity: {
52674       grave_yard: "cemetery",
52675       fountain: "water_standing"
52676     },
52677     landuse: {
52678       cemetery: [
52679         { religion: "christian", pattern: "cemetery_christian" },
52680         { religion: "buddhist", pattern: "cemetery_buddhist" },
52681         { religion: "muslim", pattern: "cemetery_muslim" },
52682         { religion: "jewish", pattern: "cemetery_jewish" },
52683         { pattern: "cemetery" }
52684       ],
52685       construction: "construction",
52686       farmland: "farmland",
52687       farmyard: "farmyard",
52688       forest: [
52689         { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
52690         { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
52691         { leaf_type: "leafless", pattern: "forest_leafless" },
52692         { pattern: "forest" }
52693         // same as 'leaf_type:mixed'
52694       ],
52695       grave_yard: "cemetery",
52696       grass: "grass",
52697       landfill: "landfill",
52698       meadow: "meadow",
52699       military: "construction",
52700       orchard: "orchard",
52701       quarry: "quarry",
52702       vineyard: "vineyard"
52703     },
52704     leisure: {
52705       horse_riding: "farmyard"
52706     },
52707     natural: {
52708       beach: "beach",
52709       grassland: "grass",
52710       sand: "beach",
52711       scrub: "scrub",
52712       water: [
52713         { water: "pond", pattern: "pond" },
52714         { water: "reservoir", pattern: "water_standing" },
52715         { pattern: "waves" }
52716       ],
52717       wetland: [
52718         { wetland: "marsh", pattern: "wetland_marsh" },
52719         { wetland: "swamp", pattern: "wetland_swamp" },
52720         { wetland: "bog", pattern: "wetland_bog" },
52721         { wetland: "reedbed", pattern: "wetland_reedbed" },
52722         { pattern: "wetland" }
52723       ],
52724       wood: [
52725         { leaf_type: "broadleaved", pattern: "forest_broadleaved" },
52726         { leaf_type: "needleleaved", pattern: "forest_needleleaved" },
52727         { leaf_type: "leafless", pattern: "forest_leafless" },
52728         { pattern: "forest" }
52729         // same as 'leaf_type:mixed'
52730       ]
52731     },
52732     golf: {
52733       green: "golf_green",
52734       tee: "grass",
52735       fairway: "grass",
52736       rough: "scrub"
52737     },
52738     surface: {
52739       grass: "grass",
52740       sand: "beach"
52741     }
52742   };
52743   function svgTagPattern(tags) {
52744     if (tags.building && tags.building !== "no") {
52745       return null;
52746     }
52747     for (var tag in patterns) {
52748       var entityValue = tags[tag];
52749       if (!entityValue) continue;
52750       if (typeof patterns[tag] === "string") {
52751         return "pattern-" + patterns[tag];
52752       } else {
52753         var values = patterns[tag];
52754         for (var value in values) {
52755           if (entityValue !== value) continue;
52756           var rules = values[value];
52757           if (typeof rules === "string") {
52758             return "pattern-" + rules;
52759           }
52760           for (var ruleKey in rules) {
52761             var rule = rules[ruleKey];
52762             var pass = true;
52763             for (var criterion in rule) {
52764               if (criterion !== "pattern") {
52765                 var v3 = tags[criterion];
52766                 if (!v3 || v3 !== rule[criterion]) {
52767                   pass = false;
52768                   break;
52769                 }
52770               }
52771             }
52772             if (pass) {
52773               return "pattern-" + rule.pattern;
52774             }
52775           }
52776         }
52777       }
52778     }
52779     return null;
52780   }
52781
52782   // modules/svg/areas.js
52783   function svgAreas(projection2, context) {
52784     function getPatternStyle(tags) {
52785       var imageID = svgTagPattern(tags);
52786       if (imageID) {
52787         return 'url("#ideditor-' + imageID + '")';
52788       }
52789       return "";
52790     }
52791     function drawTargets(selection2, graph, entities, filter2) {
52792       var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
52793       var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
52794       var getPath = svgPath(projection2).geojson;
52795       var activeID = context.activeID();
52796       var base = context.history().base();
52797       var data = { targets: [], nopes: [] };
52798       entities.forEach(function(way) {
52799         var features = svgSegmentWay(way, graph, activeID);
52800         data.targets.push.apply(data.targets, features.passive);
52801         data.nopes.push.apply(data.nopes, features.active);
52802       });
52803       var targetData = data.targets.filter(getPath);
52804       var targets = selection2.selectAll(".area.target-allowed").filter(function(d2) {
52805         return filter2(d2.properties.entity);
52806       }).data(targetData, function key(d2) {
52807         return d2.id;
52808       });
52809       targets.exit().remove();
52810       var segmentWasEdited = function(d2) {
52811         var wayID = d2.properties.entity.id;
52812         if (!base.entities[wayID] || !(0, import_fast_deep_equal6.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
52813           return false;
52814         }
52815         return d2.properties.nodes.some(function(n3) {
52816           return !base.entities[n3.id] || !(0, import_fast_deep_equal6.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
52817         });
52818       };
52819       targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d2) {
52820         return "way area target target-allowed " + targetClass + d2.id;
52821       }).classed("segment-edited", segmentWasEdited);
52822       var nopeData = data.nopes.filter(getPath);
52823       var nopes = selection2.selectAll(".area.target-nope").filter(function(d2) {
52824         return filter2(d2.properties.entity);
52825       }).data(nopeData, function key(d2) {
52826         return d2.id;
52827       });
52828       nopes.exit().remove();
52829       nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d2) {
52830         return "way area target target-nope " + nopeClass + d2.id;
52831       }).classed("segment-edited", segmentWasEdited);
52832     }
52833     function drawAreas(selection2, graph, entities, filter2) {
52834       var path = svgPath(projection2, graph, true);
52835       var areas = {};
52836       var base = context.history().base();
52837       for (var i3 = 0; i3 < entities.length; i3++) {
52838         var entity = entities[i3];
52839         if (entity.geometry(graph) !== "area") continue;
52840         if (!areas[entity.id]) {
52841           areas[entity.id] = {
52842             entity,
52843             area: Math.abs(entity.area(graph))
52844           };
52845         }
52846       }
52847       var fills = Object.values(areas).filter(function hasPath(a2) {
52848         return path(a2.entity);
52849       });
52850       fills.sort(function areaSort(a2, b3) {
52851         return b3.area - a2.area;
52852       });
52853       fills = fills.map(function(a2) {
52854         return a2.entity;
52855       });
52856       var strokes = fills.filter(function(area) {
52857         return area.type === "way";
52858       });
52859       var data = {
52860         clip: fills,
52861         shadow: strokes,
52862         stroke: strokes,
52863         fill: fills
52864       };
52865       var clipPaths = context.surface().selectAll("defs").selectAll(".clipPath-osm").filter(filter2).data(data.clip, osmEntity.key);
52866       clipPaths.exit().remove();
52867       var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-osm").attr("id", function(entity2) {
52868         return "ideditor-" + entity2.id + "-clippath";
52869       });
52870       clipPathsEnter.append("path");
52871       clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", path);
52872       var drawLayer = selection2.selectAll(".layer-osm.areas");
52873       var touchLayer = selection2.selectAll(".layer-touch.areas");
52874       var areagroup = drawLayer.selectAll("g.areagroup").data(["fill", "shadow", "stroke"]);
52875       areagroup = areagroup.enter().append("g").attr("class", function(d2) {
52876         return "areagroup area-" + d2;
52877       }).merge(areagroup);
52878       var paths = areagroup.selectAll("path").filter(filter2).data(function(layer) {
52879         return data[layer];
52880       }, osmEntity.key);
52881       paths.exit().remove();
52882       var fillpaths = selection2.selectAll(".area-fill path.area").nodes();
52883       var bisect = bisector(function(node) {
52884         return -node.__data__.area(graph);
52885       }).left;
52886       function sortedByArea(entity2) {
52887         if (this._parent.__data__ === "fill") {
52888           return fillpaths[bisect(fillpaths, -entity2.area(graph))];
52889         }
52890       }
52891       paths = paths.enter().insert("path", sortedByArea).merge(paths).each(function(entity2) {
52892         var layer = this.parentNode.__data__;
52893         this.setAttribute("class", entity2.type + " area " + layer + " " + entity2.id);
52894         if (layer === "fill") {
52895           this.setAttribute("clip-path", "url(#ideditor-" + entity2.id + "-clippath)");
52896           this.style.fill = this.style.stroke = getPatternStyle(entity2.tags);
52897         }
52898       }).classed("added", function(d2) {
52899         return !base.entities[d2.id];
52900       }).classed("geometry-edited", function(d2) {
52901         return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal6.default)(graph.entities[d2.id].nodes, base.entities[d2.id].nodes);
52902       }).classed("retagged", function(d2) {
52903         return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal6.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
52904       }).call(svgTagClasses()).attr("d", path);
52905       touchLayer.call(drawTargets, graph, data.stroke, filter2);
52906     }
52907     return drawAreas;
52908   }
52909
52910   // modules/svg/data.js
52911   var import_fast_json_stable_stringify2 = __toESM(require_fast_json_stable_stringify(), 1);
52912
52913   // node_modules/@tmcw/togeojson/dist/togeojson.es.mjs
52914   function $2(element, tagName) {
52915     return Array.from(element.getElementsByTagName(tagName));
52916   }
52917   function normalizeId(id2) {
52918     return id2[0] === "#" ? id2 : "#".concat(id2);
52919   }
52920   function $ns(element, tagName, ns) {
52921     return Array.from(element.getElementsByTagNameNS(ns, tagName));
52922   }
52923   function nodeVal(node) {
52924     node == null ? void 0 : node.normalize();
52925     return (node == null ? void 0 : node.textContent) || "";
52926   }
52927   function get1(node, tagName, callback) {
52928     const n3 = node.getElementsByTagName(tagName);
52929     const result = n3.length ? n3[0] : null;
52930     if (result && callback)
52931       callback(result);
52932     return result;
52933   }
52934   function get4(node, tagName, callback) {
52935     const properties = {};
52936     if (!node)
52937       return properties;
52938     const n3 = node.getElementsByTagName(tagName);
52939     const result = n3.length ? n3[0] : null;
52940     if (result && callback) {
52941       return callback(result, properties);
52942     }
52943     return properties;
52944   }
52945   function val1(node, tagName, callback) {
52946     const val = nodeVal(get1(node, tagName));
52947     if (val && callback)
52948       return callback(val) || {};
52949     return {};
52950   }
52951   function $num(node, tagName, callback) {
52952     const val = Number.parseFloat(nodeVal(get1(node, tagName)));
52953     if (Number.isNaN(val))
52954       return void 0;
52955     if (val && callback)
52956       return callback(val) || {};
52957     return {};
52958   }
52959   function num1(node, tagName, callback) {
52960     const val = Number.parseFloat(nodeVal(get1(node, tagName)));
52961     if (Number.isNaN(val))
52962       return void 0;
52963     if (callback)
52964       callback(val);
52965     return val;
52966   }
52967   function getMulti(node, propertyNames) {
52968     const properties = {};
52969     for (const property of propertyNames) {
52970       val1(node, property, (val) => {
52971         properties[property] = val;
52972       });
52973     }
52974     return properties;
52975   }
52976   function isElement(node) {
52977     return (node == null ? void 0 : node.nodeType) === 1;
52978   }
52979   function getExtensions(node) {
52980     let values = [];
52981     if (node === null)
52982       return values;
52983     for (const child of Array.from(node.childNodes)) {
52984       if (!isElement(child))
52985         continue;
52986       const name = abbreviateName(child.nodeName);
52987       if (name === "gpxtpx:TrackPointExtension") {
52988         values = values.concat(getExtensions(child));
52989       } else {
52990         const val = nodeVal(child);
52991         values.push([name, parseNumeric(val)]);
52992       }
52993     }
52994     return values;
52995   }
52996   function abbreviateName(name) {
52997     return ["heart", "gpxtpx:hr", "hr"].includes(name) ? "heart" : name;
52998   }
52999   function parseNumeric(val) {
53000     const num = Number.parseFloat(val);
53001     return Number.isNaN(num) ? val : num;
53002   }
53003   function coordPair$1(node) {
53004     const ll = [
53005       Number.parseFloat(node.getAttribute("lon") || ""),
53006       Number.parseFloat(node.getAttribute("lat") || "")
53007     ];
53008     if (Number.isNaN(ll[0]) || Number.isNaN(ll[1])) {
53009       return null;
53010     }
53011     num1(node, "ele", (val) => {
53012       ll.push(val);
53013     });
53014     const time = get1(node, "time");
53015     return {
53016       coordinates: ll,
53017       time: time ? nodeVal(time) : null,
53018       extendedValues: getExtensions(get1(node, "extensions"))
53019     };
53020   }
53021   function getLineStyle(node) {
53022     return get4(node, "line", (lineStyle) => {
53023       const val = Object.assign({}, val1(lineStyle, "color", (color2) => {
53024         return { stroke: "#".concat(color2) };
53025       }), $num(lineStyle, "opacity", (opacity) => {
53026         return { "stroke-opacity": opacity };
53027       }), $num(lineStyle, "width", (width) => {
53028         return { "stroke-width": width * 96 / 25.4 };
53029       }));
53030       return val;
53031     });
53032   }
53033   function extractProperties(ns, node) {
53034     var _a5;
53035     const properties = getMulti(node, [
53036       "name",
53037       "cmt",
53038       "desc",
53039       "type",
53040       "time",
53041       "keywords"
53042     ]);
53043     for (const [n3, url] of ns) {
53044       for (const child of Array.from(node.getElementsByTagNameNS(url, "*"))) {
53045         properties[child.tagName.replace(":", "_")] = (_a5 = nodeVal(child)) == null ? void 0 : _a5.trim();
53046       }
53047     }
53048     const links = $2(node, "link");
53049     if (links.length) {
53050       properties.links = links.map((link2) => Object.assign({ href: link2.getAttribute("href") }, getMulti(link2, ["text", "type"])));
53051     }
53052     return properties;
53053   }
53054   function getPoints$1(node, pointname) {
53055     const pts = $2(node, pointname);
53056     const line = [];
53057     const times = [];
53058     const extendedValues = {};
53059     for (let i3 = 0; i3 < pts.length; i3++) {
53060       const c2 = coordPair$1(pts[i3]);
53061       if (!c2) {
53062         continue;
53063       }
53064       line.push(c2.coordinates);
53065       if (c2.time)
53066         times.push(c2.time);
53067       for (const [name, val] of c2.extendedValues) {
53068         const plural = name === "heart" ? name : "".concat(name.replace("gpxtpx:", ""), "s");
53069         if (!extendedValues[plural]) {
53070           extendedValues[plural] = Array(pts.length).fill(null);
53071         }
53072         extendedValues[plural][i3] = val;
53073       }
53074     }
53075     if (line.length < 2)
53076       return;
53077     return {
53078       line,
53079       times,
53080       extendedValues
53081     };
53082   }
53083   function getRoute(ns, node) {
53084     const line = getPoints$1(node, "rtept");
53085     if (!line)
53086       return;
53087     return {
53088       type: "Feature",
53089       properties: Object.assign({ _gpxType: "rte" }, extractProperties(ns, node), getLineStyle(get1(node, "extensions"))),
53090       geometry: {
53091         type: "LineString",
53092         coordinates: line.line
53093       }
53094     };
53095   }
53096   function getTrack(ns, node) {
53097     var _a5;
53098     const segments = $2(node, "trkseg");
53099     const track = [];
53100     const times = [];
53101     const extractedLines = [];
53102     for (const segment of segments) {
53103       const line = getPoints$1(segment, "trkpt");
53104       if (line) {
53105         extractedLines.push(line);
53106         if ((_a5 = line.times) == null ? void 0 : _a5.length)
53107           times.push(line.times);
53108       }
53109     }
53110     if (extractedLines.length === 0)
53111       return null;
53112     const multi = extractedLines.length > 1;
53113     const properties = Object.assign({ _gpxType: "trk" }, extractProperties(ns, node), getLineStyle(get1(node, "extensions")), times.length ? {
53114       coordinateProperties: {
53115         times: multi ? times : times[0]
53116       }
53117     } : {});
53118     for (let i3 = 0; i3 < extractedLines.length; i3++) {
53119       const line = extractedLines[i3];
53120       track.push(line.line);
53121       if (!properties.coordinateProperties) {
53122         properties.coordinateProperties = {};
53123       }
53124       const props = properties.coordinateProperties;
53125       for (const [name, val] of Object.entries(line.extendedValues)) {
53126         if (multi) {
53127           if (!props[name]) {
53128             props[name] = extractedLines.map((line2) => new Array(line2.line.length).fill(null));
53129           }
53130           props[name][i3] = val;
53131         } else {
53132           props[name] = val;
53133         }
53134       }
53135     }
53136     return {
53137       type: "Feature",
53138       properties,
53139       geometry: multi ? {
53140         type: "MultiLineString",
53141         coordinates: track
53142       } : {
53143         type: "LineString",
53144         coordinates: track[0]
53145       }
53146     };
53147   }
53148   function getPoint(ns, node) {
53149     const properties = Object.assign(extractProperties(ns, node), getMulti(node, ["sym"]));
53150     const pair3 = coordPair$1(node);
53151     if (!pair3)
53152       return null;
53153     return {
53154       type: "Feature",
53155       properties,
53156       geometry: {
53157         type: "Point",
53158         coordinates: pair3.coordinates
53159       }
53160     };
53161   }
53162   function* gpxGen(node) {
53163     var _a5, _b3;
53164     const n3 = node;
53165     const GPXX = "gpxx";
53166     const GPXX_URI = "http://www.garmin.com/xmlschemas/GpxExtensions/v3";
53167     const ns = [[GPXX, GPXX_URI]];
53168     const attrs = (_a5 = n3.getElementsByTagName("gpx")[0]) == null ? void 0 : _a5.attributes;
53169     if (attrs) {
53170       for (const attr of Array.from(attrs)) {
53171         if (((_b3 = attr.name) == null ? void 0 : _b3.startsWith("xmlns:")) && attr.value !== GPXX_URI) {
53172           ns.push([attr.name, attr.value]);
53173         }
53174       }
53175     }
53176     for (const track of $2(n3, "trk")) {
53177       const feature4 = getTrack(ns, track);
53178       if (feature4)
53179         yield feature4;
53180     }
53181     for (const route of $2(n3, "rte")) {
53182       const feature4 = getRoute(ns, route);
53183       if (feature4)
53184         yield feature4;
53185     }
53186     for (const waypoint of $2(n3, "wpt")) {
53187       const point = getPoint(ns, waypoint);
53188       if (point)
53189         yield point;
53190     }
53191   }
53192   function gpx(node) {
53193     return {
53194       type: "FeatureCollection",
53195       features: Array.from(gpxGen(node))
53196     };
53197   }
53198   function fixColor(v3, prefix) {
53199     const properties = {};
53200     const colorProp = prefix === "stroke" || prefix === "fill" ? prefix : "".concat(prefix, "-color");
53201     if (v3[0] === "#") {
53202       v3 = v3.substring(1);
53203     }
53204     if (v3.length === 6 || v3.length === 3) {
53205       properties[colorProp] = "#".concat(v3);
53206     } else if (v3.length === 8) {
53207       properties["".concat(prefix, "-opacity")] = Number.parseInt(v3.substring(0, 2), 16) / 255;
53208       properties[colorProp] = "#".concat(v3.substring(6, 8)).concat(v3.substring(4, 6)).concat(v3.substring(2, 4));
53209     }
53210     return properties;
53211   }
53212   function numericProperty(node, source, target) {
53213     const properties = {};
53214     num1(node, source, (val) => {
53215       properties[target] = val;
53216     });
53217     return properties;
53218   }
53219   function getColor(node, output) {
53220     return get4(node, "color", (elem) => fixColor(nodeVal(elem), output));
53221   }
53222   function extractIconHref(node) {
53223     return get4(node, "Icon", (icon2, properties) => {
53224       val1(icon2, "href", (href) => {
53225         properties.icon = href;
53226       });
53227       return properties;
53228     });
53229   }
53230   function extractIcon(node) {
53231     return get4(node, "IconStyle", (iconStyle) => {
53232       return Object.assign(getColor(iconStyle, "icon"), numericProperty(iconStyle, "scale", "icon-scale"), numericProperty(iconStyle, "heading", "icon-heading"), get4(iconStyle, "hotSpot", (hotspot) => {
53233         const left = Number.parseFloat(hotspot.getAttribute("x") || "");
53234         const top = Number.parseFloat(hotspot.getAttribute("y") || "");
53235         const xunits = hotspot.getAttribute("xunits") || "";
53236         const yunits = hotspot.getAttribute("yunits") || "";
53237         if (!Number.isNaN(left) && !Number.isNaN(top))
53238           return {
53239             "icon-offset": [left, top],
53240             "icon-offset-units": [xunits, yunits]
53241           };
53242         return {};
53243       }), extractIconHref(iconStyle));
53244     });
53245   }
53246   function extractLabel(node) {
53247     return get4(node, "LabelStyle", (labelStyle) => {
53248       return Object.assign(getColor(labelStyle, "label"), numericProperty(labelStyle, "scale", "label-scale"));
53249     });
53250   }
53251   function extractLine(node) {
53252     return get4(node, "LineStyle", (lineStyle) => {
53253       return Object.assign(getColor(lineStyle, "stroke"), numericProperty(lineStyle, "width", "stroke-width"));
53254     });
53255   }
53256   function extractPoly(node) {
53257     return get4(node, "PolyStyle", (polyStyle, properties) => {
53258       return Object.assign(properties, get4(polyStyle, "color", (elem) => fixColor(nodeVal(elem), "fill")), val1(polyStyle, "fill", (fill) => {
53259         if (fill === "0")
53260           return { "fill-opacity": 0 };
53261       }), val1(polyStyle, "outline", (outline) => {
53262         if (outline === "0")
53263           return { "stroke-opacity": 0 };
53264       }));
53265     });
53266   }
53267   function extractStyle(node) {
53268     return Object.assign({}, extractPoly(node), extractLine(node), extractLabel(node), extractIcon(node));
53269   }
53270   var removeSpace = /\s*/g;
53271   var trimSpace = /^\s*|\s*$/g;
53272   var splitSpace = /\s+/;
53273   function coord1(value) {
53274     return value.replace(removeSpace, "").split(",").map(Number.parseFloat).filter((num) => !Number.isNaN(num)).slice(0, 3);
53275   }
53276   function coord(value) {
53277     return value.replace(trimSpace, "").split(splitSpace).map(coord1).filter((coord2) => {
53278       return coord2.length >= 2;
53279     });
53280   }
53281   function gxCoords(node) {
53282     let elems = $2(node, "coord");
53283     if (elems.length === 0) {
53284       elems = $ns(node, "coord", "*");
53285     }
53286     const coordinates = elems.map((elem) => {
53287       return nodeVal(elem).split(" ").map(Number.parseFloat);
53288     });
53289     if (coordinates.length === 0) {
53290       return null;
53291     }
53292     return {
53293       geometry: coordinates.length > 2 ? {
53294         type: "LineString",
53295         coordinates
53296       } : {
53297         type: "Point",
53298         coordinates: coordinates[0]
53299       },
53300       times: $2(node, "when").map((elem) => nodeVal(elem))
53301     };
53302   }
53303   function fixRing(ring) {
53304     if (ring.length === 0)
53305       return ring;
53306     const first = ring[0];
53307     const last2 = ring[ring.length - 1];
53308     let equal = true;
53309     for (let i3 = 0; i3 < Math.max(first.length, last2.length); i3++) {
53310       if (first[i3] !== last2[i3]) {
53311         equal = false;
53312         break;
53313       }
53314     }
53315     if (!equal) {
53316       return ring.concat([ring[0]]);
53317     }
53318     return ring;
53319   }
53320   function getCoordinates(node) {
53321     return nodeVal(get1(node, "coordinates"));
53322   }
53323   function getGeometry(node) {
53324     let geometries = [];
53325     let coordTimes = [];
53326     for (let i3 = 0; i3 < node.childNodes.length; i3++) {
53327       const child = node.childNodes.item(i3);
53328       if (isElement(child)) {
53329         switch (child.tagName) {
53330           case "MultiGeometry":
53331           case "MultiTrack":
53332           case "gx:MultiTrack": {
53333             const childGeometries = getGeometry(child);
53334             geometries = geometries.concat(childGeometries.geometries);
53335             coordTimes = coordTimes.concat(childGeometries.coordTimes);
53336             break;
53337           }
53338           case "Point": {
53339             const coordinates = coord1(getCoordinates(child));
53340             if (coordinates.length >= 2) {
53341               geometries.push({
53342                 type: "Point",
53343                 coordinates
53344               });
53345             }
53346             break;
53347           }
53348           case "LinearRing":
53349           case "LineString": {
53350             const coordinates = coord(getCoordinates(child));
53351             if (coordinates.length >= 2) {
53352               geometries.push({
53353                 type: "LineString",
53354                 coordinates
53355               });
53356             }
53357             break;
53358           }
53359           case "Polygon": {
53360             const coords = [];
53361             for (const linearRing of $2(child, "LinearRing")) {
53362               const ring = fixRing(coord(getCoordinates(linearRing)));
53363               if (ring.length >= 4) {
53364                 coords.push(ring);
53365               }
53366             }
53367             if (coords.length) {
53368               geometries.push({
53369                 type: "Polygon",
53370                 coordinates: coords
53371               });
53372             }
53373             break;
53374           }
53375           case "Track":
53376           case "gx:Track": {
53377             const gx = gxCoords(child);
53378             if (!gx)
53379               break;
53380             const { times, geometry } = gx;
53381             geometries.push(geometry);
53382             if (times.length)
53383               coordTimes.push(times);
53384             break;
53385           }
53386         }
53387       }
53388     }
53389     return {
53390       geometries,
53391       coordTimes
53392     };
53393   }
53394   var toNumber2 = (x3) => Number(x3);
53395   var typeConverters = {
53396     string: (x3) => x3,
53397     int: toNumber2,
53398     uint: toNumber2,
53399     short: toNumber2,
53400     ushort: toNumber2,
53401     float: toNumber2,
53402     double: toNumber2,
53403     bool: (x3) => Boolean(x3)
53404   };
53405   function extractExtendedData(node, schema) {
53406     return get4(node, "ExtendedData", (extendedData, properties) => {
53407       for (const data of $2(extendedData, "Data")) {
53408         properties[data.getAttribute("name") || ""] = nodeVal(get1(data, "value"));
53409       }
53410       for (const simpleData of $2(extendedData, "SimpleData")) {
53411         const name = simpleData.getAttribute("name") || "";
53412         const typeConverter = schema[name] || typeConverters.string;
53413         properties[name] = typeConverter(nodeVal(simpleData));
53414       }
53415       return properties;
53416     });
53417   }
53418   function getMaybeHTMLDescription(node) {
53419     const descriptionNode = get1(node, "description");
53420     for (const c2 of Array.from((descriptionNode == null ? void 0 : descriptionNode.childNodes) || [])) {
53421       if (c2.nodeType === 4) {
53422         return {
53423           description: {
53424             "@type": "html",
53425             value: nodeVal(c2)
53426           }
53427         };
53428       }
53429     }
53430     return {};
53431   }
53432   function extractTimeSpan(node) {
53433     return get4(node, "TimeSpan", (timeSpan) => {
53434       return {
53435         timespan: {
53436           begin: nodeVal(get1(timeSpan, "begin")),
53437           end: nodeVal(get1(timeSpan, "end"))
53438         }
53439       };
53440     });
53441   }
53442   function extractTimeStamp(node) {
53443     return get4(node, "TimeStamp", (timeStamp) => {
53444       return { timestamp: nodeVal(get1(timeStamp, "when")) };
53445     });
53446   }
53447   function extractCascadedStyle(node, styleMap) {
53448     return val1(node, "styleUrl", (styleUrl) => {
53449       styleUrl = normalizeId(styleUrl);
53450       if (styleMap[styleUrl]) {
53451         return Object.assign({ styleUrl }, styleMap[styleUrl]);
53452       }
53453       return { styleUrl };
53454     });
53455   }
53456   var AltitudeMode;
53457   (function(AltitudeMode2) {
53458     AltitudeMode2["ABSOLUTE"] = "absolute";
53459     AltitudeMode2["RELATIVE_TO_GROUND"] = "relativeToGround";
53460     AltitudeMode2["CLAMP_TO_GROUND"] = "clampToGround";
53461     AltitudeMode2["CLAMP_TO_SEAFLOOR"] = "clampToSeaFloor";
53462     AltitudeMode2["RELATIVE_TO_SEAFLOOR"] = "relativeToSeaFloor";
53463   })(AltitudeMode || (AltitudeMode = {}));
53464   function processAltitudeMode(mode) {
53465     switch (mode == null ? void 0 : mode.textContent) {
53466       case AltitudeMode.ABSOLUTE:
53467         return AltitudeMode.ABSOLUTE;
53468       case AltitudeMode.CLAMP_TO_GROUND:
53469         return AltitudeMode.CLAMP_TO_GROUND;
53470       case AltitudeMode.CLAMP_TO_SEAFLOOR:
53471         return AltitudeMode.CLAMP_TO_SEAFLOOR;
53472       case AltitudeMode.RELATIVE_TO_GROUND:
53473         return AltitudeMode.RELATIVE_TO_GROUND;
53474       case AltitudeMode.RELATIVE_TO_SEAFLOOR:
53475         return AltitudeMode.RELATIVE_TO_SEAFLOOR;
53476     }
53477     return null;
53478   }
53479   function getGroundOverlayBox(node) {
53480     const latLonQuad = get1(node, "gx:LatLonQuad");
53481     if (latLonQuad) {
53482       const ring = fixRing(coord(getCoordinates(node)));
53483       return {
53484         geometry: {
53485           type: "Polygon",
53486           coordinates: [ring]
53487         }
53488       };
53489     }
53490     return getLatLonBox(node);
53491   }
53492   var DEGREES_TO_RADIANS = Math.PI / 180;
53493   function rotateBox(bbox2, coordinates, rotation) {
53494     const center = [(bbox2[0] + bbox2[2]) / 2, (bbox2[1] + bbox2[3]) / 2];
53495     return [
53496       coordinates[0].map((coordinate) => {
53497         const dy = coordinate[1] - center[1];
53498         const dx = coordinate[0] - center[0];
53499         const distance = Math.sqrt(dy ** 2 + dx ** 2);
53500         const angle2 = Math.atan2(dy, dx) + rotation * DEGREES_TO_RADIANS;
53501         return [
53502           center[0] + Math.cos(angle2) * distance,
53503           center[1] + Math.sin(angle2) * distance
53504         ];
53505       })
53506     ];
53507   }
53508   function getLatLonBox(node) {
53509     const latLonBox = get1(node, "LatLonBox");
53510     if (latLonBox) {
53511       const north = num1(latLonBox, "north");
53512       const west = num1(latLonBox, "west");
53513       const east = num1(latLonBox, "east");
53514       const south = num1(latLonBox, "south");
53515       const rotation = num1(latLonBox, "rotation");
53516       if (typeof north === "number" && typeof south === "number" && typeof west === "number" && typeof east === "number") {
53517         const bbox2 = [west, south, east, north];
53518         let coordinates = [
53519           [
53520             [west, north],
53521             // top left
53522             [east, north],
53523             // top right
53524             [east, south],
53525             // top right
53526             [west, south],
53527             // bottom left
53528             [west, north]
53529             // top left (again)
53530           ]
53531         ];
53532         if (typeof rotation === "number") {
53533           coordinates = rotateBox(bbox2, coordinates, rotation);
53534         }
53535         return {
53536           bbox: bbox2,
53537           geometry: {
53538             type: "Polygon",
53539             coordinates
53540           }
53541         };
53542       }
53543     }
53544     return null;
53545   }
53546   function getGroundOverlay(node, styleMap, schema, options) {
53547     var _a5;
53548     const box = getGroundOverlayBox(node);
53549     const geometry = (box == null ? void 0 : box.geometry) || null;
53550     if (!geometry && options.skipNullGeometry) {
53551       return null;
53552     }
53553     const feature4 = {
53554       type: "Feature",
53555       geometry,
53556       properties: Object.assign(
53557         /**
53558          * Related to
53559          * https://gist.github.com/tmcw/037a1cb6660d74a392e9da7446540f46
53560          */
53561         { "@geometry-type": "groundoverlay" },
53562         getMulti(node, [
53563           "name",
53564           "address",
53565           "visibility",
53566           "open",
53567           "phoneNumber",
53568           "description"
53569         ]),
53570         getMaybeHTMLDescription(node),
53571         extractCascadedStyle(node, styleMap),
53572         extractStyle(node),
53573         extractIconHref(node),
53574         extractExtendedData(node, schema),
53575         extractTimeSpan(node),
53576         extractTimeStamp(node)
53577       )
53578     };
53579     if (box == null ? void 0 : box.bbox) {
53580       feature4.bbox = box.bbox;
53581     }
53582     if (((_a5 = feature4.properties) == null ? void 0 : _a5.visibility) !== void 0) {
53583       feature4.properties.visibility = feature4.properties.visibility !== "0";
53584     }
53585     const id2 = node.getAttribute("id");
53586     if (id2 !== null && id2 !== "")
53587       feature4.id = id2;
53588     return feature4;
53589   }
53590   function getNetworkLinkRegion(node) {
53591     const region = get1(node, "Region");
53592     if (region) {
53593       return {
53594         coordinateBox: getLatLonAltBox(region),
53595         lod: getLod(node)
53596       };
53597     }
53598     return null;
53599   }
53600   function getLod(node) {
53601     var _a5, _b3, _c2, _d2;
53602     const lod = get1(node, "Lod");
53603     if (lod) {
53604       return [
53605         (_a5 = num1(lod, "minLodPixels")) != null ? _a5 : -1,
53606         (_b3 = num1(lod, "maxLodPixels")) != null ? _b3 : -1,
53607         (_c2 = num1(lod, "minFadeExtent")) != null ? _c2 : null,
53608         (_d2 = num1(lod, "maxFadeExtent")) != null ? _d2 : null
53609       ];
53610     }
53611     return null;
53612   }
53613   function getLatLonAltBox(node) {
53614     const latLonAltBox = get1(node, "LatLonAltBox");
53615     if (latLonAltBox) {
53616       const north = num1(latLonAltBox, "north");
53617       const west = num1(latLonAltBox, "west");
53618       const east = num1(latLonAltBox, "east");
53619       const south = num1(latLonAltBox, "south");
53620       const altitudeMode = processAltitudeMode(get1(latLonAltBox, "altitudeMode") || get1(latLonAltBox, "gx:altitudeMode"));
53621       if (altitudeMode) {
53622         console.debug("Encountered an unsupported feature of KML for togeojson: please contact developers for support of altitude mode.");
53623       }
53624       if (typeof north === "number" && typeof south === "number" && typeof west === "number" && typeof east === "number") {
53625         const bbox2 = [west, south, east, north];
53626         const coordinates = [
53627           [
53628             [west, north],
53629             // top left
53630             [east, north],
53631             // top right
53632             [east, south],
53633             // top right
53634             [west, south],
53635             // bottom left
53636             [west, north]
53637             // top left (again)
53638           ]
53639         ];
53640         return {
53641           bbox: bbox2,
53642           geometry: {
53643             type: "Polygon",
53644             coordinates
53645           }
53646         };
53647       }
53648     }
53649     return null;
53650   }
53651   function getLinkObject(node) {
53652     const linkObj = get1(node, "Link");
53653     if (linkObj) {
53654       return getMulti(linkObj, [
53655         "href",
53656         "refreshMode",
53657         "refreshInterval",
53658         "viewRefreshMode",
53659         "viewRefreshTime",
53660         "viewBoundScale",
53661         "viewFormat",
53662         "httpQuery"
53663       ]);
53664     }
53665     return {};
53666   }
53667   function getNetworkLink(node, styleMap, schema, options) {
53668     var _a5, _b3, _c2;
53669     const box = getNetworkLinkRegion(node);
53670     const geometry = ((_a5 = box == null ? void 0 : box.coordinateBox) == null ? void 0 : _a5.geometry) || null;
53671     if (!geometry && options.skipNullGeometry) {
53672       return null;
53673     }
53674     const feature4 = {
53675       type: "Feature",
53676       geometry,
53677       properties: Object.assign(
53678         /**
53679          * Related to
53680          * https://gist.github.com/tmcw/037a1cb6660d74a392e9da7446540f46
53681          */
53682         { "@geometry-type": "networklink" },
53683         getMulti(node, [
53684           "name",
53685           "address",
53686           "visibility",
53687           "open",
53688           "phoneNumber",
53689           "styleUrl",
53690           "refreshVisibility",
53691           "flyToView",
53692           "description"
53693         ]),
53694         getMaybeHTMLDescription(node),
53695         extractCascadedStyle(node, styleMap),
53696         extractStyle(node),
53697         extractIconHref(node),
53698         extractExtendedData(node, schema),
53699         extractTimeSpan(node),
53700         extractTimeStamp(node),
53701         getLinkObject(node),
53702         (box == null ? void 0 : box.lod) ? { lod: box.lod } : {}
53703       )
53704     };
53705     if ((_b3 = box == null ? void 0 : box.coordinateBox) == null ? void 0 : _b3.bbox) {
53706       feature4.bbox = box.coordinateBox.bbox;
53707     }
53708     if (((_c2 = feature4.properties) == null ? void 0 : _c2.visibility) !== void 0) {
53709       feature4.properties.visibility = feature4.properties.visibility !== "0";
53710     }
53711     const id2 = node.getAttribute("id");
53712     if (id2 !== null && id2 !== "")
53713       feature4.id = id2;
53714     return feature4;
53715   }
53716   function geometryListToGeometry(geometries) {
53717     return geometries.length === 0 ? null : geometries.length === 1 ? geometries[0] : {
53718       type: "GeometryCollection",
53719       geometries
53720     };
53721   }
53722   function getPlacemark(node, styleMap, schema, options) {
53723     var _a5;
53724     const { coordTimes, geometries } = getGeometry(node);
53725     const geometry = geometryListToGeometry(geometries);
53726     if (!geometry && options.skipNullGeometry) {
53727       return null;
53728     }
53729     const feature4 = {
53730       type: "Feature",
53731       geometry,
53732       properties: Object.assign(getMulti(node, [
53733         "name",
53734         "address",
53735         "visibility",
53736         "open",
53737         "phoneNumber",
53738         "description"
53739       ]), getMaybeHTMLDescription(node), extractCascadedStyle(node, styleMap), extractStyle(node), extractExtendedData(node, schema), extractTimeSpan(node), extractTimeStamp(node), coordTimes.length ? {
53740         coordinateProperties: {
53741           times: coordTimes.length === 1 ? coordTimes[0] : coordTimes
53742         }
53743       } : {})
53744     };
53745     if (((_a5 = feature4.properties) == null ? void 0 : _a5.visibility) !== void 0) {
53746       feature4.properties.visibility = feature4.properties.visibility !== "0";
53747     }
53748     const id2 = node.getAttribute("id");
53749     if (id2 !== null && id2 !== "")
53750       feature4.id = id2;
53751     return feature4;
53752   }
53753   function getStyleId(style) {
53754     let id2 = style.getAttribute("id");
53755     const parentNode = style.parentNode;
53756     if (!id2 && isElement(parentNode) && parentNode.localName === "CascadingStyle") {
53757       id2 = parentNode.getAttribute("kml:id") || parentNode.getAttribute("id");
53758     }
53759     return normalizeId(id2 || "");
53760   }
53761   function buildStyleMap(node) {
53762     const styleMap = {};
53763     for (const style of $2(node, "Style")) {
53764       styleMap[getStyleId(style)] = extractStyle(style);
53765     }
53766     for (const map2 of $2(node, "StyleMap")) {
53767       const id2 = normalizeId(map2.getAttribute("id") || "");
53768       val1(map2, "styleUrl", (styleUrl) => {
53769         styleUrl = normalizeId(styleUrl);
53770         if (styleMap[styleUrl]) {
53771           styleMap[id2] = styleMap[styleUrl];
53772         }
53773       });
53774     }
53775     return styleMap;
53776   }
53777   function buildSchema(node) {
53778     const schema = {};
53779     for (const field of $2(node, "SimpleField")) {
53780       schema[field.getAttribute("name") || ""] = typeConverters[field.getAttribute("type") || ""] || typeConverters.string;
53781     }
53782     return schema;
53783   }
53784   function* kmlGen(node, options = {
53785     skipNullGeometry: false
53786   }) {
53787     const n3 = node;
53788     const styleMap = buildStyleMap(n3);
53789     const schema = buildSchema(n3);
53790     for (const placemark of $2(n3, "Placemark")) {
53791       const feature4 = getPlacemark(placemark, styleMap, schema, options);
53792       if (feature4)
53793         yield feature4;
53794     }
53795     for (const groundOverlay of $2(n3, "GroundOverlay")) {
53796       const feature4 = getGroundOverlay(groundOverlay, styleMap, schema, options);
53797       if (feature4)
53798         yield feature4;
53799     }
53800     for (const networkLink of $2(n3, "NetworkLink")) {
53801       const feature4 = getNetworkLink(networkLink, styleMap, schema, options);
53802       if (feature4)
53803         yield feature4;
53804     }
53805   }
53806   function kml(node, options = {
53807     skipNullGeometry: false
53808   }) {
53809     return {
53810       type: "FeatureCollection",
53811       features: Array.from(kmlGen(node, options))
53812     };
53813   }
53814
53815   // modules/svg/data.js
53816   var _initialized = false;
53817   var _enabled = false;
53818   var _geojson;
53819   function svgData(projection2, context, dispatch12) {
53820     var throttledRedraw = throttle_default(function() {
53821       dispatch12.call("change");
53822     }, 1e3);
53823     var _showLabels = true;
53824     var detected = utilDetect();
53825     var layer = select_default2(null);
53826     var _vtService;
53827     var _fileList;
53828     var _template;
53829     var _src;
53830     const supportedFormats = [
53831       ".gpx",
53832       ".kml",
53833       ".geojson",
53834       ".json"
53835     ];
53836     function init2() {
53837       if (_initialized) return;
53838       _geojson = {};
53839       _enabled = true;
53840       function over(d3_event) {
53841         d3_event.stopPropagation();
53842         d3_event.preventDefault();
53843         d3_event.dataTransfer.dropEffect = "copy";
53844       }
53845       context.container().attr("dropzone", "copy").on("drop.svgData", function(d3_event) {
53846         d3_event.stopPropagation();
53847         d3_event.preventDefault();
53848         if (!detected.filedrop) return;
53849         var f2 = d3_event.dataTransfer.files[0];
53850         var extension = getExtension(f2.name);
53851         if (!supportedFormats.includes(extension)) return;
53852         drawData.fileList(d3_event.dataTransfer.files);
53853       }).on("dragenter.svgData", over).on("dragexit.svgData", over).on("dragover.svgData", over);
53854       _initialized = true;
53855     }
53856     function getService() {
53857       if (services.vectorTile && !_vtService) {
53858         _vtService = services.vectorTile;
53859         _vtService.event.on("loadedData", throttledRedraw);
53860       } else if (!services.vectorTile && _vtService) {
53861         _vtService = null;
53862       }
53863       return _vtService;
53864     }
53865     function showLayer() {
53866       layerOn();
53867       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
53868         dispatch12.call("change");
53869       });
53870     }
53871     function hideLayer() {
53872       throttledRedraw.cancel();
53873       layer.transition().duration(250).style("opacity", 0).on("end", layerOff);
53874     }
53875     function layerOn() {
53876       layer.style("display", "block");
53877     }
53878     function layerOff() {
53879       layer.selectAll(".viewfield-group").remove();
53880       layer.style("display", "none");
53881     }
53882     function ensureIDs(gj) {
53883       if (!gj) return null;
53884       if (gj.type === "FeatureCollection") {
53885         for (var i3 = 0; i3 < gj.features.length; i3++) {
53886           ensureFeatureID(gj.features[i3]);
53887         }
53888       } else {
53889         ensureFeatureID(gj);
53890       }
53891       return gj;
53892     }
53893     function ensureFeatureID(feature4) {
53894       if (!feature4) return;
53895       feature4.__featurehash__ = utilHashcode((0, import_fast_json_stable_stringify2.default)(feature4));
53896       return feature4;
53897     }
53898     function getFeatures(gj) {
53899       if (!gj) return [];
53900       if (gj.type === "FeatureCollection") {
53901         return gj.features;
53902       } else {
53903         return [gj];
53904       }
53905     }
53906     function featureKey(d2) {
53907       return d2.__featurehash__;
53908     }
53909     function isPolygon(d2) {
53910       return d2.geometry.type === "Polygon" || d2.geometry.type === "MultiPolygon";
53911     }
53912     function clipPathID(d2) {
53913       return "ideditor-data-" + d2.__featurehash__ + "-clippath";
53914     }
53915     function featureClasses(d2) {
53916       return [
53917         "data" + d2.__featurehash__,
53918         d2.geometry.type,
53919         isPolygon(d2) ? "area" : "",
53920         d2.__layerID__ || ""
53921       ].filter(Boolean).join(" ");
53922     }
53923     function drawData(selection2) {
53924       var vtService = getService();
53925       var getPath = svgPath(projection2).geojson;
53926       var getAreaPath = svgPath(projection2, null, true).geojson;
53927       var hasData = drawData.hasData();
53928       layer = selection2.selectAll(".layer-mapdata").data(_enabled && hasData ? [0] : []);
53929       layer.exit().remove();
53930       layer = layer.enter().append("g").attr("class", "layer-mapdata").merge(layer);
53931       var surface = context.surface();
53932       if (!surface || surface.empty()) return;
53933       var geoData, polygonData;
53934       if (_template && vtService) {
53935         var sourceID = _template;
53936         vtService.loadTiles(sourceID, _template, projection2);
53937         geoData = vtService.data(sourceID, projection2);
53938       } else {
53939         geoData = getFeatures(_geojson);
53940       }
53941       geoData = geoData.filter(getPath);
53942       polygonData = geoData.filter(isPolygon);
53943       var clipPaths = surface.selectAll("defs").selectAll(".clipPath-data").data(polygonData, featureKey);
53944       clipPaths.exit().remove();
53945       var clipPathsEnter = clipPaths.enter().append("clipPath").attr("class", "clipPath-data").attr("id", clipPathID);
53946       clipPathsEnter.append("path");
53947       clipPaths.merge(clipPathsEnter).selectAll("path").attr("d", getAreaPath);
53948       var datagroups = layer.selectAll("g.datagroup").data(["fill", "shadow", "stroke"]);
53949       datagroups = datagroups.enter().append("g").attr("class", function(d2) {
53950         return "datagroup datagroup-" + d2;
53951       }).merge(datagroups);
53952       var pathData = {
53953         fill: polygonData,
53954         shadow: geoData,
53955         stroke: geoData
53956       };
53957       var paths = datagroups.selectAll("path").data(function(layer2) {
53958         return pathData[layer2];
53959       }, featureKey);
53960       paths.exit().remove();
53961       paths = paths.enter().append("path").attr("class", function(d2) {
53962         var datagroup = this.parentNode.__data__;
53963         return "pathdata " + datagroup + " " + featureClasses(d2);
53964       }).attr("clip-path", function(d2) {
53965         var datagroup = this.parentNode.__data__;
53966         return datagroup === "fill" ? "url(#" + clipPathID(d2) + ")" : null;
53967       }).merge(paths).attr("d", function(d2) {
53968         var datagroup = this.parentNode.__data__;
53969         return datagroup === "fill" ? getAreaPath(d2) : getPath(d2);
53970       });
53971       layer.call(drawLabels, "label-halo", geoData).call(drawLabels, "label", geoData);
53972       function drawLabels(selection3, textClass, data) {
53973         var labelPath = path_default(projection2);
53974         var labelData = data.filter(function(d2) {
53975           return _showLabels && d2.properties && (d2.properties.desc || d2.properties.name);
53976         });
53977         var labels = selection3.selectAll("text." + textClass).data(labelData, featureKey);
53978         labels.exit().remove();
53979         labels = labels.enter().append("text").attr("class", function(d2) {
53980           return textClass + " " + featureClasses(d2);
53981         }).merge(labels).text(function(d2) {
53982           return d2.properties.desc || d2.properties.name;
53983         }).attr("x", function(d2) {
53984           var centroid = labelPath.centroid(d2);
53985           return centroid[0] + 11;
53986         }).attr("y", function(d2) {
53987           var centroid = labelPath.centroid(d2);
53988           return centroid[1];
53989         });
53990       }
53991     }
53992     function getExtension(fileName) {
53993       if (!fileName) return;
53994       var re4 = /\.(gpx|kml|(geo)?json|png)$/i;
53995       var match = fileName.toLowerCase().match(re4);
53996       return match && match.length && match[0];
53997     }
53998     function xmlToDom(textdata) {
53999       return new DOMParser().parseFromString(textdata, "text/xml");
54000     }
54001     function stringifyGeojsonProperties(feature4) {
54002       const properties = feature4.properties;
54003       for (const key in properties) {
54004         const property = properties[key];
54005         if (typeof property === "number" || typeof property === "boolean" || Array.isArray(property)) {
54006           properties[key] = property.toString();
54007         } else if (property === null) {
54008           properties[key] = "null";
54009         } else if (typeof property === "object") {
54010           properties[key] = JSON.stringify(property);
54011         }
54012       }
54013     }
54014     drawData.setFile = function(extension, data) {
54015       _template = null;
54016       _fileList = null;
54017       _geojson = null;
54018       _src = null;
54019       var gj;
54020       switch (extension) {
54021         case ".gpx":
54022           gj = gpx(xmlToDom(data));
54023           break;
54024         case ".kml":
54025           gj = kml(xmlToDom(data));
54026           break;
54027         case ".geojson":
54028         case ".json":
54029           gj = JSON.parse(data);
54030           if (gj.type === "FeatureCollection") {
54031             gj.features.forEach(stringifyGeojsonProperties);
54032           } else if (gj.type === "Feature") {
54033             stringifyGeojsonProperties(gj);
54034           }
54035           break;
54036       }
54037       gj = gj || {};
54038       if (Object.keys(gj).length) {
54039         _geojson = ensureIDs(gj);
54040         _src = extension + " data file";
54041         this.fitZoom();
54042       }
54043       dispatch12.call("change");
54044       return this;
54045     };
54046     drawData.showLabels = function(val) {
54047       if (!arguments.length) return _showLabels;
54048       _showLabels = val;
54049       return this;
54050     };
54051     drawData.enabled = function(val) {
54052       if (!arguments.length) return _enabled;
54053       _enabled = val;
54054       if (_enabled) {
54055         showLayer();
54056       } else {
54057         hideLayer();
54058       }
54059       dispatch12.call("change");
54060       return this;
54061     };
54062     drawData.hasData = function() {
54063       var gj = _geojson || {};
54064       return !!(_template || Object.keys(gj).length);
54065     };
54066     drawData.template = function(val, src) {
54067       if (!arguments.length) return _template;
54068       var osm = context.connection();
54069       if (osm) {
54070         var blocklists = osm.imageryBlocklists();
54071         var fail = false;
54072         var tested = 0;
54073         var regex;
54074         for (var i3 = 0; i3 < blocklists.length; i3++) {
54075           regex = blocklists[i3];
54076           fail = regex.test(val);
54077           tested++;
54078           if (fail) break;
54079         }
54080         if (!tested) {
54081           regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
54082           fail = regex.test(val);
54083         }
54084       }
54085       _template = val;
54086       _fileList = null;
54087       _geojson = null;
54088       _src = src || "vectortile:" + val.split(/[?#]/)[0];
54089       dispatch12.call("change");
54090       return this;
54091     };
54092     drawData.geojson = function(gj, src) {
54093       if (!arguments.length) return _geojson;
54094       _template = null;
54095       _fileList = null;
54096       _geojson = null;
54097       _src = null;
54098       gj = gj || {};
54099       if (Object.keys(gj).length) {
54100         _geojson = ensureIDs(gj);
54101         _src = src || "unknown.geojson";
54102       }
54103       dispatch12.call("change");
54104       return this;
54105     };
54106     drawData.fileList = function(fileList) {
54107       if (!arguments.length) return _fileList;
54108       _template = null;
54109       _geojson = null;
54110       _src = null;
54111       _fileList = fileList;
54112       if (!fileList || !fileList.length) return this;
54113       var f2 = fileList[0];
54114       var extension = getExtension(f2.name);
54115       var reader = new FileReader();
54116       reader.onload = /* @__PURE__ */ (function() {
54117         return function(e3) {
54118           drawData.setFile(extension, e3.target.result);
54119         };
54120       })(f2);
54121       reader.readAsText(f2);
54122       return this;
54123     };
54124     drawData.url = function(url, defaultExtension) {
54125       _template = null;
54126       _fileList = null;
54127       _geojson = null;
54128       _src = null;
54129       var testUrl = url.split(/[?#]/)[0];
54130       var extension = getExtension(testUrl) || defaultExtension;
54131       if (extension) {
54132         _template = null;
54133         text_default3(url).then(function(data) {
54134           drawData.setFile(extension, data);
54135         }).catch(function() {
54136         });
54137       } else {
54138         drawData.template(url);
54139       }
54140       return this;
54141     };
54142     drawData.getSrc = function() {
54143       return _src || "";
54144     };
54145     drawData.fitZoom = function() {
54146       var features = getFeatures(_geojson);
54147       if (!features.length) return;
54148       var map2 = context.map();
54149       var viewport = map2.trimmedExtent().polygon();
54150       var coords = features.reduce(function(coords2, feature4) {
54151         var geom = feature4.geometry;
54152         if (!geom) return coords2;
54153         var c2 = geom.coordinates;
54154         switch (geom.type) {
54155           case "Point":
54156             c2 = [c2];
54157           case "MultiPoint":
54158           case "LineString":
54159             break;
54160           case "MultiPolygon":
54161             c2 = utilArrayFlatten(c2);
54162           case "Polygon":
54163           case "MultiLineString":
54164             c2 = utilArrayFlatten(c2);
54165             break;
54166         }
54167         return utilArrayUnion(coords2, c2);
54168       }, []);
54169       if (!geoPolygonIntersectsPolygon(viewport, coords, true)) {
54170         var extent = geoExtent(bounds_default({ type: "LineString", coordinates: coords }));
54171         map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
54172       }
54173       return this;
54174     };
54175     init2();
54176     return drawData;
54177   }
54178
54179   // modules/svg/debug.js
54180   function svgDebug(projection2, context) {
54181     function drawDebug(selection2) {
54182       const showTile = context.getDebug("tile");
54183       const showCollision = context.getDebug("collision");
54184       const showImagery = context.getDebug("imagery");
54185       const showTouchTargets = context.getDebug("target");
54186       const showDownloaded = context.getDebug("downloaded");
54187       let debugData = [];
54188       if (showTile) {
54189         debugData.push({ class: "red", label: "tile" });
54190       }
54191       if (showCollision) {
54192         debugData.push({ class: "yellow", label: "collision" });
54193       }
54194       if (showImagery) {
54195         debugData.push({ class: "orange", label: "imagery" });
54196       }
54197       if (showTouchTargets) {
54198         debugData.push({ class: "pink", label: "touchTargets" });
54199       }
54200       if (showDownloaded) {
54201         debugData.push({ class: "purple", label: "downloaded" });
54202       }
54203       let legend = context.container().select(".main-content").selectAll(".debug-legend").data(debugData.length ? [0] : []);
54204       legend.exit().remove();
54205       legend = legend.enter().append("div").attr("class", "fillD debug-legend").merge(legend);
54206       let legendItems = legend.selectAll(".debug-legend-item").data(debugData, (d2) => d2.label);
54207       legendItems.exit().remove();
54208       legendItems.enter().append("span").attr("class", (d2) => "debug-legend-item ".concat(d2.class)).text((d2) => d2.label);
54209       let layer = selection2.selectAll(".layer-debug").data(showImagery || showDownloaded ? [0] : []);
54210       layer.exit().remove();
54211       layer = layer.enter().append("g").attr("class", "layer-debug").merge(layer);
54212       const extent = context.map().extent();
54213       _mainFileFetcher.get("imagery").then((d2) => {
54214         const hits = showImagery && d2.query.bbox(extent.rectangle(), true) || [];
54215         const features = hits.map((d4) => d4.features[d4.id]);
54216         let imagery = layer.selectAll("path.debug-imagery").data(features);
54217         imagery.exit().remove();
54218         imagery.enter().append("path").attr("class", "debug-imagery debug orange");
54219       }).catch(() => {
54220       });
54221       const osm = context.connection();
54222       let dataDownloaded = [];
54223       if (osm && showDownloaded) {
54224         const rtree = osm.caches("get").tile.rtree;
54225         dataDownloaded = rtree.all().map((bbox2) => {
54226           return {
54227             type: "Feature",
54228             properties: { id: bbox2.id },
54229             geometry: {
54230               type: "Polygon",
54231               coordinates: [[
54232                 [bbox2.minX, bbox2.minY],
54233                 [bbox2.minX, bbox2.maxY],
54234                 [bbox2.maxX, bbox2.maxY],
54235                 [bbox2.maxX, bbox2.minY],
54236                 [bbox2.minX, bbox2.minY]
54237               ]]
54238             }
54239           };
54240         });
54241       }
54242       let downloaded = layer.selectAll("path.debug-downloaded").data(showDownloaded ? dataDownloaded : []);
54243       downloaded.exit().remove();
54244       downloaded.enter().append("path").attr("class", "debug-downloaded debug purple");
54245       layer.selectAll("path").attr("d", svgPath(projection2).geojson);
54246     }
54247     drawDebug.enabled = function() {
54248       if (!arguments.length) {
54249         return context.getDebug("tile") || context.getDebug("collision") || context.getDebug("imagery") || context.getDebug("target") || context.getDebug("downloaded");
54250       } else {
54251         return this;
54252       }
54253     };
54254     return drawDebug;
54255   }
54256
54257   // modules/svg/defs.js
54258   function svgDefs(context) {
54259     var _defsSelection = select_default2(null);
54260     var _spritesheetIds = [
54261       "iD-sprite",
54262       "maki-sprite",
54263       "temaki-sprite",
54264       "fa-sprite",
54265       "roentgen-sprite",
54266       "community-sprite"
54267     ];
54268     function drawDefs(selection2) {
54269       _defsSelection = selection2.append("defs");
54270       function addOnewayMarker(name, colour) {
54271         _defsSelection.append("marker").attr("id", "ideditor-oneway-marker-".concat(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");
54272       }
54273       addOnewayMarker("black", "#333");
54274       addOnewayMarker("white", "#fff");
54275       addOnewayMarker("gray", "#eee");
54276       function addSidedMarker(name, color2, offset) {
54277         _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);
54278       }
54279       addSidedMarker("natural", "rgb(170, 170, 170)", 0);
54280       addSidedMarker("coastline", "#77dede", 1);
54281       addSidedMarker("waterway", "#77dede", 1);
54282       addSidedMarker("barrier", "#ddd", 1);
54283       addSidedMarker("man_made", "#fff", 0);
54284       _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");
54285       _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");
54286       _defsSelection.append("marker").attr("id", "ideditor-viewfield-marker-side").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 3 14 C 8 13 8 13 13 14 L 8 5 Z").attr("fill", "#333").attr("fill-opacity", "0.75").attr("stroke", "#fff").attr("stroke-width", "0.5px").attr("stroke-opacity", "0.75");
54287       _defsSelection.append("marker").attr("id", "ideditor-viewfield-marker-side-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 3 14 C 8 13 8 13 13 14 L 8 5 Z").attr("fill", "none").attr("stroke", "#fff").attr("stroke-width", "0.5px").attr("stroke-opacity", "0.75");
54288       var patterns2 = _defsSelection.selectAll("pattern").data([
54289         // pattern name, pattern image name
54290         ["beach", "dots"],
54291         ["construction", "construction"],
54292         ["cemetery", "cemetery"],
54293         ["cemetery_christian", "cemetery_christian"],
54294         ["cemetery_buddhist", "cemetery_buddhist"],
54295         ["cemetery_muslim", "cemetery_muslim"],
54296         ["cemetery_jewish", "cemetery_jewish"],
54297         ["farmland", "farmland"],
54298         ["farmyard", "farmyard"],
54299         ["forest", "forest"],
54300         ["forest_broadleaved", "forest_broadleaved"],
54301         ["forest_needleleaved", "forest_needleleaved"],
54302         ["forest_leafless", "forest_leafless"],
54303         ["golf_green", "grass"],
54304         ["grass", "grass"],
54305         ["landfill", "landfill"],
54306         ["meadow", "grass"],
54307         ["orchard", "orchard"],
54308         ["pond", "pond"],
54309         ["quarry", "quarry"],
54310         ["scrub", "bushes"],
54311         ["vineyard", "vineyard"],
54312         ["water_standing", "lines"],
54313         ["waves", "waves"],
54314         ["wetland", "wetland"],
54315         ["wetland_marsh", "wetland_marsh"],
54316         ["wetland_swamp", "wetland_swamp"],
54317         ["wetland_bog", "wetland_bog"],
54318         ["wetland_reedbed", "wetland_reedbed"]
54319       ]).enter().append("pattern").attr("id", function(d2) {
54320         return "ideditor-pattern-" + d2[0];
54321       }).attr("width", 32).attr("height", 32).attr("patternUnits", "userSpaceOnUse");
54322       patterns2.append("rect").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("class", function(d2) {
54323         return "pattern-color-" + d2[0];
54324       });
54325       patterns2.append("image").attr("x", 0).attr("y", 0).attr("width", 32).attr("height", 32).attr("xlink:href", function(d2) {
54326         return context.imagePath("pattern/" + d2[1] + ".png");
54327       });
54328       _defsSelection.selectAll("clipPath").data([12, 18, 20, 32, 45]).enter().append("clipPath").attr("id", function(d2) {
54329         return "ideditor-clip-square-" + d2;
54330       }).append("rect").attr("x", 0).attr("y", 0).attr("width", function(d2) {
54331         return d2;
54332       }).attr("height", function(d2) {
54333         return d2;
54334       });
54335       const filters = _defsSelection.selectAll("filter").data(["alpha-slope5"]).enter().append("filter").attr("id", (d2) => d2);
54336       const alphaSlope5 = filters.filter("#alpha-slope5").append("feComponentTransfer");
54337       alphaSlope5.append("feFuncR").attr("type", "identity");
54338       alphaSlope5.append("feFuncG").attr("type", "identity");
54339       alphaSlope5.append("feFuncB").attr("type", "identity");
54340       alphaSlope5.append("feFuncA").attr("type", "linear").attr("slope", 5);
54341       addSprites(_spritesheetIds, true);
54342     }
54343     function addSprites(ids, overrideColors) {
54344       _spritesheetIds = utilArrayUniq(_spritesheetIds.concat(ids));
54345       var spritesheets = _defsSelection.selectAll(".spritesheet").data(_spritesheetIds);
54346       spritesheets.enter().append("g").attr("class", function(d2) {
54347         return "spritesheet spritesheet-" + d2;
54348       }).each(function(d2) {
54349         var url = context.imagePath(d2 + ".svg");
54350         var node = select_default2(this).node();
54351         svg(url).then(function(svg2) {
54352           node.appendChild(
54353             select_default2(svg2.documentElement).attr("id", "ideditor-" + d2).node()
54354           );
54355           if (overrideColors && d2 !== "iD-sprite") {
54356             select_default2(node).selectAll("path").attr("fill", "currentColor");
54357           }
54358         }).catch(function() {
54359         });
54360       });
54361       spritesheets.exit().remove();
54362     }
54363     drawDefs.addSprites = addSprites;
54364     return drawDefs;
54365   }
54366
54367   // modules/svg/keepRight.js
54368   var _layerEnabled = false;
54369   var _qaService;
54370   function svgKeepRight(projection2, context, dispatch12) {
54371     const throttledRedraw = throttle_default(() => dispatch12.call("change"), 1e3);
54372     const minZoom5 = 12;
54373     let touchLayer = select_default2(null);
54374     let drawLayer = select_default2(null);
54375     let layerVisible = false;
54376     function markerPath(selection2, klass) {
54377       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");
54378     }
54379     function getService() {
54380       if (services.keepRight && !_qaService) {
54381         _qaService = services.keepRight;
54382         _qaService.on("loaded", throttledRedraw);
54383       } else if (!services.keepRight && _qaService) {
54384         _qaService = null;
54385       }
54386       return _qaService;
54387     }
54388     function editOn() {
54389       if (!layerVisible) {
54390         layerVisible = true;
54391         drawLayer.style("display", "block");
54392       }
54393     }
54394     function editOff() {
54395       if (layerVisible) {
54396         layerVisible = false;
54397         drawLayer.style("display", "none");
54398         drawLayer.selectAll(".qaItem.keepRight").remove();
54399         touchLayer.selectAll(".qaItem.keepRight").remove();
54400       }
54401     }
54402     function layerOn() {
54403       editOn();
54404       drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch12.call("change"));
54405     }
54406     function layerOff() {
54407       throttledRedraw.cancel();
54408       drawLayer.interrupt();
54409       touchLayer.selectAll(".qaItem.keepRight").remove();
54410       drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
54411         editOff();
54412         dispatch12.call("change");
54413       });
54414     }
54415     function updateMarkers() {
54416       if (!layerVisible || !_layerEnabled) return;
54417       const service = getService();
54418       const selectedID = context.selectedErrorID();
54419       const data = service ? service.getItems(projection2) : [];
54420       const getTransform = svgPointTransform(projection2);
54421       const markers = drawLayer.selectAll(".qaItem.keepRight").data(data, (d2) => d2.id);
54422       markers.exit().remove();
54423       const markersEnter = markers.enter().append("g").attr("class", (d2) => "qaItem ".concat(d2.service, " itemId-").concat(d2.id, " itemType-").concat(d2.parentIssueType));
54424       markersEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
54425       markersEnter.append("path").call(markerPath, "shadow");
54426       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");
54427       markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
54428       if (touchLayer.empty()) return;
54429       const fillClass = context.getDebug("target") ? "pink " : "nocolor ";
54430       const targets = touchLayer.selectAll(".qaItem.keepRight").data(data, (d2) => d2.id);
54431       targets.exit().remove();
54432       targets.enter().append("rect").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").merge(targets).sort(sortY).attr("class", (d2) => "qaItem ".concat(d2.service, " target ").concat(fillClass, " itemId-").concat(d2.id)).attr("transform", getTransform);
54433       function sortY(a2, b3) {
54434         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];
54435       }
54436     }
54437     function drawKeepRight(selection2) {
54438       const service = getService();
54439       const surface = context.surface();
54440       if (surface && !surface.empty()) {
54441         touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
54442       }
54443       drawLayer = selection2.selectAll(".layer-keepRight").data(service ? [0] : []);
54444       drawLayer.exit().remove();
54445       drawLayer = drawLayer.enter().append("g").attr("class", "layer-keepRight").style("display", _layerEnabled ? "block" : "none").merge(drawLayer);
54446       if (_layerEnabled) {
54447         if (service && ~~context.map().zoom() >= minZoom5) {
54448           editOn();
54449           service.loadIssues(projection2);
54450           updateMarkers();
54451         } else {
54452           editOff();
54453         }
54454       }
54455     }
54456     drawKeepRight.enabled = function(val) {
54457       if (!arguments.length) return _layerEnabled;
54458       _layerEnabled = val;
54459       if (_layerEnabled) {
54460         layerOn();
54461       } else {
54462         layerOff();
54463         if (context.selectedErrorID()) {
54464           context.enter(modeBrowse(context));
54465         }
54466       }
54467       dispatch12.call("change");
54468       return this;
54469     };
54470     drawKeepRight.supported = () => !!getService();
54471     return drawKeepRight;
54472   }
54473
54474   // modules/svg/geolocate.js
54475   function svgGeolocate(projection2) {
54476     var layer = select_default2(null);
54477     var _position;
54478     function init2() {
54479       if (svgGeolocate.initialized) return;
54480       svgGeolocate.enabled = false;
54481       svgGeolocate.initialized = true;
54482     }
54483     function showLayer() {
54484       layer.style("display", "block");
54485     }
54486     function hideLayer() {
54487       layer.transition().duration(250).style("opacity", 0);
54488     }
54489     function layerOn() {
54490       layer.style("opacity", 0).transition().duration(250).style("opacity", 1);
54491     }
54492     function layerOff() {
54493       layer.style("display", "none");
54494     }
54495     function transform2(d2) {
54496       return svgPointTransform(projection2)(d2);
54497     }
54498     function accuracy(accuracy2, loc) {
54499       var degreesRadius = geoMetersToLat(accuracy2), tangentLoc = [loc[0], loc[1] + degreesRadius], projectedTangent = projection2(tangentLoc), projectedLoc = projection2([loc[0], loc[1]]);
54500       return Math.round(projectedLoc[1] - projectedTangent[1]).toString();
54501     }
54502     function update() {
54503       var geolocation = { loc: [_position.coords.longitude, _position.coords.latitude] };
54504       var groups = layer.selectAll(".geolocations").selectAll(".geolocation").data([geolocation]);
54505       groups.exit().remove();
54506       var pointsEnter = groups.enter().append("g").attr("class", "geolocation");
54507       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");
54508       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");
54509       groups.merge(pointsEnter).attr("transform", transform2);
54510       layer.select(".geolocate-radius").attr("r", accuracy(_position.coords.accuracy, geolocation.loc));
54511     }
54512     function drawLocation(selection2) {
54513       var enabled = svgGeolocate.enabled;
54514       layer = selection2.selectAll(".layer-geolocate").data([0]);
54515       layer.exit().remove();
54516       var layerEnter = layer.enter().append("g").attr("class", "layer-geolocate").style("display", enabled ? "block" : "none");
54517       layerEnter.append("g").attr("class", "geolocations");
54518       layer = layerEnter.merge(layer);
54519       if (enabled) {
54520         update();
54521       } else {
54522         layerOff();
54523       }
54524     }
54525     drawLocation.enabled = function(position, enabled) {
54526       if (!arguments.length) return svgGeolocate.enabled;
54527       _position = position;
54528       svgGeolocate.enabled = enabled;
54529       if (svgGeolocate.enabled) {
54530         showLayer();
54531         layerOn();
54532       } else {
54533         hideLayer();
54534       }
54535       return this;
54536     };
54537     init2();
54538     return drawLocation;
54539   }
54540
54541   // modules/svg/labels.js
54542   function svgLabels(projection2, context) {
54543     var path = path_default(projection2);
54544     var detected = utilDetect();
54545     var baselineHack = detected.browser.toLowerCase() === "safari";
54546     var _rdrawn = new RBush();
54547     var _rskipped = new RBush();
54548     var _entitybboxes = {};
54549     const labelStack = [
54550       ["line", "aeroway", "*", 12],
54551       ["line", "highway", "motorway", 12],
54552       ["line", "highway", "trunk", 12],
54553       ["line", "highway", "primary", 12],
54554       ["line", "highway", "secondary", 12],
54555       ["line", "highway", "tertiary", 12],
54556       ["line", "highway", "*", 12],
54557       ["line", "railway", "*", 12],
54558       ["line", "waterway", "*", 12],
54559       ["area", "aeroway", "*", 12],
54560       ["area", "amenity", "*", 12],
54561       ["area", "building", "*", 12],
54562       ["area", "historic", "*", 12],
54563       ["area", "leisure", "*", 12],
54564       ["area", "man_made", "*", 12],
54565       ["area", "natural", "*", 12],
54566       ["area", "shop", "*", 12],
54567       ["area", "tourism", "*", 12],
54568       ["area", "camp_site", "*", 12],
54569       ["point", "aeroway", "*", 10],
54570       ["point", "amenity", "*", 10],
54571       ["point", "building", "*", 10],
54572       ["point", "historic", "*", 10],
54573       ["point", "leisure", "*", 10],
54574       ["point", "man_made", "*", 10],
54575       ["point", "natural", "*", 10],
54576       ["point", "shop", "*", 10],
54577       ["point", "tourism", "*", 10],
54578       ["point", "camp_site", "*", 10],
54579       ["*", "alt_name", "*", 12],
54580       ["*", "official_name", "*", 12],
54581       ["*", "loc_name", "*", 12],
54582       ["*", "loc_ref", "*", 12],
54583       ["*", "unsigned_ref", "*", 12],
54584       ["*", "seamark:name", "*", 12],
54585       ["*", "sector:name", "*", 12],
54586       ["*", "lock_name", "*", 12],
54587       ["*", "distance", "*", 12],
54588       ["*", "railway:position", "*", 12],
54589       ["line", "ref", "*", 12],
54590       ["area", "ref", "*", 12],
54591       ["point", "ref", "*", 10],
54592       ["line", "name", "*", 12],
54593       ["area", "name", "*", 12],
54594       ["point", "name", "*", 10],
54595       ["point", "addr:housenumber", "*", 10],
54596       ["point", "addr:housename", "*", 10]
54597     ];
54598     function shouldSkipIcon(preset) {
54599       var noIcons = ["building", "landuse", "natural"];
54600       return noIcons.some(function(s2) {
54601         return preset.id.indexOf(s2) >= 0;
54602       });
54603     }
54604     function drawLinePaths(selection2, labels, filter2, classes) {
54605       var paths = selection2.selectAll("path:not(.debug)").filter((d2) => filter2(d2.entity)).data(labels, (d2) => osmEntity.key(d2.entity));
54606       paths.exit().remove();
54607       paths.enter().append("path").style("stroke-width", (d2) => d2.position["font-size"]).attr("id", (d2) => "ideditor-labelpath-" + d2.entity.id).attr("class", classes).merge(paths).attr("d", (d2) => d2.position.lineString);
54608     }
54609     function drawLineLabels(selection2, labels, filter2, classes) {
54610       var texts = selection2.selectAll("text." + classes).filter((d2) => filter2(d2.entity)).data(labels, (d2) => osmEntity.key(d2.entity));
54611       texts.exit().remove();
54612       texts.enter().append("text").attr("class", (d2) => classes + " " + d2.position.classes + " " + d2.entity.id).attr("dy", baselineHack ? "0.35em" : null).append("textPath").attr("class", "textpath");
54613       selection2.selectAll("text." + classes).selectAll(".textpath").filter((d2) => filter2(d2.entity)).data(labels, (d2) => osmEntity.key(d2.entity)).attr("startOffset", "50%").attr("xlink:href", function(d2) {
54614         return "#ideditor-labelpath-" + d2.entity.id;
54615       }).text((d2) => d2.name);
54616     }
54617     function drawPointLabels(selection2, labels, filter2, classes) {
54618       if (classes.includes("pointlabel-halo")) {
54619         labels = labels.filter((d2) => !d2.position.isAddr);
54620       }
54621       var texts = selection2.selectAll("text." + classes).filter((d2) => filter2(d2.entity)).data(labels, (d2) => osmEntity.key(d2.entity));
54622       texts.exit().remove();
54623       texts.enter().append("text").attr("class", (d2) => classes + " " + d2.position.classes + " " + d2.entity.id).style("text-anchor", (d2) => d2.position.textAnchor).text((d2) => d2.name).merge(texts).attr("x", (d2) => d2.position.x).attr("y", (d2) => d2.position.y);
54624     }
54625     function drawAreaLabels(selection2, labels, filter2, classes) {
54626       labels = labels.filter(hasText);
54627       drawPointLabels(selection2, labels, filter2, classes);
54628       function hasText(d2) {
54629         return d2.position.hasOwnProperty("x") && d2.position.hasOwnProperty("y");
54630       }
54631     }
54632     function drawAreaIcons(selection2, labels, filter2, classes) {
54633       var icons = selection2.selectAll("use." + classes).filter((d2) => filter2(d2.entity)).data(labels, (d2) => osmEntity.key(d2.entity));
54634       icons.exit().remove();
54635       icons.enter().append("use").attr("class", "icon " + classes).attr("width", "17px").attr("height", "17px").merge(icons).attr("transform", (d2) => d2.position.transform).attr("xlink:href", function(d2) {
54636         var preset = _mainPresetIndex.match(d2.entity, context.graph());
54637         var picon = preset && preset.icon;
54638         return picon ? "#" + picon : "";
54639       });
54640     }
54641     function drawCollisionBoxes(selection2, rtree, which) {
54642       var classes = "debug " + which + " " + (which === "debug-skipped" ? "orange" : "yellow");
54643       var gj = [];
54644       if (context.getDebug("collision")) {
54645         gj = rtree.all().map(function(d2) {
54646           return { type: "Polygon", coordinates: [[
54647             [d2.minX, d2.minY],
54648             [d2.maxX, d2.minY],
54649             [d2.maxX, d2.maxY],
54650             [d2.minX, d2.maxY],
54651             [d2.minX, d2.minY]
54652           ]] };
54653         });
54654       }
54655       var boxes = selection2.selectAll("." + which).data(gj);
54656       boxes.exit().remove();
54657       boxes.enter().append("path").attr("class", classes).merge(boxes).attr("d", path_default());
54658     }
54659     function drawLabels(selection2, graph, entities, filter2, dimensions, fullRedraw) {
54660       var wireframe = context.surface().classed("fill-wireframe");
54661       var zoom = geoScaleToZoom(projection2.scale());
54662       var labelable = [];
54663       var renderNodeAs = {};
54664       var i3, j3, k3, entity, geometry;
54665       for (i3 = 0; i3 < labelStack.length; i3++) {
54666         labelable.push([]);
54667       }
54668       if (fullRedraw) {
54669         _rdrawn.clear();
54670         _rskipped.clear();
54671         _entitybboxes = {};
54672       } else {
54673         for (i3 = 0; i3 < entities.length; i3++) {
54674           entity = entities[i3];
54675           var toRemove = [].concat(_entitybboxes[entity.id] || []).concat(_entitybboxes[entity.id + "I"] || []);
54676           for (j3 = 0; j3 < toRemove.length; j3++) {
54677             _rdrawn.remove(toRemove[j3]);
54678             _rskipped.remove(toRemove[j3]);
54679           }
54680         }
54681       }
54682       for (i3 = 0; i3 < entities.length; i3++) {
54683         entity = entities[i3];
54684         geometry = entity.geometry(graph);
54685         if (geometry === "point" || geometry === "vertex" && isInterestingVertex(entity)) {
54686           const isAddr = isAddressPoint(entity.tags);
54687           var hasDirections = entity.directions(graph, projection2).length;
54688           var markerPadding = 0;
54689           if (wireframe) {
54690             renderNodeAs[entity.id] = { geometry: "vertex", isAddr };
54691           } else if (geometry === "vertex") {
54692             renderNodeAs[entity.id] = { geometry: "vertex", isAddr };
54693           } else if (zoom >= 18 && hasDirections) {
54694             renderNodeAs[entity.id] = { geometry: "vertex", isAddr };
54695           } else {
54696             renderNodeAs[entity.id] = { geometry: "point", isAddr };
54697             markerPadding = 20;
54698           }
54699           if (isAddr) {
54700             undoInsert(entity.id + "P");
54701           } else {
54702             var coord2 = projection2(entity.loc);
54703             var nodePadding = 10;
54704             var bbox2 = {
54705               minX: coord2[0] - nodePadding,
54706               minY: coord2[1] - nodePadding - markerPadding,
54707               maxX: coord2[0] + nodePadding,
54708               maxY: coord2[1] + nodePadding
54709             };
54710             doInsert(bbox2, entity.id + "P");
54711           }
54712         }
54713         if (geometry === "vertex") {
54714           geometry = "point";
54715         }
54716         var preset = geometry === "area" && _mainPresetIndex.match(entity, graph);
54717         var icon2 = preset && !shouldSkipIcon(preset) && preset.icon;
54718         if (!icon2 && !utilDisplayName(entity, void 0, true)) continue;
54719         for (k3 = 0; k3 < labelStack.length; k3++) {
54720           var matchGeom = labelStack[k3][0];
54721           var matchKey = labelStack[k3][1];
54722           var matchVal = labelStack[k3][2];
54723           var hasVal = entity.tags[matchKey];
54724           if ((matchGeom === "*" || geometry === matchGeom) && hasVal && (matchVal === "*" || matchVal === hasVal)) {
54725             labelable[k3].push(entity);
54726             break;
54727           }
54728         }
54729       }
54730       var labelled = {
54731         point: [],
54732         line: [],
54733         area: []
54734       };
54735       for (k3 = 0; k3 < labelable.length; k3++) {
54736         var fontSize = labelStack[k3][3];
54737         for (i3 = 0; i3 < labelable[k3].length; i3++) {
54738           entity = labelable[k3][i3];
54739           geometry = entity.geometry(graph);
54740           let name = geometry === "line" ? utilDisplayNameForPath(entity) : utilDisplayName(entity, void 0, true);
54741           var width = name && textWidth(name, fontSize, selection2.select("g.layer-osm.labels").node());
54742           var p2 = null;
54743           if (geometry === "point" || geometry === "vertex") {
54744             if (wireframe) continue;
54745             var renderAs = renderNodeAs[entity.id];
54746             if (renderAs.geometry === "vertex" && zoom < 17) continue;
54747             while (renderAs.isAddr && width > 36) {
54748               name = "".concat(name.substring(0, name.replace(/…$/, "").length - 1), "\u2026");
54749               width = textWidth(name, fontSize, selection2.select("g.layer-osm.labels").node());
54750             }
54751             p2 = getPointLabel(entity, width, fontSize, renderAs);
54752           } else if (geometry === "line") {
54753             p2 = getLineLabel(entity, width, fontSize);
54754           } else if (geometry === "area") {
54755             p2 = getAreaLabel(entity, width, fontSize);
54756           }
54757           if (p2) {
54758             if (geometry === "vertex") {
54759               geometry = "point";
54760             }
54761             p2.classes = geometry + " tag-" + labelStack[k3][1];
54762             labelled[geometry].push({
54763               entity,
54764               name,
54765               position: p2
54766             });
54767           }
54768         }
54769       }
54770       function isInterestingVertex(entity2) {
54771         var selectedIDs = context.selectedIDs();
54772         return entity2.hasInterestingTags() || entity2.isEndpoint(graph) || entity2.isConnected(graph) || selectedIDs.indexOf(entity2.id) !== -1 || graph.parentWays(entity2).some(function(parent2) {
54773           return selectedIDs.indexOf(parent2.id) !== -1;
54774         });
54775       }
54776       function getPointLabel(entity2, width2, height, style) {
54777         var y3 = style.geometry === "point" ? -12 : 0;
54778         var pointOffsets = {
54779           ltr: [15, y3, "start"],
54780           rtl: [-15, y3, "end"]
54781         };
54782         const isAddrMarker = style.isAddr && style.geometry !== "vertex";
54783         var textDirection = _mainLocalizer.textDirection();
54784         var coord3 = projection2(entity2.loc);
54785         var textPadding = 2;
54786         var offset = pointOffsets[textDirection];
54787         if (isAddrMarker) offset = [0, 1, "middle"];
54788         var p3 = {
54789           height,
54790           width: width2,
54791           x: coord3[0] + offset[0],
54792           y: coord3[1] + offset[1],
54793           textAnchor: offset[2]
54794         };
54795         let bbox3;
54796         if (isAddrMarker) {
54797           bbox3 = {
54798             minX: p3.x - width2 / 2 - textPadding,
54799             minY: p3.y - height / 2 - textPadding,
54800             maxX: p3.x + width2 / 2 + textPadding,
54801             maxY: p3.y + height / 2 + textPadding
54802           };
54803         } else if (textDirection === "rtl") {
54804           bbox3 = {
54805             minX: p3.x - width2 - textPadding,
54806             minY: p3.y - height / 2 - textPadding,
54807             maxX: p3.x + textPadding,
54808             maxY: p3.y + height / 2 + textPadding
54809           };
54810         } else {
54811           bbox3 = {
54812             minX: p3.x - textPadding,
54813             minY: p3.y - height / 2 - textPadding,
54814             maxX: p3.x + width2 + textPadding,
54815             maxY: p3.y + height / 2 + textPadding
54816           };
54817         }
54818         if (tryInsert([bbox3], entity2.id, true)) {
54819           return p3;
54820         }
54821       }
54822       function getLineLabel(entity2, width2, height) {
54823         var viewport = geoExtent(context.projection.clipExtent()).polygon();
54824         var points = graph.childNodes(entity2).map(function(node) {
54825           return projection2(node.loc);
54826         });
54827         var length2 = geoPathLength(points);
54828         if (length2 < width2 + 20) return;
54829         var lineOffsets = [
54830           50,
54831           45,
54832           55,
54833           40,
54834           60,
54835           35,
54836           65,
54837           30,
54838           70,
54839           25,
54840           75,
54841           20,
54842           80,
54843           15,
54844           95,
54845           10,
54846           90,
54847           5,
54848           95
54849         ];
54850         var padding = 3;
54851         for (var i4 = 0; i4 < lineOffsets.length; i4++) {
54852           var offset = lineOffsets[i4];
54853           var middle = offset / 100 * length2;
54854           var start2 = middle - width2 / 2;
54855           if (start2 < 0 || start2 + width2 > length2) continue;
54856           var sub = subpath(points, start2, start2 + width2);
54857           if (!sub || !geoPolygonIntersectsPolygon(viewport, sub, true)) {
54858             continue;
54859           }
54860           var isReverse = reverse(sub);
54861           if (isReverse) {
54862             sub = sub.reverse();
54863           }
54864           var bboxes = [];
54865           var boxsize = (height + 2) / 2;
54866           for (var j4 = 0; j4 < sub.length - 1; j4++) {
54867             var a2 = sub[j4];
54868             var b3 = sub[j4 + 1];
54869             var num = Math.max(1, Math.floor(geoVecLength(a2, b3) / boxsize / 2));
54870             for (var box = 0; box < num; box++) {
54871               var p3 = geoVecInterp(a2, b3, box / num);
54872               var x05 = p3[0] - boxsize - padding;
54873               var y05 = p3[1] - boxsize - padding;
54874               var x12 = p3[0] + boxsize + padding;
54875               var y12 = p3[1] + boxsize + padding;
54876               bboxes.push({
54877                 minX: Math.min(x05, x12),
54878                 minY: Math.min(y05, y12),
54879                 maxX: Math.max(x05, x12),
54880                 maxY: Math.max(y05, y12)
54881               });
54882             }
54883           }
54884           if (tryInsert(bboxes, entity2.id, false)) {
54885             return {
54886               "font-size": height + 2,
54887               lineString: lineString2(sub),
54888               startOffset: offset + "%"
54889             };
54890           }
54891         }
54892         function reverse(p4) {
54893           var angle2 = Math.atan2(p4[1][1] - p4[0][1], p4[1][0] - p4[0][0]);
54894           return !(p4[0][0] < p4[p4.length - 1][0] && angle2 < Math.PI / 2 && angle2 > -Math.PI / 2);
54895         }
54896         function lineString2(points2) {
54897           return "M" + points2.join("L");
54898         }
54899         function subpath(points2, from, to) {
54900           var sofar = 0;
54901           var start3, end, i0, i1;
54902           for (var i5 = 0; i5 < points2.length - 1; i5++) {
54903             var a3 = points2[i5];
54904             var b4 = points2[i5 + 1];
54905             var current = geoVecLength(a3, b4);
54906             var portion;
54907             if (!start3 && sofar + current >= from) {
54908               portion = (from - sofar) / current;
54909               start3 = [
54910                 a3[0] + portion * (b4[0] - a3[0]),
54911                 a3[1] + portion * (b4[1] - a3[1])
54912               ];
54913               i0 = i5 + 1;
54914             }
54915             if (!end && sofar + current >= to) {
54916               portion = (to - sofar) / current;
54917               end = [
54918                 a3[0] + portion * (b4[0] - a3[0]),
54919                 a3[1] + portion * (b4[1] - a3[1])
54920               ];
54921               i1 = i5 + 1;
54922             }
54923             sofar += current;
54924           }
54925           var result = points2.slice(i0, i1);
54926           result.unshift(start3);
54927           result.push(end);
54928           return result;
54929         }
54930       }
54931       function getAreaLabel(entity2, width2, height) {
54932         var centroid = path.centroid(entity2.asGeoJSON(graph));
54933         var extent = entity2.extent(graph);
54934         var areaWidth = projection2(extent[1])[0] - projection2(extent[0])[0];
54935         if (isNaN(centroid[0]) || areaWidth < 20) return;
54936         var preset2 = _mainPresetIndex.match(entity2, context.graph());
54937         var picon = preset2 && preset2.icon;
54938         var iconSize = 17;
54939         var padding = 2;
54940         var p3 = {};
54941         if (picon && !shouldSkipIcon(preset2)) {
54942           if (addIcon()) {
54943             addLabel(iconSize + padding);
54944             return p3;
54945           }
54946         } else {
54947           if (addLabel(0)) {
54948             return p3;
54949           }
54950         }
54951         function addIcon() {
54952           var iconX = centroid[0] - iconSize / 2;
54953           var iconY = centroid[1] - iconSize / 2;
54954           var bbox3 = {
54955             minX: iconX,
54956             minY: iconY,
54957             maxX: iconX + iconSize,
54958             maxY: iconY + iconSize
54959           };
54960           if (tryInsert([bbox3], entity2.id + "I", true)) {
54961             p3.transform = "translate(" + iconX + "," + iconY + ")";
54962             return true;
54963           }
54964           return false;
54965         }
54966         function addLabel(yOffset) {
54967           if (width2 && areaWidth >= width2 + 20) {
54968             var labelX = centroid[0];
54969             var labelY = centroid[1] + yOffset;
54970             var bbox3 = {
54971               minX: labelX - width2 / 2 - padding,
54972               minY: labelY - height / 2 - padding,
54973               maxX: labelX + width2 / 2 + padding,
54974               maxY: labelY + height / 2 + padding
54975             };
54976             if (tryInsert([bbox3], entity2.id, true)) {
54977               p3.x = labelX;
54978               p3.y = labelY;
54979               p3.textAnchor = "middle";
54980               p3.height = height;
54981               return true;
54982             }
54983           }
54984           return false;
54985         }
54986       }
54987       function doInsert(bbox3, id2) {
54988         bbox3.id = id2;
54989         var oldbox = _entitybboxes[id2];
54990         if (oldbox) {
54991           _rdrawn.remove(oldbox);
54992         }
54993         _entitybboxes[id2] = bbox3;
54994         _rdrawn.insert(bbox3);
54995       }
54996       function undoInsert(id2) {
54997         var oldbox = _entitybboxes[id2];
54998         if (oldbox) {
54999           _rdrawn.remove(oldbox);
55000         }
55001         delete _entitybboxes[id2];
55002       }
55003       function tryInsert(bboxes, id2, saveSkipped) {
55004         var skipped = false;
55005         for (var i4 = 0; i4 < bboxes.length; i4++) {
55006           var bbox3 = bboxes[i4];
55007           bbox3.id = id2;
55008           if (bbox3.minX < 0 || bbox3.minY < 0 || bbox3.maxX > dimensions[0] || bbox3.maxY > dimensions[1]) {
55009             skipped = true;
55010             break;
55011           }
55012           if (_rdrawn.collides(bbox3)) {
55013             skipped = true;
55014             break;
55015           }
55016         }
55017         _entitybboxes[id2] = bboxes;
55018         if (skipped) {
55019           if (saveSkipped) {
55020             _rskipped.load(bboxes);
55021           }
55022         } else {
55023           _rdrawn.load(bboxes);
55024         }
55025         return !skipped;
55026       }
55027       var layer = selection2.selectAll(".layer-osm.labels");
55028       layer.selectAll(".labels-group").data(["halo", "label", "debug"]).enter().append("g").attr("class", function(d2) {
55029         return "labels-group " + d2;
55030       });
55031       var halo = layer.selectAll(".labels-group.halo");
55032       var label = layer.selectAll(".labels-group.label");
55033       var debug2 = layer.selectAll(".labels-group.debug");
55034       drawPointLabels(label, labelled.point, filter2, "pointlabel");
55035       drawPointLabels(halo, labelled.point, filter2, "pointlabel-halo");
55036       drawLinePaths(layer, labelled.line, filter2, "");
55037       drawLineLabels(label, labelled.line, filter2, "linelabel");
55038       drawLineLabels(halo, labelled.line, filter2, "linelabel-halo");
55039       drawAreaLabels(label, labelled.area, filter2, "arealabel");
55040       drawAreaLabels(halo, labelled.area, filter2, "arealabel-halo");
55041       drawAreaIcons(label, labelled.area, filter2, "areaicon");
55042       drawAreaIcons(halo, labelled.area, filter2, "areaicon-halo");
55043       drawCollisionBoxes(debug2, _rskipped, "debug-skipped");
55044       drawCollisionBoxes(debug2, _rdrawn, "debug-drawn");
55045       layer.call(filterLabels);
55046     }
55047     function filterLabels(selection2) {
55048       var _a5, _b3;
55049       var drawLayer = selection2.selectAll(".layer-osm.labels");
55050       var layers = drawLayer.selectAll(".labels-group.halo, .labels-group.label");
55051       layers.selectAll(".nolabel").classed("nolabel", false);
55052       const graph = context.graph();
55053       const mouse = context.map().mouse();
55054       let bbox2;
55055       let hideIds = [];
55056       if (mouse && context.mode().id !== "browse") {
55057         const pad2 = 20;
55058         bbox2 = { minX: mouse[0] - pad2, minY: mouse[1] - pad2, maxX: mouse[0] + pad2, maxY: mouse[1] + pad2 };
55059         const nearMouse = _rdrawn.search(bbox2).map((entity) => entity.id).filter((id2) => {
55060           var _a6;
55061           return context.mode().id !== "select" || // in select mode: hide labels of currently selected line(s)
55062           // to still allow accessing midpoints
55063           // https://github.com/openstreetmap/iD/issues/11220
55064           context.mode().selectedIDs().includes(id2) && ((_a6 = graph.hasEntity(id2)) == null ? void 0 : _a6.geometry(graph)) === "line";
55065         });
55066         hideIds.push.apply(hideIds, nearMouse);
55067         hideIds = utilArrayUniq(hideIds);
55068       }
55069       const selected = (((_b3 = (_a5 = context.mode()) == null ? void 0 : _a5.selectedIDs) == null ? void 0 : _b3.call(_a5)) || []).filter((id2) => {
55070         var _a6;
55071         return ((_a6 = graph.hasEntity(id2)) == null ? void 0 : _a6.geometry(graph)) !== "line";
55072       });
55073       hideIds = utilArrayDifference(hideIds, selected);
55074       layers.selectAll(utilEntitySelector(hideIds)).classed("nolabel", true);
55075       var debug2 = selection2.selectAll(".labels-group.debug");
55076       var gj = [];
55077       if (context.getDebug("collision")) {
55078         gj = bbox2 ? [{
55079           type: "Polygon",
55080           coordinates: [[
55081             [bbox2.minX, bbox2.minY],
55082             [bbox2.maxX, bbox2.minY],
55083             [bbox2.maxX, bbox2.maxY],
55084             [bbox2.minX, bbox2.maxY],
55085             [bbox2.minX, bbox2.minY]
55086           ]]
55087         }] : [];
55088       }
55089       var box = debug2.selectAll(".debug-mouse").data(gj);
55090       box.exit().remove();
55091       box.enter().append("path").attr("class", "debug debug-mouse yellow").merge(box).attr("d", path_default());
55092     }
55093     var throttleFilterLabels = throttle_default(filterLabels, 100);
55094     drawLabels.observe = function(selection2) {
55095       var listener = function() {
55096         throttleFilterLabels(selection2);
55097       };
55098       selection2.on("mousemove.hidelabels", listener);
55099       context.on("enter.hidelabels", listener);
55100     };
55101     drawLabels.off = function(selection2) {
55102       throttleFilterLabels.cancel();
55103       selection2.on("mousemove.hidelabels", null);
55104       context.on("enter.hidelabels", null);
55105     };
55106     return drawLabels;
55107   }
55108   var _textWidthCache = {};
55109   function textWidth(text, size, container) {
55110     let c2 = _textWidthCache[size];
55111     if (!c2) c2 = _textWidthCache[size] = {};
55112     if (c2[text]) {
55113       return c2[text];
55114     }
55115     const elem = document.createElementNS("http://www.w3.org/2000/svg", "text");
55116     elem.style.fontSize = "".concat(size, "px");
55117     elem.style.fontWeight = "bold";
55118     elem.textContent = text;
55119     container.appendChild(elem);
55120     c2[text] = elem.getComputedTextLength();
55121     elem.remove();
55122     return c2[text];
55123   }
55124   var nonPrimaryKeys = /* @__PURE__ */ new Set([
55125     "building:flats",
55126     "check_date",
55127     "fixme",
55128     "layer",
55129     "level",
55130     "level:ref",
55131     "note"
55132   ]);
55133   var nonPrimaryKeysRegex = /^(ref|survey|note|([^:]+:|old_|alt_)addr):/;
55134   function isAddressPoint(tags) {
55135     const keys2 = Object.keys(tags).filter(
55136       (key) => osmIsInterestingTag(key) && !nonPrimaryKeys.has(key) && !nonPrimaryKeysRegex.test(key)
55137     );
55138     return keys2.length > 0 && keys2.every(
55139       (key) => key.startsWith("addr:")
55140     );
55141   }
55142
55143   // node_modules/exifr/dist/full.esm.mjs
55144   var e = "undefined" != typeof self ? self : global;
55145   var t = "undefined" != typeof navigator;
55146   var i2 = t && "undefined" == typeof HTMLImageElement;
55147   var n2 = !("undefined" == typeof global || "undefined" == typeof process || !process.versions || !process.versions.node);
55148   var s = e.Buffer;
55149   var r = e.BigInt;
55150   var a = !!s;
55151   var o = (e3) => e3;
55152   function l(e3, t2 = o) {
55153     if (n2) try {
55154       return "function" == typeof __require ? Promise.resolve(t2(__require(e3))) : import(
55155         /* webpackIgnore: true */
55156         e3
55157       ).then(t2);
55158     } catch (t3) {
55159       console.warn("Couldn't load ".concat(e3));
55160     }
55161   }
55162   var h2 = e.fetch;
55163   var u3 = (e3) => h2 = e3;
55164   if (!e.fetch) {
55165     const e3 = l("http", ((e4) => e4)), t2 = l("https", ((e4) => e4)), i3 = (n3, { headers: s2 } = {}) => new Promise((async (r2, a2) => {
55166       let { port: o2, hostname: l2, pathname: h3, protocol: u4, search: c2 } = new URL(n3);
55167       const f2 = { method: "GET", hostname: l2, path: encodeURI(h3) + c2, headers: s2 };
55168       "" !== o2 && (f2.port = Number(o2));
55169       const d2 = ("https:" === u4 ? await t2 : await e3).request(f2, ((e4) => {
55170         if (301 === e4.statusCode || 302 === e4.statusCode) {
55171           let t3 = new URL(e4.headers.location, n3).toString();
55172           return i3(t3, { headers: s2 }).then(r2).catch(a2);
55173         }
55174         r2({ status: e4.statusCode, arrayBuffer: () => new Promise(((t3) => {
55175           let i4 = [];
55176           e4.on("data", ((e6) => i4.push(e6))), e4.on("end", (() => t3(Buffer.concat(i4))));
55177         })) });
55178       }));
55179       d2.on("error", a2), d2.end();
55180     }));
55181     u3(i3);
55182   }
55183   function c(e3, t2, i3) {
55184     return t2 in e3 ? Object.defineProperty(e3, t2, { value: i3, enumerable: true, configurable: true, writable: true }) : e3[t2] = i3, e3;
55185   }
55186   var f = (e3) => p(e3) ? void 0 : e3;
55187   var d = (e3) => void 0 !== e3;
55188   function p(e3) {
55189     return void 0 === e3 || (e3 instanceof Map ? 0 === e3.size : 0 === Object.values(e3).filter(d).length);
55190   }
55191   function g2(e3) {
55192     let t2 = new Error(e3);
55193     throw delete t2.stack, t2;
55194   }
55195   function m2(e3) {
55196     return "" === (e3 = (function(e4) {
55197       for (; e4.endsWith("\0"); ) e4 = e4.slice(0, -1);
55198       return e4;
55199     })(e3).trim()) ? void 0 : e3;
55200   }
55201   function S2(e3) {
55202     let t2 = (function(e4) {
55203       let t3 = 0;
55204       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;
55205     })(e3);
55206     return e3.jfif.enabled && (t2 += 50), e3.xmp.enabled && (t2 += 2e4), e3.iptc.enabled && (t2 += 14e3), e3.icc.enabled && (t2 += 6e3), t2;
55207   }
55208   var C2 = (e3) => String.fromCharCode.apply(null, e3);
55209   var y2 = "undefined" != typeof TextDecoder ? new TextDecoder("utf-8") : void 0;
55210   function b2(e3) {
55211     return y2 ? y2.decode(e3) : a ? Buffer.from(e3).toString("utf8") : decodeURIComponent(escape(C2(e3)));
55212   }
55213   var I2 = class _I {
55214     static from(e3, t2) {
55215       return e3 instanceof this && e3.le === t2 ? e3 : new _I(e3, void 0, void 0, t2);
55216     }
55217     constructor(e3, t2 = 0, i3, n3) {
55218       if ("boolean" == typeof n3 && (this.le = n3), Array.isArray(e3) && (e3 = new Uint8Array(e3)), 0 === e3) this.byteOffset = 0, this.byteLength = 0;
55219       else if (e3 instanceof ArrayBuffer) {
55220         void 0 === i3 && (i3 = e3.byteLength - t2);
55221         let n4 = new DataView(e3, t2, i3);
55222         this._swapDataView(n4);
55223       } else if (e3 instanceof Uint8Array || e3 instanceof DataView || e3 instanceof _I) {
55224         void 0 === i3 && (i3 = e3.byteLength - t2), (t2 += e3.byteOffset) + i3 > e3.byteOffset + e3.byteLength && g2("Creating view outside of available memory in ArrayBuffer");
55225         let n4 = new DataView(e3.buffer, t2, i3);
55226         this._swapDataView(n4);
55227       } else if ("number" == typeof e3) {
55228         let t3 = new DataView(new ArrayBuffer(e3));
55229         this._swapDataView(t3);
55230       } else g2("Invalid input argument for BufferView: " + e3);
55231     }
55232     _swapArrayBuffer(e3) {
55233       this._swapDataView(new DataView(e3));
55234     }
55235     _swapBuffer(e3) {
55236       this._swapDataView(new DataView(e3.buffer, e3.byteOffset, e3.byteLength));
55237     }
55238     _swapDataView(e3) {
55239       this.dataView = e3, this.buffer = e3.buffer, this.byteOffset = e3.byteOffset, this.byteLength = e3.byteLength;
55240     }
55241     _lengthToEnd(e3) {
55242       return this.byteLength - e3;
55243     }
55244     set(e3, t2, i3 = _I) {
55245       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);
55246     }
55247     subarray(e3, t2) {
55248       return t2 = t2 || this._lengthToEnd(e3), new _I(this, e3, t2);
55249     }
55250     toUint8() {
55251       return new Uint8Array(this.buffer, this.byteOffset, this.byteLength);
55252     }
55253     getUint8Array(e3, t2) {
55254       return new Uint8Array(this.buffer, this.byteOffset + e3, t2);
55255     }
55256     getString(e3 = 0, t2 = this.byteLength) {
55257       return b2(this.getUint8Array(e3, t2));
55258     }
55259     getLatin1String(e3 = 0, t2 = this.byteLength) {
55260       let i3 = this.getUint8Array(e3, t2);
55261       return C2(i3);
55262     }
55263     getUnicodeString(e3 = 0, t2 = this.byteLength) {
55264       const i3 = [];
55265       for (let n3 = 0; n3 < t2 && e3 + n3 < this.byteLength; n3 += 2) i3.push(this.getUint16(e3 + n3));
55266       return C2(i3);
55267     }
55268     getInt8(e3) {
55269       return this.dataView.getInt8(e3);
55270     }
55271     getUint8(e3) {
55272       return this.dataView.getUint8(e3);
55273     }
55274     getInt16(e3, t2 = this.le) {
55275       return this.dataView.getInt16(e3, t2);
55276     }
55277     getInt32(e3, t2 = this.le) {
55278       return this.dataView.getInt32(e3, t2);
55279     }
55280     getUint16(e3, t2 = this.le) {
55281       return this.dataView.getUint16(e3, t2);
55282     }
55283     getUint32(e3, t2 = this.le) {
55284       return this.dataView.getUint32(e3, t2);
55285     }
55286     getFloat32(e3, t2 = this.le) {
55287       return this.dataView.getFloat32(e3, t2);
55288     }
55289     getFloat64(e3, t2 = this.le) {
55290       return this.dataView.getFloat64(e3, t2);
55291     }
55292     getFloat(e3, t2 = this.le) {
55293       return this.dataView.getFloat32(e3, t2);
55294     }
55295     getDouble(e3, t2 = this.le) {
55296       return this.dataView.getFloat64(e3, t2);
55297     }
55298     getUintBytes(e3, t2, i3) {
55299       switch (t2) {
55300         case 1:
55301           return this.getUint8(e3, i3);
55302         case 2:
55303           return this.getUint16(e3, i3);
55304         case 4:
55305           return this.getUint32(e3, i3);
55306         case 8:
55307           return this.getUint64 && this.getUint64(e3, i3);
55308       }
55309     }
55310     getUint(e3, t2, i3) {
55311       switch (t2) {
55312         case 8:
55313           return this.getUint8(e3, i3);
55314         case 16:
55315           return this.getUint16(e3, i3);
55316         case 32:
55317           return this.getUint32(e3, i3);
55318         case 64:
55319           return this.getUint64 && this.getUint64(e3, i3);
55320       }
55321     }
55322     toString(e3) {
55323       return this.dataView.toString(e3, this.constructor.name);
55324     }
55325     ensureChunk() {
55326     }
55327   };
55328   function P2(e3, t2) {
55329     g2("".concat(e3, " '").concat(t2, "' was not loaded, try using full build of exifr."));
55330   }
55331   var k2 = class extends Map {
55332     constructor(e3) {
55333       super(), this.kind = e3;
55334     }
55335     get(e3, t2) {
55336       return this.has(e3) || P2(this.kind, e3), t2 && (e3 in t2 || (function(e4, t3) {
55337         g2("Unknown ".concat(e4, " '").concat(t3, "'."));
55338       })(this.kind, e3), t2[e3].enabled || P2(this.kind, e3)), super.get(e3);
55339     }
55340     keyList() {
55341       return Array.from(this.keys());
55342     }
55343   };
55344   var w2 = new k2("file parser");
55345   var T2 = new k2("segment parser");
55346   var A = new k2("file reader");
55347   function D2(e3, n3) {
55348     return "string" == typeof e3 ? O(e3, n3) : t && !i2 && e3 instanceof HTMLImageElement ? O(e3.src, n3) : e3 instanceof Uint8Array || e3 instanceof ArrayBuffer || e3 instanceof DataView ? new I2(e3) : t && e3 instanceof Blob ? x2(e3, n3, "blob", R) : void g2("Invalid input argument");
55349   }
55350   function O(e3, i3) {
55351     return (s2 = e3).startsWith("data:") || s2.length > 1e4 ? v2(e3, i3, "base64") : n2 && e3.includes("://") ? x2(e3, i3, "url", M2) : n2 ? v2(e3, i3, "fs") : t ? x2(e3, i3, "url", M2) : void g2("Invalid input argument");
55352     var s2;
55353   }
55354   async function x2(e3, t2, i3, n3) {
55355     return A.has(i3) ? v2(e3, t2, i3) : n3 ? (async function(e4, t3) {
55356       let i4 = await t3(e4);
55357       return new I2(i4);
55358     })(e3, n3) : void g2("Parser ".concat(i3, " is not loaded"));
55359   }
55360   async function v2(e3, t2, i3) {
55361     let n3 = new (A.get(i3))(e3, t2);
55362     return await n3.read(), n3;
55363   }
55364   var M2 = (e3) => h2(e3).then(((e4) => e4.arrayBuffer()));
55365   var R = (e3) => new Promise(((t2, i3) => {
55366     let n3 = new FileReader();
55367     n3.onloadend = () => t2(n3.result || new ArrayBuffer()), n3.onerror = i3, n3.readAsArrayBuffer(e3);
55368   }));
55369   var L2 = class extends Map {
55370     get tagKeys() {
55371       return this.allKeys || (this.allKeys = Array.from(this.keys())), this.allKeys;
55372     }
55373     get tagValues() {
55374       return this.allValues || (this.allValues = Array.from(this.values())), this.allValues;
55375     }
55376   };
55377   function U2(e3, t2, i3) {
55378     let n3 = new L2();
55379     for (let [e4, t3] of i3) n3.set(e4, t3);
55380     if (Array.isArray(t2)) for (let i4 of t2) e3.set(i4, n3);
55381     else e3.set(t2, n3);
55382     return n3;
55383   }
55384   function F2(e3, t2, i3) {
55385     let n3, s2 = e3.get(t2);
55386     for (n3 of i3) s2.set(n3[0], n3[1]);
55387   }
55388   var E2 = /* @__PURE__ */ new Map();
55389   var B2 = /* @__PURE__ */ new Map();
55390   var N2 = /* @__PURE__ */ new Map();
55391   var G2 = ["chunked", "firstChunkSize", "firstChunkSizeNode", "firstChunkSizeBrowser", "chunkSize", "chunkLimit"];
55392   var V2 = ["jfif", "xmp", "icc", "iptc", "ihdr"];
55393   var z2 = ["tiff", ...V2];
55394   var H = ["ifd0", "ifd1", "exif", "gps", "interop"];
55395   var j2 = [...z2, ...H];
55396   var W2 = ["makerNote", "userComment"];
55397   var K2 = ["translateKeys", "translateValues", "reviveValues", "multiSegment"];
55398   var X3 = [...K2, "sanitize", "mergeOutput", "silentErrors"];
55399   var _2 = class {
55400     get translate() {
55401       return this.translateKeys || this.translateValues || this.reviveValues;
55402     }
55403   };
55404   var Y = class extends _2 {
55405     get needed() {
55406       return this.enabled || this.deps.size > 0;
55407     }
55408     constructor(e3, t2, i3, n3) {
55409       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 = H.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);
55410       else if ("object" == typeof i3) {
55411         if (this.enabled = true, this.parse = false !== i3.parse, this.canBeFiltered) {
55412           let { pick: e4, skip: t3 } = i3;
55413           e4 && e4.length > 0 && this.translateTagSet(e4, this.pick), t3 && t3.length > 0 && this.translateTagSet(t3, this.skip);
55414         }
55415         this.applyInheritables(i3);
55416       } else true === i3 || false === i3 ? this.parse = this.enabled = i3 : g2("Invalid options argument: ".concat(i3));
55417     }
55418     applyInheritables(e3) {
55419       let t2, i3;
55420       for (t2 of K2) i3 = e3[t2], void 0 !== i3 && (this[t2] = i3);
55421     }
55422     translateTagSet(e3, t2) {
55423       if (this.dict) {
55424         let i3, n3, { tagKeys: s2, tagValues: r2 } = this.dict;
55425         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);
55426       } else for (let i3 of e3) t2.add(i3);
55427     }
55428     finalizeFilters() {
55429       !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);
55430     }
55431   };
55432   var $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 };
55433   var J2 = /* @__PURE__ */ new Map();
55434   var q2 = class extends _2 {
55435     static useCached(e3) {
55436       let t2 = J2.get(e3);
55437       return void 0 !== t2 || (t2 = new this(e3), J2.set(e3, t2)), t2;
55438     }
55439     constructor(e3) {
55440       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 ".concat(e3)), void 0 === this.firstChunkSize && (this.firstChunkSize = t ? this.firstChunkSizeBrowser : this.firstChunkSizeNode), this.mergeOutput && (this.ifd1.enabled = false), this.filterNestedSegmentTags(), this.traverseTiffDependencyTree(), this.checkLoadedPlugins();
55441     }
55442     setupFromUndefined() {
55443       let e3;
55444       for (e3 of G2) this[e3] = $3[e3];
55445       for (e3 of X3) this[e3] = $3[e3];
55446       for (e3 of W2) this[e3] = $3[e3];
55447       for (e3 of j2) this[e3] = new Y(e3, $3[e3], void 0, this);
55448     }
55449     setupFromTrue() {
55450       let e3;
55451       for (e3 of G2) this[e3] = $3[e3];
55452       for (e3 of X3) this[e3] = $3[e3];
55453       for (e3 of W2) this[e3] = true;
55454       for (e3 of j2) this[e3] = new Y(e3, true, void 0, this);
55455     }
55456     setupFromArray(e3) {
55457       let t2;
55458       for (t2 of G2) this[t2] = $3[t2];
55459       for (t2 of X3) this[t2] = $3[t2];
55460       for (t2 of W2) this[t2] = $3[t2];
55461       for (t2 of j2) this[t2] = new Y(t2, false, void 0, this);
55462       this.setupGlobalFilters(e3, void 0, H);
55463     }
55464     setupFromObject(e3) {
55465       let t2;
55466       for (t2 of (H.ifd0 = H.ifd0 || H.image, H.ifd1 = H.ifd1 || H.thumbnail, Object.assign(this, e3), G2)) this[t2] = Z(e3[t2], $3[t2]);
55467       for (t2 of X3) this[t2] = Z(e3[t2], $3[t2]);
55468       for (t2 of W2) this[t2] = Z(e3[t2], $3[t2]);
55469       for (t2 of z2) this[t2] = new Y(t2, $3[t2], e3[t2], this);
55470       for (t2 of H) this[t2] = new Y(t2, $3[t2], e3[t2], this.tiff);
55471       this.setupGlobalFilters(e3.pick, e3.skip, H, j2), true === e3.tiff ? this.batchEnableWithBool(H, true) : false === e3.tiff ? this.batchEnableWithUserValue(H, e3) : Array.isArray(e3.tiff) ? this.setupGlobalFilters(e3.tiff, void 0, H) : "object" == typeof e3.tiff && this.setupGlobalFilters(e3.tiff.pick, e3.tiff.skip, H);
55472     }
55473     batchEnableWithBool(e3, t2) {
55474       for (let i3 of e3) this[i3].enabled = t2;
55475     }
55476     batchEnableWithUserValue(e3, t2) {
55477       for (let i3 of e3) {
55478         let e4 = t2[i3];
55479         this[i3].enabled = false !== e4 && void 0 !== e4;
55480       }
55481     }
55482     setupGlobalFilters(e3, t2, i3, n3 = i3) {
55483       if (e3 && e3.length) {
55484         for (let e4 of n3) this[e4].enabled = false;
55485         let t3 = Q2(e3, i3);
55486         for (let [e4, i4] of t3) ee(this[e4].pick, i4), this[e4].enabled = true;
55487       } else if (t2 && t2.length) {
55488         let e4 = Q2(t2, i3);
55489         for (let [t3, i4] of e4) ee(this[t3].skip, i4);
55490       }
55491     }
55492     filterNestedSegmentTags() {
55493       let { ifd0: e3, exif: t2, xmp: i3, iptc: n3, icc: s2 } = this;
55494       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);
55495     }
55496     traverseTiffDependencyTree() {
55497       let { ifd0: e3, exif: t2, gps: i3, interop: n3 } = this;
55498       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 = H.some(((e4) => true === this[e4].enabled)) || this.makerNote || this.userComment;
55499       for (let e4 of H) this[e4].finalizeFilters();
55500     }
55501     get onlyTiff() {
55502       return !V2.map(((e3) => this[e3].enabled)).some(((e3) => true === e3)) && this.tiff.enabled;
55503     }
55504     checkLoadedPlugins() {
55505       for (let e3 of z2) this[e3].enabled && !T2.has(e3) && P2("segment parser", e3);
55506     }
55507   };
55508   function Q2(e3, t2) {
55509     let i3, n3, s2, r2, a2 = [];
55510     for (s2 of t2) {
55511       for (r2 of (i3 = E2.get(s2), n3 = [], i3)) (e3.includes(r2[0]) || e3.includes(r2[1])) && n3.push(r2[0]);
55512       n3.length && a2.push([s2, n3]);
55513     }
55514     return a2;
55515   }
55516   function Z(e3, t2) {
55517     return void 0 !== e3 ? e3 : void 0 !== t2 ? t2 : void 0;
55518   }
55519   function ee(e3, t2) {
55520     for (let i3 of t2) e3.add(i3);
55521   }
55522   c(q2, "default", $3);
55523   var te = class {
55524     constructor(e3) {
55525       c(this, "parsers", {}), c(this, "output", {}), c(this, "errors", []), c(this, "pushToErrors", ((e4) => this.errors.push(e4))), this.options = q2.useCached(e3);
55526     }
55527     async read(e3) {
55528       this.file = await D2(e3, this.options);
55529     }
55530     setup() {
55531       if (this.fileParser) return;
55532       let { file: e3 } = this, t2 = e3.getUint16(0);
55533       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;
55534       this.file.close && this.file.close(), g2("Unknown file format");
55535     }
55536     async parse() {
55537       let { output: e3, errors: t2 } = this;
55538       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);
55539     }
55540     async executeParsers() {
55541       let { output: e3 } = this;
55542       await this.fileParser.parse();
55543       let t2 = Object.values(this.parsers).map((async (t3) => {
55544         let i3 = await t3.parse();
55545         t3.assignToOutput(e3, i3);
55546       }));
55547       this.options.silentErrors && (t2 = t2.map(((e4) => e4.catch(this.pushToErrors)))), await Promise.all(t2);
55548     }
55549     async extractThumbnail() {
55550       this.setup();
55551       let { options: e3, file: t2 } = this, i3 = T2.get("tiff", e3);
55552       var n3;
55553       if (t2.tiff ? n3 = { start: 0, type: "tiff" } : t2.jpeg && (n3 = await this.fileParser.getOrFindSegment("tiff")), void 0 === n3) return;
55554       let s2 = await this.fileParser.ensureSegmentChunk(n3), r2 = this.parsers.tiff = new i3(s2, e3, t2), a2 = await r2.extractThumbnail();
55555       return t2.close && t2.close(), a2;
55556     }
55557   };
55558   async function ie2(e3, t2) {
55559     let i3 = new te(t2);
55560     return await i3.read(e3), i3.parse();
55561   }
55562   var ne = Object.freeze({ __proto__: null, parse: ie2, Exifr: te, fileParsers: w2, segmentParsers: T2, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R, chunkedProps: G2, otherSegments: V2, segments: z2, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2 });
55563   var se2 = class {
55564     constructor(e3, t2, i3) {
55565       c(this, "errors", []), c(this, "ensureSegmentChunk", (async (e4) => {
55566         let t3 = e4.start, i4 = e4.size || 65536;
55567         if (this.file.chunked) if (this.file.available(t3, i4)) e4.chunk = this.file.subarray(t3, i4);
55568         else try {
55569           e4.chunk = await this.file.readChunk(t3, i4);
55570         } catch (t4) {
55571           g2("Couldn't read segment: ".concat(JSON.stringify(e4), ". ").concat(t4.message));
55572         }
55573         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));
55574         return e4.chunk;
55575       })), this.extendOptions && this.extendOptions(e3), this.options = e3, this.file = t2, this.parsers = i3;
55576     }
55577     injectSegment(e3, t2) {
55578       this.options[e3].enabled && this.createParser(e3, t2);
55579     }
55580     createParser(e3, t2) {
55581       let i3 = new (T2.get(e3))(t2, this.options, this.file);
55582       return this.parsers[e3] = i3;
55583     }
55584     createParsers(e3) {
55585       for (let t2 of e3) {
55586         let { type: e4, chunk: i3 } = t2, n3 = this.options[e4];
55587         if (n3 && n3.enabled) {
55588           let t3 = this.parsers[e4];
55589           t3 && t3.append || t3 || this.createParser(e4, i3);
55590         }
55591       }
55592     }
55593     async readSegments(e3) {
55594       let t2 = e3.map(this.ensureSegmentChunk);
55595       await Promise.all(t2);
55596     }
55597   };
55598   var re3 = class {
55599     static findPosition(e3, t2) {
55600       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;
55601       return { offset: t2, length: i3, headerLength: n3, start: s2, size: r2, end: s2 + r2 };
55602     }
55603     static parse(e3, t2 = {}) {
55604       return new this(e3, new q2({ [this.type]: t2 }), e3).parse();
55605     }
55606     normalizeInput(e3) {
55607       return e3 instanceof I2 ? e3 : new I2(e3);
55608     }
55609     constructor(e3, t2 = {}, i3) {
55610       c(this, "errors", []), c(this, "raw", /* @__PURE__ */ new Map()), c(this, "handleError", ((e4) => {
55611         if (!this.options.silentErrors) throw e4;
55612         this.errors.push(e4.message);
55613       })), 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;
55614     }
55615     translate() {
55616       this.canTranslate && (this.translated = this.translateBlock(this.raw, this.type));
55617     }
55618     get output() {
55619       return this.translated ? this.translated : this.raw ? Object.fromEntries(this.raw) : void 0;
55620     }
55621     translateBlock(e3, t2) {
55622       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, l2 = r2.translateKeys && !!s2, h3 = {};
55623       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))), l2 && s2.has(t3) && (t3 = s2.get(t3) || t3), h3[t3] = r3;
55624       return h3;
55625     }
55626     translateValue(e3, t2) {
55627       return t2[e3] || t2.DEFAULT || e3;
55628     }
55629     assignToOutput(e3, t2) {
55630       this.assignObjectToOutput(e3, this.constructor.type, t2);
55631     }
55632     assignObjectToOutput(e3, t2, i3) {
55633       if (this.globalOptions.mergeOutput) return Object.assign(e3, i3);
55634       e3[t2] ? Object.assign(e3[t2], i3) : e3[t2] = i3;
55635     }
55636   };
55637   c(re3, "headerLength", 4), c(re3, "type", void 0), c(re3, "multiSegment", false), c(re3, "canHandle", (() => false));
55638   function ae2(e3) {
55639     return 192 === e3 || 194 === e3 || 196 === e3 || 219 === e3 || 221 === e3 || 218 === e3 || 254 === e3;
55640   }
55641   function oe2(e3) {
55642     return e3 >= 224 && e3 <= 239;
55643   }
55644   function le2(e3, t2, i3) {
55645     for (let [n3, s2] of T2) if (s2.canHandle(e3, t2, i3)) return n3;
55646   }
55647   var he2 = class extends se2 {
55648     constructor(...e3) {
55649       super(...e3), c(this, "appSegments", []), c(this, "jpegSegments", []), c(this, "unknownSegments", []);
55650     }
55651     static canHandle(e3, t2) {
55652       return 65496 === t2;
55653     }
55654     async parse() {
55655       await this.findAppSegments(), await this.readSegments(this.appSegments), this.mergeMultiSegments(), this.createParsers(this.mergedAppSegments || this.appSegments);
55656     }
55657     setupSegmentFinderArgs(e3) {
55658       true === e3 ? (this.findAll = true, this.wanted = new Set(T2.keyList())) : (e3 = void 0 === e3 ? T2.keyList().filter(((e4) => this.options[e4].enabled)) : e3.filter(((e4) => this.options[e4].enabled && T2.has(e4))), this.findAll = false, this.remaining = new Set(e3), this.wanted = new Set(e3)), this.unfinishedMultiSegment = false;
55659     }
55660     async findAppSegments(e3 = 0, t2) {
55661       this.setupSegmentFinderArgs(t2);
55662       let { file: i3, findAll: n3, wanted: s2, remaining: r2 } = this;
55663       if (!n3 && this.file.chunked && (n3 = Array.from(s2).some(((e4) => {
55664         let t3 = T2.get(e4), i4 = this.options[e4];
55665         return t3.multiSegment && i4.multiSegment;
55666       })), n3 && await this.file.readWhole()), e3 = this.findAppSegmentsInRange(e3, i3.byteLength), !this.options.onlyTiff && i3.chunked) {
55667         let t3 = false;
55668         for (; r2.size > 0 && !t3 && (i3.canReadNextChunk || this.unfinishedMultiSegment); ) {
55669           let { nextChunkOffset: n4 } = i3, s3 = this.appSegments.some(((e4) => !this.file.available(e4.offset || e4.start, e4.length || e4.size)));
55670           if (t3 = e3 > n4 && !s3 ? !await i3.readNextChunk(e3) : !await i3.readNextChunk(n4), void 0 === (e3 = this.findAppSegmentsInRange(e3, i3.byteLength))) return;
55671         }
55672       }
55673     }
55674     findAppSegmentsInRange(e3, t2) {
55675       t2 -= 2;
55676       let i3, n3, s2, r2, a2, o2, { file: l2, findAll: h3, wanted: u4, remaining: c2, options: f2 } = this;
55677       for (; e3 < t2; e3++) if (255 === l2.getUint8(e3)) {
55678         if (i3 = l2.getUint8(e3 + 1), oe2(i3)) {
55679           if (n3 = l2.getUint16(e3 + 2), s2 = le2(l2, e3, n3), s2 && u4.has(s2) && (r2 = T2.get(s2), a2 = r2.findPosition(l2, 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;
55680           f2.recordUnknownSegments && (a2 = re3.findPosition(l2, e3), a2.marker = i3, this.unknownSegments.push(a2)), e3 += n3 + 1;
55681         } else if (ae2(i3)) {
55682           if (n3 = l2.getUint16(e3 + 2), 218 === i3 && false !== f2.stopAfterSos) return;
55683           f2.recordJpegSegments && this.jpegSegments.push({ offset: e3, length: n3, marker: i3 }), e3 += n3 + 1;
55684         }
55685       }
55686       return e3;
55687     }
55688     mergeMultiSegments() {
55689       if (!this.appSegments.some(((e4) => e4.multiSegment))) return;
55690       let e3 = (function(e4, t2) {
55691         let i3, n3, s2, r2 = /* @__PURE__ */ new Map();
55692         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);
55693         return Array.from(r2);
55694       })(this.appSegments, "type");
55695       this.mergedAppSegments = e3.map((([e4, t2]) => {
55696         let i3 = T2.get(e4, this.options);
55697         if (i3.handleMultiSegments) {
55698           return { type: e4, chunk: i3.handleMultiSegments(t2) };
55699         }
55700         return t2[0];
55701       }));
55702     }
55703     getSegment(e3) {
55704       return this.appSegments.find(((t2) => t2.type === e3));
55705     }
55706     async getOrFindSegment(e3) {
55707       let t2 = this.getSegment(e3);
55708       return void 0 === t2 && (await this.findAppSegments(0, [e3]), t2 = this.getSegment(e3)), t2;
55709     }
55710   };
55711   c(he2, "type", "jpeg"), w2.set("jpeg", he2);
55712   var ue2 = [void 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4];
55713   var ce2 = class extends re3 {
55714     parseHeader() {
55715       var e3 = this.chunk.getUint16();
55716       18761 === e3 ? this.le = true : 19789 === e3 && (this.le = false), this.chunk.le = this.le, this.headerParsed = true;
55717     }
55718     parseTags(e3, t2, i3 = /* @__PURE__ */ new Map()) {
55719       let { pick: n3, skip: s2 } = this.options[t2];
55720       n3 = new Set(n3);
55721       let r2 = n3.size > 0, a2 = 0 === s2.size, o2 = this.chunk.getUint16(e3);
55722       e3 += 2;
55723       for (let l2 = 0; l2 < o2; l2++) {
55724         let o3 = this.chunk.getUint16(e3);
55725         if (r2) {
55726           if (n3.has(o3) && (i3.set(o3, this.parseTag(e3, o3, t2)), n3.delete(o3), 0 === n3.size)) break;
55727         } else !a2 && s2.has(o3) || i3.set(o3, this.parseTag(e3, o3, t2));
55728         e3 += 12;
55729       }
55730       return i3;
55731     }
55732     parseTag(e3, t2, i3) {
55733       let { chunk: n3 } = this, s2 = n3.getUint16(e3 + 2), r2 = n3.getUint32(e3 + 4), a2 = ue2[s2];
55734       if (a2 * r2 <= 4 ? e3 += 8 : e3 = n3.getUint32(e3 + 8), (s2 < 1 || s2 > 13) && g2("Invalid TIFF value type. block: ".concat(i3.toUpperCase(), ", tag: ").concat(t2.toString(16), ", type: ").concat(s2, ", offset ").concat(e3)), e3 > n3.byteLength && g2("Invalid TIFF value offset. block: ".concat(i3.toUpperCase(), ", tag: ").concat(t2.toString(16), ", type: ").concat(s2, ", offset ").concat(e3, " is outside of chunk size ").concat(n3.byteLength)), 1 === s2) return n3.getUint8Array(e3, r2);
55735       if (2 === s2) return m2(n3.getString(e3, r2));
55736       if (7 === s2) return n3.getUint8Array(e3, r2);
55737       if (1 === r2) return this.parseTagValue(s2, e3);
55738       {
55739         let t3 = new ((function(e4) {
55740           switch (e4) {
55741             case 1:
55742               return Uint8Array;
55743             case 3:
55744               return Uint16Array;
55745             case 4:
55746               return Uint32Array;
55747             case 5:
55748               return Array;
55749             case 6:
55750               return Int8Array;
55751             case 8:
55752               return Int16Array;
55753             case 9:
55754               return Int32Array;
55755             case 10:
55756               return Array;
55757             case 11:
55758               return Float32Array;
55759             case 12:
55760               return Float64Array;
55761             default:
55762               return Array;
55763           }
55764         })(s2))(r2), i4 = a2;
55765         for (let n4 = 0; n4 < r2; n4++) t3[n4] = this.parseTagValue(s2, e3), e3 += i4;
55766         return t3;
55767       }
55768     }
55769     parseTagValue(e3, t2) {
55770       let { chunk: i3 } = this;
55771       switch (e3) {
55772         case 1:
55773           return i3.getUint8(t2);
55774         case 3:
55775           return i3.getUint16(t2);
55776         case 4:
55777           return i3.getUint32(t2);
55778         case 5:
55779           return i3.getUint32(t2) / i3.getUint32(t2 + 4);
55780         case 6:
55781           return i3.getInt8(t2);
55782         case 8:
55783           return i3.getInt16(t2);
55784         case 9:
55785           return i3.getInt32(t2);
55786         case 10:
55787           return i3.getInt32(t2) / i3.getInt32(t2 + 4);
55788         case 11:
55789           return i3.getFloat(t2);
55790         case 12:
55791           return i3.getDouble(t2);
55792         case 13:
55793           return i3.getUint32(t2);
55794         default:
55795           g2("Invalid tiff type ".concat(e3));
55796       }
55797     }
55798   };
55799   var fe2 = class extends ce2 {
55800     static canHandle(e3, t2) {
55801       return 225 === e3.getUint8(t2 + 1) && 1165519206 === e3.getUint32(t2 + 4) && 0 === e3.getUint16(t2 + 8);
55802     }
55803     async parse() {
55804       this.parseHeader();
55805       let { options: e3 } = this;
55806       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();
55807     }
55808     safeParse(e3) {
55809       let t2 = this[e3]();
55810       return void 0 !== t2.catch && (t2 = t2.catch(this.handleError)), t2;
55811     }
55812     findIfd0Offset() {
55813       void 0 === this.ifd0Offset && (this.ifd0Offset = this.chunk.getUint32(4));
55814     }
55815     findIfd1Offset() {
55816       if (void 0 === this.ifd1Offset) {
55817         this.findIfd0Offset();
55818         let e3 = this.chunk.getUint16(this.ifd0Offset), t2 = this.ifd0Offset + 2 + 12 * e3;
55819         this.ifd1Offset = this.chunk.getUint32(t2);
55820       }
55821     }
55822     parseBlock(e3, t2) {
55823       let i3 = /* @__PURE__ */ new Map();
55824       return this[t2] = i3, this.parseTags(e3, t2, i3), i3;
55825     }
55826     async parseIfd0Block() {
55827       if (this.ifd0) return;
55828       let { file: e3 } = this;
55829       this.findIfd0Offset(), this.ifd0Offset < 8 && g2("Malformed EXIF data"), !e3.chunked && this.ifd0Offset > e3.byteLength && g2("IFD0 offset points to outside of file.\nthis.ifd0Offset: ".concat(this.ifd0Offset, ", file.byteLength: ").concat(e3.byteLength)), e3.tiff && await e3.ensureChunk(this.ifd0Offset, S2(this.options));
55830       let t2 = this.parseBlock(this.ifd0Offset, "ifd0");
55831       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;
55832     }
55833     async parseExifBlock() {
55834       if (this.exif) return;
55835       if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.exifOffset) return;
55836       this.file.tiff && await this.file.ensureChunk(this.exifOffset, S2(this.options));
55837       let e3 = this.parseBlock(this.exifOffset, "exif");
55838       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;
55839     }
55840     unpack(e3, t2) {
55841       let i3 = e3.get(t2);
55842       i3 && 1 === i3.length && e3.set(t2, i3[0]);
55843     }
55844     async parseGpsBlock() {
55845       if (this.gps) return;
55846       if (this.ifd0 || await this.parseIfd0Block(), void 0 === this.gpsOffset) return;
55847       let e3 = this.parseBlock(this.gpsOffset, "gps");
55848       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;
55849     }
55850     async parseInteropBlock() {
55851       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");
55852     }
55853     async parseThumbnailBlock(e3 = false) {
55854       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;
55855     }
55856     async extractThumbnail() {
55857       if (this.headerParsed || this.parseHeader(), this.ifd1Parsed || await this.parseThumbnailBlock(true), void 0 === this.ifd1) return;
55858       let e3 = this.ifd1.get(513), t2 = this.ifd1.get(514);
55859       return this.chunk.getUint8Array(e3, t2);
55860     }
55861     get image() {
55862       return this.ifd0;
55863     }
55864     get thumbnail() {
55865       return this.ifd1;
55866     }
55867     createOutput() {
55868       let e3, t2, i3, n3 = {};
55869       for (t2 of H) if (e3 = this[t2], !p(e3)) if (i3 = this.canTranslate ? this.translateBlock(e3, t2) : Object.fromEntries(e3), this.options.mergeOutput) {
55870         if ("ifd1" === t2) continue;
55871         Object.assign(n3, i3);
55872       } else n3[t2] = i3;
55873       return this.makerNote && (n3.makerNote = this.makerNote), this.userComment && (n3.userComment = this.userComment), n3;
55874     }
55875     assignToOutput(e3, t2) {
55876       if (this.globalOptions.mergeOutput) Object.assign(e3, t2);
55877       else for (let [i3, n3] of Object.entries(t2)) this.assignObjectToOutput(e3, i3, n3);
55878     }
55879   };
55880   function de2(e3, t2, i3, n3) {
55881     var s2 = e3 + t2 / 60 + i3 / 3600;
55882     return "S" !== n3 && "W" !== n3 || (s2 *= -1), s2;
55883   }
55884   c(fe2, "type", "tiff"), c(fe2, "headerLength", 10), T2.set("tiff", fe2);
55885   var pe2 = Object.freeze({ __proto__: null, default: ne, Exifr: te, fileParsers: w2, segmentParsers: T2, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R, chunkedProps: G2, otherSegments: V2, segments: z2, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2, parse: ie2 });
55886   var ge2 = { ifd0: false, ifd1: false, exif: false, gps: false, interop: false, sanitize: false, reviveValues: true, translateKeys: false, translateValues: false, mergeOutput: false };
55887   var me2 = Object.assign({}, ge2, { firstChunkSize: 4e4, gps: [1, 2, 3, 4] });
55888   async function Se2(e3) {
55889     let t2 = new te(me2);
55890     await t2.read(e3);
55891     let i3 = await t2.parse();
55892     if (i3 && i3.gps) {
55893       let { latitude: e4, longitude: t3 } = i3.gps;
55894       return { latitude: e4, longitude: t3 };
55895     }
55896   }
55897   var Ce2 = Object.assign({}, ge2, { tiff: false, ifd1: true, mergeOutput: false });
55898   async function ye2(e3) {
55899     let t2 = new te(Ce2);
55900     await t2.read(e3);
55901     let i3 = await t2.extractThumbnail();
55902     return i3 && a ? s.from(i3) : i3;
55903   }
55904   async function be2(e3) {
55905     let t2 = await this.thumbnail(e3);
55906     if (void 0 !== t2) {
55907       let e4 = new Blob([t2]);
55908       return URL.createObjectURL(e4);
55909     }
55910   }
55911   var Ie2 = Object.assign({}, ge2, { firstChunkSize: 4e4, ifd0: [274] });
55912   async function Pe2(e3) {
55913     let t2 = new te(Ie2);
55914     await t2.read(e3);
55915     let i3 = await t2.parse();
55916     if (i3 && i3.ifd0) return i3.ifd0[274];
55917   }
55918   var 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 } });
55919   var we2 = true;
55920   var Te2 = true;
55921   if ("object" == typeof navigator) {
55922     let e3 = navigator.userAgent;
55923     if (e3.includes("iPad") || e3.includes("iPhone")) {
55924       let t2 = e3.match(/OS (\d+)_(\d+)/);
55925       if (t2) {
55926         let [, e4, i3] = t2, n3 = Number(e4) + 0.1 * Number(i3);
55927         we2 = n3 < 13.4, Te2 = false;
55928       }
55929     } else if (e3.includes("OS X 10")) {
55930       let [, t2] = e3.match(/OS X 10[_.](\d+)/);
55931       we2 = Te2 = Number(t2) < 15;
55932     }
55933     if (e3.includes("Chrome/")) {
55934       let [, t2] = e3.match(/Chrome\/(\d+)/);
55935       we2 = Te2 = Number(t2) < 81;
55936     } else if (e3.includes("Firefox/")) {
55937       let [, t2] = e3.match(/Firefox\/(\d+)/);
55938       we2 = Te2 = Number(t2) < 77;
55939     }
55940   }
55941   async function Ae2(e3) {
55942     let t2 = await Pe2(e3);
55943     return Object.assign({ canvas: we2, css: Te2 }, ke2[t2]);
55944   }
55945   var De2 = class extends I2 {
55946     constructor(...e3) {
55947       super(...e3), c(this, "ranges", new Oe2()), 0 !== this.byteLength && this.ranges.add(0, this.byteLength);
55948     }
55949     _tryExtend(e3, t2, i3) {
55950       if (0 === e3 && 0 === this.byteLength && i3) {
55951         let e4 = new DataView(i3.buffer || i3, i3.byteOffset, i3.byteLength);
55952         this._swapDataView(e4);
55953       } else {
55954         let i4 = e3 + t2;
55955         if (i4 > this.byteLength) {
55956           let { dataView: e4 } = this._extend(i4);
55957           this._swapDataView(e4);
55958         }
55959       }
55960     }
55961     _extend(e3) {
55962       let t2;
55963       t2 = a ? s.allocUnsafe(e3) : new Uint8Array(e3);
55964       let i3 = new DataView(t2.buffer, t2.byteOffset, t2.byteLength);
55965       return t2.set(new Uint8Array(this.buffer, this.byteOffset, this.byteLength), 0), { uintView: t2, dataView: i3 };
55966     }
55967     subarray(e3, t2, i3 = false) {
55968       return t2 = t2 || this._lengthToEnd(e3), i3 && this._tryExtend(e3, t2), this.ranges.add(e3, t2), super.subarray(e3, t2);
55969     }
55970     set(e3, t2, i3 = false) {
55971       i3 && this._tryExtend(t2, e3.byteLength, e3);
55972       let n3 = super.set(e3, t2);
55973       return this.ranges.add(t2, n3.byteLength), n3;
55974     }
55975     async ensureChunk(e3, t2) {
55976       this.chunked && (this.ranges.available(e3, t2) || await this.readChunk(e3, t2));
55977     }
55978     available(e3, t2) {
55979       return this.ranges.available(e3, t2);
55980     }
55981   };
55982   var Oe2 = class {
55983     constructor() {
55984       c(this, "list", []);
55985     }
55986     get length() {
55987       return this.list.length;
55988     }
55989     add(e3, t2, i3 = 0) {
55990       let n3 = e3 + t2, s2 = this.list.filter(((t3) => xe(e3, t3.offset, n3) || xe(e3, t3.end, n3)));
55991       if (s2.length > 0) {
55992         e3 = Math.min(e3, ...s2.map(((e4) => e4.offset))), n3 = Math.max(n3, ...s2.map(((e4) => e4.end))), t2 = n3 - e3;
55993         let i4 = s2.shift();
55994         i4.offset = e3, i4.length = t2, i4.end = n3, this.list = this.list.filter(((e4) => !s2.includes(e4)));
55995       } else this.list.push({ offset: e3, length: t2, end: n3 });
55996     }
55997     available(e3, t2) {
55998       let i3 = e3 + t2;
55999       return this.list.some(((t3) => t3.offset <= e3 && i3 <= t3.end));
56000     }
56001   };
56002   function xe(e3, t2, i3) {
56003     return e3 <= t2 && t2 <= i3;
56004   }
56005   var ve2 = class extends De2 {
56006     constructor(e3, t2) {
56007       super(0), c(this, "chunksRead", 0), this.input = e3, this.options = t2;
56008     }
56009     async readWhole() {
56010       this.chunked = false, await this.readChunk(this.nextChunkOffset);
56011     }
56012     async readChunked() {
56013       this.chunked = true, await this.readChunk(0, this.options.firstChunkSize);
56014     }
56015     async readNextChunk(e3 = this.nextChunkOffset) {
56016       if (this.fullyRead) return this.chunksRead++, false;
56017       let t2 = this.options.chunkSize, i3 = await this.readChunk(e3, t2);
56018       return !!i3 && i3.byteLength === t2;
56019     }
56020     async readChunk(e3, t2) {
56021       if (this.chunksRead++, 0 !== (t2 = this.safeWrapAddress(e3, t2))) return this._readChunk(e3, t2);
56022     }
56023     safeWrapAddress(e3, t2) {
56024       return void 0 !== this.size && e3 + t2 > this.size ? Math.max(0, this.size - e3) : t2;
56025     }
56026     get nextChunkOffset() {
56027       if (0 !== this.ranges.list.length) return this.ranges.list[0].length;
56028     }
56029     get canReadNextChunk() {
56030       return this.chunksRead < this.options.chunkLimit;
56031     }
56032     get fullyRead() {
56033       return void 0 !== this.size && this.nextChunkOffset === this.size;
56034     }
56035     read() {
56036       return this.options.chunked ? this.readChunked() : this.readWhole();
56037     }
56038     close() {
56039     }
56040   };
56041   A.set("blob", class extends ve2 {
56042     async readWhole() {
56043       this.chunked = false;
56044       let e3 = await R(this.input);
56045       this._swapArrayBuffer(e3);
56046     }
56047     readChunked() {
56048       return this.chunked = true, this.size = this.input.size, super.readChunked();
56049     }
56050     async _readChunk(e3, t2) {
56051       let i3 = t2 ? e3 + t2 : void 0, n3 = this.input.slice(e3, i3), s2 = await R(n3);
56052       return this.set(s2, e3, true);
56053     }
56054   });
56055   var Me2 = Object.freeze({ __proto__: null, default: pe2, Exifr: te, fileParsers: w2, segmentParsers: T2, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R, chunkedProps: G2, otherSegments: V2, segments: z2, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2, parse: ie2, gpsOnlyOptions: me2, gps: Se2, thumbnailOnlyOptions: Ce2, thumbnail: ye2, thumbnailUrl: be2, orientationOnlyOptions: Ie2, orientation: Pe2, rotations: ke2, get rotateCanvas() {
56056     return we2;
56057   }, get rotateCss() {
56058     return Te2;
56059   }, rotation: Ae2 });
56060   A.set("url", class extends ve2 {
56061     async readWhole() {
56062       this.chunked = false;
56063       let e3 = await M2(this.input);
56064       e3 instanceof ArrayBuffer ? this._swapArrayBuffer(e3) : e3 instanceof Uint8Array && this._swapBuffer(e3);
56065     }
56066     async _readChunk(e3, t2) {
56067       let i3 = t2 ? e3 + t2 - 1 : void 0, n3 = this.options.httpHeaders || {};
56068       (e3 || i3) && (n3.range = "bytes=".concat([e3, i3].join("-")));
56069       let s2 = await h2(this.input, { headers: n3 }), r2 = await s2.arrayBuffer(), a2 = r2.byteLength;
56070       if (416 !== s2.status) return a2 !== t2 && (this.size = e3 + a2), this.set(r2, e3, true);
56071     }
56072   });
56073   I2.prototype.getUint64 = function(e3) {
56074     let t2 = this.getUint32(e3), i3 = this.getUint32(e3 + 4);
56075     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.");
56076   };
56077   var Re2 = class extends se2 {
56078     parseBoxes(e3 = 0) {
56079       let t2 = [];
56080       for (; e3 < this.file.byteLength - 4; ) {
56081         let i3 = this.parseBoxHead(e3);
56082         if (t2.push(i3), 0 === i3.length) break;
56083         e3 += i3.length;
56084       }
56085       return t2;
56086     }
56087     parseSubBoxes(e3) {
56088       e3.boxes = this.parseBoxes(e3.start);
56089     }
56090     findBox(e3, t2) {
56091       return void 0 === e3.boxes && this.parseSubBoxes(e3), e3.boxes.find(((e4) => e4.kind === t2));
56092     }
56093     parseBoxHead(e3) {
56094       let t2 = this.file.getUint32(e3), i3 = this.file.getString(e3 + 4, 4), n3 = e3 + 8;
56095       return 1 === t2 && (t2 = this.file.getUint64(e3 + 8), n3 += 8), { offset: e3, length: t2, kind: i3, start: n3 };
56096     }
56097     parseBoxFullHead(e3) {
56098       if (void 0 !== e3.version) return;
56099       let t2 = this.file.getUint32(e3.start);
56100       e3.version = t2 >> 24, e3.start += 4;
56101     }
56102   };
56103   var Le2 = class extends Re2 {
56104     static canHandle(e3, t2) {
56105       if (0 !== t2) return false;
56106       let i3 = e3.getUint16(2);
56107       if (i3 > 50) return false;
56108       let n3 = 16, s2 = [];
56109       for (; n3 < i3; ) s2.push(e3.getString(n3, 4)), n3 += 4;
56110       return s2.includes(this.type);
56111     }
56112     async parse() {
56113       let e3 = this.file.getUint32(0), t2 = this.parseBoxHead(e3);
56114       for (; "meta" !== t2.kind; ) e3 += t2.length, await this.file.ensureChunk(e3, 16), t2 = this.parseBoxHead(e3);
56115       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);
56116     }
56117     async registerSegment(e3, t2, i3) {
56118       await this.file.ensureChunk(t2, i3);
56119       let n3 = this.file.subarray(t2, i3);
56120       this.createParser(e3, n3);
56121     }
56122     async findIcc(e3) {
56123       let t2 = this.findBox(e3, "iprp");
56124       if (void 0 === t2) return;
56125       let i3 = this.findBox(t2, "ipco");
56126       if (void 0 === i3) return;
56127       let n3 = this.findBox(i3, "colr");
56128       void 0 !== n3 && await this.registerSegment("icc", n3.offset + 12, n3.length);
56129     }
56130     async findExif(e3) {
56131       let t2 = this.findBox(e3, "iinf");
56132       if (void 0 === t2) return;
56133       let i3 = this.findBox(e3, "iloc");
56134       if (void 0 === i3) return;
56135       let n3 = this.findExifLocIdInIinf(t2), s2 = this.findExtentInIloc(i3, n3);
56136       if (void 0 === s2) return;
56137       let [r2, a2] = s2;
56138       await this.file.ensureChunk(r2, a2);
56139       let o2 = 4 + this.file.getUint32(r2);
56140       r2 += o2, a2 -= o2, await this.registerSegment("tiff", r2, a2);
56141     }
56142     findExifLocIdInIinf(e3) {
56143       this.parseBoxFullHead(e3);
56144       let t2, i3, n3, s2, r2 = e3.start, a2 = this.file.getUint16(r2);
56145       for (r2 += 2; a2--; ) {
56146         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);
56147         r2 += t2.length;
56148       }
56149     }
56150     get8bits(e3) {
56151       let t2 = this.file.getUint8(e3);
56152       return [t2 >> 4, 15 & t2];
56153     }
56154     findExtentInIloc(e3, t2) {
56155       this.parseBoxFullHead(e3);
56156       let i3 = e3.start, [n3, s2] = this.get8bits(i3++), [r2, a2] = this.get8bits(i3++), o2 = 2 === e3.version ? 4 : 2, l2 = 1 === e3.version || 2 === e3.version ? 2 : 0, h3 = a2 + n3 + s2, u4 = 2 === e3.version ? 4 : 2, c2 = this.file.getUintBytes(i3, u4);
56157       for (i3 += u4; c2--; ) {
56158         let e4 = this.file.getUintBytes(i3, o2);
56159         i3 += o2 + l2 + 2 + r2;
56160         let u5 = this.file.getUint16(i3);
56161         if (i3 += 2, e4 === t2) return u5 > 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)];
56162         i3 += u5 * h3;
56163       }
56164     }
56165   };
56166   var Ue2 = class extends Le2 {
56167   };
56168   c(Ue2, "type", "heic");
56169   var Fe2 = class extends Le2 {
56170   };
56171   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" }]]);
56172   var 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" }]]);
56173   var Be2 = { 1: "No absolute unit of measurement", 2: "Inch", 3: "Centimeter" };
56174   Ee2.set(37392, Be2), Ee2.set(41488, Be2);
56175   var Ne2 = { 0: "Normal", 1: "Low", 2: "High" };
56176   function Ge2(e3) {
56177     return "object" == typeof e3 && void 0 !== e3.length ? e3[0] : e3;
56178   }
56179   function Ve2(e3) {
56180     let t2 = Array.from(e3).slice(1);
56181     return t2[1] > 15 && (t2 = t2.map(((e4) => String.fromCharCode(e4)))), "0" !== t2[2] && 0 !== t2[2] || t2.pop(), t2.join(".");
56182   }
56183   function ze2(e3) {
56184     if ("string" == typeof e3) {
56185       var [t2, i3, n3, s2, r2, a2] = e3.trim().split(/[-: ]/g).map(Number), o2 = new Date(t2, i3 - 1, n3);
56186       return Number.isNaN(s2) || Number.isNaN(r2) || Number.isNaN(a2) || (o2.setHours(s2), o2.setMinutes(r2), o2.setSeconds(a2)), Number.isNaN(+o2) ? e3 : o2;
56187     }
56188   }
56189   function He2(e3) {
56190     if ("string" == typeof e3) return e3;
56191     let t2 = [];
56192     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]));
56193     else for (let i3 = 0; i3 < e3.length; i3 += 2) t2.push(je2(e3[i3], e3[i3 + 1]));
56194     return m2(String.fromCodePoint(...t2));
56195   }
56196   function je2(e3, t2) {
56197     return e3 << 8 | t2;
56198   }
56199   Ee2.set(41992, Ne2), Ee2.set(41993, Ne2), Ee2.set(41994, Ne2), U2(N2, ["ifd0", "ifd1"], [[50827, function(e3) {
56200     return "string" != typeof e3 ? b2(e3) : e3;
56201   }], [306, ze2], [40091, He2], [40092, He2], [40093, He2], [40094, He2], [40095, He2]]), U2(N2, "exif", [[40960, Ve2], [36864, Ve2], [36867, ze2], [36868, ze2], [40962, Ge2], [40963, Ge2]]), U2(N2, "gps", [[0, (e3) => Array.from(e3).join(".")], [7, (e3) => Array.from(e3).join(":")]]);
56202   var We2 = class extends re3 {
56203     static canHandle(e3, t2) {
56204       return 225 === e3.getUint8(t2 + 1) && 1752462448 === e3.getUint32(t2 + 4) && "http://ns.adobe.com/" === e3.getString(t2 + 4, "http://ns.adobe.com/".length);
56205     }
56206     static headerLength(e3, t2) {
56207       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;
56208     }
56209     static findPosition(e3, t2) {
56210       let i3 = super.findPosition(e3, t2);
56211       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;
56212     }
56213     static handleMultiSegments(e3) {
56214       return e3.map(((e4) => e4.chunk.getString())).join("");
56215     }
56216     normalizeInput(e3) {
56217       return "string" == typeof e3 ? e3 : I2.from(e3).getString();
56218     }
56219     parse(e3 = this.chunk) {
56220       if (!this.localOptions.parse) return e3;
56221       e3 = (function(e4) {
56222         let t3 = {}, i4 = {};
56223         for (let e6 of Ze2) t3[e6] = [], i4[e6] = 0;
56224         return e4.replace(et, ((e6, n4, s2) => {
56225           if ("<" === n4) {
56226             let n5 = ++i4[s2];
56227             return t3[s2].push(n5), "".concat(e6, "#").concat(n5);
56228           }
56229           return "".concat(e6, "#").concat(t3[s2].pop());
56230         }));
56231       })(e3);
56232       let t2 = Xe2.findAll(e3, "rdf", "Description");
56233       0 === t2.length && t2.push(new Xe2("rdf", "Description", void 0, e3));
56234       let i3, n3 = {};
56235       for (let e4 of t2) for (let t3 of e4.properties) i3 = Je2(t3.ns, n3), _e2(t3, i3);
56236       return (function(e4) {
56237         let t3;
56238         for (let i4 in e4) t3 = e4[i4] = f(e4[i4]), void 0 === t3 && delete e4[i4];
56239         return f(e4);
56240       })(n3);
56241     }
56242     assignToOutput(e3, t2) {
56243       if (this.localOptions.parse) for (let [i3, n3] of Object.entries(t2)) switch (i3) {
56244         case "tiff":
56245           this.assignObjectToOutput(e3, "ifd0", n3);
56246           break;
56247         case "exif":
56248           this.assignObjectToOutput(e3, "exif", n3);
56249           break;
56250         case "xmlns":
56251           break;
56252         default:
56253           this.assignObjectToOutput(e3, i3, n3);
56254       }
56255       else e3.xmp = t2;
56256     }
56257   };
56258   c(We2, "type", "xmp"), c(We2, "multiSegment", true), T2.set("xmp", We2);
56259   var Ke2 = class _Ke {
56260     static findAll(e3) {
56261       return qe2(e3, /([a-zA-Z0-9-]+):([a-zA-Z0-9-]+)=("[^"]*"|'[^']*')/gm).map(_Ke.unpackMatch);
56262     }
56263     static unpackMatch(e3) {
56264       let t2 = e3[1], i3 = e3[2], n3 = e3[3].slice(1, -1);
56265       return n3 = Qe2(n3), new _Ke(t2, i3, n3);
56266     }
56267     constructor(e3, t2, i3) {
56268       this.ns = e3, this.name = t2, this.value = i3;
56269     }
56270     serialize() {
56271       return this.value;
56272     }
56273   };
56274   var Xe2 = class _Xe {
56275     static findAll(e3, t2, i3) {
56276       if (void 0 !== t2 || void 0 !== i3) {
56277         t2 = t2 || "[\\w\\d-]+", i3 = i3 || "[\\w\\d-]+";
56278         var n3 = new RegExp("<(".concat(t2, "):(").concat(i3, ")(#\\d+)?((\\s+?[\\w\\d-:]+=(\"[^\"]*\"|'[^']*'))*\\s*)(\\/>|>([\\s\\S]*?)<\\/\\1:\\2\\3>)"), "gm");
56279       } else n3 = /<([\w\d-]+):([\w\d-]+)(#\d+)?((\s+?[\w\d-:]+=("[^"]*"|'[^']*'))*\s*)(\/>|>([\s\S]*?)<\/\1:\2\3>)/gm;
56280       return qe2(e3, n3).map(_Xe.unpackMatch);
56281     }
56282     static unpackMatch(e3) {
56283       let t2 = e3[1], i3 = e3[2], n3 = e3[4], s2 = e3[8];
56284       return new _Xe(t2, i3, n3, s2);
56285     }
56286     constructor(e3, t2, i3, n3) {
56287       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];
56288     }
56289     get isPrimitive() {
56290       return void 0 !== this.value && 0 === this.attrs.length && 0 === this.children.length;
56291     }
56292     get isListContainer() {
56293       return 1 === this.children.length && this.children[0].isList;
56294     }
56295     get isList() {
56296       let { ns: e3, name: t2 } = this;
56297       return "rdf" === e3 && ("Seq" === t2 || "Bag" === t2 || "Alt" === t2);
56298     }
56299     get isListItem() {
56300       return "rdf" === this.ns && "li" === this.name;
56301     }
56302     serialize() {
56303       if (0 === this.properties.length && void 0 === this.value) return;
56304       if (this.isPrimitive) return this.value;
56305       if (this.isListContainer) return this.children[0].serialize();
56306       if (this.isList) return $e2(this.children.map(Ye));
56307       if (this.isListItem && 1 === this.children.length && 0 === this.attrs.length) return this.children[0].serialize();
56308       let e3 = {};
56309       for (let t2 of this.properties) _e2(t2, e3);
56310       return void 0 !== this.value && (e3.value = this.value), f(e3);
56311     }
56312   };
56313   function _e2(e3, t2) {
56314     let i3 = e3.serialize();
56315     void 0 !== i3 && (t2[e3.name] = i3);
56316   }
56317   var Ye = (e3) => e3.serialize();
56318   var $e2 = (e3) => 1 === e3.length ? e3[0] : e3;
56319   var Je2 = (e3, t2) => t2[e3] ? t2[e3] : t2[e3] = {};
56320   function qe2(e3, t2) {
56321     let i3, n3 = [];
56322     if (!e3) return n3;
56323     for (; null !== (i3 = t2.exec(e3)); ) n3.push(i3);
56324     return n3;
56325   }
56326   function Qe2(e3) {
56327     if ((function(e4) {
56328       return null == e4 || "null" === e4 || "undefined" === e4 || "" === e4 || "" === e4.trim();
56329     })(e3)) return;
56330     let t2 = Number(e3);
56331     if (!Number.isNaN(t2)) return t2;
56332     let i3 = e3.toLowerCase();
56333     return "true" === i3 || "false" !== i3 && e3.trim();
56334   }
56335   var Ze2 = ["rdf:li", "rdf:Seq", "rdf:Bag", "rdf:Alt", "rdf:Description"];
56336   var et = new RegExp("(<|\\/)(".concat(Ze2.join("|"), ")"), "g");
56337   var tt = Object.freeze({ __proto__: null, default: Me2, Exifr: te, fileParsers: w2, segmentParsers: T2, fileReaders: A, tagKeys: E2, tagValues: B2, tagRevivers: N2, createDictionary: U2, extendDictionary: F2, fetchUrlAsArrayBuffer: M2, readBlobAsArrayBuffer: R, chunkedProps: G2, otherSegments: V2, segments: z2, tiffBlocks: H, segmentsAndBlocks: j2, tiffExtractables: W2, inheritables: K2, allFormatters: X3, Options: q2, parse: ie2, gpsOnlyOptions: me2, gps: Se2, thumbnailOnlyOptions: Ce2, thumbnail: ye2, thumbnailUrl: be2, orientationOnlyOptions: Ie2, orientation: Pe2, rotations: ke2, get rotateCanvas() {
56338     return we2;
56339   }, get rotateCss() {
56340     return Te2;
56341   }, rotation: Ae2 });
56342   var at = l("fs", ((e3) => e3.promises));
56343   A.set("fs", class extends ve2 {
56344     async readWhole() {
56345       this.chunked = false, this.fs = await at;
56346       let e3 = await this.fs.readFile(this.input);
56347       this._swapBuffer(e3);
56348     }
56349     async readChunked() {
56350       this.chunked = true, this.fs = await at, await this.open(), await this.readChunk(0, this.options.firstChunkSize);
56351     }
56352     async open() {
56353       void 0 === this.fh && (this.fh = await this.fs.open(this.input, "r"), this.size = (await this.fh.stat(this.input)).size);
56354     }
56355     async _readChunk(e3, t2) {
56356       void 0 === this.fh && await this.open(), e3 + t2 > this.size && (t2 = this.size - e3);
56357       var i3 = this.subarray(e3, t2, true);
56358       return await this.fh.read(i3.dataView, 0, t2, e3), i3;
56359     }
56360     async close() {
56361       if (this.fh) {
56362         let e3 = this.fh;
56363         this.fh = void 0, await e3.close();
56364       }
56365     }
56366   });
56367   A.set("base64", class extends ve2 {
56368     constructor(...e3) {
56369       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);
56370     }
56371     async _readChunk(e3, t2) {
56372       let i3, n3, r2 = this.input;
56373       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);
56374       let o2 = e3 + t2, l2 = i3 + 4 * Math.ceil(o2 / 3);
56375       r2 = r2.slice(i3, l2);
56376       let h3 = Math.min(t2, this.size - e3);
56377       if (a) {
56378         let t3 = s.from(r2, "base64").slice(n3, n3 + h3);
56379         return this.set(t3, e3, true);
56380       }
56381       {
56382         let t3 = this.subarray(e3, h3, true), i4 = atob(r2), s2 = t3.toUint8();
56383         for (let e4 = 0; e4 < h3; e4++) s2[e4] = i4.charCodeAt(n3 + e4);
56384         return t3;
56385       }
56386     }
56387   });
56388   var ot = class extends se2 {
56389     static canHandle(e3, t2) {
56390       return 18761 === t2 || 19789 === t2;
56391     }
56392     extendOptions(e3) {
56393       let { ifd0: t2, xmp: i3, iptc: n3, icc: s2 } = e3;
56394       i3.enabled && t2.deps.add(700), n3.enabled && t2.deps.add(33723), s2.enabled && t2.deps.add(34675), t2.finalizeFilters();
56395     }
56396     async parse() {
56397       let { tiff: e3, xmp: t2, iptc: i3, icc: n3 } = this.options;
56398       if (e3.enabled || t2.enabled || i3.enabled || n3.enabled) {
56399         let e4 = Math.max(S2(this.options), this.options.chunkSize);
56400         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");
56401       }
56402     }
56403     adaptTiffPropAsSegment(e3) {
56404       if (this.parsers.tiff[e3]) {
56405         let t2 = this.parsers.tiff[e3];
56406         this.injectSegment(e3, t2);
56407       }
56408     }
56409   };
56410   c(ot, "type", "tiff"), w2.set("tiff", ot);
56411   var lt = l("zlib");
56412   var ht = ["ihdr", "iccp", "text", "itxt", "exif"];
56413   var ut = class extends se2 {
56414     constructor(...e3) {
56415       super(...e3), c(this, "catchError", ((e4) => this.errors.push(e4))), c(this, "metaChunks", []), c(this, "unknownChunks", []);
56416     }
56417     static canHandle(e3, t2) {
56418       return 35152 === t2 && 2303741511 === e3.getUint32(0) && 218765834 === e3.getUint32(4);
56419     }
56420     async parse() {
56421       let { file: e3 } = this;
56422       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);
56423     }
56424     async findPngChunksInRange(e3, t2) {
56425       let { file: i3 } = this;
56426       for (; e3 < t2; ) {
56427         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 };
56428         ht.includes(s2) ? this.metaChunks.push(a2) : this.unknownChunks.push(a2), e3 += r2;
56429       }
56430     }
56431     parseTextChunks() {
56432       let e3 = this.metaChunks.filter(((e4) => "text" === e4.type));
56433       for (let t2 of e3) {
56434         let [e4, i3] = this.file.getString(t2.start, t2.size).split("\0");
56435         this.injectKeyValToIhdr(e4, i3);
56436       }
56437     }
56438     injectKeyValToIhdr(e3, t2) {
56439       let i3 = this.parsers.ihdr;
56440       i3 && i3.raw.set(e3, t2);
56441     }
56442     findIhdr() {
56443       let e3 = this.metaChunks.find(((e4) => "ihdr" === e4.type));
56444       e3 && false !== this.options.ihdr.enabled && this.createParser("ihdr", e3.chunk);
56445     }
56446     async findExif() {
56447       let e3 = this.metaChunks.find(((e4) => "exif" === e4.type));
56448       e3 && this.injectSegment("tiff", e3.chunk);
56449     }
56450     async findXmp() {
56451       let e3 = this.metaChunks.filter(((e4) => "itxt" === e4.type));
56452       for (let t2 of e3) {
56453         "XML:com.adobe.xmp" === t2.chunk.getString(0, "XML:com.adobe.xmp".length) && this.injectSegment("xmp", t2.chunk);
56454       }
56455     }
56456     async findIcc() {
56457       let e3 = this.metaChunks.find(((e4) => "iccp" === e4.type));
56458       if (!e3) return;
56459       let { chunk: t2 } = e3, i3 = t2.getUint8Array(0, 81), s2 = 0;
56460       for (; s2 < 80 && 0 !== i3[s2]; ) s2++;
56461       let r2 = s2 + 2, a2 = t2.getString(0, s2);
56462       if (this.injectKeyValToIhdr("ProfileName", a2), n2) {
56463         let e4 = await lt, i4 = t2.getUint8Array(r2);
56464         i4 = e4.inflateSync(i4), this.injectSegment("icc", i4);
56465       }
56466     }
56467   };
56468   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"]]);
56469   var 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"]];
56470   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" }]]);
56471   var ft = class extends re3 {
56472     static canHandle(e3, t2) {
56473       return 224 === e3.getUint8(t2 + 1) && 1246120262 === e3.getUint32(t2 + 4) && 0 === e3.getUint8(t2 + 8);
56474     }
56475     parse() {
56476       return this.parseTags(), this.translate(), this.output;
56477     }
56478     parseTags() {
56479       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)]]);
56480     }
56481   };
56482   c(ft, "type", "jfif"), c(ft, "headerLength", 9), T2.set("jfif", ft), U2(E2, "jfif", [[0, "JFIFVersion"], [2, "ResolutionUnit"], [3, "XResolution"], [5, "YResolution"], [7, "ThumbnailWidth"], [8, "ThumbnailHeight"]]);
56483   var dt = class extends re3 {
56484     parse() {
56485       return this.parseTags(), this.translate(), this.output;
56486     }
56487     parseTags() {
56488       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)]);
56489     }
56490   };
56491   c(dt, "type", "ihdr"), T2.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" }]]);
56492   var pt = class extends re3 {
56493     static canHandle(e3, t2) {
56494       return 226 === e3.getUint8(t2 + 1) && 1229144927 === e3.getUint32(t2 + 4);
56495     }
56496     static findPosition(e3, t2) {
56497       let i3 = super.findPosition(e3, t2);
56498       return i3.chunkNumber = e3.getUint8(t2 + 16), i3.chunkCount = e3.getUint8(t2 + 17), i3.multiSegment = i3.chunkCount > 1, i3;
56499     }
56500     static handleMultiSegments(e3) {
56501       return (function(e4) {
56502         let t2 = (function(e6) {
56503           let t3 = e6[0].constructor, i3 = 0;
56504           for (let t4 of e6) i3 += t4.length;
56505           let n3 = new t3(i3), s2 = 0;
56506           for (let t4 of e6) n3.set(t4, s2), s2 += t4.length;
56507           return n3;
56508         })(e4.map(((e6) => e6.chunk.toUint8())));
56509         return new I2(t2);
56510       })(e3);
56511     }
56512     parse() {
56513       return this.raw = /* @__PURE__ */ new Map(), this.parseHeader(), this.parseTags(), this.translate(), this.output;
56514     }
56515     parseHeader() {
56516       let { raw: e3 } = this;
56517       this.chunk.byteLength < 84 && g2("ICC header is too short");
56518       for (let [t2, i3] of Object.entries(gt)) {
56519         t2 = parseInt(t2, 10);
56520         let n3 = i3(this.chunk, t2);
56521         "\0\0\0\0" !== n3 && e3.set(t2, n3);
56522       }
56523     }
56524     parseTags() {
56525       let e3, t2, i3, n3, s2, { raw: r2 } = this, a2 = this.chunk.getUint32(128), o2 = 132, l2 = this.chunk.byteLength;
56526       for (; a2--; ) {
56527         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 > l2) return void console.warn("reached the end of the first ICC chunk. Enable options.tiff.multiSegment to read all ICC segments.");
56528         s2 = this.parseTag(n3, t2, i3), void 0 !== s2 && "\0\0\0\0" !== s2 && r2.set(e3, s2), o2 += 12;
56529       }
56530     }
56531     parseTag(e3, t2, i3) {
56532       switch (e3) {
56533         case "desc":
56534           return this.parseDesc(t2);
56535         case "mluc":
56536           return this.parseMluc(t2);
56537         case "text":
56538           return this.parseText(t2, i3);
56539         case "sig ":
56540           return this.parseSig(t2);
56541       }
56542       if (!(t2 + i3 > this.chunk.byteLength)) return this.chunk.getUint8Array(t2, i3);
56543     }
56544     parseDesc(e3) {
56545       let t2 = this.chunk.getUint32(e3 + 8) - 1;
56546       return m2(this.chunk.getString(e3 + 12, t2));
56547     }
56548     parseText(e3, t2) {
56549       return m2(this.chunk.getString(e3 + 8, t2 - 8));
56550     }
56551     parseSig(e3) {
56552       return m2(this.chunk.getString(e3 + 8, 4));
56553     }
56554     parseMluc(e3) {
56555       let { chunk: t2 } = this, i3 = t2.getUint32(e3 + 8), n3 = t2.getUint32(e3 + 12), s2 = e3 + 16, r2 = [];
56556       for (let a2 = 0; a2 < i3; a2++) {
56557         let i4 = t2.getString(s2 + 0, 2), a3 = t2.getString(s2 + 2, 2), o2 = t2.getUint32(s2 + 4), l2 = t2.getUint32(s2 + 8) + e3, h3 = m2(t2.getUnicodeString(l2, o2));
56558         r2.push({ lang: i4, country: a3, text: h3 }), s2 += n3;
56559       }
56560       return 1 === i3 ? r2[0].text : r2;
56561     }
56562     translateValue(e3, t2) {
56563       return "string" == typeof e3 ? t2[e3] || t2[e3.toLowerCase()] || e3 : t2[e3] || e3;
56564     }
56565   };
56566   c(pt, "type", "icc"), c(pt, "multiSegment", true), c(pt, "headerLength", 18);
56567   var gt = { 4: mt, 8: function(e3, t2) {
56568     return [e3.getUint8(t2), e3.getUint8(t2 + 1) >> 4, e3.getUint8(t2 + 1) % 16].map(((e4) => e4.toString(10))).join(".");
56569   }, 12: mt, 16: mt, 20: mt, 24: function(e3, t2) {
56570     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);
56571     return new Date(Date.UTC(i3, n3, s2, r2, a2, o2));
56572   }, 36: mt, 40: mt, 48: mt, 52: mt, 64: (e3, t2) => e3.getUint32(t2), 80: mt };
56573   function mt(e3, t2) {
56574     return m2(e3.getString(t2, 4));
56575   }
56576   T2.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"]]);
56577   var 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" };
56578   var 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!)" };
56579   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" }]]);
56580   var yt = class extends re3 {
56581     static canHandle(e3, t2, i3) {
56582       return 237 === e3.getUint8(t2 + 1) && "Photoshop" === e3.getString(t2 + 4, 9) && void 0 !== this.containsIptc8bim(e3, t2, i3);
56583     }
56584     static headerLength(e3, t2, i3) {
56585       let n3, s2 = this.containsIptc8bim(e3, t2, i3);
56586       if (void 0 !== s2) return n3 = e3.getUint8(t2 + s2 + 7), n3 % 2 != 0 && (n3 += 1), 0 === n3 && (n3 = 4), s2 + 8 + n3;
56587     }
56588     static containsIptc8bim(e3, t2, i3) {
56589       for (let n3 = 0; n3 < i3; n3++) if (this.isIptcSegmentHead(e3, t2 + n3)) return n3;
56590     }
56591     static isIptcSegmentHead(e3, t2) {
56592       return 56 === e3.getUint8(t2) && 943868237 === e3.getUint32(t2) && 1028 === e3.getUint16(t2 + 4);
56593     }
56594     parse() {
56595       let { raw: e3 } = this, t2 = this.chunk.byteLength - 1, i3 = false;
56596       for (let n3 = 0; n3 < t2; n3++) if (28 === this.chunk.getUint8(n3) && 2 === this.chunk.getUint8(n3 + 1)) {
56597         i3 = true;
56598         let t3 = this.chunk.getUint16(n3 + 3), s2 = this.chunk.getUint8(n3 + 2), r2 = this.chunk.getLatin1String(n3 + 5, t3);
56599         e3.set(s2, this.pluralizeValue(e3.get(s2), r2)), n3 += 4 + t3;
56600       } else if (i3) break;
56601       return this.translate(), this.output;
56602     }
56603     pluralizeValue(e3, t2) {
56604       return void 0 !== e3 ? e3 instanceof Array ? (e3.push(t2), e3) : [e3, t2] : t2;
56605     }
56606   };
56607   c(yt, "type", "iptc"), c(yt, "translateValues", false), c(yt, "reviveValues", false), T2.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" }]]);
56608   var full_esm_default = tt;
56609
56610   // modules/svg/local_photos.js
56611   var _initialized2 = false;
56612   var _enabled2 = false;
56613   var minViewfieldZoom = 16;
56614   function svgLocalPhotos(projection2, context, dispatch12) {
56615     const detected = utilDetect();
56616     let layer = select_default2(null);
56617     let _fileList;
56618     let _photos = [];
56619     let _idAutoinc = 0;
56620     let _photoFrame;
56621     let _activePhotoIdx;
56622     function init2() {
56623       if (_initialized2) return;
56624       _enabled2 = true;
56625       function over(d3_event) {
56626         d3_event.stopPropagation();
56627         d3_event.preventDefault();
56628         d3_event.dataTransfer.dropEffect = "copy";
56629       }
56630       context.container().attr("dropzone", "copy").on("drop.svgLocalPhotos", function(d3_event) {
56631         d3_event.stopPropagation();
56632         d3_event.preventDefault();
56633         if (!detected.filedrop) return;
56634         drawPhotos.fileList(d3_event.dataTransfer.files, (loaded) => {
56635           if (loaded.length > 0) {
56636             drawPhotos.fitZoom(false);
56637           }
56638         });
56639       }).on("dragenter.svgLocalPhotos", over).on("dragexit.svgLocalPhotos", over).on("dragover.svgLocalPhotos", over);
56640       _initialized2 = true;
56641     }
56642     function ensureViewerLoaded(context2) {
56643       if (_photoFrame) {
56644         return Promise.resolve(_photoFrame);
56645       }
56646       const viewer = context2.container().select(".photoviewer").selectAll(".local-photos-wrapper").data([0]);
56647       const viewerEnter = viewer.enter().append("div").attr("class", "photo-wrapper local-photos-wrapper").classed("hide", true);
56648       viewerEnter.append("div").attr("class", "photo-attribution photo-attribution-dual fillD");
56649       const controlsEnter = viewerEnter.append("div").attr("class", "photo-controls-wrap").append("div").attr("class", "photo-controls-local");
56650       controlsEnter.append("button").classed("back", true).on("click.back", () => stepPhotos(-1)).text("\u25C0");
56651       controlsEnter.append("button").classed("forward", true).on("click.forward", () => stepPhotos(1)).text("\u25B6");
56652       return planePhotoFrame(context2, viewerEnter).then((planePhotoFrame2) => _photoFrame = planePhotoFrame2);
56653     }
56654     function stepPhotos(stepBy) {
56655       if (!_photos || _photos.length === 0) return;
56656       if (_activePhotoIdx === void 0) _activePhotoIdx = 0;
56657       const newIndex = _activePhotoIdx + stepBy;
56658       _activePhotoIdx = Math.max(0, Math.min(_photos.length - 1, newIndex));
56659       click(null, _photos[_activePhotoIdx], false);
56660     }
56661     function click(d3_event, image, zoomTo) {
56662       _activePhotoIdx = _photos.indexOf(image);
56663       ensureViewerLoaded(context).then(() => {
56664         const viewer = context.container().select(".photoviewer").datum(image);
56665         const viewerWrap = viewer.select(".local-photos-wrapper");
56666         const isHidden = viewerWrap.classed("hide");
56667         if (isHidden) {
56668           for (const service of Object.values(services)) {
56669             if (typeof service.hideViewer === "function") {
56670               service.hideViewer(context);
56671             }
56672           }
56673           viewer.classed("hide", false);
56674           viewerWrap.classed("hide", false);
56675         }
56676         const controlsWrap = viewerWrap.select(".photo-controls-wrap");
56677         controlsWrap.select(".back").attr("disabled", _activePhotoIdx <= 0 ? true : null);
56678         controlsWrap.select(".forward").attr("disabled", _activePhotoIdx >= _photos.length - 1 ? true : null);
56679         const attribution = viewerWrap.selectAll(".photo-attribution").text("");
56680         if (image.date) {
56681           attribution.append("span").text(image.date.toLocaleString(_mainLocalizer.localeCode()));
56682         }
56683         if (image.name) {
56684           attribution.append("span").classed("filename", true).text(image.name);
56685         }
56686         _photoFrame.selectPhoto({ image_path: "" });
56687         image.getSrc().then((src) => {
56688           _photoFrame.selectPhoto({ image_path: src }).showPhotoFrame(viewerWrap);
56689           setStyles();
56690         });
56691       });
56692       if (zoomTo) {
56693         context.map().centerEase(image.loc);
56694       }
56695     }
56696     function transform2(d2) {
56697       var svgpoint = projection2(d2.loc);
56698       return "translate(" + svgpoint[0] + "," + svgpoint[1] + ")";
56699     }
56700     function setStyles(hovered) {
56701       const viewer = context.container().select(".photoviewer");
56702       const selected = viewer.empty() ? void 0 : viewer.datum();
56703       context.container().selectAll(".layer-local-photos .viewfield-group").classed("hovered", (d2) => d2.id === (hovered == null ? void 0 : hovered.id)).classed("highlighted", (d2) => d2.id === (hovered == null ? void 0 : hovered.id) || d2.id === (selected == null ? void 0 : selected.id)).classed("currentView", (d2) => d2.id === (selected == null ? void 0 : selected.id));
56704     }
56705     function display_markers(imageList) {
56706       imageList = imageList.filter((image) => isArray_default(image.loc) && isNumber_default(image.loc[0]) && isNumber_default(image.loc[1]));
56707       const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(imageList, function(d2) {
56708         return d2.id;
56709       });
56710       groups.exit().remove();
56711       const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", (d3_event, d2) => setStyles(d2)).on("mouseleave", () => setStyles(null)).on("click", click);
56712       groupsEnter.append("g").attr("class", "viewfield-scale");
56713       const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
56714       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
56715       const showViewfields = context.map().zoom() >= minViewfieldZoom;
56716       const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
56717       viewfields.exit().remove();
56718       viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", function() {
56719         var _a5;
56720         const d2 = this.parentNode.__data__;
56721         return "rotate(".concat(Math.round((_a5 = d2.direction) != null ? _a5 : 0), ",0,0),scale(1.5,1.5),translate(-8,-13)");
56722       }).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() {
56723         const d2 = this.parentNode.__data__;
56724         return isNumber_default(d2.direction) ? "visible" : "hidden";
56725       });
56726     }
56727     function drawPhotos(selection2) {
56728       layer = selection2.selectAll(".layer-local-photos").data(_photos ? [0] : []);
56729       layer.exit().remove();
56730       const layerEnter = layer.enter().append("g").attr("class", "layer-local-photos");
56731       layerEnter.append("g").attr("class", "markers");
56732       layer = layerEnter.merge(layer);
56733       if (_photos) {
56734         display_markers(_photos);
56735       }
56736     }
56737     function readFileAsDataURL(file) {
56738       return new Promise((resolve, reject) => {
56739         const reader = new FileReader();
56740         reader.onload = () => resolve(reader.result);
56741         reader.onerror = (error) => reject(error);
56742         reader.readAsDataURL(file);
56743       });
56744     }
56745     async function readmultifiles(files, callback) {
56746       const loaded = [];
56747       for (const file of files) {
56748         try {
56749           const exifData = await full_esm_default.parse(file);
56750           const photo = {
56751             service: "photo",
56752             id: _idAutoinc++,
56753             name: file.name,
56754             getSrc: () => readFileAsDataURL(file),
56755             file,
56756             loc: [exifData.longitude, exifData.latitude],
56757             direction: exifData.GPSImgDirection,
56758             date: exifData.CreateDate || exifData.DateTimeOriginal || exifData.ModifyDate
56759           };
56760           loaded.push(photo);
56761           const sameName = _photos.filter((i3) => i3.name === photo.name);
56762           if (sameName.length === 0) {
56763             _photos.push(photo);
56764           } else {
56765             const thisContent = await photo.getSrc();
56766             const sameNameContent = await Promise.allSettled(sameName.map((i3) => i3.getSrc()));
56767             if (!sameNameContent.some((i3) => i3.value === thisContent)) {
56768               _photos.push(photo);
56769             }
56770           }
56771         } catch (e3) {
56772         }
56773       }
56774       if (typeof callback === "function") callback(loaded);
56775       dispatch12.call("change");
56776     }
56777     drawPhotos.setFiles = function(fileList, callback) {
56778       readmultifiles(Array.from(fileList), callback);
56779       return this;
56780     };
56781     drawPhotos.fileList = function(fileList, callback) {
56782       if (!arguments.length) return _fileList;
56783       _fileList = fileList;
56784       if (!fileList || !fileList.length) return this;
56785       drawPhotos.setFiles(_fileList, callback);
56786       return this;
56787     };
56788     drawPhotos.getPhotos = function() {
56789       return _photos;
56790     };
56791     drawPhotos.removePhoto = function(id2) {
56792       _photos = _photos.filter((i3) => i3.id !== id2);
56793       dispatch12.call("change");
56794       return _photos;
56795     };
56796     drawPhotos.openPhoto = click;
56797     drawPhotos.fitZoom = function(force) {
56798       const coords = _photos.map((image) => image.loc).filter((l2) => isArray_default(l2) && isNumber_default(l2[0]) && isNumber_default(l2[1]));
56799       if (coords.length === 0) return;
56800       const extent = coords.map((l2) => geoExtent(l2, l2)).reduce((a2, b3) => a2.extend(b3));
56801       const map2 = context.map();
56802       var viewport = map2.trimmedExtent().polygon();
56803       if (force !== false || !geoPolygonIntersectsPolygon(viewport, coords, true)) {
56804         map2.centerZoom(extent.center(), Math.min(18, map2.trimmedExtentZoom(extent)));
56805       }
56806     };
56807     function showLayer() {
56808       layer.style("display", "block");
56809       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
56810         dispatch12.call("change");
56811       });
56812     }
56813     function hideLayer() {
56814       layer.transition().duration(250).style("opacity", 0).on("end", () => {
56815         layer.selectAll(".viewfield-group").remove();
56816         layer.style("display", "none");
56817       });
56818     }
56819     drawPhotos.enabled = function(val) {
56820       if (!arguments.length) return _enabled2;
56821       _enabled2 = val;
56822       if (_enabled2) {
56823         showLayer();
56824       } else {
56825         hideLayer();
56826       }
56827       dispatch12.call("change");
56828       return this;
56829     };
56830     drawPhotos.hasData = function() {
56831       return isArray_default(_photos) && _photos.length > 0;
56832     };
56833     init2();
56834     return drawPhotos;
56835   }
56836
56837   // modules/svg/osmose.js
56838   var _layerEnabled2 = false;
56839   var _qaService2;
56840   function svgOsmose(projection2, context, dispatch12) {
56841     const throttledRedraw = throttle_default(() => dispatch12.call("change"), 1e3);
56842     const minZoom5 = 12;
56843     let touchLayer = select_default2(null);
56844     let drawLayer = select_default2(null);
56845     let layerVisible = false;
56846     function markerPath(selection2, klass) {
56847       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");
56848     }
56849     function getService() {
56850       if (services.osmose && !_qaService2) {
56851         _qaService2 = services.osmose;
56852         _qaService2.on("loaded", throttledRedraw);
56853       } else if (!services.osmose && _qaService2) {
56854         _qaService2 = null;
56855       }
56856       return _qaService2;
56857     }
56858     function editOn() {
56859       if (!layerVisible) {
56860         layerVisible = true;
56861         drawLayer.style("display", "block");
56862       }
56863     }
56864     function editOff() {
56865       if (layerVisible) {
56866         layerVisible = false;
56867         drawLayer.style("display", "none");
56868         drawLayer.selectAll(".qaItem.osmose").remove();
56869         touchLayer.selectAll(".qaItem.osmose").remove();
56870       }
56871     }
56872     function layerOn() {
56873       editOn();
56874       drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", () => dispatch12.call("change"));
56875     }
56876     function layerOff() {
56877       throttledRedraw.cancel();
56878       drawLayer.interrupt();
56879       touchLayer.selectAll(".qaItem.osmose").remove();
56880       drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", () => {
56881         editOff();
56882         dispatch12.call("change");
56883       });
56884     }
56885     function updateMarkers() {
56886       if (!layerVisible || !_layerEnabled2) return;
56887       const service = getService();
56888       const selectedID = context.selectedErrorID();
56889       const data = service ? service.getItems(projection2) : [];
56890       const getTransform = svgPointTransform(projection2);
56891       const markers = drawLayer.selectAll(".qaItem.osmose").data(data, (d2) => d2.id);
56892       markers.exit().remove();
56893       const markersEnter = markers.enter().append("g").attr("class", (d2) => "qaItem ".concat(d2.service, " itemId-").concat(d2.id, " itemType-").concat(d2.itemType));
56894       markersEnter.append("polygon").call(markerPath, "shadow");
56895       markersEnter.append("ellipse").attr("cx", 0).attr("cy", 0).attr("rx", 4.5).attr("ry", 2).attr("class", "stroke");
56896       markersEnter.append("polygon").attr("fill", (d2) => service.getColor(d2.item)).call(markerPath, "qaItem-fill");
56897       markersEnter.append("use").attr("class", "icon-annotation").attr("transform", "translate(-6, -22)").attr("width", "12px").attr("height", "12px").attr("xlink:href", (d2) => d2.icon ? "#" + d2.icon : "");
56898       markers.merge(markersEnter).sort(sortY).classed("selected", (d2) => d2.id === selectedID).attr("transform", getTransform);
56899       if (touchLayer.empty()) return;
56900       const fillClass = context.getDebug("target") ? "pink" : "nocolor";
56901       const targets = touchLayer.selectAll(".qaItem.osmose").data(data, (d2) => d2.id);
56902       targets.exit().remove();
56903       targets.enter().append("rect").attr("width", "20px").attr("height", "30px").attr("x", "-10px").attr("y", "-28px").merge(targets).sort(sortY).attr("class", (d2) => "qaItem ".concat(d2.service, " target ").concat(fillClass, " itemId-").concat(d2.id)).attr("transform", getTransform);
56904       function sortY(a2, b3) {
56905         return a2.id === selectedID ? 1 : b3.id === selectedID ? -1 : b3.loc[1] - a2.loc[1];
56906       }
56907     }
56908     function drawOsmose(selection2) {
56909       const service = getService();
56910       const surface = context.surface();
56911       if (surface && !surface.empty()) {
56912         touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
56913       }
56914       drawLayer = selection2.selectAll(".layer-osmose").data(service ? [0] : []);
56915       drawLayer.exit().remove();
56916       drawLayer = drawLayer.enter().append("g").attr("class", "layer-osmose").style("display", _layerEnabled2 ? "block" : "none").merge(drawLayer);
56917       if (_layerEnabled2) {
56918         if (service && ~~context.map().zoom() >= minZoom5) {
56919           editOn();
56920           service.loadIssues(projection2);
56921           updateMarkers();
56922         } else {
56923           editOff();
56924         }
56925       }
56926     }
56927     drawOsmose.enabled = function(val) {
56928       if (!arguments.length) return _layerEnabled2;
56929       _layerEnabled2 = val;
56930       if (_layerEnabled2) {
56931         getService().loadStrings().then(layerOn).catch((err) => {
56932           console.log(err);
56933         });
56934       } else {
56935         layerOff();
56936         if (context.selectedErrorID()) {
56937           context.enter(modeBrowse(context));
56938         }
56939       }
56940       dispatch12.call("change");
56941       return this;
56942     };
56943     drawOsmose.supported = () => !!getService();
56944     return drawOsmose;
56945   }
56946
56947   // modules/svg/streetside.js
56948   function svgStreetside(projection2, context, dispatch12) {
56949     var throttledRedraw = throttle_default(function() {
56950       dispatch12.call("change");
56951     }, 1e3);
56952     var minZoom5 = 14;
56953     var minMarkerZoom = 16;
56954     var minViewfieldZoom2 = 18;
56955     var layer = select_default2(null);
56956     var _viewerYaw = 0;
56957     var _selectedSequence = null;
56958     var _streetside;
56959     function init2() {
56960       if (svgStreetside.initialized) return;
56961       svgStreetside.enabled = false;
56962       svgStreetside.initialized = true;
56963     }
56964     function getService() {
56965       if (services.streetside && !_streetside) {
56966         _streetside = services.streetside;
56967         _streetside.event.on("viewerChanged.svgStreetside", viewerChanged).on("loadedImages.svgStreetside", throttledRedraw);
56968       } else if (!services.streetside && _streetside) {
56969         _streetside = null;
56970       }
56971       return _streetside;
56972     }
56973     function showLayer() {
56974       var service = getService();
56975       if (!service) return;
56976       editOn();
56977       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
56978         dispatch12.call("change");
56979       });
56980     }
56981     function hideLayer() {
56982       throttledRedraw.cancel();
56983       layer.transition().duration(250).style("opacity", 0).on("end", editOff);
56984     }
56985     function editOn() {
56986       layer.style("display", "block");
56987     }
56988     function editOff() {
56989       layer.selectAll(".viewfield-group").remove();
56990       layer.style("display", "none");
56991     }
56992     function click(d3_event, d2) {
56993       var service = getService();
56994       if (!service) return;
56995       if (d2.sequenceKey !== _selectedSequence) {
56996         _viewerYaw = 0;
56997       }
56998       _selectedSequence = d2.sequenceKey;
56999       service.ensureViewerLoaded(context).then(function() {
57000         service.selectImage(context, d2.key).yaw(_viewerYaw).showViewer(context);
57001       });
57002       context.map().centerEase(d2.loc);
57003     }
57004     function mouseover(d3_event, d2) {
57005       var service = getService();
57006       if (service) service.setStyles(context, d2);
57007     }
57008     function mouseout() {
57009       var service = getService();
57010       if (service) service.setStyles(context, null);
57011     }
57012     function transform2(d2) {
57013       var t2 = svgPointTransform(projection2)(d2);
57014       var rot = d2.ca + _viewerYaw;
57015       if (rot) {
57016         t2 += " rotate(" + Math.floor(rot) + ",0,0)";
57017       }
57018       return t2;
57019     }
57020     function viewerChanged() {
57021       var service = getService();
57022       if (!service) return;
57023       var viewer = service.viewer();
57024       if (!viewer) return;
57025       _viewerYaw = viewer.getYaw();
57026       if (context.map().isTransformed()) return;
57027       layer.selectAll(".viewfield-group.currentView").attr("transform", transform2);
57028     }
57029     function filterBubbles(bubbles, skipDateFilter = false) {
57030       var fromDate = context.photos().fromDate();
57031       var toDate = context.photos().toDate();
57032       var usernames = context.photos().usernames();
57033       if (fromDate && !skipDateFilter) {
57034         var fromTimestamp = new Date(fromDate).getTime();
57035         bubbles = bubbles.filter(function(bubble) {
57036           return new Date(bubble.captured_at).getTime() >= fromTimestamp;
57037         });
57038       }
57039       if (toDate && !skipDateFilter) {
57040         var toTimestamp = new Date(toDate).getTime();
57041         bubbles = bubbles.filter(function(bubble) {
57042           return new Date(bubble.captured_at).getTime() <= toTimestamp;
57043         });
57044       }
57045       if (usernames) {
57046         bubbles = bubbles.filter(function(bubble) {
57047           return usernames.indexOf(bubble.captured_by) !== -1;
57048         });
57049       }
57050       return bubbles;
57051     }
57052     function filterSequences(sequences, skipDateFilter = false) {
57053       var fromDate = context.photos().fromDate();
57054       var toDate = context.photos().toDate();
57055       var usernames = context.photos().usernames();
57056       if (fromDate && !skipDateFilter) {
57057         var fromTimestamp = new Date(fromDate).getTime();
57058         sequences = sequences.filter(function(sequences2) {
57059           return new Date(sequences2.properties.captured_at).getTime() >= fromTimestamp;
57060         });
57061       }
57062       if (toDate && !skipDateFilter) {
57063         var toTimestamp = new Date(toDate).getTime();
57064         sequences = sequences.filter(function(sequences2) {
57065           return new Date(sequences2.properties.captured_at).getTime() <= toTimestamp;
57066         });
57067       }
57068       if (usernames) {
57069         sequences = sequences.filter(function(sequences2) {
57070           return usernames.indexOf(sequences2.properties.captured_by) !== -1;
57071         });
57072       }
57073       return sequences;
57074     }
57075     function update() {
57076       var viewer = context.container().select(".photoviewer");
57077       var selected = viewer.empty() ? void 0 : viewer.datum();
57078       var z3 = ~~context.map().zoom();
57079       var showMarkers = z3 >= minMarkerZoom;
57080       var showViewfields = z3 >= minViewfieldZoom2;
57081       var service = getService();
57082       var sequences = [];
57083       var bubbles = [];
57084       if (context.photos().showsPanoramic()) {
57085         sequences = service ? service.sequences(projection2) : [];
57086         bubbles = service && showMarkers ? service.bubbles(projection2) : [];
57087         sequences = filterSequences(sequences);
57088         bubbles = filterBubbles(bubbles);
57089       }
57090       var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
57091         return d2.properties.key;
57092       });
57093       dispatch12.call("photoDatesChanged", this, "streetside", [
57094         ...filterBubbles(bubbles, true).map((p2) => p2.captured_at),
57095         ...filterSequences(sequences, true).map((t2) => t2.properties.vintageStart)
57096       ]);
57097       traces.exit().remove();
57098       traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
57099       var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(bubbles, function(d2) {
57100         return d2.key + (d2.sequenceKey ? "v1" : "v0");
57101       });
57102       groups.exit().remove();
57103       var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
57104       groupsEnter.append("g").attr("class", "viewfield-scale");
57105       var markers = groups.merge(groupsEnter).sort(function(a2, b3) {
57106         return a2 === selected ? 1 : b3 === selected ? -1 : b3.loc[1] - a2.loc[1];
57107       }).attr("transform", transform2).select(".viewfield-scale");
57108       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
57109       var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
57110       viewfields.exit().remove();
57111       viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
57112       function viewfieldPath() {
57113         var d2 = this.parentNode.__data__;
57114         if (d2.pano) {
57115           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
57116         } else {
57117           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
57118         }
57119       }
57120     }
57121     function drawImages(selection2) {
57122       var enabled = svgStreetside.enabled;
57123       var service = getService();
57124       layer = selection2.selectAll(".layer-streetside-images").data(service ? [0] : []);
57125       layer.exit().remove();
57126       var layerEnter = layer.enter().append("g").attr("class", "layer-streetside-images").style("display", enabled ? "block" : "none");
57127       layerEnter.append("g").attr("class", "sequences");
57128       layerEnter.append("g").attr("class", "markers");
57129       layer = layerEnter.merge(layer);
57130       if (enabled) {
57131         if (service && ~~context.map().zoom() >= minZoom5) {
57132           editOn();
57133           update();
57134           service.loadBubbles(projection2);
57135         } else {
57136           dispatch12.call("photoDatesChanged", this, "streetside", []);
57137           editOff();
57138         }
57139       } else {
57140         dispatch12.call("photoDatesChanged", this, "streetside", []);
57141       }
57142     }
57143     drawImages.enabled = function(_3) {
57144       if (!arguments.length) return svgStreetside.enabled;
57145       svgStreetside.enabled = _3;
57146       if (svgStreetside.enabled) {
57147         showLayer();
57148         context.photos().on("change.streetside", update);
57149       } else {
57150         hideLayer();
57151         context.photos().on("change.streetside", null);
57152       }
57153       dispatch12.call("change");
57154       return this;
57155     };
57156     drawImages.supported = function() {
57157       return !!getService();
57158     };
57159     drawImages.rendered = function(zoom) {
57160       return zoom >= minZoom5;
57161     };
57162     init2();
57163     return drawImages;
57164   }
57165
57166   // modules/svg/vegbilder.js
57167   function svgVegbilder(projection2, context, dispatch12) {
57168     const throttledRedraw = throttle_default(() => dispatch12.call("change"), 1e3);
57169     const minZoom5 = 14;
57170     const minMarkerZoom = 16;
57171     const minViewfieldZoom2 = 18;
57172     let layer = select_default2(null);
57173     let _viewerYaw = 0;
57174     let _vegbilder;
57175     function init2() {
57176       if (svgVegbilder.initialized) return;
57177       svgVegbilder.enabled = false;
57178       svgVegbilder.initialized = true;
57179     }
57180     function getService() {
57181       if (services.vegbilder && !_vegbilder) {
57182         _vegbilder = services.vegbilder;
57183         _vegbilder.event.on("viewerChanged.svgVegbilder", viewerChanged).on("loadedImages.svgVegbilder", throttledRedraw);
57184       } else if (!services.vegbilder && _vegbilder) {
57185         _vegbilder = null;
57186       }
57187       return _vegbilder;
57188     }
57189     function showLayer() {
57190       const service = getService();
57191       if (!service) return;
57192       editOn();
57193       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", () => dispatch12.call("change"));
57194     }
57195     function hideLayer() {
57196       throttledRedraw.cancel();
57197       layer.transition().duration(250).style("opacity", 0).on("end", editOff);
57198     }
57199     function editOn() {
57200       layer.style("display", "block");
57201     }
57202     function editOff() {
57203       layer.selectAll(".viewfield-group").remove();
57204       layer.style("display", "none");
57205     }
57206     function click(d3_event, d2) {
57207       const service = getService();
57208       if (!service) return;
57209       service.ensureViewerLoaded(context).then(() => {
57210         service.selectImage(context, d2.key).showViewer(context);
57211       });
57212       context.map().centerEase(d2.loc);
57213     }
57214     function mouseover(d3_event, d2) {
57215       const service = getService();
57216       if (service) service.setStyles(context, d2);
57217     }
57218     function mouseout() {
57219       const service = getService();
57220       if (service) service.setStyles(context, null);
57221     }
57222     function transform2(d2, selected) {
57223       let t2 = svgPointTransform(projection2)(d2);
57224       let rot = d2.ca;
57225       if (d2 === selected) {
57226         rot += _viewerYaw;
57227       }
57228       if (rot) {
57229         t2 += " rotate(" + Math.floor(rot) + ",0,0)";
57230       }
57231       return t2;
57232     }
57233     function viewerChanged() {
57234       const service = getService();
57235       if (!service) return;
57236       const frame2 = service.photoFrame();
57237       if (!frame2) return;
57238       _viewerYaw = frame2.getYaw();
57239       if (context.map().isTransformed()) return;
57240       layer.selectAll(".viewfield-group.currentView").attr("transform", (d2) => transform2(d2, d2));
57241     }
57242     function filterImages(images, skipDateFilter) {
57243       const photoContext = context.photos();
57244       const fromDateString = photoContext.fromDate();
57245       const toDateString = photoContext.toDate();
57246       const showsFlat = photoContext.showsFlat();
57247       const showsPano = photoContext.showsPanoramic();
57248       if (fromDateString && !skipDateFilter) {
57249         const fromDate = new Date(fromDateString);
57250         images = images.filter((image) => image.captured_at.getTime() >= fromDate.getTime());
57251       }
57252       if (toDateString && !skipDateFilter) {
57253         const toDate = new Date(toDateString);
57254         images = images.filter((image) => image.captured_at.getTime() <= toDate.getTime());
57255       }
57256       if (!showsPano) {
57257         images = images.filter((image) => !image.is_sphere);
57258       }
57259       if (!showsFlat) {
57260         images = images.filter((image) => image.is_sphere);
57261       }
57262       return images;
57263     }
57264     function filterSequences(sequences, skipDateFilter) {
57265       const photoContext = context.photos();
57266       const fromDateString = photoContext.fromDate();
57267       const toDateString = photoContext.toDate();
57268       const showsFlat = photoContext.showsFlat();
57269       const showsPano = photoContext.showsPanoramic();
57270       if (fromDateString && !skipDateFilter) {
57271         const fromDate = new Date(fromDateString);
57272         sequences = sequences.filter(({ images }) => images[0].captured_at.getTime() >= fromDate.getTime());
57273       }
57274       if (toDateString && !skipDateFilter) {
57275         const toDate = new Date(toDateString);
57276         sequences = sequences.filter(({ images }) => images[images.length - 1].captured_at.getTime() <= toDate.getTime());
57277       }
57278       if (!showsPano) {
57279         sequences = sequences.filter(({ images }) => !images[0].is_sphere);
57280       }
57281       if (!showsFlat) {
57282         sequences = sequences.filter(({ images }) => images[0].is_sphere);
57283       }
57284       return sequences;
57285     }
57286     function update() {
57287       const viewer = context.container().select(".photoviewer");
57288       const selected = viewer.empty() ? void 0 : viewer.datum();
57289       const z3 = ~~context.map().zoom();
57290       const showMarkers = z3 >= minMarkerZoom;
57291       const showViewfields = z3 >= minViewfieldZoom2;
57292       const service = getService();
57293       let sequences = [];
57294       let images = [];
57295       if (service) {
57296         service.loadImages(context);
57297         sequences = service.sequences(projection2);
57298         images = showMarkers ? service.images(projection2) : [];
57299         dispatch12.call("photoDatesChanged", this, "vegbilder", [
57300           ...filterImages(images, true).map((p2) => p2.captured_at),
57301           ...filterSequences(sequences, true).map((s2) => s2.images[0].captured_at)
57302         ]);
57303         images = filterImages(images);
57304         sequences = filterSequences(sequences);
57305       }
57306       let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, (d2) => d2.key);
57307       traces.exit().remove();
57308       traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
57309       const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, (d2) => d2.key);
57310       groups.exit().remove();
57311       const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
57312       groupsEnter.append("g").attr("class", "viewfield-scale");
57313       const markers = groups.merge(groupsEnter).sort((a2, b3) => {
57314         return a2 === selected ? 1 : b3 === selected ? -1 : b3.loc[1] - a2.loc[1];
57315       }).attr("transform", (d2) => transform2(d2, selected)).select(".viewfield-scale");
57316       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
57317       const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
57318       viewfields.exit().remove();
57319       viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
57320       function viewfieldPath() {
57321         const d2 = this.parentNode.__data__;
57322         if (d2.is_sphere) {
57323           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
57324         } else {
57325           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
57326         }
57327       }
57328     }
57329     function drawImages(selection2) {
57330       const enabled = svgVegbilder.enabled;
57331       const service = getService();
57332       layer = selection2.selectAll(".layer-vegbilder").data(service ? [0] : []);
57333       layer.exit().remove();
57334       const layerEnter = layer.enter().append("g").attr("class", "layer-vegbilder").style("display", enabled ? "block" : "none");
57335       layerEnter.append("g").attr("class", "sequences");
57336       layerEnter.append("g").attr("class", "markers");
57337       layer = layerEnter.merge(layer);
57338       if (enabled) {
57339         if (service && ~~context.map().zoom() >= minZoom5) {
57340           editOn();
57341           update();
57342           service.loadImages(context);
57343         } else {
57344           dispatch12.call("photoDatesChanged", this, "vegbilder", []);
57345           editOff();
57346         }
57347       } else {
57348         dispatch12.call("photoDatesChanged", this, "vegbilder", []);
57349       }
57350     }
57351     drawImages.enabled = function(_3) {
57352       if (!arguments.length) return svgVegbilder.enabled;
57353       svgVegbilder.enabled = _3;
57354       if (svgVegbilder.enabled) {
57355         showLayer();
57356         context.photos().on("change.vegbilder", update);
57357       } else {
57358         hideLayer();
57359         context.photos().on("change.vegbilder", null);
57360       }
57361       dispatch12.call("change");
57362       return this;
57363     };
57364     drawImages.supported = function() {
57365       return !!getService();
57366     };
57367     drawImages.rendered = function(zoom) {
57368       return zoom >= minZoom5;
57369     };
57370     drawImages.validHere = function(extent, zoom) {
57371       return zoom >= minZoom5 - 2 && getService().validHere(extent);
57372     };
57373     init2();
57374     return drawImages;
57375   }
57376
57377   // modules/svg/mapillary_images.js
57378   function svgMapillaryImages(projection2, context, dispatch12) {
57379     const throttledRedraw = throttle_default(function() {
57380       dispatch12.call("change");
57381     }, 1e3);
57382     const minZoom5 = 12;
57383     const minMarkerZoom = 16;
57384     const minViewfieldZoom2 = 18;
57385     let layer = select_default2(null);
57386     let _mapillary;
57387     function init2() {
57388       if (svgMapillaryImages.initialized) return;
57389       svgMapillaryImages.enabled = false;
57390       svgMapillaryImages.initialized = true;
57391     }
57392     function getService() {
57393       if (services.mapillary && !_mapillary) {
57394         _mapillary = services.mapillary;
57395         _mapillary.event.on("loadedImages", throttledRedraw);
57396       } else if (!services.mapillary && _mapillary) {
57397         _mapillary = null;
57398       }
57399       return _mapillary;
57400     }
57401     function showLayer() {
57402       const service = getService();
57403       if (!service) return;
57404       editOn();
57405       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
57406         dispatch12.call("change");
57407       });
57408     }
57409     function hideLayer() {
57410       throttledRedraw.cancel();
57411       layer.transition().duration(250).style("opacity", 0).on("end", editOff);
57412     }
57413     function editOn() {
57414       layer.style("display", "block");
57415     }
57416     function editOff() {
57417       layer.selectAll(".viewfield-group").remove();
57418       layer.style("display", "none");
57419     }
57420     function click(d3_event, image) {
57421       const service = getService();
57422       if (!service) return;
57423       service.ensureViewerLoaded(context).then(function() {
57424         service.selectImage(context, image.id).showViewer(context);
57425       });
57426       context.map().centerEase(image.loc);
57427     }
57428     function mouseover(d3_event, image) {
57429       const service = getService();
57430       if (service) service.setStyles(context, image);
57431     }
57432     function mouseout() {
57433       const service = getService();
57434       if (service) service.setStyles(context, null);
57435     }
57436     function transform2(d2) {
57437       let t2 = svgPointTransform(projection2)(d2);
57438       if (d2.ca) {
57439         t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
57440       }
57441       return t2;
57442     }
57443     function filterImages(images, skipDateFilter = false) {
57444       const showsPano = context.photos().showsPanoramic();
57445       const showsFlat = context.photos().showsFlat();
57446       const fromDate = context.photos().fromDate();
57447       const toDate = context.photos().toDate();
57448       if (!showsPano || !showsFlat) {
57449         images = images.filter(function(image) {
57450           if (image.is_pano) return showsPano;
57451           return showsFlat;
57452         });
57453       }
57454       if (fromDate && !skipDateFilter) {
57455         images = images.filter(function(image) {
57456           return new Date(image.captured_at).getTime() >= new Date(fromDate).getTime();
57457         });
57458       }
57459       if (toDate && !skipDateFilter) {
57460         images = images.filter(function(image) {
57461           return new Date(image.captured_at).getTime() <= new Date(toDate).getTime();
57462         });
57463       }
57464       return images;
57465     }
57466     function filterSequences(sequences, skipDateFilter = false) {
57467       const showsPano = context.photos().showsPanoramic();
57468       const showsFlat = context.photos().showsFlat();
57469       const fromDate = context.photos().fromDate();
57470       const toDate = context.photos().toDate();
57471       if (!showsPano || !showsFlat) {
57472         sequences = sequences.filter(function(sequence) {
57473           if (sequence.properties.hasOwnProperty("is_pano")) {
57474             if (sequence.properties.is_pano) return showsPano;
57475             return showsFlat;
57476           }
57477           return false;
57478         });
57479       }
57480       if (fromDate && !skipDateFilter) {
57481         sequences = sequences.filter(function(sequence) {
57482           return new Date(sequence.properties.captured_at).getTime() >= new Date(fromDate).getTime().toString();
57483         });
57484       }
57485       if (toDate && !skipDateFilter) {
57486         sequences = sequences.filter(function(sequence) {
57487           return new Date(sequence.properties.captured_at).getTime() <= new Date(toDate).getTime().toString();
57488         });
57489       }
57490       return sequences;
57491     }
57492     function update() {
57493       const z3 = ~~context.map().zoom();
57494       const showMarkers = z3 >= minMarkerZoom;
57495       const showViewfields = z3 >= minViewfieldZoom2;
57496       const service = getService();
57497       let sequences = service ? service.sequences(projection2) : [];
57498       let images = service && showMarkers ? service.images(projection2) : [];
57499       dispatch12.call("photoDatesChanged", this, "mapillary", [
57500         ...filterImages(images, true).map((p2) => p2.captured_at),
57501         ...filterSequences(sequences, true).map((s2) => s2.properties.captured_at)
57502       ]);
57503       images = filterImages(images);
57504       sequences = filterSequences(sequences);
57505       service.filterViewer(context);
57506       let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
57507         return d2.properties.id;
57508       });
57509       traces.exit().remove();
57510       traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
57511       const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
57512         return d2.id;
57513       });
57514       groups.exit().remove();
57515       const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
57516       groupsEnter.append("g").attr("class", "viewfield-scale");
57517       const markers = groups.merge(groupsEnter).sort(function(a2, b3) {
57518         return b3.loc[1] - a2.loc[1];
57519       }).attr("transform", transform2).select(".viewfield-scale");
57520       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
57521       const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
57522       viewfields.exit().remove();
57523       viewfields.enter().insert("path", "circle").attr("class", "viewfield").classed("pano", function() {
57524         return this.parentNode.__data__.is_pano;
57525       }).attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
57526       function viewfieldPath() {
57527         if (this.parentNode.__data__.is_pano) {
57528           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
57529         } else {
57530           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
57531         }
57532       }
57533     }
57534     function drawImages(selection2) {
57535       const enabled = svgMapillaryImages.enabled;
57536       const service = getService();
57537       layer = selection2.selectAll(".layer-mapillary").data(service ? [0] : []);
57538       layer.exit().remove();
57539       const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary").style("display", enabled ? "block" : "none");
57540       layerEnter.append("g").attr("class", "sequences");
57541       layerEnter.append("g").attr("class", "markers");
57542       layer = layerEnter.merge(layer);
57543       if (enabled) {
57544         if (service && ~~context.map().zoom() >= minZoom5) {
57545           editOn();
57546           update();
57547           service.loadImages(projection2);
57548         } else {
57549           dispatch12.call("photoDatesChanged", this, "mapillary", []);
57550           editOff();
57551         }
57552       } else {
57553         dispatch12.call("photoDatesChanged", this, "mapillary", []);
57554       }
57555     }
57556     drawImages.enabled = function(_3) {
57557       if (!arguments.length) return svgMapillaryImages.enabled;
57558       svgMapillaryImages.enabled = _3;
57559       if (svgMapillaryImages.enabled) {
57560         showLayer();
57561         context.photos().on("change.mapillary_images", update);
57562       } else {
57563         hideLayer();
57564         context.photos().on("change.mapillary_images", null);
57565       }
57566       dispatch12.call("change");
57567       return this;
57568     };
57569     drawImages.supported = function() {
57570       return !!getService();
57571     };
57572     drawImages.rendered = function(zoom) {
57573       return zoom >= minZoom5;
57574     };
57575     init2();
57576     return drawImages;
57577   }
57578
57579   // modules/svg/mapillary_position.js
57580   function svgMapillaryPosition(projection2, context) {
57581     const throttledRedraw = throttle_default(function() {
57582       update();
57583     }, 1e3);
57584     const minZoom5 = 12;
57585     const minViewfieldZoom2 = 18;
57586     let layer = select_default2(null);
57587     let _mapillary;
57588     let viewerCompassAngle;
57589     function init2() {
57590       if (svgMapillaryPosition.initialized) return;
57591       svgMapillaryPosition.initialized = true;
57592     }
57593     function getService() {
57594       if (services.mapillary && !_mapillary) {
57595         _mapillary = services.mapillary;
57596         _mapillary.event.on("imageChanged", throttledRedraw);
57597         _mapillary.event.on("bearingChanged", function(e3) {
57598           viewerCompassAngle = e3.bearing;
57599           if (context.map().isTransformed()) return;
57600           layer.selectAll(".viewfield-group.currentView").filter(function(d2) {
57601             return d2.is_pano;
57602           }).attr("transform", transform2);
57603         });
57604       } else if (!services.mapillary && _mapillary) {
57605         _mapillary = null;
57606       }
57607       return _mapillary;
57608     }
57609     function editOn() {
57610       layer.style("display", "block");
57611     }
57612     function editOff() {
57613       layer.selectAll(".viewfield-group").remove();
57614       layer.style("display", "none");
57615     }
57616     function transform2(d2) {
57617       let t2 = svgPointTransform(projection2)(d2);
57618       if (d2.is_pano && viewerCompassAngle !== null && isFinite(viewerCompassAngle)) {
57619         t2 += " rotate(" + Math.floor(viewerCompassAngle) + ",0,0)";
57620       } else if (d2.ca) {
57621         t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
57622       }
57623       return t2;
57624     }
57625     function update() {
57626       const z3 = ~~context.map().zoom();
57627       const showViewfields = z3 >= minViewfieldZoom2;
57628       const service = getService();
57629       const image = service && service.getActiveImage();
57630       const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(image ? [image] : [], function(d2) {
57631         return d2.id;
57632       });
57633       groups.exit().remove();
57634       const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group currentView highlighted");
57635       groupsEnter.append("g").attr("class", "viewfield-scale");
57636       const markers = groups.merge(groupsEnter).attr("transform", transform2).select(".viewfield-scale");
57637       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
57638       const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
57639       viewfields.exit().remove();
57640       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");
57641     }
57642     function drawImages(selection2) {
57643       const service = getService();
57644       layer = selection2.selectAll(".layer-mapillary-position").data(service ? [0] : []);
57645       layer.exit().remove();
57646       const layerEnter = layer.enter().append("g").attr("class", "layer-mapillary-position");
57647       layerEnter.append("g").attr("class", "markers");
57648       layer = layerEnter.merge(layer);
57649       if (service && ~~context.map().zoom() >= minZoom5) {
57650         editOn();
57651         update();
57652       } else {
57653         editOff();
57654       }
57655     }
57656     drawImages.enabled = function() {
57657       update();
57658       return this;
57659     };
57660     drawImages.supported = function() {
57661       return !!getService();
57662     };
57663     drawImages.rendered = function(zoom) {
57664       return zoom >= minZoom5;
57665     };
57666     init2();
57667     return drawImages;
57668   }
57669
57670   // modules/svg/mapillary_signs.js
57671   function svgMapillarySigns(projection2, context, dispatch12) {
57672     const throttledRedraw = throttle_default(function() {
57673       dispatch12.call("change");
57674     }, 1e3);
57675     const minZoom5 = 12;
57676     let layer = select_default2(null);
57677     let _mapillary;
57678     function init2() {
57679       if (svgMapillarySigns.initialized) return;
57680       svgMapillarySigns.enabled = false;
57681       svgMapillarySigns.initialized = true;
57682     }
57683     function getService() {
57684       if (services.mapillary && !_mapillary) {
57685         _mapillary = services.mapillary;
57686         _mapillary.event.on("loadedSigns", throttledRedraw);
57687       } else if (!services.mapillary && _mapillary) {
57688         _mapillary = null;
57689       }
57690       return _mapillary;
57691     }
57692     function showLayer() {
57693       const service = getService();
57694       if (!service) return;
57695       service.loadSignResources(context);
57696       editOn();
57697     }
57698     function hideLayer() {
57699       throttledRedraw.cancel();
57700       editOff();
57701     }
57702     function editOn() {
57703       layer.style("display", "block");
57704     }
57705     function editOff() {
57706       layer.selectAll(".icon-sign").remove();
57707       layer.style("display", "none");
57708     }
57709     function click(d3_event, d2) {
57710       const service = getService();
57711       if (!service) return;
57712       context.map().centerEase(d2.loc);
57713       const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
57714       service.getDetections(d2.id).then((detections) => {
57715         if (detections.length) {
57716           const imageId = detections[0].image.id;
57717           if (imageId === selectedImageId) {
57718             service.highlightDetection(detections[0]).selectImage(context, imageId);
57719           } else {
57720             service.ensureViewerLoaded(context).then(function() {
57721               service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
57722             });
57723           }
57724         }
57725       });
57726     }
57727     function filterData(detectedFeatures) {
57728       var fromDate = context.photos().fromDate();
57729       var toDate = context.photos().toDate();
57730       if (fromDate) {
57731         var fromTimestamp = new Date(fromDate).getTime();
57732         detectedFeatures = detectedFeatures.filter(function(feature4) {
57733           return new Date(feature4.last_seen_at).getTime() >= fromTimestamp;
57734         });
57735       }
57736       if (toDate) {
57737         var toTimestamp = new Date(toDate).getTime();
57738         detectedFeatures = detectedFeatures.filter(function(feature4) {
57739           return new Date(feature4.first_seen_at).getTime() <= toTimestamp;
57740         });
57741       }
57742       return detectedFeatures;
57743     }
57744     function update() {
57745       const service = getService();
57746       let data = service ? service.signs(projection2) : [];
57747       data = filterData(data);
57748       const transform2 = svgPointTransform(projection2);
57749       const signs = layer.selectAll(".icon-sign").data(data, function(d2) {
57750         return d2.id;
57751       });
57752       signs.exit().remove();
57753       const enter = signs.enter().append("g").attr("class", "icon-sign icon-detected").on("click", click);
57754       enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d2) {
57755         return "#" + d2.value;
57756       });
57757       enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
57758       signs.merge(enter).attr("transform", transform2);
57759     }
57760     function drawSigns(selection2) {
57761       const enabled = svgMapillarySigns.enabled;
57762       const service = getService();
57763       layer = selection2.selectAll(".layer-mapillary-signs").data(service ? [0] : []);
57764       layer.exit().remove();
57765       layer = layer.enter().append("g").attr("class", "layer-mapillary-signs layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
57766       if (enabled) {
57767         if (service && ~~context.map().zoom() >= minZoom5) {
57768           editOn();
57769           update();
57770           service.loadSigns(projection2);
57771           service.showSignDetections(true);
57772         } else {
57773           editOff();
57774         }
57775       } else if (service) {
57776         service.showSignDetections(false);
57777       }
57778     }
57779     drawSigns.enabled = function(_3) {
57780       if (!arguments.length) return svgMapillarySigns.enabled;
57781       svgMapillarySigns.enabled = _3;
57782       if (svgMapillarySigns.enabled) {
57783         showLayer();
57784         context.photos().on("change.mapillary_signs", update);
57785       } else {
57786         hideLayer();
57787         context.photos().on("change.mapillary_signs", null);
57788       }
57789       dispatch12.call("change");
57790       return this;
57791     };
57792     drawSigns.supported = function() {
57793       return !!getService();
57794     };
57795     drawSigns.rendered = function(zoom) {
57796       return zoom >= minZoom5;
57797     };
57798     init2();
57799     return drawSigns;
57800   }
57801
57802   // modules/svg/mapillary_map_features.js
57803   function svgMapillaryMapFeatures(projection2, context, dispatch12) {
57804     const throttledRedraw = throttle_default(function() {
57805       dispatch12.call("change");
57806     }, 1e3);
57807     const minZoom5 = 12;
57808     let layer = select_default2(null);
57809     let _mapillary;
57810     function init2() {
57811       if (svgMapillaryMapFeatures.initialized) return;
57812       svgMapillaryMapFeatures.enabled = false;
57813       svgMapillaryMapFeatures.initialized = true;
57814     }
57815     function getService() {
57816       if (services.mapillary && !_mapillary) {
57817         _mapillary = services.mapillary;
57818         _mapillary.event.on("loadedMapFeatures", throttledRedraw);
57819       } else if (!services.mapillary && _mapillary) {
57820         _mapillary = null;
57821       }
57822       return _mapillary;
57823     }
57824     function showLayer() {
57825       const service = getService();
57826       if (!service) return;
57827       service.loadObjectResources(context);
57828       editOn();
57829     }
57830     function hideLayer() {
57831       throttledRedraw.cancel();
57832       editOff();
57833     }
57834     function editOn() {
57835       layer.style("display", "block");
57836     }
57837     function editOff() {
57838       layer.selectAll(".icon-map-feature").remove();
57839       layer.style("display", "none");
57840     }
57841     function click(d3_event, d2) {
57842       const service = getService();
57843       if (!service) return;
57844       context.map().centerEase(d2.loc);
57845       const selectedImageId = service.getActiveImage() && service.getActiveImage().id;
57846       service.getDetections(d2.id).then((detections) => {
57847         if (detections.length) {
57848           const imageId = detections[0].image.id;
57849           if (imageId === selectedImageId) {
57850             service.highlightDetection(detections[0]).selectImage(context, imageId);
57851           } else {
57852             service.ensureViewerLoaded(context).then(function() {
57853               service.highlightDetection(detections[0]).selectImage(context, imageId).showViewer(context);
57854             });
57855           }
57856         }
57857       });
57858     }
57859     function filterData(detectedFeatures) {
57860       const fromDate = context.photos().fromDate();
57861       const toDate = context.photos().toDate();
57862       if (fromDate) {
57863         detectedFeatures = detectedFeatures.filter(function(feature4) {
57864           return new Date(feature4.last_seen_at).getTime() >= new Date(fromDate).getTime();
57865         });
57866       }
57867       if (toDate) {
57868         detectedFeatures = detectedFeatures.filter(function(feature4) {
57869           return new Date(feature4.first_seen_at).getTime() <= new Date(toDate).getTime();
57870         });
57871       }
57872       return detectedFeatures;
57873     }
57874     function update() {
57875       const service = getService();
57876       let data = service ? service.mapFeatures(projection2) : [];
57877       data = filterData(data);
57878       const transform2 = svgPointTransform(projection2);
57879       const mapFeatures = layer.selectAll(".icon-map-feature").data(data, function(d2) {
57880         return d2.id;
57881       });
57882       mapFeatures.exit().remove();
57883       const enter = mapFeatures.enter().append("g").attr("class", "icon-map-feature icon-detected").on("click", click);
57884       enter.append("title").text(function(d2) {
57885         var id2 = d2.value.replace(/--/g, ".").replace(/-/g, "_");
57886         return _t("mapillary_map_features." + id2);
57887       });
57888       enter.append("use").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px").attr("xlink:href", function(d2) {
57889         if (d2.value === "object--billboard") {
57890           return "#object--sign--advertisement";
57891         }
57892         return "#" + d2.value;
57893       });
57894       enter.append("rect").attr("width", "24px").attr("height", "24px").attr("x", "-12px").attr("y", "-12px");
57895       mapFeatures.merge(enter).attr("transform", transform2);
57896     }
57897     function drawMapFeatures(selection2) {
57898       const enabled = svgMapillaryMapFeatures.enabled;
57899       const service = getService();
57900       layer = selection2.selectAll(".layer-mapillary-map-features").data(service ? [0] : []);
57901       layer.exit().remove();
57902       layer = layer.enter().append("g").attr("class", "layer-mapillary-map-features layer-mapillary-detections").style("display", enabled ? "block" : "none").merge(layer);
57903       if (enabled) {
57904         if (service && ~~context.map().zoom() >= minZoom5) {
57905           editOn();
57906           update();
57907           service.loadMapFeatures(projection2);
57908           service.showFeatureDetections(true);
57909         } else {
57910           editOff();
57911         }
57912       } else if (service) {
57913         service.showFeatureDetections(false);
57914       }
57915     }
57916     drawMapFeatures.enabled = function(_3) {
57917       if (!arguments.length) return svgMapillaryMapFeatures.enabled;
57918       svgMapillaryMapFeatures.enabled = _3;
57919       if (svgMapillaryMapFeatures.enabled) {
57920         showLayer();
57921         context.photos().on("change.mapillary_map_features", update);
57922       } else {
57923         hideLayer();
57924         context.photos().on("change.mapillary_map_features", null);
57925       }
57926       dispatch12.call("change");
57927       return this;
57928     };
57929     drawMapFeatures.supported = function() {
57930       return !!getService();
57931     };
57932     drawMapFeatures.rendered = function(zoom) {
57933       return zoom >= minZoom5;
57934     };
57935     init2();
57936     return drawMapFeatures;
57937   }
57938
57939   // modules/svg/kartaview_images.js
57940   function svgKartaviewImages(projection2, context, dispatch12) {
57941     var throttledRedraw = throttle_default(function() {
57942       dispatch12.call("change");
57943     }, 1e3);
57944     var minZoom5 = 12;
57945     var minMarkerZoom = 16;
57946     var minViewfieldZoom2 = 18;
57947     var layer = select_default2(null);
57948     var _kartaview;
57949     function init2() {
57950       if (svgKartaviewImages.initialized) return;
57951       svgKartaviewImages.enabled = false;
57952       svgKartaviewImages.initialized = true;
57953     }
57954     function getService() {
57955       if (services.kartaview && !_kartaview) {
57956         _kartaview = services.kartaview;
57957         _kartaview.event.on("loadedImages", throttledRedraw);
57958       } else if (!services.kartaview && _kartaview) {
57959         _kartaview = null;
57960       }
57961       return _kartaview;
57962     }
57963     function showLayer() {
57964       var service = getService();
57965       if (!service) return;
57966       editOn();
57967       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
57968         dispatch12.call("change");
57969       });
57970     }
57971     function hideLayer() {
57972       throttledRedraw.cancel();
57973       layer.transition().duration(250).style("opacity", 0).on("end", editOff);
57974     }
57975     function editOn() {
57976       layer.style("display", "block");
57977     }
57978     function editOff() {
57979       layer.selectAll(".viewfield-group").remove();
57980       layer.style("display", "none");
57981     }
57982     function click(d3_event, d2) {
57983       var service = getService();
57984       if (!service) return;
57985       service.ensureViewerLoaded(context).then(function() {
57986         service.selectImage(context, d2.key).showViewer(context);
57987       });
57988       context.map().centerEase(d2.loc);
57989     }
57990     function mouseover(d3_event, d2) {
57991       var service = getService();
57992       if (service) service.setStyles(context, d2);
57993     }
57994     function mouseout() {
57995       var service = getService();
57996       if (service) service.setStyles(context, null);
57997     }
57998     function transform2(d2) {
57999       var t2 = svgPointTransform(projection2)(d2);
58000       if (d2.ca) {
58001         t2 += " rotate(" + Math.floor(d2.ca) + ",0,0)";
58002       }
58003       return t2;
58004     }
58005     function filterImages(images, skipDateFilter = false) {
58006       var fromDate = context.photos().fromDate();
58007       var toDate = context.photos().toDate();
58008       var usernames = context.photos().usernames();
58009       if (fromDate && !skipDateFilter) {
58010         var fromTimestamp = new Date(fromDate).getTime();
58011         images = images.filter(function(item) {
58012           return new Date(item.captured_at).getTime() >= fromTimestamp;
58013         });
58014       }
58015       if (toDate && !skipDateFilter) {
58016         var toTimestamp = new Date(toDate).getTime();
58017         images = images.filter(function(item) {
58018           return new Date(item.captured_at).getTime() <= toTimestamp;
58019         });
58020       }
58021       if (usernames) {
58022         images = images.filter(function(item) {
58023           return usernames.indexOf(item.captured_by) !== -1;
58024         });
58025       }
58026       return images;
58027     }
58028     function filterSequences(sequences, skipDateFilter = false) {
58029       var fromDate = context.photos().fromDate();
58030       var toDate = context.photos().toDate();
58031       var usernames = context.photos().usernames();
58032       if (fromDate && !skipDateFilter) {
58033         var fromTimestamp = new Date(fromDate).getTime();
58034         sequences = sequences.filter(function(sequence) {
58035           return new Date(sequence.properties.captured_at).getTime() >= fromTimestamp;
58036         });
58037       }
58038       if (toDate && !skipDateFilter) {
58039         var toTimestamp = new Date(toDate).getTime();
58040         sequences = sequences.filter(function(sequence) {
58041           return new Date(sequence.properties.captured_at).getTime() <= toTimestamp;
58042         });
58043       }
58044       if (usernames) {
58045         sequences = sequences.filter(function(sequence) {
58046           return usernames.indexOf(sequence.properties.captured_by) !== -1;
58047         });
58048       }
58049       return sequences;
58050     }
58051     function update() {
58052       var viewer = context.container().select(".photoviewer");
58053       var selected = viewer.empty() ? void 0 : viewer.datum();
58054       var z3 = ~~context.map().zoom();
58055       var showMarkers = z3 >= minMarkerZoom;
58056       var showViewfields = z3 >= minViewfieldZoom2;
58057       var service = getService();
58058       var sequences = [];
58059       var images = [];
58060       sequences = service ? service.sequences(projection2) : [];
58061       images = service && showMarkers ? service.images(projection2) : [];
58062       dispatch12.call("photoDatesChanged", this, "kartaview", [
58063         ...filterImages(images, true).map((p2) => p2.captured_at),
58064         ...filterSequences(sequences, true).map((s2) => s2.properties.captured_at)
58065       ]);
58066       sequences = filterSequences(sequences);
58067       images = filterImages(images);
58068       var traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
58069         return d2.properties.key;
58070       });
58071       traces.exit().remove();
58072       traces = traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
58073       var groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
58074         return d2.key;
58075       });
58076       groups.exit().remove();
58077       var groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
58078       groupsEnter.append("g").attr("class", "viewfield-scale");
58079       var markers = groups.merge(groupsEnter).sort(function(a2, b3) {
58080         return a2 === selected ? 1 : b3 === selected ? -1 : b3.loc[1] - a2.loc[1];
58081       }).attr("transform", transform2).select(".viewfield-scale");
58082       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
58083       var viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
58084       viewfields.exit().remove();
58085       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");
58086     }
58087     function drawImages(selection2) {
58088       var enabled = svgKartaviewImages.enabled, service = getService();
58089       layer = selection2.selectAll(".layer-kartaview").data(service ? [0] : []);
58090       layer.exit().remove();
58091       var layerEnter = layer.enter().append("g").attr("class", "layer-kartaview").style("display", enabled ? "block" : "none");
58092       layerEnter.append("g").attr("class", "sequences");
58093       layerEnter.append("g").attr("class", "markers");
58094       layer = layerEnter.merge(layer);
58095       if (enabled) {
58096         if (service && ~~context.map().zoom() >= minZoom5) {
58097           editOn();
58098           update();
58099           service.loadImages(projection2);
58100         } else {
58101           dispatch12.call("photoDatesChanged", this, "kartaview", []);
58102           editOff();
58103         }
58104       } else {
58105         dispatch12.call("photoDatesChanged", this, "kartaview", []);
58106       }
58107     }
58108     drawImages.enabled = function(_3) {
58109       if (!arguments.length) return svgKartaviewImages.enabled;
58110       svgKartaviewImages.enabled = _3;
58111       if (svgKartaviewImages.enabled) {
58112         showLayer();
58113         context.photos().on("change.kartaview_images", update);
58114       } else {
58115         hideLayer();
58116         context.photos().on("change.kartaview_images", null);
58117       }
58118       dispatch12.call("change");
58119       return this;
58120     };
58121     drawImages.supported = function() {
58122       return !!getService();
58123     };
58124     drawImages.rendered = function(zoom) {
58125       return zoom >= minZoom5;
58126     };
58127     init2();
58128     return drawImages;
58129   }
58130
58131   // modules/svg/mapilio_images.js
58132   function svgMapilioImages(projection2, context, dispatch12) {
58133     const throttledRedraw = throttle_default(function() {
58134       dispatch12.call("change");
58135     }, 1e3);
58136     const imageMinZoom2 = 16;
58137     const lineMinZoom2 = 10;
58138     const viewFieldZoomLevel = 18;
58139     let layer = select_default2(null);
58140     let _mapilio;
58141     let _viewerYaw = 0;
58142     function init2() {
58143       if (svgMapilioImages.initialized) return;
58144       svgMapilioImages.enabled = false;
58145       svgMapilioImages.initialized = true;
58146     }
58147     function getService() {
58148       if (services.mapilio && !_mapilio) {
58149         _mapilio = services.mapilio;
58150         _mapilio.event.on("loadedImages", throttledRedraw).on("loadedLines", throttledRedraw);
58151       } else if (!services.mapilio && _mapilio) {
58152         _mapilio = null;
58153       }
58154       return _mapilio;
58155     }
58156     function filterImages(images, skipDateFilter = false) {
58157       var fromDate = context.photos().fromDate();
58158       var toDate = context.photos().toDate();
58159       if (fromDate && !skipDateFilter) {
58160         images = images.filter(function(image) {
58161           return new Date(image.capture_time).getTime() >= new Date(fromDate).getTime();
58162         });
58163       }
58164       if (toDate && !skipDateFilter) {
58165         images = images.filter(function(image) {
58166           return new Date(image.capture_time).getTime() <= new Date(toDate).getTime();
58167         });
58168       }
58169       return images;
58170     }
58171     function filterSequences(sequences, skipDateFilter = false) {
58172       var fromDate = context.photos().fromDate();
58173       var toDate = context.photos().toDate();
58174       if (fromDate && !skipDateFilter) {
58175         sequences = sequences.filter(function(sequence) {
58176           return new Date(sequence.properties.capture_time).getTime() >= new Date(fromDate).getTime().toString();
58177         });
58178       }
58179       if (toDate && !skipDateFilter) {
58180         sequences = sequences.filter(function(sequence) {
58181           return new Date(sequence.properties.capture_time).getTime() <= new Date(toDate).getTime().toString();
58182         });
58183       }
58184       return sequences;
58185     }
58186     function showLayer() {
58187       const service = getService();
58188       if (!service) return;
58189       editOn();
58190       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
58191         dispatch12.call("change");
58192       });
58193     }
58194     function hideLayer() {
58195       throttledRedraw.cancel();
58196       layer.transition().duration(250).style("opacity", 0).on("end", editOff);
58197     }
58198     function transform2(d2, selectedImageId) {
58199       let t2 = svgPointTransform(projection2)(d2);
58200       let rot = d2.heading || 0;
58201       if (d2.id === selectedImageId) {
58202         rot += _viewerYaw;
58203       }
58204       if (rot) {
58205         t2 += " rotate(" + Math.floor(rot) + ",0,0)";
58206       }
58207       return t2;
58208     }
58209     function editOn() {
58210       layer.style("display", "block");
58211     }
58212     function editOff() {
58213       layer.selectAll(".viewfield-group").remove();
58214       layer.style("display", "none");
58215     }
58216     function click(d3_event, image) {
58217       const service = getService();
58218       if (!service) return;
58219       service.ensureViewerLoaded(context, image.id).then(() => {
58220         service.selectImage(context, image.id).showViewer(context);
58221       });
58222       context.map().centerEase(image.loc);
58223     }
58224     function mouseover(d3_event, image) {
58225       const service = getService();
58226       if (service) service.setStyles(context, image);
58227     }
58228     function mouseout() {
58229       const service = getService();
58230       if (service) service.setStyles(context, null);
58231     }
58232     async function update() {
58233       var _a5;
58234       const zoom = ~~context.map().zoom();
58235       const showViewfields = zoom >= viewFieldZoomLevel;
58236       const service = getService();
58237       let sequences = service ? service.sequences(projection2, zoom) : [];
58238       let images = service && zoom >= imageMinZoom2 ? service.images(projection2) : [];
58239       dispatch12.call("photoDatesChanged", this, "mapilio", [
58240         ...filterImages(images, true).map((p2) => p2.capture_time),
58241         ...filterSequences(sequences, true).map((s2) => s2.properties.capture_time)
58242       ]);
58243       images = await filterImages(images);
58244       sequences = await filterSequences(sequences);
58245       const activeImage = (_a5 = service.getActiveImage) == null ? void 0 : _a5.call(service);
58246       const activeImageId = activeImage ? activeImage.id : null;
58247       let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
58248         return d2.properties.id;
58249       });
58250       traces.exit().remove();
58251       traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
58252       const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
58253         return d2.id;
58254       });
58255       groups.exit().remove();
58256       const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
58257       groupsEnter.append("g").attr("class", "viewfield-scale");
58258       const markers = groups.merge(groupsEnter).sort(function(a2, b3) {
58259         if (a2.id === activeImageId) return 1;
58260         if (b3.id === activeImageId) return -1;
58261         return a2.capture_time_parsed - b3.capture_time_parsed;
58262       }).attr("transform", (d2) => transform2(d2, activeImageId)).select(".viewfield-scale");
58263       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
58264       const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
58265       viewfields.exit().remove();
58266       viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
58267       service.setStyles(context, null);
58268       function viewfieldPath() {
58269         if (this.parentNode.__data__.isPano) {
58270           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
58271         } else {
58272           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
58273         }
58274       }
58275     }
58276     function drawImages(selection2) {
58277       const enabled = svgMapilioImages.enabled;
58278       const service = getService();
58279       layer = selection2.selectAll(".layer-mapilio").data(service ? [0] : []);
58280       layer.exit().remove();
58281       const layerEnter = layer.enter().append("g").attr("class", "layer-mapilio").style("display", enabled ? "block" : "none");
58282       layerEnter.append("g").attr("class", "sequences");
58283       layerEnter.append("g").attr("class", "markers");
58284       layer = layerEnter.merge(layer);
58285       if (enabled) {
58286         let zoom = ~~context.map().zoom();
58287         if (service) {
58288           if (zoom >= imageMinZoom2) {
58289             editOn();
58290             update();
58291             service.loadImages(projection2);
58292             service.loadLines(projection2, zoom);
58293           } else if (zoom >= lineMinZoom2) {
58294             editOn();
58295             update();
58296             service.loadImages(projection2);
58297             service.loadLines(projection2, zoom);
58298           } else {
58299             editOff();
58300             dispatch12.call("photoDatesChanged", this, "mapilio", []);
58301             service.selectImage(context, null);
58302           }
58303         } else {
58304           editOff();
58305         }
58306       } else {
58307         dispatch12.call("photoDatesChanged", this, "mapilio", []);
58308       }
58309     }
58310     drawImages.enabled = function(_3) {
58311       if (!arguments.length) return svgMapilioImages.enabled;
58312       svgMapilioImages.enabled = _3;
58313       if (svgMapilioImages.enabled) {
58314         showLayer();
58315         context.photos().on("change.mapilio_images", update);
58316       } else {
58317         hideLayer();
58318         context.photos().on("change.mapilio_images", null);
58319       }
58320       dispatch12.call("change");
58321       return this;
58322     };
58323     drawImages.supported = function() {
58324       return !!getService();
58325     };
58326     drawImages.rendered = function(zoom) {
58327       return zoom >= lineMinZoom2;
58328     };
58329     init2();
58330     return drawImages;
58331   }
58332
58333   // modules/svg/panoramax_images.js
58334   function svgPanoramaxImages(projection2, context, dispatch12) {
58335     const throttledRedraw = throttle_default(function() {
58336       dispatch12.call("change");
58337     }, 1e3);
58338     const imageMinZoom2 = 15;
58339     const lineMinZoom2 = 10;
58340     const viewFieldZoomLevel = 18;
58341     let layer = select_default2(null);
58342     let _panoramax;
58343     let _viewerYaw = 0;
58344     let _activeUsernameFilter;
58345     let _activeIds;
58346     function init2() {
58347       if (svgPanoramaxImages.initialized) return;
58348       svgPanoramaxImages.enabled = false;
58349       svgPanoramaxImages.initialized = true;
58350     }
58351     function getService() {
58352       if (services.panoramax && !_panoramax) {
58353         _panoramax = services.panoramax;
58354         _panoramax.event.on("viewerChanged", viewerChanged).on("loadedLines", throttledRedraw).on("loadedImages", throttledRedraw);
58355       } else if (!services.panoramax && _panoramax) {
58356         _panoramax = null;
58357       }
58358       return _panoramax;
58359     }
58360     async function filterImages(images, skipDateFilter = false) {
58361       const showsPano = context.photos().showsPanoramic();
58362       const showsFlat = context.photos().showsFlat();
58363       const fromDate = context.photos().fromDate();
58364       const toDate = context.photos().toDate();
58365       const username = context.photos().usernames();
58366       const service = getService();
58367       if (!showsPano || !showsFlat) {
58368         images = images.filter(function(image) {
58369           if (image.isPano) return showsPano;
58370           return showsFlat;
58371         });
58372       }
58373       if (fromDate && !skipDateFilter) {
58374         images = images.filter(function(image) {
58375           return new Date(image.capture_time).getTime() >= new Date(fromDate).getTime();
58376         });
58377       }
58378       if (toDate && !skipDateFilter) {
58379         images = images.filter(function(image) {
58380           return new Date(image.capture_time).getTime() <= new Date(toDate).getTime();
58381         });
58382       }
58383       if (username && service) {
58384         if (_activeUsernameFilter !== username) {
58385           _activeUsernameFilter = username;
58386           const tempIds = await service.getUserIds(username);
58387           _activeIds = {};
58388           tempIds.forEach((id2) => {
58389             _activeIds[id2] = true;
58390           });
58391         }
58392         images = images.filter(function(image) {
58393           return _activeIds[image.account_id];
58394         });
58395       }
58396       return images;
58397     }
58398     async function filterSequences(sequences, skipDateFilter = false) {
58399       const showsPano = context.photos().showsPanoramic();
58400       const showsFlat = context.photos().showsFlat();
58401       const fromDate = context.photos().fromDate();
58402       const toDate = context.photos().toDate();
58403       const username = context.photos().usernames();
58404       const service = getService();
58405       if (!showsPano || !showsFlat) {
58406         sequences = sequences.filter(function(sequence) {
58407           if (sequence.properties.type === "equirectangular") return showsPano;
58408           return showsFlat;
58409         });
58410       }
58411       if (fromDate && !skipDateFilter) {
58412         sequences = sequences.filter(function(sequence) {
58413           return new Date(sequence.properties.date).getTime() >= new Date(fromDate).getTime().toString();
58414         });
58415       }
58416       if (toDate && !skipDateFilter) {
58417         sequences = sequences.filter(function(sequence) {
58418           return new Date(sequence.properties.date).getTime() <= new Date(toDate).getTime().toString();
58419         });
58420       }
58421       if (username && service) {
58422         if (_activeUsernameFilter !== username) {
58423           _activeUsernameFilter = username;
58424           const tempIds = await service.getUserIds(username);
58425           _activeIds = {};
58426           tempIds.forEach((id2) => {
58427             _activeIds[id2] = true;
58428           });
58429         }
58430         sequences = sequences.filter(function(sequence) {
58431           return _activeIds[sequence.properties.account_id];
58432         });
58433       }
58434       return sequences;
58435     }
58436     function showLayer() {
58437       const service = getService();
58438       if (!service) return;
58439       editOn();
58440       layer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end", function() {
58441         dispatch12.call("change");
58442       });
58443     }
58444     function hideLayer() {
58445       throttledRedraw.cancel();
58446       layer.transition().duration(250).style("opacity", 0).on("end", editOff);
58447     }
58448     function transform2(d2, selectedImageId) {
58449       let t2 = svgPointTransform(projection2)(d2);
58450       let rot = d2.heading;
58451       if (d2.id === selectedImageId) {
58452         rot += _viewerYaw;
58453       }
58454       if (rot) {
58455         t2 += " rotate(" + Math.floor(rot) + ",0,0)";
58456       }
58457       return t2;
58458     }
58459     function editOn() {
58460       layer.style("display", "block");
58461     }
58462     function editOff() {
58463       layer.selectAll(".viewfield-group").remove();
58464       layer.style("display", "none");
58465     }
58466     function click(d3_event, image) {
58467       const service = getService();
58468       if (!service) return;
58469       service.ensureViewerLoaded(context).then(function() {
58470         service.selectImage(context, image.id).showViewer(context);
58471       });
58472       context.map().centerEase(image.loc);
58473     }
58474     function mouseover(d3_event, image) {
58475       const service = getService();
58476       if (service) service.setStyles(context, image);
58477     }
58478     function mouseout() {
58479       const service = getService();
58480       if (service) service.setStyles(context, null);
58481     }
58482     async function update() {
58483       var _a5;
58484       const zoom = ~~context.map().zoom();
58485       const showViewfields = zoom >= viewFieldZoomLevel;
58486       const service = getService();
58487       let sequences = service ? service.sequences(projection2, zoom) : [];
58488       let images = service && zoom >= imageMinZoom2 ? service.images(projection2) : [];
58489       dispatch12.call("photoDatesChanged", this, "panoramax", [
58490         ...(await filterImages(images, true)).map((p2) => p2.capture_time),
58491         ...(await filterSequences(sequences, true)).map((s2) => s2.properties.date)
58492       ]);
58493       images = await filterImages(images);
58494       sequences = await filterSequences(sequences);
58495       let traces = layer.selectAll(".sequences").selectAll(".sequence").data(sequences, function(d2) {
58496         return d2.properties.id;
58497       });
58498       traces.exit().remove();
58499       traces.enter().append("path").attr("class", "sequence").merge(traces).attr("d", svgPath(projection2).geojson);
58500       const groups = layer.selectAll(".markers").selectAll(".viewfield-group").data(images, function(d2) {
58501         return d2.id;
58502       });
58503       groups.exit().remove();
58504       const groupsEnter = groups.enter().append("g").attr("class", "viewfield-group").on("mouseenter", mouseover).on("mouseleave", mouseout).on("click", click);
58505       groupsEnter.append("g").attr("class", "viewfield-scale");
58506       const activeImageId = (_a5 = service.getActiveImage()) == null ? void 0 : _a5.id;
58507       const markers = groups.merge(groupsEnter).sort(function(a2, b3) {
58508         if (a2.id === activeImageId) return 1;
58509         if (b3.id === activeImageId) return -1;
58510         return a2.capture_time_parsed - b3.capture_time_parsed;
58511       }).attr("transform", (d2) => transform2(d2, activeImageId)).select(".viewfield-scale");
58512       markers.selectAll("circle").data([0]).enter().append("circle").attr("dx", "0").attr("dy", "0").attr("r", "6");
58513       const viewfields = markers.selectAll(".viewfield").data(showViewfields ? [0] : []);
58514       viewfields.exit().remove();
58515       viewfields.enter().insert("path", "circle").attr("class", "viewfield").attr("transform", "scale(1.5,1.5),translate(-8, -13)").attr("d", viewfieldPath);
58516       service.setStyles(context, null);
58517       function viewfieldPath() {
58518         if (this.parentNode.__data__.isPano) {
58519           return "M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0";
58520         } else {
58521           return "M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z";
58522         }
58523       }
58524     }
58525     function viewerChanged() {
58526       const service = getService();
58527       if (!service) return;
58528       const frame2 = service.photoFrame();
58529       if (!frame2) return;
58530       _viewerYaw = frame2.getYaw();
58531       if (context.map().isTransformed()) return;
58532       layer.selectAll(".viewfield-group.currentView").attr("transform", (d2) => transform2(d2, d2.id));
58533     }
58534     function drawImages(selection2) {
58535       const enabled = svgPanoramaxImages.enabled;
58536       const service = getService();
58537       layer = selection2.selectAll(".layer-panoramax").data(service ? [0] : []);
58538       layer.exit().remove();
58539       const layerEnter = layer.enter().append("g").attr("class", "layer-panoramax").style("display", enabled ? "block" : "none");
58540       layerEnter.append("g").attr("class", "sequences");
58541       layerEnter.append("g").attr("class", "markers");
58542       layer = layerEnter.merge(layer);
58543       if (enabled) {
58544         let zoom = ~~context.map().zoom();
58545         if (service) {
58546           if (zoom >= imageMinZoom2) {
58547             editOn();
58548             update();
58549             service.loadImages(projection2);
58550           } else if (zoom >= lineMinZoom2) {
58551             editOn();
58552             update();
58553             service.loadLines(projection2, zoom);
58554           } else {
58555             editOff();
58556             dispatch12.call("photoDatesChanged", this, "panoramax", []);
58557           }
58558         } else {
58559           editOff();
58560         }
58561       } else {
58562         dispatch12.call("photoDatesChanged", this, "panoramax", []);
58563       }
58564     }
58565     drawImages.enabled = function(_3) {
58566       if (!arguments.length) return svgPanoramaxImages.enabled;
58567       svgPanoramaxImages.enabled = _3;
58568       if (svgPanoramaxImages.enabled) {
58569         showLayer();
58570         context.photos().on("change.panoramax_images", update);
58571       } else {
58572         hideLayer();
58573         context.photos().on("change.panoramax_images", null);
58574       }
58575       dispatch12.call("change");
58576       return this;
58577     };
58578     drawImages.supported = function() {
58579       return !!getService();
58580     };
58581     drawImages.rendered = function(zoom) {
58582       return zoom >= lineMinZoom2;
58583     };
58584     init2();
58585     return drawImages;
58586   }
58587
58588   // modules/svg/osm.js
58589   function svgOsm(projection2, context, dispatch12) {
58590     var enabled = true;
58591     function drawOsm(selection2) {
58592       selection2.selectAll(".layer-osm").data(["covered", "areas", "lines", "points", "labels"]).enter().append("g").attr("class", function(d2) {
58593         return "layer-osm " + d2;
58594       });
58595       selection2.selectAll(".layer-osm.points").selectAll(".points-group").data(["vertices", "midpoints", "points", "turns"]).enter().append("g").attr("class", function(d2) {
58596         return "points-group " + d2;
58597       });
58598     }
58599     function showLayer() {
58600       var layer = context.surface().selectAll(".data-layer.osm");
58601       layer.interrupt();
58602       layer.classed("disabled", false).style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
58603         dispatch12.call("change");
58604       });
58605     }
58606     function hideLayer() {
58607       var layer = context.surface().selectAll(".data-layer.osm");
58608       layer.interrupt();
58609       layer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
58610         layer.classed("disabled", true);
58611         dispatch12.call("change");
58612       });
58613     }
58614     drawOsm.enabled = function(val) {
58615       if (!arguments.length) return enabled;
58616       enabled = val;
58617       if (enabled) {
58618         showLayer();
58619       } else {
58620         hideLayer();
58621       }
58622       dispatch12.call("change");
58623       return this;
58624     };
58625     return drawOsm;
58626   }
58627
58628   // modules/svg/notes.js
58629   var hash = utilStringQs(window.location.hash);
58630   var _notesEnabled = !!hash.notes;
58631   var _osmService;
58632   function svgNotes(projection2, context, dispatch12) {
58633     if (!dispatch12) {
58634       dispatch12 = dispatch_default("change");
58635     }
58636     var throttledRedraw = throttle_default(function() {
58637       dispatch12.call("change");
58638     }, 1e3);
58639     var minZoom5 = 12;
58640     var touchLayer = select_default2(null);
58641     var drawLayer = select_default2(null);
58642     var _notesVisible = false;
58643     function markerPath(selection2, klass) {
58644       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");
58645     }
58646     function getService() {
58647       if (services.osm && !_osmService) {
58648         _osmService = services.osm;
58649         _osmService.on("loadedNotes", throttledRedraw);
58650       } else if (!services.osm && _osmService) {
58651         _osmService = null;
58652       }
58653       return _osmService;
58654     }
58655     function editOn() {
58656       if (!_notesVisible) {
58657         _notesVisible = true;
58658         drawLayer.style("display", "block");
58659       }
58660     }
58661     function editOff() {
58662       if (_notesVisible) {
58663         _notesVisible = false;
58664         drawLayer.style("display", "none");
58665         drawLayer.selectAll(".note").remove();
58666         touchLayer.selectAll(".note").remove();
58667       }
58668     }
58669     function layerOn() {
58670       editOn();
58671       drawLayer.style("opacity", 0).transition().duration(250).style("opacity", 1).on("end interrupt", function() {
58672         dispatch12.call("change");
58673       });
58674     }
58675     function layerOff() {
58676       throttledRedraw.cancel();
58677       drawLayer.interrupt();
58678       touchLayer.selectAll(".note").remove();
58679       drawLayer.transition().duration(250).style("opacity", 0).on("end interrupt", function() {
58680         editOff();
58681         dispatch12.call("change");
58682       });
58683     }
58684     function updateMarkers() {
58685       if (!_notesVisible || !_notesEnabled) return;
58686       var service = getService();
58687       var selectedID = context.selectedNoteID();
58688       var data = service ? service.notes(projection2) : [];
58689       var getTransform = svgPointTransform(projection2);
58690       var notes = drawLayer.selectAll(".note").data(data, function(d2) {
58691         return d2.status + d2.id;
58692       });
58693       notes.exit().remove();
58694       var notesEnter = notes.enter().append("g").attr("class", function(d2) {
58695         return "note note-" + d2.id + " " + d2.status;
58696       }).classed("new", function(d2) {
58697         return d2.id < 0;
58698       });
58699       notesEnter.append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
58700       notesEnter.append("path").call(markerPath, "shadow");
58701       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");
58702       notesEnter.selectAll(".icon-annotation").data(function(d2) {
58703         return [d2];
58704       }).enter().append("use").attr("class", "icon-annotation").attr("width", "10px").attr("height", "10px").attr("x", "-3px").attr("y", "-19px").attr("xlink:href", function(d2) {
58705         if (d2.id < 0) return "#iD-icon-plus";
58706         if (d2.status === "open") return "#iD-icon-close";
58707         return "#iD-icon-apply";
58708       });
58709       notes.merge(notesEnter).sort(sortY).classed("selected", function(d2) {
58710         var mode = context.mode();
58711         var isMoving = mode && mode.id === "drag-note";
58712         return !isMoving && d2.id === selectedID;
58713       }).attr("transform", getTransform);
58714       if (touchLayer.empty()) return;
58715       var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
58716       var targets = touchLayer.selectAll(".note").data(data, function(d2) {
58717         return d2.id;
58718       });
58719       targets.exit().remove();
58720       targets.enter().append("rect").attr("width", "20px").attr("height", "20px").attr("x", "-8px").attr("y", "-22px").merge(targets).sort(sortY).attr("class", function(d2) {
58721         var newClass = d2.id < 0 ? "new" : "";
58722         return "note target note-" + d2.id + " " + fillClass + newClass;
58723       }).attr("transform", getTransform);
58724       function sortY(a2, b3) {
58725         if (a2.id === selectedID) return 1;
58726         if (b3.id === selectedID) return -1;
58727         return b3.loc[1] - a2.loc[1];
58728       }
58729     }
58730     function drawNotes(selection2) {
58731       var service = getService();
58732       var surface = context.surface();
58733       if (surface && !surface.empty()) {
58734         touchLayer = surface.selectAll(".data-layer.touch .layer-touch.markers");
58735       }
58736       drawLayer = selection2.selectAll(".layer-notes").data(service ? [0] : []);
58737       drawLayer.exit().remove();
58738       drawLayer = drawLayer.enter().append("g").attr("class", "layer-notes").style("display", _notesEnabled ? "block" : "none").merge(drawLayer);
58739       if (_notesEnabled) {
58740         if (service && ~~context.map().zoom() >= minZoom5) {
58741           editOn();
58742           service.loadNotes(projection2);
58743           updateMarkers();
58744         } else {
58745           editOff();
58746         }
58747       }
58748     }
58749     drawNotes.enabled = function(val) {
58750       if (!arguments.length) return _notesEnabled;
58751       _notesEnabled = val;
58752       if (_notesEnabled) {
58753         layerOn();
58754       } else {
58755         layerOff();
58756         if (context.selectedNoteID()) {
58757           context.enter(modeBrowse(context));
58758         }
58759       }
58760       dispatch12.call("change");
58761       return this;
58762     };
58763     return drawNotes;
58764   }
58765
58766   // modules/svg/touch.js
58767   function svgTouch() {
58768     function drawTouch(selection2) {
58769       selection2.selectAll(".layer-touch").data(["areas", "lines", "points", "turns", "markers"]).enter().append("g").attr("class", function(d2) {
58770         return "layer-touch " + d2;
58771       });
58772     }
58773     return drawTouch;
58774   }
58775
58776   // modules/util/dimensions.js
58777   function refresh(selection2, node) {
58778     var cr = node.getBoundingClientRect();
58779     var prop = [cr.width, cr.height];
58780     selection2.property("__dimensions__", prop);
58781     return prop;
58782   }
58783   function utilGetDimensions(selection2, force) {
58784     if (!selection2 || selection2.empty()) {
58785       return [0, 0];
58786     }
58787     var node = selection2.node(), cached = selection2.property("__dimensions__");
58788     return !cached || force ? refresh(selection2, node) : cached;
58789   }
58790   function utilSetDimensions(selection2, dimensions) {
58791     if (!selection2 || selection2.empty()) {
58792       return selection2;
58793     }
58794     var node = selection2.node();
58795     if (dimensions === null) {
58796       refresh(selection2, node);
58797       return selection2;
58798     }
58799     return selection2.property("__dimensions__", [dimensions[0], dimensions[1]]).attr("width", dimensions[0]).attr("height", dimensions[1]);
58800   }
58801
58802   // modules/svg/layers.js
58803   function svgLayers(projection2, context) {
58804     var dispatch12 = dispatch_default("change", "photoDatesChanged");
58805     var svg2 = select_default2(null);
58806     var _layers = [
58807       { id: "osm", layer: svgOsm(projection2, context, dispatch12) },
58808       { id: "notes", layer: svgNotes(projection2, context, dispatch12) },
58809       { id: "data", layer: svgData(projection2, context, dispatch12) },
58810       { id: "keepRight", layer: svgKeepRight(projection2, context, dispatch12) },
58811       { id: "osmose", layer: svgOsmose(projection2, context, dispatch12) },
58812       { id: "streetside", layer: svgStreetside(projection2, context, dispatch12) },
58813       { id: "mapillary", layer: svgMapillaryImages(projection2, context, dispatch12) },
58814       { id: "mapillary-position", layer: svgMapillaryPosition(projection2, context, dispatch12) },
58815       { id: "mapillary-map-features", layer: svgMapillaryMapFeatures(projection2, context, dispatch12) },
58816       { id: "mapillary-signs", layer: svgMapillarySigns(projection2, context, dispatch12) },
58817       { id: "kartaview", layer: svgKartaviewImages(projection2, context, dispatch12) },
58818       { id: "mapilio", layer: svgMapilioImages(projection2, context, dispatch12) },
58819       { id: "vegbilder", layer: svgVegbilder(projection2, context, dispatch12) },
58820       { id: "panoramax", layer: svgPanoramaxImages(projection2, context, dispatch12) },
58821       { id: "local-photos", layer: svgLocalPhotos(projection2, context, dispatch12) },
58822       { id: "debug", layer: svgDebug(projection2, context, dispatch12) },
58823       { id: "geolocate", layer: svgGeolocate(projection2, context, dispatch12) },
58824       { id: "touch", layer: svgTouch(projection2, context, dispatch12) }
58825     ];
58826     function drawLayers(selection2) {
58827       svg2 = selection2.selectAll(".surface").data([0]);
58828       svg2 = svg2.enter().append("svg").attr("class", "surface").merge(svg2);
58829       var defs = svg2.selectAll(".surface-defs").data([0]);
58830       defs.enter().append("defs").attr("class", "surface-defs");
58831       var groups = svg2.selectAll(".data-layer").data(_layers);
58832       groups.exit().remove();
58833       groups.enter().append("g").attr("class", function(d2) {
58834         return "data-layer " + d2.id;
58835       }).merge(groups).each(function(d2) {
58836         select_default2(this).call(d2.layer);
58837       });
58838     }
58839     drawLayers.all = function() {
58840       return _layers;
58841     };
58842     drawLayers.layer = function(id2) {
58843       var obj = _layers.find(function(o2) {
58844         return o2.id === id2;
58845       });
58846       return obj && obj.layer;
58847     };
58848     drawLayers.only = function(what) {
58849       var arr = [].concat(what);
58850       var all = _layers.map(function(layer) {
58851         return layer.id;
58852       });
58853       return drawLayers.remove(utilArrayDifference(all, arr));
58854     };
58855     drawLayers.remove = function(what) {
58856       var arr = [].concat(what);
58857       arr.forEach(function(id2) {
58858         _layers = _layers.filter(function(o2) {
58859           return o2.id !== id2;
58860         });
58861       });
58862       dispatch12.call("change");
58863       return this;
58864     };
58865     drawLayers.add = function(what) {
58866       var arr = [].concat(what);
58867       arr.forEach(function(obj) {
58868         if ("id" in obj && "layer" in obj) {
58869           _layers.push(obj);
58870         }
58871       });
58872       dispatch12.call("change");
58873       return this;
58874     };
58875     drawLayers.dimensions = function(val) {
58876       if (!arguments.length) return utilGetDimensions(svg2);
58877       utilSetDimensions(svg2, val);
58878       return this;
58879     };
58880     return utilRebind(drawLayers, dispatch12, "on");
58881   }
58882
58883   // modules/svg/lines.js
58884   var import_fast_deep_equal7 = __toESM(require_fast_deep_equal(), 1);
58885   function onewayArrowColour(tags) {
58886     if (tags.highway === "construction" && tags.bridge) return "white";
58887     if (tags.highway === "pedestrian") return "gray";
58888     if (tags.railway && !tags.highway) return "gray";
58889     if (tags.aeroway === "runway") return "white";
58890     return "black";
58891   }
58892   function svgLines(projection2, context) {
58893     var detected = utilDetect();
58894     var highway_stack = {
58895       motorway: 0,
58896       motorway_link: 1,
58897       trunk: 2,
58898       trunk_link: 3,
58899       primary: 4,
58900       primary_link: 5,
58901       secondary: 6,
58902       tertiary: 7,
58903       unclassified: 8,
58904       residential: 9,
58905       service: 10,
58906       busway: 11,
58907       footway: 12
58908     };
58909     function drawTargets(selection2, graph, entities, filter2) {
58910       var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
58911       var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
58912       var getPath = svgPath(projection2).geojson;
58913       var activeID = context.activeID();
58914       var base = context.history().base();
58915       var data = { targets: [], nopes: [] };
58916       entities.forEach(function(way) {
58917         var features = svgSegmentWay(way, graph, activeID);
58918         data.targets.push.apply(data.targets, features.passive);
58919         data.nopes.push.apply(data.nopes, features.active);
58920       });
58921       var targetData = data.targets.filter(getPath);
58922       var targets = selection2.selectAll(".line.target-allowed").filter(function(d2) {
58923         return filter2(d2.properties.entity);
58924       }).data(targetData, function key(d2) {
58925         return d2.id;
58926       });
58927       targets.exit().remove();
58928       var segmentWasEdited = function(d2) {
58929         var wayID = d2.properties.entity.id;
58930         if (!base.entities[wayID] || !(0, import_fast_deep_equal7.default)(graph.entities[wayID].nodes, base.entities[wayID].nodes)) {
58931           return false;
58932         }
58933         return d2.properties.nodes.some(function(n3) {
58934           return !base.entities[n3.id] || !(0, import_fast_deep_equal7.default)(graph.entities[n3.id].loc, base.entities[n3.id].loc);
58935         });
58936       };
58937       targets.enter().append("path").merge(targets).attr("d", getPath).attr("class", function(d2) {
58938         return "way line target target-allowed " + targetClass + d2.id;
58939       }).classed("segment-edited", segmentWasEdited);
58940       var nopeData = data.nopes.filter(getPath);
58941       var nopes = selection2.selectAll(".line.target-nope").filter(function(d2) {
58942         return filter2(d2.properties.entity);
58943       }).data(nopeData, function key(d2) {
58944         return d2.id;
58945       });
58946       nopes.exit().remove();
58947       nopes.enter().append("path").merge(nopes).attr("d", getPath).attr("class", function(d2) {
58948         return "way line target target-nope " + nopeClass + d2.id;
58949       }).classed("segment-edited", segmentWasEdited);
58950     }
58951     function drawLines(selection2, graph, entities, filter2) {
58952       var base = context.history().base();
58953       function waystack(a2, b3) {
58954         var selected = context.selectedIDs();
58955         var scoreA = selected.indexOf(a2.id) !== -1 ? 20 : 0;
58956         var scoreB = selected.indexOf(b3.id) !== -1 ? 20 : 0;
58957         if (a2.tags.highway) {
58958           scoreA -= highway_stack[a2.tags.highway];
58959         }
58960         if (b3.tags.highway) {
58961           scoreB -= highway_stack[b3.tags.highway];
58962         }
58963         return scoreA - scoreB;
58964       }
58965       function drawLineGroup(selection3, klass, isSelected) {
58966         var mode = context.mode();
58967         var isDrawing = mode && /^draw/.test(mode.id);
58968         var selectedClass = !isDrawing && isSelected ? "selected " : "";
58969         var lines = selection3.selectAll("path").filter(filter2).data(getPathData(isSelected), osmEntity.key);
58970         lines.exit().remove();
58971         lines.enter().append("path").attr("class", function(d2) {
58972           var prefix = "way line";
58973           if (!d2.hasInterestingTags()) {
58974             var parentRelations = graph.parentRelations(d2);
58975             var parentMultipolygons = parentRelations.filter(function(relation) {
58976               return relation.isMultipolygon();
58977             });
58978             if (parentMultipolygons.length > 0 && // and only multipolygon relations
58979             parentRelations.length === parentMultipolygons.length) {
58980               prefix = "relation area";
58981             }
58982           }
58983           var oldMPClass = oldMultiPolygonOuters[d2.id] ? "old-multipolygon " : "";
58984           return prefix + " " + klass + " " + selectedClass + oldMPClass + d2.id;
58985         }).classed("added", function(d2) {
58986           return !base.entities[d2.id];
58987         }).classed("geometry-edited", function(d2) {
58988           return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d2.id].nodes, base.entities[d2.id].nodes);
58989         }).classed("retagged", function(d2) {
58990           return graph.entities[d2.id] && base.entities[d2.id] && !(0, import_fast_deep_equal7.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
58991         }).call(svgTagClasses()).merge(lines).sort(waystack).attr("d", getPath).call(svgTagClasses().tags(svgRelationMemberTags(graph)));
58992         return selection3;
58993       }
58994       function getPathData(isSelected) {
58995         return function() {
58996           var layer = this.parentNode.__data__;
58997           var data = pathdata[layer] || [];
58998           return data.filter(function(d2) {
58999             if (isSelected) {
59000               return context.selectedIDs().indexOf(d2.id) !== -1;
59001             } else {
59002               return context.selectedIDs().indexOf(d2.id) === -1;
59003             }
59004           });
59005         };
59006       }
59007       function addMarkers(layergroup, pathclass, groupclass, groupdata, marker) {
59008         var markergroup = layergroup.selectAll("g." + groupclass).data([pathclass]);
59009         markergroup = markergroup.enter().append("g").attr("class", groupclass).merge(markergroup);
59010         var markers = markergroup.selectAll("path").filter(filter2).data(
59011           function data() {
59012             return groupdata[this.parentNode.__data__] || [];
59013           },
59014           function key(d2) {
59015             return [d2.id, d2.index];
59016           }
59017         );
59018         markers.exit().remove();
59019         markers = markers.enter().append("path").attr("class", pathclass).merge(markers).attr("marker-mid", marker).attr("d", function(d2) {
59020           return d2.d;
59021         });
59022         if (detected.ie) {
59023           markers.each(function() {
59024             this.parentNode.insertBefore(this, this);
59025           });
59026         }
59027       }
59028       var getPath = svgPath(projection2, graph);
59029       var ways = [];
59030       var onewaydata = {};
59031       var sideddata = {};
59032       var oldMultiPolygonOuters = {};
59033       for (var i3 = 0; i3 < entities.length; i3++) {
59034         var entity = entities[i3];
59035         if (entity.geometry(graph) === "line" || entity.geometry(graph) === "area" && entity.sidednessIdentifier && entity.sidednessIdentifier() === "coastline") {
59036           ways.push(entity);
59037         }
59038       }
59039       ways = ways.filter(getPath);
59040       const pathdata = utilArrayGroupBy(ways, (way) => Math.trunc(way.layer()));
59041       Object.keys(pathdata).forEach(function(k3) {
59042         var v3 = pathdata[k3];
59043         var onewayArr = v3.filter(function(d2) {
59044           return d2.isOneWay();
59045         });
59046         var onewaySegments = svgMarkerSegments(
59047           projection2,
59048           graph,
59049           36,
59050           (entity2) => entity2.isOneWayBackwards(),
59051           (entity2) => entity2.isBiDirectional()
59052         );
59053         onewaydata[k3] = utilArrayFlatten(onewayArr.map(onewaySegments));
59054         var sidedArr = v3.filter(function(d2) {
59055           return d2.isSided();
59056         });
59057         var sidedSegments = svgMarkerSegments(
59058           projection2,
59059           graph,
59060           30
59061         );
59062         sideddata[k3] = utilArrayFlatten(sidedArr.map(sidedSegments));
59063       });
59064       var covered = selection2.selectAll(".layer-osm.covered");
59065       var uncovered = selection2.selectAll(".layer-osm.lines");
59066       var touchLayer = selection2.selectAll(".layer-touch.lines");
59067       [covered, uncovered].forEach(function(selection3) {
59068         var range3 = selection3 === covered ? range(-10, 0) : range(0, 11);
59069         var layergroup = selection3.selectAll("g.layergroup").data(range3);
59070         layergroup = layergroup.enter().append("g").attr("class", function(d2) {
59071           return "layergroup layer" + String(d2);
59072         }).merge(layergroup);
59073         layergroup.selectAll("g.linegroup").data(["shadow", "casing", "stroke", "shadow-highlighted", "casing-highlighted", "stroke-highlighted"]).enter().append("g").attr("class", function(d2) {
59074           return "linegroup line-" + d2;
59075         });
59076         layergroup.selectAll("g.line-shadow").call(drawLineGroup, "shadow", false);
59077         layergroup.selectAll("g.line-casing").call(drawLineGroup, "casing", false);
59078         layergroup.selectAll("g.line-stroke").call(drawLineGroup, "stroke", false);
59079         layergroup.selectAll("g.line-shadow-highlighted").call(drawLineGroup, "shadow", true);
59080         layergroup.selectAll("g.line-casing-highlighted").call(drawLineGroup, "casing", true);
59081         layergroup.selectAll("g.line-stroke-highlighted").call(drawLineGroup, "stroke", true);
59082         addMarkers(layergroup, "oneway", "onewaygroup", onewaydata, (d2) => {
59083           const category = onewayArrowColour(graph.entity(d2.id).tags);
59084           return "url(#ideditor-oneway-marker-".concat(category, ")");
59085         });
59086         addMarkers(
59087           layergroup,
59088           "sided",
59089           "sidedgroup",
59090           sideddata,
59091           function marker(d2) {
59092             var category = graph.entity(d2.id).sidednessIdentifier();
59093             return "url(#ideditor-sided-marker-" + category + ")";
59094           }
59095         );
59096       });
59097       touchLayer.call(drawTargets, graph, ways, filter2);
59098     }
59099     return drawLines;
59100   }
59101
59102   // modules/svg/midpoints.js
59103   function svgMidpoints(projection2, context) {
59104     var targetRadius = 8;
59105     function drawTargets(selection2, graph, entities, filter2) {
59106       var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
59107       var getTransform = svgPointTransform(projection2).geojson;
59108       var data = entities.map(function(midpoint) {
59109         return {
59110           type: "Feature",
59111           id: midpoint.id,
59112           properties: {
59113             target: true,
59114             entity: midpoint
59115           },
59116           geometry: {
59117             type: "Point",
59118             coordinates: midpoint.loc
59119           }
59120         };
59121       });
59122       var targets = selection2.selectAll(".midpoint.target").filter(function(d2) {
59123         return filter2(d2.properties.entity);
59124       }).data(data, function key(d2) {
59125         return d2.id;
59126       });
59127       targets.exit().remove();
59128       targets.enter().append("circle").attr("r", targetRadius).merge(targets).attr("class", function(d2) {
59129         return "node midpoint target " + fillClass + d2.id;
59130       }).attr("transform", getTransform);
59131     }
59132     function drawMidpoints(selection2, graph, entities, filter2, extent) {
59133       var drawLayer = selection2.selectAll(".layer-osm.points .points-group.midpoints");
59134       var touchLayer = selection2.selectAll(".layer-touch.points");
59135       var mode = context.mode();
59136       if (mode && mode.id !== "select" || !context.map().withinEditableZoom()) {
59137         drawLayer.selectAll(".midpoint").remove();
59138         touchLayer.selectAll(".midpoint.target").remove();
59139         return;
59140       }
59141       var poly = extent.polygon();
59142       var midpoints = {};
59143       for (var i3 = 0; i3 < entities.length; i3++) {
59144         var entity = entities[i3];
59145         if (entity.type !== "way") continue;
59146         if (!filter2(entity)) continue;
59147         if (context.selectedIDs().indexOf(entity.id) < 0) continue;
59148         var nodes = graph.childNodes(entity);
59149         for (var j3 = 0; j3 < nodes.length - 1; j3++) {
59150           var a2 = nodes[j3];
59151           var b3 = nodes[j3 + 1];
59152           var id2 = [a2.id, b3.id].sort().join("-");
59153           if (midpoints[id2]) {
59154             midpoints[id2].parents.push(entity);
59155           } else if (geoVecLength(projection2(a2.loc), projection2(b3.loc)) > 40) {
59156             var point = geoVecInterp(a2.loc, b3.loc, 0.5);
59157             var loc = null;
59158             if (extent.intersects(point)) {
59159               loc = point;
59160             } else {
59161               for (var k3 = 0; k3 < 4; k3++) {
59162                 point = geoLineIntersection([a2.loc, b3.loc], [poly[k3], poly[k3 + 1]]);
59163                 if (point && geoVecLength(projection2(a2.loc), projection2(point)) > 20 && geoVecLength(projection2(b3.loc), projection2(point)) > 20) {
59164                   loc = point;
59165                   break;
59166                 }
59167               }
59168             }
59169             if (loc) {
59170               midpoints[id2] = {
59171                 type: "midpoint",
59172                 id: id2,
59173                 loc,
59174                 edge: [a2.id, b3.id],
59175                 parents: [entity]
59176               };
59177             }
59178           }
59179         }
59180       }
59181       function midpointFilter(d2) {
59182         if (midpoints[d2.id]) return true;
59183         for (var i4 = 0; i4 < d2.parents.length; i4++) {
59184           if (filter2(d2.parents[i4])) {
59185             return true;
59186           }
59187         }
59188         return false;
59189       }
59190       var groups = drawLayer.selectAll(".midpoint").filter(midpointFilter).data(Object.values(midpoints), function(d2) {
59191         return d2.id;
59192       });
59193       groups.exit().remove();
59194       var enter = groups.enter().insert("g", ":first-child").attr("class", "midpoint");
59195       enter.append("polygon").attr("points", "-6,8 10,0 -6,-8").attr("class", "shadow");
59196       enter.append("polygon").attr("points", "-3,4 5,0 -3,-4").attr("class", "fill");
59197       groups = groups.merge(enter).attr("transform", function(d2) {
59198         var translate = svgPointTransform(projection2);
59199         var a3 = graph.entity(d2.edge[0]);
59200         var b4 = graph.entity(d2.edge[1]);
59201         var angle2 = geoAngle(a3, b4, projection2) * (180 / Math.PI);
59202         return translate(d2) + " rotate(" + angle2 + ")";
59203       }).call(svgTagClasses().tags(
59204         function(d2) {
59205           return d2.parents[0].tags;
59206         }
59207       ));
59208       groups.select("polygon.shadow");
59209       groups.select("polygon.fill");
59210       touchLayer.call(drawTargets, graph, Object.values(midpoints), midpointFilter);
59211     }
59212     return drawMidpoints;
59213   }
59214
59215   // modules/svg/points.js
59216   var import_fast_deep_equal8 = __toESM(require_fast_deep_equal(), 1);
59217
59218   // node_modules/d3-brush/src/brush.js
59219   var { abs: abs2, max: max2, min: min2 } = Math;
59220   function number1(e3) {
59221     return [+e3[0], +e3[1]];
59222   }
59223   function number22(e3) {
59224     return [number1(e3[0]), number1(e3[1])];
59225   }
59226   var X4 = {
59227     name: "x",
59228     handles: ["w", "e"].map(type),
59229     input: function(x3, e3) {
59230       return x3 == null ? null : [[+x3[0], e3[0][1]], [+x3[1], e3[1][1]]];
59231     },
59232     output: function(xy) {
59233       return xy && [xy[0][0], xy[1][0]];
59234     }
59235   };
59236   var Y3 = {
59237     name: "y",
59238     handles: ["n", "s"].map(type),
59239     input: function(y3, e3) {
59240       return y3 == null ? null : [[e3[0][0], +y3[0]], [e3[1][0], +y3[1]]];
59241     },
59242     output: function(xy) {
59243       return xy && [xy[0][1], xy[1][1]];
59244     }
59245   };
59246   var XY = {
59247     name: "xy",
59248     handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
59249     input: function(xy) {
59250       return xy == null ? null : number22(xy);
59251     },
59252     output: function(xy) {
59253       return xy;
59254     }
59255   };
59256   function type(t2) {
59257     return { type: t2 };
59258   }
59259
59260   // modules/svg/points.js
59261   function svgPoints(projection2, context) {
59262     function markerPath(selection2, klass) {
59263       selection2.attr("class", klass).attr("transform", (d2) => isAddressPoint(d2.tags) ? "translate(-".concat(addressShieldWidth(d2, selection2) / 2, ", -8)") : "translate(-8, -23)").attr("d", (d2) => {
59264         if (!isAddressPoint(d2.tags)) {
59265           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";
59266         }
59267         const w3 = addressShieldWidth(d2, selection2);
59268         return "M ".concat(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 -").concat(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");
59269       });
59270     }
59271     function sortY(a2, b3) {
59272       return b3.loc[1] - a2.loc[1];
59273     }
59274     function addressShieldWidth(d2, selection2) {
59275       const width = textWidth(d2.tags["addr:housenumber"] || d2.tags["addr:housename"] || "", 10, selection2.node().parentElement);
59276       return clamp_default(width, 10, 34) + 8;
59277     }
59278     ;
59279     function fastEntityKey(d2) {
59280       const mode = context.mode();
59281       const isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
59282       return isMoving ? d2.id : osmEntity.key(d2);
59283     }
59284     function drawTargets(selection2, graph, entities, filter2) {
59285       var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
59286       var getTransform = svgPointTransform(projection2).geojson;
59287       var activeID = context.activeID();
59288       var data = [];
59289       entities.forEach(function(node) {
59290         if (activeID === node.id) return;
59291         data.push({
59292           type: "Feature",
59293           id: node.id,
59294           properties: {
59295             target: true,
59296             entity: node,
59297             isAddr: isAddressPoint(node.tags)
59298           },
59299           geometry: node.asGeoJSON()
59300         });
59301       });
59302       var targets = selection2.selectAll(".point.target").filter((d2) => filter2(d2.properties.entity)).data(data, (d2) => fastEntityKey(d2.properties.entity));
59303       targets.exit().remove();
59304       targets.enter().append("rect").attr("x", (d2) => d2.properties.isAddr ? -addressShieldWidth(d2.properties.entity, selection2) / 2 : -10).attr("y", (d2) => d2.properties.isAddr ? -8 : -26).attr("width", (d2) => d2.properties.isAddr ? addressShieldWidth(d2.properties.entity, selection2) : 20).attr("height", (d2) => d2.properties.isAddr ? 16 : 30).attr("class", function(d2) {
59305         return "node point target " + fillClass + d2.id;
59306       }).merge(targets).attr("transform", getTransform);
59307     }
59308     function drawPoints(selection2, graph, entities, filter2) {
59309       var wireframe = context.surface().classed("fill-wireframe");
59310       var zoom = geoScaleToZoom(projection2.scale());
59311       var base = context.history().base();
59312       function renderAsPoint(entity) {
59313         return entity.geometry(graph) === "point" && !(zoom >= 18 && entity.directions(graph, projection2).length);
59314       }
59315       var points = wireframe ? [] : entities.filter(renderAsPoint);
59316       points.sort(sortY);
59317       var drawLayer = selection2.selectAll(".layer-osm.points .points-group.points");
59318       var touchLayer = selection2.selectAll(".layer-touch.points");
59319       var groups = drawLayer.selectAll("g.point").filter(filter2).data(points, fastEntityKey);
59320       groups.exit().remove();
59321       var enter = groups.enter().append("g").attr("class", function(d2) {
59322         return "node point " + d2.id;
59323       }).order();
59324       enter.append("path").call(markerPath, "shadow");
59325       enter.each(function(d2) {
59326         if (isAddressPoint(d2.tags)) return;
59327         select_default2(this).append("ellipse").attr("cx", 0.5).attr("cy", 1).attr("rx", 6.5).attr("ry", 3).attr("class", "stroke");
59328       });
59329       enter.append("path").call(markerPath, "stroke");
59330       enter.append("use").attr("transform", "translate(-5.5, -20)").attr("class", "icon").attr("width", "12px").attr("height", "12px");
59331       groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("added", function(d2) {
59332         return !base.entities[d2.id];
59333       }).classed("moved", function(d2) {
59334         return base.entities[d2.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d2.id].loc, base.entities[d2.id].loc);
59335       }).classed("retagged", function(d2) {
59336         return base.entities[d2.id] && !(0, import_fast_deep_equal8.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
59337       }).call(svgTagClasses());
59338       groups.select(".shadow");
59339       groups.select(".stroke");
59340       groups.select(".icon").attr("xlink:href", function(entity) {
59341         var preset = _mainPresetIndex.match(entity, graph);
59342         var picon = preset && preset.icon;
59343         return picon ? "#" + picon : "";
59344       });
59345       touchLayer.call(drawTargets, graph, points, filter2);
59346     }
59347     return drawPoints;
59348   }
59349
59350   // modules/svg/turns.js
59351   function svgTurns(projection2, context) {
59352     function icon2(turn) {
59353       var u4 = turn.u ? "-u" : "";
59354       if (turn.no) return "#iD-turn-no" + u4;
59355       if (turn.only) return "#iD-turn-only" + u4;
59356       return "#iD-turn-yes" + u4;
59357     }
59358     function drawTurns(selection2, graph, turns) {
59359       function turnTransform(d2) {
59360         var pxRadius = 50;
59361         var toWay = graph.entity(d2.to.way);
59362         var toPoints = graph.childNodes(toWay).map(function(n3) {
59363           return n3.loc;
59364         }).map(projection2);
59365         var toLength = geoPathLength(toPoints);
59366         var mid = toLength / 2;
59367         var toNode = graph.entity(d2.to.node);
59368         var toVertex = graph.entity(d2.to.vertex);
59369         var a2 = geoAngle(toVertex, toNode, projection2);
59370         var o2 = projection2(toVertex.loc);
59371         var r2 = d2.u ? 0 : !toWay.__via ? pxRadius : Math.min(mid, pxRadius);
59372         return "translate(" + (r2 * Math.cos(a2) + o2[0]) + "," + (r2 * Math.sin(a2) + o2[1]) + ") rotate(" + a2 * 180 / Math.PI + ")";
59373       }
59374       var drawLayer = selection2.selectAll(".layer-osm.points .points-group.turns");
59375       var touchLayer = selection2.selectAll(".layer-touch.turns");
59376       var groups = drawLayer.selectAll("g.turn").data(turns, function(d2) {
59377         return d2.key;
59378       });
59379       groups.exit().remove();
59380       var groupsEnter = groups.enter().append("g").attr("class", function(d2) {
59381         return "turn " + d2.key;
59382       });
59383       var turnsEnter = groupsEnter.filter(function(d2) {
59384         return !d2.u;
59385       });
59386       turnsEnter.append("rect").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
59387       turnsEnter.append("use").attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
59388       var uEnter = groupsEnter.filter(function(d2) {
59389         return d2.u;
59390       });
59391       uEnter.append("circle").attr("r", "16");
59392       uEnter.append("use").attr("transform", "translate(-16, -16)").attr("width", "32").attr("height", "32");
59393       groups = groups.merge(groupsEnter).attr("opacity", function(d2) {
59394         return d2.direct === false ? "0.7" : null;
59395       }).attr("transform", turnTransform);
59396       groups.select("use").attr("xlink:href", icon2);
59397       groups.select("rect");
59398       groups.select("circle");
59399       var fillClass = context.getDebug("target") ? "pink " : "nocolor ";
59400       groups = touchLayer.selectAll("g.turn").data(turns, function(d2) {
59401         return d2.key;
59402       });
59403       groups.exit().remove();
59404       groupsEnter = groups.enter().append("g").attr("class", function(d2) {
59405         return "turn " + d2.key;
59406       });
59407       turnsEnter = groupsEnter.filter(function(d2) {
59408         return !d2.u;
59409       });
59410       turnsEnter.append("rect").attr("class", "target " + fillClass).attr("transform", "translate(-22, -12)").attr("width", "44").attr("height", "24");
59411       uEnter = groupsEnter.filter(function(d2) {
59412         return d2.u;
59413       });
59414       uEnter.append("circle").attr("class", "target " + fillClass).attr("r", "16");
59415       groups = groups.merge(groupsEnter).attr("transform", turnTransform);
59416       groups.select("rect");
59417       groups.select("circle");
59418       return this;
59419     }
59420     return drawTurns;
59421   }
59422
59423   // modules/svg/vertices.js
59424   var import_fast_deep_equal9 = __toESM(require_fast_deep_equal(), 1);
59425   function svgVertices(projection2, context) {
59426     var radiuses = {
59427       //       z16-, z17,   z18+,  w/icon
59428       shadow: [6, 7.5, 7.5, 12],
59429       stroke: [2.5, 3.5, 3.5, 8],
59430       fill: [1, 1.5, 1.5, 1.5]
59431     };
59432     var _currHoverTarget;
59433     var _currPersistent = {};
59434     var _currHover = {};
59435     var _prevHover = {};
59436     var _currSelected = {};
59437     var _prevSelected = {};
59438     var _radii = {};
59439     function sortY(a2, b3) {
59440       return b3.loc[1] - a2.loc[1];
59441     }
59442     function fastEntityKey(d2) {
59443       var mode = context.mode();
59444       var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
59445       return isMoving ? d2.id : osmEntity.key(d2);
59446     }
59447     function draw(selection2, graph, vertices, sets2, filter2) {
59448       sets2 = sets2 || { selected: {}, important: {}, hovered: {} };
59449       var icons = {};
59450       var directions = {};
59451       var wireframe = context.surface().classed("fill-wireframe");
59452       var zoom = geoScaleToZoom(projection2.scale());
59453       var z3 = zoom < 17 ? 0 : zoom < 18 ? 1 : 2;
59454       var activeID = context.activeID();
59455       var base = context.history().base();
59456       function getIcon(d2) {
59457         var entity = graph.entity(d2.id);
59458         if (entity.id in icons) return icons[entity.id];
59459         icons[entity.id] = entity.hasInterestingTags() && _mainPresetIndex.match(entity, graph).icon;
59460         return icons[entity.id];
59461       }
59462       function getDirections(entity) {
59463         if (entity.id in directions) return directions[entity.id];
59464         var angles = entity.directions(graph, projection2);
59465         directions[entity.id] = angles.length ? angles : false;
59466         return angles;
59467       }
59468       function updateAttributes(selection3) {
59469         ["shadow", "stroke", "fill"].forEach(function(klass) {
59470           var rads = radiuses[klass];
59471           selection3.selectAll("." + klass).each(function(entity) {
59472             var i3 = z3 && getIcon(entity);
59473             var r2 = rads[i3 ? 3 : z3];
59474             if (entity.id !== activeID && entity.isEndpoint(graph) && !entity.isConnected(graph)) {
59475               r2 += 1.5;
59476             }
59477             if (klass === "shadow") {
59478               _radii[entity.id] = r2;
59479             }
59480             select_default2(this).attr("r", r2).attr("visibility", i3 && klass === "fill" ? "hidden" : null);
59481           });
59482         });
59483       }
59484       vertices.sort(sortY);
59485       var groups = selection2.selectAll("g.vertex").filter(filter2).data(vertices, fastEntityKey);
59486       groups.exit().remove();
59487       var enter = groups.enter().append("g").attr("class", function(d2) {
59488         return "node vertex " + d2.id;
59489       }).order();
59490       enter.append("circle").attr("class", "shadow");
59491       enter.append("circle").attr("class", "stroke");
59492       enter.filter(function(d2) {
59493         return d2.hasInterestingTags();
59494       }).append("circle").attr("class", "fill");
59495       groups = groups.merge(enter).attr("transform", svgPointTransform(projection2)).classed("sibling", function(d2) {
59496         return d2.id in sets2.selected;
59497       }).classed("shared", function(d2) {
59498         return graph.isShared(d2);
59499       }).classed("endpoint", function(d2) {
59500         return d2.isEndpoint(graph);
59501       }).classed("added", function(d2) {
59502         return !base.entities[d2.id];
59503       }).classed("moved", function(d2) {
59504         return base.entities[d2.id] && !(0, import_fast_deep_equal9.default)(graph.entities[d2.id].loc, base.entities[d2.id].loc);
59505       }).classed("retagged", function(d2) {
59506         return base.entities[d2.id] && !(0, import_fast_deep_equal9.default)(graph.entities[d2.id].tags, base.entities[d2.id].tags);
59507       }).call(svgTagClasses()).call(updateAttributes);
59508       var iconUse = groups.selectAll(".icon").data(function data(d2) {
59509         return zoom >= 17 && getIcon(d2) ? [d2] : [];
59510       }, fastEntityKey);
59511       iconUse.exit().remove();
59512       iconUse.enter().append("use").attr("class", "icon").attr("width", "12px").attr("height", "12px").attr("transform", "translate(-6, -6)").attr("xlink:href", function(d2) {
59513         var picon = getIcon(d2);
59514         return picon ? "#" + picon : "";
59515       });
59516       var dgroups = groups.selectAll(".viewfieldgroup").data(function data(d2) {
59517         return zoom >= 18 && getDirections(d2) ? [d2] : [];
59518       }, fastEntityKey);
59519       dgroups.exit().remove();
59520       dgroups = dgroups.enter().insert("g", ".shadow").attr("class", "viewfieldgroup").merge(dgroups);
59521       var viewfields = dgroups.selectAll(".viewfield").data(getDirections, function key(d2) {
59522         return osmEntity.key(d2);
59523       });
59524       viewfields.exit().remove();
59525       viewfields.enter().append("path").attr("class", "viewfield").attr("d", "M0,0H0").merge(viewfields).attr("marker-start", (d2) => "url(#ideditor-viewfield-marker" + (d2.type === "side" ? "-side" : "") + (wireframe ? "-wireframe" : "") + ")").attr("transform", (d2) => "rotate(".concat(d2.angle, ")"));
59526     }
59527     function drawTargets(selection2, graph, entities, filter2) {
59528       var targetClass = context.getDebug("target") ? "pink " : "nocolor ";
59529       var nopeClass = context.getDebug("target") ? "red " : "nocolor ";
59530       var getTransform = svgPointTransform(projection2).geojson;
59531       var activeID = context.activeID();
59532       var data = { targets: [], nopes: [] };
59533       entities.forEach(function(node) {
59534         if (activeID === node.id) return;
59535         var vertexType = svgPassiveVertex(node, graph, activeID);
59536         if (vertexType !== 0) {
59537           data.targets.push({
59538             type: "Feature",
59539             id: node.id,
59540             properties: {
59541               target: true,
59542               entity: node
59543             },
59544             geometry: node.asGeoJSON()
59545           });
59546         } else {
59547           data.nopes.push({
59548             type: "Feature",
59549             id: node.id + "-nope",
59550             properties: {
59551               nope: true,
59552               target: true,
59553               entity: node
59554             },
59555             geometry: node.asGeoJSON()
59556           });
59557         }
59558       });
59559       var targets = selection2.selectAll(".vertex.target-allowed").filter(function(d2) {
59560         return filter2(d2.properties.entity);
59561       }).data(data.targets, function key(d2) {
59562         return d2.id;
59563       });
59564       targets.exit().remove();
59565       targets.enter().append("circle").attr("r", function(d2) {
59566         return _radii[d2.id] || radiuses.shadow[3];
59567       }).merge(targets).attr("class", function(d2) {
59568         return "node vertex target target-allowed " + targetClass + d2.id;
59569       }).attr("transform", getTransform);
59570       var nopes = selection2.selectAll(".vertex.target-nope").filter(function(d2) {
59571         return filter2(d2.properties.entity);
59572       }).data(data.nopes, function key(d2) {
59573         return d2.id;
59574       });
59575       nopes.exit().remove();
59576       nopes.enter().append("circle").attr("r", function(d2) {
59577         return _radii[d2.properties.entity.id] || radiuses.shadow[3];
59578       }).merge(nopes).attr("class", function(d2) {
59579         return "node vertex target target-nope " + nopeClass + d2.id;
59580       }).attr("transform", getTransform);
59581     }
59582     function renderAsVertex(entity, graph, wireframe, zoom) {
59583       var geometry = entity.geometry(graph);
59584       return geometry === "vertex" || geometry === "point" && (wireframe || zoom >= 18 && entity.directions(graph, projection2).length);
59585     }
59586     function isEditedNode(node, base, head) {
59587       var baseNode = base.entities[node.id];
59588       var headNode = head.entities[node.id];
59589       return !headNode || !baseNode || !(0, import_fast_deep_equal9.default)(headNode.tags, baseNode.tags) || !(0, import_fast_deep_equal9.default)(headNode.loc, baseNode.loc);
59590     }
59591     function getSiblingAndChildVertices(ids, graph, wireframe, zoom) {
59592       var results = {};
59593       var seenIds = {};
59594       function addChildVertices(entity) {
59595         if (seenIds[entity.id]) return;
59596         seenIds[entity.id] = true;
59597         var geometry = entity.geometry(graph);
59598         if (!context.features().isHiddenFeature(entity, graph, geometry)) {
59599           var i3;
59600           if (entity.type === "way") {
59601             for (i3 = 0; i3 < entity.nodes.length; i3++) {
59602               var child = graph.hasEntity(entity.nodes[i3]);
59603               if (child) {
59604                 addChildVertices(child);
59605               }
59606             }
59607           } else if (entity.type === "relation") {
59608             for (i3 = 0; i3 < entity.members.length; i3++) {
59609               var member = graph.hasEntity(entity.members[i3].id);
59610               if (member) {
59611                 addChildVertices(member);
59612               }
59613             }
59614           } else if (renderAsVertex(entity, graph, wireframe, zoom)) {
59615             results[entity.id] = entity;
59616           }
59617         }
59618       }
59619       ids.forEach(function(id2) {
59620         var entity = graph.hasEntity(id2);
59621         if (!entity) return;
59622         if (entity.type === "node") {
59623           if (renderAsVertex(entity, graph, wireframe, zoom)) {
59624             results[entity.id] = entity;
59625             graph.parentWays(entity).forEach(function(entity2) {
59626               addChildVertices(entity2);
59627             });
59628           }
59629         } else {
59630           addChildVertices(entity);
59631         }
59632       });
59633       return results;
59634     }
59635     function drawVertices(selection2, graph, entities, filter2, extent, fullRedraw) {
59636       var wireframe = context.surface().classed("fill-wireframe");
59637       var visualDiff = context.surface().classed("highlight-edited");
59638       var zoom = geoScaleToZoom(projection2.scale());
59639       var mode = context.mode();
59640       var isMoving = mode && /^(add|draw|drag|move|rotate)/.test(mode.id);
59641       var base = context.history().base();
59642       var drawLayer = selection2.selectAll(".layer-osm.points .points-group.vertices");
59643       var touchLayer = selection2.selectAll(".layer-touch.points");
59644       if (fullRedraw) {
59645         _currPersistent = {};
59646         _radii = {};
59647       }
59648       for (var i3 = 0; i3 < entities.length; i3++) {
59649         var entity = entities[i3];
59650         var geometry = entity.geometry(graph);
59651         var keep = false;
59652         if (geometry === "point" && renderAsVertex(entity, graph, wireframe, zoom)) {
59653           _currPersistent[entity.id] = entity;
59654           keep = true;
59655         } else if (geometry === "vertex" && (entity.hasInterestingTags() || entity.isEndpoint(graph) || entity.isConnected(graph) || visualDiff && isEditedNode(entity, base, graph))) {
59656           _currPersistent[entity.id] = entity;
59657           keep = true;
59658         }
59659         if (!keep && !fullRedraw) {
59660           delete _currPersistent[entity.id];
59661         }
59662       }
59663       var sets2 = {
59664         persistent: _currPersistent,
59665         // persistent = important vertices (render always)
59666         selected: _currSelected,
59667         // selected + siblings of selected (render always)
59668         hovered: _currHover
59669         // hovered + siblings of hovered (render only in draw modes)
59670       };
59671       var all = Object.assign({}, isMoving ? _currHover : {}, _currSelected, _currPersistent);
59672       var filterRendered = function(d2) {
59673         return d2.id in _currPersistent || d2.id in _currSelected || d2.id in _currHover || filter2(d2);
59674       };
59675       drawLayer.call(draw, graph, currentVisible(all), sets2, filterRendered);
59676       var filterTouch = function(d2) {
59677         return isMoving ? true : filterRendered(d2);
59678       };
59679       touchLayer.call(drawTargets, graph, currentVisible(all), filterTouch);
59680       function currentVisible(which) {
59681         return Object.keys(which).map(graph.hasEntity, graph).filter(function(entity2) {
59682           return entity2 && entity2.intersects(extent, graph);
59683         });
59684       }
59685     }
59686     drawVertices.drawSelected = function(selection2, graph, extent) {
59687       var wireframe = context.surface().classed("fill-wireframe");
59688       var zoom = geoScaleToZoom(projection2.scale());
59689       _prevSelected = _currSelected || {};
59690       if (context.map().isInWideSelection()) {
59691         _currSelected = {};
59692         context.selectedIDs().forEach(function(id2) {
59693           var entity = graph.hasEntity(id2);
59694           if (!entity) return;
59695           if (entity.type === "node") {
59696             if (renderAsVertex(entity, graph, wireframe, zoom)) {
59697               _currSelected[entity.id] = entity;
59698             }
59699           }
59700         });
59701       } else {
59702         _currSelected = getSiblingAndChildVertices(context.selectedIDs(), graph, wireframe, zoom);
59703       }
59704       var filter2 = function(d2) {
59705         return d2.id in _prevSelected;
59706       };
59707       drawVertices(selection2, graph, Object.values(_prevSelected), filter2, extent, false);
59708     };
59709     drawVertices.drawHover = function(selection2, graph, target, extent) {
59710       if (target === _currHoverTarget) return;
59711       var wireframe = context.surface().classed("fill-wireframe");
59712       var zoom = geoScaleToZoom(projection2.scale());
59713       _prevHover = _currHover || {};
59714       _currHoverTarget = target;
59715       var entity = target && target.properties && target.properties.entity;
59716       if (entity) {
59717         _currHover = getSiblingAndChildVertices([entity.id], graph, wireframe, zoom);
59718       } else {
59719         _currHover = {};
59720       }
59721       var filter2 = function(d2) {
59722         return d2.id in _prevHover;
59723       };
59724       drawVertices(selection2, graph, Object.values(_prevHover), filter2, extent, false);
59725     };
59726     return drawVertices;
59727   }
59728
59729   // modules/ui/length_indicator.js
59730   function uiLengthIndicator(maxChars) {
59731     var _wrap = select_default2(null);
59732     var _tooltip = uiPopover("tooltip max-length-warning").placement("bottom").hasArrow(true).content(() => (selection2) => {
59733       selection2.text("");
59734       selection2.call(svgIcon("#iD-icon-alert", "inline"));
59735       selection2.call(_t.append("inspector.max_length_reached", { maxChars }));
59736     });
59737     var _silent = false;
59738     var lengthIndicator = function(selection2) {
59739       _wrap = selection2.selectAll("span.length-indicator-wrap").data([0]);
59740       _wrap = _wrap.enter().append("span").merge(_wrap).classed("length-indicator-wrap", true);
59741       selection2.call(_tooltip);
59742     };
59743     lengthIndicator.update = function(val) {
59744       const strLen = utilUnicodeCharsCount(utilCleanOsmString(val, Number.POSITIVE_INFINITY));
59745       let indicator = _wrap.selectAll("span.length-indicator").data([strLen]);
59746       indicator.enter().append("span").merge(indicator).classed("length-indicator", true).classed("limit-reached", (d2) => d2 > maxChars).style("border-right-width", (d2) => "".concat(Math.abs(maxChars - d2) * 2, "px")).style("margin-right", (d2) => d2 > maxChars ? "".concat((maxChars - d2) * 2, "px") : 0).style("opacity", (d2) => d2 > maxChars * 0.8 ? Math.min(1, (d2 / maxChars - 0.8) / (1 - 0.8)) : 0).style("pointer-events", (d2) => d2 > maxChars * 0.8 ? null : "none");
59747       if (_silent) return;
59748       if (strLen > maxChars) {
59749         _tooltip.show();
59750       } else {
59751         _tooltip.hide();
59752       }
59753     };
59754     lengthIndicator.silent = function(val) {
59755       if (!arguments.length) return _silent;
59756       _silent = val;
59757       return lengthIndicator;
59758     };
59759     return lengthIndicator;
59760   }
59761
59762   // modules/ui/fields/combo.js
59763   function uiFieldCombo(field, context) {
59764     var dispatch12 = dispatch_default("change");
59765     var _isMulti = field.type === "multiCombo" || field.type === "manyCombo";
59766     var _isNetwork = field.type === "networkCombo";
59767     var _isSemi = field.type === "semiCombo";
59768     var _showTagInfoSuggestions = field.type !== "manyCombo" && field.autoSuggestions !== false;
59769     var _allowCustomValues = field.type !== "manyCombo" && field.customValues !== false;
59770     var _snake_case = field.snake_case || field.snake_case === void 0;
59771     var _combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(field.caseSensitive).minItems(1);
59772     var _container = select_default2(null);
59773     var _inputWrap = select_default2(null);
59774     var _input = select_default2(null);
59775     var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
59776     var _comboData = [];
59777     var _multiData = [];
59778     var _entityIDs = [];
59779     var _tags;
59780     var _countryCode;
59781     var _staticPlaceholder;
59782     var _customOptions = [];
59783     var _dataDeprecated = [];
59784     _mainFileFetcher.get("deprecated").then(function(d2) {
59785       _dataDeprecated = d2;
59786     }).catch(function() {
59787     });
59788     if (_isMulti && field.key && /[^:]$/.test(field.key)) {
59789       field.key += ":";
59790     }
59791     function snake(s2) {
59792       return s2.replace(/\s+/g, "_");
59793     }
59794     function clean2(s2) {
59795       return s2.split(";").map(function(s3) {
59796         return s3.trim();
59797       }).join(";");
59798     }
59799     function tagValue(dval) {
59800       dval = clean2(dval || "");
59801       var found = getOptions(true).find(function(o2) {
59802         return o2.key && clean2(o2.value) === dval;
59803       });
59804       if (found) return found.key;
59805       if (field.type === "typeCombo" && !dval) {
59806         return "yes";
59807       }
59808       return restrictTagValueSpelling(dval) || void 0;
59809     }
59810     function restrictTagValueSpelling(dval) {
59811       if (_snake_case) {
59812         dval = snake(dval);
59813       }
59814       if (!field.caseSensitive) {
59815         if (!(field.key === "type" && dval === "associatedStreet")) {
59816           dval = dval.toLowerCase();
59817         }
59818       }
59819       return dval;
59820     }
59821     function getLabelId(field2, v3) {
59822       return field2.hasTextForStringId("options.".concat(v3, ".title")) ? "options.".concat(v3, ".title") : "options.".concat(v3);
59823     }
59824     function displayValue(tval) {
59825       tval = tval || "";
59826       var stringsField = field.resolveReference("stringsCrossReference");
59827       const labelId = getLabelId(stringsField, tval);
59828       if (stringsField.hasTextForStringId(labelId)) {
59829         return stringsField.t(labelId, { default: tval });
59830       }
59831       if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
59832         return "";
59833       }
59834       return tval;
59835     }
59836     function renderValue(tval) {
59837       tval = tval || "";
59838       var stringsField = field.resolveReference("stringsCrossReference");
59839       const labelId = getLabelId(stringsField, tval);
59840       if (stringsField.hasTextForStringId(labelId)) {
59841         return stringsField.t.append(labelId, { default: tval });
59842       }
59843       if (field.type === "typeCombo" && tval.toLowerCase() === "yes") {
59844         tval = "";
59845       }
59846       return (selection2) => selection2.text(tval);
59847     }
59848     function objectDifference(a2, b3) {
59849       return a2.filter(function(d1) {
59850         return !b3.some(function(d2) {
59851           return d1.value === d2.value;
59852         });
59853       });
59854     }
59855     function initCombo(selection2, attachTo) {
59856       if (!_allowCustomValues) {
59857         selection2.attr("readonly", "readonly");
59858       }
59859       if (_showTagInfoSuggestions && services.taginfo) {
59860         selection2.call(_combobox.fetcher(setTaginfoValues), attachTo);
59861         setTaginfoValues("", setPlaceholder);
59862       } else {
59863         selection2.call(_combobox, attachTo);
59864         setTimeout(() => setStaticValues(setPlaceholder), 0);
59865       }
59866     }
59867     function getOptions(allOptions) {
59868       var stringsField = field.resolveReference("stringsCrossReference");
59869       if (!(field.options || stringsField.options)) return [];
59870       let options;
59871       if (allOptions !== true) {
59872         options = field.options || stringsField.options;
59873       } else {
59874         options = [].concat(field.options, stringsField.options).filter(Boolean);
59875       }
59876       const result = options.map(function(v3) {
59877         const labelId = getLabelId(stringsField, v3);
59878         return {
59879           key: v3,
59880           value: stringsField.t(labelId, { default: v3 }),
59881           title: stringsField.t("options.".concat(v3, ".description"), { default: v3 }),
59882           display: addComboboxIcons(stringsField.t.append(labelId, { default: v3 }), v3),
59883           klass: stringsField.hasTextForStringId(labelId) ? "" : "raw-option"
59884         };
59885       });
59886       return [...result, ..._customOptions];
59887     }
59888     function hasStaticValues() {
59889       return getOptions().length > 0;
59890     }
59891     function setStaticValues(callback, filter2) {
59892       _comboData = getOptions();
59893       if (filter2 !== void 0) {
59894         _comboData = _comboData.filter(filter2);
59895       }
59896       if (!field.allowDuplicates) {
59897         _comboData = objectDifference(_comboData, _multiData);
59898       }
59899       _combobox.data(_comboData);
59900       _container.classed("empty-combobox", _comboData.length === 0);
59901       if (callback) callback(_comboData);
59902     }
59903     function setTaginfoValues(q3, callback) {
59904       var queryFilter = (d2) => d2.value.toLowerCase().includes(q3.toLowerCase()) || d2.key.toLowerCase().includes(q3.toLowerCase());
59905       if (hasStaticValues()) {
59906         setStaticValues(callback, queryFilter);
59907       }
59908       var stringsField = field.resolveReference("stringsCrossReference");
59909       var fn = _isMulti ? "multikeys" : "values";
59910       var query = (_isMulti ? field.key : "") + q3;
59911       var hasCountryPrefix = _isNetwork && _countryCode && _countryCode.indexOf(q3.toLowerCase()) === 0;
59912       if (hasCountryPrefix) {
59913         query = _countryCode + ":";
59914       }
59915       var params = {
59916         debounce: q3 !== "",
59917         key: field.key,
59918         query
59919       };
59920       if (_entityIDs.length) {
59921         params.geometry = context.graph().geometry(_entityIDs[0]);
59922       }
59923       services.taginfo[fn](params, function(err, data) {
59924         if (err) return;
59925         data = data.filter((d2) => field.type !== "typeCombo" || d2.value !== "yes");
59926         data = data.filter((d2) => {
59927           var value = d2.value;
59928           if (_isMulti) {
59929             value = value.slice(field.key.length);
59930           }
59931           return value === restrictTagValueSpelling(value);
59932         });
59933         var deprecatedValues = deprecatedTagValuesByKey(_dataDeprecated)[field.key];
59934         if (deprecatedValues) {
59935           data = data.filter((d2) => !deprecatedValues.includes(d2.value));
59936         }
59937         if (hasCountryPrefix) {
59938           data = data.filter((d2) => d2.value.toLowerCase().indexOf(_countryCode + ":") === 0);
59939         }
59940         const additionalOptions = (field.options || stringsField.options || []).filter((v3) => !data.some((dv) => dv.value === (_isMulti ? field.key + v3 : v3))).map((v3) => ({ value: v3 }));
59941         _container.classed("empty-combobox", data.length === 0);
59942         _comboData = data.concat(additionalOptions).map(function(d2) {
59943           var v3 = d2.value;
59944           if (_isMulti) v3 = v3.replace(field.key, "");
59945           const labelId = getLabelId(stringsField, v3);
59946           var isLocalizable = stringsField.hasTextForStringId(labelId);
59947           var label = stringsField.t(labelId, { default: v3 });
59948           return {
59949             key: v3,
59950             value: label,
59951             title: stringsField.t("options.".concat(v3, ".description"), { default: isLocalizable ? v3 : d2.title !== label ? d2.title : "" }),
59952             display: addComboboxIcons(stringsField.t.append(labelId, { default: v3 }), v3),
59953             klass: isLocalizable ? "" : "raw-option"
59954           };
59955         });
59956         _comboData = _comboData.filter(queryFilter);
59957         if (!field.allowDuplicates) {
59958           _comboData = objectDifference(_comboData, _multiData);
59959         }
59960         if (callback) callback(_comboData, hasStaticValues());
59961       });
59962     }
59963     function addComboboxIcons(disp, value) {
59964       const iconsField = field.resolveReference("iconsCrossReference");
59965       if (iconsField.icons) {
59966         return function(selection2) {
59967           var span = selection2.insert("span", ":first-child").attr("class", "tag-value-icon");
59968           if (iconsField.icons[value]) {
59969             span.call(svgIcon("#".concat(iconsField.icons[value])));
59970           }
59971           disp.call(this, selection2);
59972         };
59973       }
59974       return disp;
59975     }
59976     function setPlaceholder(values) {
59977       if (_isMulti || _isSemi) {
59978         _staticPlaceholder = field.placeholder() || _t("inspector.add");
59979       } else {
59980         var vals = values.map(function(d2) {
59981           return d2.value;
59982         }).filter(function(s2) {
59983           return s2.length < 20;
59984         });
59985         var placeholders = vals.length > 1 ? vals : values.map(function(d2) {
59986           return d2.key;
59987         });
59988         _staticPlaceholder = field.placeholder() || placeholders.slice(0, 3).join(", ");
59989       }
59990       if (!/(…|\.\.\.)$/.test(_staticPlaceholder)) {
59991         _staticPlaceholder += "\u2026";
59992       }
59993       var ph;
59994       if (!_isMulti && !_isSemi && _tags && Array.isArray(_tags[field.key])) {
59995         ph = _t("inspector.multiple_values");
59996       } else {
59997         ph = _staticPlaceholder;
59998       }
59999       _container.selectAll("input").attr("placeholder", ph);
60000       var hideAdd = !_allowCustomValues && !values.length;
60001       _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
60002     }
60003     function change() {
60004       var t2 = {};
60005       var val;
60006       if (_isMulti || _isSemi) {
60007         var vals;
60008         if (_isMulti) {
60009           vals = [tagValue(utilGetSetValue(_input))];
60010         } else if (_isSemi) {
60011           val = tagValue(utilGetSetValue(_input)) || "";
60012           val = val.replace(/,/g, ";");
60013           vals = val.split(";");
60014         }
60015         vals = vals.filter(Boolean);
60016         if (!vals.length) return;
60017         _container.classed("active", false);
60018         utilGetSetValue(_input, "");
60019         if (_isMulti) {
60020           utilArrayUniq(vals).forEach(function(v3) {
60021             var key = (field.key || "") + v3;
60022             if (_tags) {
60023               var old = _tags[key];
60024               if (typeof old === "string" && old.toLowerCase() !== "no") return;
60025             }
60026             key = context.cleanTagKey(key);
60027             field.keys.push(key);
60028             t2[key] = "yes";
60029           });
60030         } else if (_isSemi) {
60031           var arr = _multiData.map(function(d2) {
60032             return d2.key;
60033           });
60034           arr = arr.concat(vals);
60035           if (!field.allowDuplicates) {
60036             arr = utilArrayUniq(arr);
60037           }
60038           t2[field.key] = context.cleanTagValue(arr.filter(Boolean).join(";"));
60039         }
60040         window.setTimeout(function() {
60041           _input.node().focus();
60042         }, 10);
60043       } else {
60044         var rawValue = utilGetSetValue(_input);
60045         if (!rawValue && Array.isArray(_tags[field.key])) return;
60046         val = context.cleanTagValue(tagValue(rawValue));
60047         t2[field.key] = val || void 0;
60048       }
60049       dispatch12.call("change", this, t2);
60050     }
60051     function removeMultikey(d3_event, d2) {
60052       d3_event.preventDefault();
60053       d3_event.stopPropagation();
60054       var t2 = {};
60055       if (_isMulti) {
60056         t2[d2.key] = void 0;
60057       } else if (_isSemi) {
60058         let arr = _multiData.map((item) => item.key);
60059         arr.splice(d2.index, 1);
60060         if (!field.allowDuplicates) {
60061           arr = utilArrayUniq(arr);
60062         }
60063         t2[field.key] = arr.length ? arr.join(";") : void 0;
60064         _lengthIndicator.update(t2[field.key]);
60065       }
60066       dispatch12.call("change", this, t2);
60067     }
60068     function invertMultikey(d3_event, d2) {
60069       d3_event.preventDefault();
60070       d3_event.stopPropagation();
60071       var t2 = {};
60072       if (_isMulti) {
60073         t2[d2.key] = _tags[d2.key] === "yes" ? "no" : "yes";
60074       }
60075       dispatch12.call("change", this, t2);
60076     }
60077     function combo(selection2) {
60078       _container = selection2.selectAll(".form-field-input-wrap").data([0]);
60079       var type2 = _isMulti || _isSemi ? "multicombo" : "combo";
60080       _container = _container.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + type2).merge(_container);
60081       if (_isMulti || _isSemi) {
60082         _container = _container.selectAll(".chiplist").data([0]);
60083         var listClass = "chiplist";
60084         if (field.key === "destination" || field.key === "via") {
60085           listClass += " full-line-chips";
60086         }
60087         _container = _container.enter().append("ul").attr("class", listClass).on("click", function() {
60088           window.setTimeout(function() {
60089             _input.node().focus();
60090           }, 10);
60091         }).merge(_container);
60092         _inputWrap = _container.selectAll(".input-wrap").data([0]);
60093         _inputWrap = _inputWrap.enter().append("li").attr("class", "input-wrap").merge(_inputWrap);
60094         var hideAdd = !_allowCustomValues && !_comboData.length;
60095         _inputWrap.style("display", hideAdd ? "none" : null);
60096         _input = _inputWrap.selectAll("input").data([0]);
60097       } else {
60098         _input = _container.selectAll("input").data([0]);
60099       }
60100       _input = _input.enter().append("input").attr("type", "text").attr("dir", "auto").attr("id", field.domId).call(utilNoAuto).call(initCombo, _container).merge(_input);
60101       if (_isSemi) {
60102         _inputWrap.call(_lengthIndicator);
60103       } else if (!_isMulti) {
60104         _container.call(_lengthIndicator);
60105       }
60106       if (_isNetwork) {
60107         var extent = combinedEntityExtent();
60108         var countryCode = extent && iso1A2Code(extent.center());
60109         _countryCode = countryCode && countryCode.toLowerCase();
60110       }
60111       _input.on("change", change).on("blur", change).on("input", function() {
60112         let val = utilGetSetValue(_input);
60113         updateIcon(val);
60114         if (_isSemi && _tags[field.key]) {
60115           val += ";" + _tags[field.key];
60116         }
60117         _lengthIndicator.update(val);
60118       });
60119       _input.on("keydown.field", function(d3_event) {
60120         switch (d3_event.keyCode) {
60121           case 13:
60122             _input.node().blur();
60123             d3_event.stopPropagation();
60124             break;
60125         }
60126       });
60127       if (_isMulti || _isSemi) {
60128         _combobox.on("accept", function() {
60129           _input.node().blur();
60130           _input.node().focus();
60131         });
60132         _input.on("focus", function() {
60133           _container.classed("active", true);
60134         });
60135       }
60136       _combobox.on("cancel", function() {
60137         _input.node().blur();
60138       }).on("update", function() {
60139         updateIcon(utilGetSetValue(_input));
60140       });
60141     }
60142     function updateIcon(value) {
60143       value = tagValue(value);
60144       let container = _container;
60145       if (field.type === "multiCombo" || field.type === "semiCombo") {
60146         container = _container.select(".input-wrap");
60147       }
60148       const iconsField = field.resolveReference("iconsCrossReference");
60149       if (iconsField.icons) {
60150         container.selectAll(".tag-value-icon").remove();
60151         if (iconsField.icons[value]) {
60152           container.selectAll(".tag-value-icon").data([value]).enter().insert("div", "input").attr("class", "tag-value-icon").call(svgIcon("#".concat(iconsField.icons[value])));
60153         }
60154       }
60155     }
60156     combo.tags = function(tags) {
60157       _tags = tags;
60158       var stringsField = field.resolveReference("stringsCrossReference");
60159       var isMixed = Array.isArray(tags[field.key]);
60160       var showsValue = (value) => !isMixed && value && !(field.type === "typeCombo" && value === "yes");
60161       var isRawValue = (value) => showsValue(value) && !stringsField.hasTextForStringId("options.".concat(value)) && !stringsField.hasTextForStringId("options.".concat(value, ".title"));
60162       var isKnownValue = (value) => showsValue(value) && !isRawValue(value);
60163       var isReadOnly = !_allowCustomValues;
60164       if (_isMulti || _isSemi) {
60165         _multiData = [];
60166         var maxLength;
60167         if (_isMulti) {
60168           for (var k3 in tags) {
60169             if (field.key && k3.indexOf(field.key) !== 0) continue;
60170             if (!field.key && field.keys.indexOf(k3) === -1) continue;
60171             var v3 = tags[k3];
60172             var suffix = field.key ? k3.slice(field.key.length) : k3;
60173             _multiData.push({
60174               key: k3,
60175               value: displayValue(suffix),
60176               display: addComboboxIcons(renderValue(suffix), suffix),
60177               state: typeof v3 === "string" ? v3.toLowerCase() : "",
60178               isMixed: Array.isArray(v3)
60179             });
60180           }
60181           if (field.key) {
60182             field.keys = _multiData.map(function(d2) {
60183               return d2.key;
60184             });
60185             maxLength = context.maxCharsForTagKey() - utilUnicodeCharsCount(field.key);
60186           } else {
60187             maxLength = context.maxCharsForTagKey();
60188           }
60189         } else if (_isSemi) {
60190           var allValues = [];
60191           var commonValues;
60192           if (Array.isArray(tags[field.key])) {
60193             tags[field.key].forEach(function(tagVal) {
60194               var thisVals = (tagVal || "").split(";").filter(Boolean);
60195               allValues = allValues.concat(thisVals);
60196               if (!commonValues) {
60197                 commonValues = thisVals;
60198               } else {
60199                 commonValues = commonValues.filter((value) => thisVals.includes(value));
60200               }
60201             });
60202             allValues = allValues.filter(Boolean);
60203           } else {
60204             allValues = (tags[field.key] || "").split(";").filter(Boolean);
60205             commonValues = allValues;
60206           }
60207           if (!field.allowDuplicates) {
60208             commonValues = utilArrayUniq(commonValues);
60209             allValues = utilArrayUniq(allValues);
60210           }
60211           _multiData = allValues.map(function(v4) {
60212             return {
60213               key: v4,
60214               value: displayValue(v4),
60215               display: addComboboxIcons(renderValue(v4), v4),
60216               isMixed: !commonValues.includes(v4)
60217             };
60218           });
60219           var currLength = utilUnicodeCharsCount(commonValues.join(";"));
60220           maxLength = context.maxCharsForTagValue() - currLength;
60221           if (currLength > 0) {
60222             maxLength -= 1;
60223           }
60224         }
60225         maxLength = Math.max(0, maxLength);
60226         var hideAdd = maxLength <= 0 || !_allowCustomValues && !_comboData.length;
60227         _container.selectAll(".chiplist .input-wrap").style("display", hideAdd ? "none" : null);
60228         var allowDragAndDrop = _isSemi && !Array.isArray(tags[field.key]);
60229         var chips = _container.selectAll(".chip").data(_multiData.map((item, index) => __spreadProps(__spreadValues({}, item), { index })));
60230         chips.exit().remove();
60231         var enter = chips.enter().insert("li", ".input-wrap").attr("class", "chip");
60232         enter.append("span");
60233         const field_buttons = enter.append("div").attr("class", "field_buttons");
60234         field_buttons.append("a").attr("class", "remove");
60235         chips = chips.merge(enter).order().classed("raw-value", function(d2) {
60236           var k4 = d2.key;
60237           if (_isMulti) k4 = k4.replace(field.key, "");
60238           return !stringsField.hasTextForStringId("options." + k4);
60239         }).classed("draggable", allowDragAndDrop).classed("mixed", function(d2) {
60240           return d2.isMixed;
60241         }).attr("title", function(d2) {
60242           if (d2.isMixed) {
60243             return _t("inspector.unshared_value_tooltip");
60244           }
60245           if (!["yes", "no"].includes(d2.state)) {
60246             return d2.state;
60247           }
60248           return null;
60249         }).classed("negated", (d2) => d2.state === "no");
60250         if (!_isSemi) {
60251           chips.selectAll("input[type=checkbox]").remove();
60252           chips.insert("input", "span").attr("type", "checkbox").property("checked", (d2) => d2.state === "yes").property("indeterminate", (d2) => d2.isMixed || !["yes", "no"].includes(d2.state)).on("click", invertMultikey);
60253         }
60254         if (allowDragAndDrop) {
60255           registerDragAndDrop(chips);
60256         }
60257         chips.each(function(d2) {
60258           const selection2 = select_default2(this);
60259           const text_span = selection2.select("span");
60260           const field_buttons2 = selection2.select(".field_buttons");
60261           const clean_value = d2.value.trim();
60262           text_span.text("");
60263           if (!field_buttons2.select("button").empty()) {
60264             field_buttons2.select("button").remove();
60265           }
60266           if (clean_value.startsWith("https://")) {
60267             text_span.text(clean_value);
60268             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) {
60269               d3_event.preventDefault();
60270               window.open(clean_value, "_blank");
60271             });
60272             return;
60273           }
60274           if (d2.display) {
60275             d2.display(text_span);
60276             return;
60277           }
60278           text_span.text(d2.value);
60279         });
60280         chips.select("a.remove").attr("href", "#").on("click", removeMultikey).attr("class", "remove").text("\xD7");
60281         updateIcon("");
60282       } else {
60283         var mixedValues = isMixed && tags[field.key].map(function(val) {
60284           return displayValue(val);
60285         }).filter(Boolean);
60286         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) {
60287           if (isReadOnly && isKnownValue(tags[field.key]) && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
60288             d3_event.preventDefault();
60289             d3_event.stopPropagation();
60290             var t2 = {};
60291             t2[field.key] = void 0;
60292             dispatch12.call("change", this, t2);
60293           }
60294         });
60295         if (!Array.isArray(tags[field.key])) {
60296           updateIcon(tags[field.key]);
60297         }
60298         if (!isMixed) {
60299           _lengthIndicator.update(tags[field.key]);
60300         }
60301       }
60302       const refreshStyles = () => {
60303         _input.data([tagValue(utilGetSetValue(_input))]).classed("raw-value", isRawValue).classed("known-value", isKnownValue);
60304       };
60305       _input.on("input.refreshStyles", refreshStyles);
60306       _combobox.on("update.refreshStyles", refreshStyles);
60307       refreshStyles();
60308     };
60309     function registerDragAndDrop(selection2) {
60310       var dragOrigin, targetIndex;
60311       selection2.call(
60312         drag_default().on("start", function(d3_event) {
60313           dragOrigin = {
60314             x: d3_event.x,
60315             y: d3_event.y
60316           };
60317           targetIndex = null;
60318         }).on("drag", function(d3_event) {
60319           var x3 = d3_event.x - dragOrigin.x, y3 = d3_event.y - dragOrigin.y;
60320           if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
60321           Math.sqrt(Math.pow(x3, 2) + Math.pow(y3, 2)) <= 5) return;
60322           var index = selection2.nodes().indexOf(this);
60323           select_default2(this).classed("dragging", true);
60324           targetIndex = null;
60325           var targetIndexOffsetTop = null;
60326           var draggedTagWidth = select_default2(this).node().offsetWidth;
60327           if (field.key === "destination" || field.key === "via") {
60328             _container.selectAll(".chip").style("transform", function(d2, index2) {
60329               var node = select_default2(this).node();
60330               if (index === index2) {
60331                 return "translate(" + x3 + "px, " + y3 + "px)";
60332               } else if (index2 > index && d3_event.y > node.offsetTop) {
60333                 if (targetIndex === null || index2 > targetIndex) {
60334                   targetIndex = index2;
60335                 }
60336                 return "translateY(-100%)";
60337               } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
60338                 if (targetIndex === null || index2 < targetIndex) {
60339                   targetIndex = index2;
60340                 }
60341                 return "translateY(100%)";
60342               }
60343               return null;
60344             });
60345           } else {
60346             _container.selectAll(".chip").each(function(d2, index2) {
60347               var node = select_default2(this).node();
60348               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) {
60349                 targetIndex = index2;
60350                 targetIndexOffsetTop = node.offsetTop;
60351               }
60352             }).style("transform", function(d2, index2) {
60353               var node = select_default2(this).node();
60354               if (index === index2) {
60355                 return "translate(" + x3 + "px, " + y3 + "px)";
60356               }
60357               if (node.offsetTop === targetIndexOffsetTop) {
60358                 if (index2 < index && index2 >= targetIndex) {
60359                   return "translateX(" + draggedTagWidth + "px)";
60360                 } else if (index2 > index && index2 <= targetIndex) {
60361                   return "translateX(-" + draggedTagWidth + "px)";
60362                 }
60363               }
60364               return null;
60365             });
60366           }
60367         }).on("end", function() {
60368           if (!select_default2(this).classed("dragging")) {
60369             return;
60370           }
60371           var index = selection2.nodes().indexOf(this);
60372           select_default2(this).classed("dragging", false);
60373           _container.selectAll(".chip").style("transform", null);
60374           if (typeof targetIndex === "number") {
60375             var element = _multiData[index];
60376             _multiData.splice(index, 1);
60377             _multiData.splice(targetIndex, 0, element);
60378             var t2 = {};
60379             if (_multiData.length) {
60380               t2[field.key] = _multiData.map(function(element2) {
60381                 return element2.key;
60382               }).join(";");
60383             } else {
60384               t2[field.key] = void 0;
60385             }
60386             dispatch12.call("change", this, t2);
60387           }
60388           dragOrigin = void 0;
60389           targetIndex = void 0;
60390         })
60391       );
60392     }
60393     combo.setCustomOptions = (newValue) => {
60394       _customOptions = newValue;
60395     };
60396     combo.focus = function() {
60397       _input.node().focus();
60398     };
60399     combo.entityIDs = function(val) {
60400       if (!arguments.length) return _entityIDs;
60401       _entityIDs = val;
60402       return combo;
60403     };
60404     function combinedEntityExtent() {
60405       return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
60406     }
60407     return utilRebind(combo, dispatch12, "on");
60408   }
60409
60410   // modules/ui/account.js
60411   function uiAccount(context) {
60412     const osm = context.connection();
60413     function updateUserDetails(selection2) {
60414       if (!osm) return;
60415       if (!osm.authenticated()) {
60416         render(selection2, null);
60417       } else {
60418         osm.userDetails((err, user) => {
60419           if (err && err.status === 401) {
60420             osm.logout();
60421           }
60422           render(selection2, user);
60423         });
60424       }
60425     }
60426     function render(selection2, user) {
60427       let userInfo = selection2.select(".userInfo");
60428       let loginLogout = selection2.select(".loginLogout");
60429       if (user) {
60430         userInfo.html("").classed("hide", false);
60431         let userLink = userInfo.append("a").attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
60432         if (user.image_url) {
60433           userLink.append("img").attr("class", "icon pre-text user-icon").attr("src", user.image_url);
60434         } else {
60435           userLink.call(svgIcon("#iD-icon-avatar", "pre-text light"));
60436         }
60437         userLink.append("span").attr("class", "label").text(user.display_name);
60438         loginLogout.classed("hide", false).select("a").text(_t("logout")).on("click", (e3) => {
60439           e3.preventDefault();
60440           osm.logout();
60441           osm.authenticate(void 0, { switchUser: true });
60442         });
60443       } else {
60444         userInfo.html("").classed("hide", true);
60445         loginLogout.classed("hide", false).select("a").text(_t("login")).on("click", (e3) => {
60446           e3.preventDefault();
60447           osm.authenticate();
60448         });
60449       }
60450     }
60451     return function(selection2) {
60452       if (!osm) return;
60453       selection2.append("li").attr("class", "userInfo").classed("hide", true);
60454       selection2.append("li").attr("class", "loginLogout").classed("hide", true).append("a").attr("href", "#");
60455       osm.on("change.account", () => updateUserDetails(selection2));
60456       updateUserDetails(selection2);
60457     };
60458   }
60459
60460   // modules/ui/attribution.js
60461   function uiAttribution(context) {
60462     let _selection = select_default2(null);
60463     function render(selection2, data, klass) {
60464       let div = selection2.selectAll(".".concat(klass)).data([0]);
60465       div = div.enter().append("div").attr("class", klass).merge(div);
60466       let attributions = div.selectAll(".attribution").data(data, (d2) => d2.id);
60467       attributions.exit().remove();
60468       attributions = attributions.enter().append("span").attr("class", "attribution").each((d2, i3, nodes) => {
60469         let attribution = select_default2(nodes[i3]);
60470         if (d2.terms_html) {
60471           attribution.html(d2.terms_html);
60472           return;
60473         }
60474         if (d2.terms_url) {
60475           attribution = attribution.append("a").attr("href", d2.terms_url).attr("target", "_blank");
60476         }
60477         const sourceID = d2.id.replace(/\./g, "<TX_DOT>");
60478         const terms_text = _t(
60479           "imagery.".concat(sourceID, ".attribution.text"),
60480           { default: d2.terms_text || d2.id || d2.name() }
60481         );
60482         if (d2.icon && !d2.overlay) {
60483           attribution.append("img").attr("class", "source-image").attr("src", d2.icon);
60484         }
60485         attribution.append("span").attr("class", "attribution-text").text(terms_text);
60486       }).merge(attributions);
60487       let copyright = attributions.selectAll(".copyright-notice").data((d2) => {
60488         let notice = d2.copyrightNotices(context.map().zoom(), context.map().extent());
60489         return notice ? [notice] : [];
60490       });
60491       copyright.exit().remove();
60492       copyright = copyright.enter().append("span").attr("class", "copyright-notice").merge(copyright);
60493       copyright.text(String);
60494     }
60495     function update() {
60496       let baselayer = context.background().baseLayerSource();
60497       _selection.call(render, baselayer ? [baselayer] : [], "base-layer-attribution");
60498       const z3 = context.map().zoom();
60499       let overlays = context.background().overlayLayerSources() || [];
60500       _selection.call(render, overlays.filter((s2) => s2.validZoom(z3)), "overlay-layer-attribution");
60501     }
60502     return function(selection2) {
60503       _selection = selection2;
60504       context.background().on("change.attribution", update);
60505       context.map().on("move.attribution", throttle_default(update, 400, { leading: false }));
60506       update();
60507     };
60508   }
60509
60510   // modules/ui/contributors.js
60511   function uiContributors(context) {
60512     var osm = context.connection(), debouncedUpdate = debounce_default(function() {
60513       update();
60514     }, 1e3), limit = 4, hidden = false, wrap2 = select_default2(null);
60515     function update() {
60516       if (!osm) return;
60517       var users = {}, entities = context.history().intersects(context.map().extent());
60518       entities.forEach(function(entity) {
60519         if (entity && entity.user) users[entity.user] = true;
60520       });
60521       var u4 = Object.keys(users), subset = u4.slice(0, u4.length > limit ? limit - 1 : limit);
60522       wrap2.html("").call(svgIcon("#iD-icon-nearby", "pre-text light"));
60523       var userList = select_default2(document.createElement("span"));
60524       userList.selectAll().data(subset).enter().append("a").attr("class", "user-link").attr("href", function(d2) {
60525         return osm.userURL(d2);
60526       }).attr("target", "_blank").text(String);
60527       if (u4.length > limit) {
60528         var count = select_default2(document.createElement("span"));
60529         var othersNum = u4.length - limit + 1;
60530         count.append("a").attr("target", "_blank").attr("href", function() {
60531           return osm.changesetsURL(context.map().center(), context.map().zoom());
60532         }).text(othersNum);
60533         wrap2.append("span").html(_t.html("contributors.truncated_list", { n: othersNum, users: { html: userList.html() }, count: { html: count.html() } }));
60534       } else {
60535         wrap2.append("span").html(_t.html("contributors.list", { users: { html: userList.html() } }));
60536       }
60537       if (!u4.length) {
60538         hidden = true;
60539         wrap2.transition().style("opacity", 0);
60540       } else if (hidden) {
60541         wrap2.transition().style("opacity", 1);
60542       }
60543     }
60544     return function(selection2) {
60545       if (!osm) return;
60546       wrap2 = selection2;
60547       update();
60548       osm.on("loaded.contributors", debouncedUpdate);
60549       context.map().on("move.contributors", debouncedUpdate);
60550     };
60551   }
60552
60553   // modules/ui/edit_menu.js
60554   function uiEditMenu(context) {
60555     var dispatch12 = dispatch_default("toggled");
60556     var _menu = select_default2(null);
60557     var _operations = [];
60558     var _anchorLoc = [0, 0];
60559     var _anchorLocLonLat = [0, 0];
60560     var _triggerType = "";
60561     var _vpTopMargin = 85;
60562     var _vpBottomMargin = 45;
60563     var _vpSideMargin = 35;
60564     var _menuTop = false;
60565     var _menuHeight;
60566     var _menuWidth;
60567     var _verticalPadding = 4;
60568     var _tooltipWidth = 210;
60569     var _menuSideMargin = 10;
60570     var _tooltips = [];
60571     var editMenu = function(selection2) {
60572       var isTouchMenu = _triggerType.includes("touch") || _triggerType.includes("pen");
60573       var ops = _operations.filter(function(op) {
60574         return !isTouchMenu || !op.mouseOnly;
60575       });
60576       if (!ops.length) return;
60577       _tooltips = [];
60578       _menuTop = isTouchMenu;
60579       var showLabels = isTouchMenu;
60580       var buttonHeight = showLabels ? 32 : 34;
60581       if (showLabels) {
60582         _menuWidth = 52 + Math.min(120, 6 * Math.max.apply(Math, ops.map(function(op) {
60583           return op.title.length;
60584         })));
60585       } else {
60586         _menuWidth = 44;
60587       }
60588       _menuHeight = _verticalPadding * 2 + ops.length * buttonHeight;
60589       _menu = selection2.append("div").attr("class", "edit-menu").classed("touch-menu", isTouchMenu).style("padding", _verticalPadding + "px 0");
60590       var buttons = _menu.selectAll(".edit-menu-item").data(ops);
60591       var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
60592         return "edit-menu-item edit-menu-item-" + d2.id;
60593       }).style("height", buttonHeight + "px").on("click", click).on("pointerup", pointerup).on("pointerdown mousedown", function pointerdown(d3_event) {
60594         d3_event.stopPropagation();
60595       }).on("mouseenter.highlight", function(d3_event, d2) {
60596         if (!d2.relatedEntityIds || select_default2(this).classed("disabled")) return;
60597         utilHighlightEntities(d2.relatedEntityIds(), true, context);
60598       }).on("mouseleave.highlight", function(d3_event, d2) {
60599         if (!d2.relatedEntityIds) return;
60600         utilHighlightEntities(d2.relatedEntityIds(), false, context);
60601       });
60602       buttonsEnter.each(function(d2) {
60603         var tooltip = uiTooltip().heading(() => d2.title).title(d2.tooltip).keys([d2.keys[0]]);
60604         _tooltips.push(tooltip);
60605         select_default2(this).call(tooltip).append("div").attr("class", "icon-wrap").call(svgIcon(d2.icon && d2.icon() || "#iD-operation-" + d2.id, "operation"));
60606       });
60607       if (showLabels) {
60608         buttonsEnter.append("span").attr("class", "label").each(function(d2) {
60609           select_default2(this).call(d2.title);
60610         });
60611       }
60612       buttonsEnter.merge(buttons).classed("disabled", function(d2) {
60613         return d2.disabled();
60614       });
60615       updatePosition();
60616       var initialScale = context.projection.scale();
60617       context.map().on("move.edit-menu", function() {
60618         if (initialScale !== context.projection.scale()) {
60619           editMenu.close();
60620         }
60621       }).on("drawn.edit-menu", function(info) {
60622         if (info.full) updatePosition();
60623       });
60624       var lastPointerUpType;
60625       function pointerup(d3_event) {
60626         lastPointerUpType = d3_event.pointerType;
60627       }
60628       function click(d3_event, operation2) {
60629         d3_event.stopPropagation();
60630         if (operation2.relatedEntityIds) {
60631           utilHighlightEntities(operation2.relatedEntityIds(), false, context);
60632         }
60633         if (operation2.disabled()) {
60634           if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
60635             context.ui().flash.duration(4e3).iconName("#iD-operation-" + operation2.id).iconClass("operation disabled").label(operation2.tooltip())();
60636           }
60637         } else {
60638           if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
60639             context.ui().flash.duration(2e3).iconName("#iD-operation-" + operation2.id).iconClass("operation").label(operation2.annotation() || operation2.title)();
60640           }
60641           operation2();
60642           editMenu.close();
60643         }
60644         lastPointerUpType = null;
60645       }
60646       dispatch12.call("toggled", this, true);
60647     };
60648     function updatePosition() {
60649       if (!_menu || _menu.empty()) return;
60650       var anchorLoc = context.projection(_anchorLocLonLat);
60651       var viewport = context.surfaceRect();
60652       if (anchorLoc[0] < 0 || anchorLoc[0] > viewport.width || anchorLoc[1] < 0 || anchorLoc[1] > viewport.height) {
60653         editMenu.close();
60654         return;
60655       }
60656       var menuLeft = displayOnLeft(viewport);
60657       var offset = [0, 0];
60658       offset[0] = menuLeft ? -1 * (_menuSideMargin + _menuWidth) : _menuSideMargin;
60659       if (_menuTop) {
60660         if (anchorLoc[1] - _menuHeight < _vpTopMargin) {
60661           offset[1] = -anchorLoc[1] + _vpTopMargin;
60662         } else {
60663           offset[1] = -_menuHeight;
60664         }
60665       } else {
60666         if (anchorLoc[1] + _menuHeight > viewport.height - _vpBottomMargin) {
60667           offset[1] = -anchorLoc[1] - _menuHeight + viewport.height - _vpBottomMargin;
60668         } else {
60669           offset[1] = 0;
60670         }
60671       }
60672       var origin = geoVecAdd(anchorLoc, offset);
60673       var _verticalOffset = parseFloat(utilGetDimensions(select_default2(".top-toolbar-wrap"))[1]);
60674       origin[1] -= _verticalOffset;
60675       _menu.style("left", origin[0] + "px").style("top", origin[1] + "px");
60676       var tooltipSide = tooltipPosition(viewport, menuLeft);
60677       _tooltips.forEach(function(tooltip) {
60678         tooltip.placement(tooltipSide);
60679       });
60680       function displayOnLeft(viewport2) {
60681         if (_mainLocalizer.textDirection() === "ltr") {
60682           if (anchorLoc[0] + _menuSideMargin + _menuWidth > viewport2.width - _vpSideMargin) {
60683             return true;
60684           }
60685           return false;
60686         } else {
60687           if (anchorLoc[0] - _menuSideMargin - _menuWidth < _vpSideMargin) {
60688             return false;
60689           }
60690           return true;
60691         }
60692       }
60693       function tooltipPosition(viewport2, menuLeft2) {
60694         if (_mainLocalizer.textDirection() === "ltr") {
60695           if (menuLeft2) {
60696             return "left";
60697           }
60698           if (anchorLoc[0] + _menuSideMargin + _menuWidth + _tooltipWidth > viewport2.width - _vpSideMargin) {
60699             return "left";
60700           }
60701           return "right";
60702         } else {
60703           if (!menuLeft2) {
60704             return "right";
60705           }
60706           if (anchorLoc[0] - _menuSideMargin - _menuWidth - _tooltipWidth < _vpSideMargin) {
60707             return "right";
60708           }
60709           return "left";
60710         }
60711       }
60712     }
60713     editMenu.close = function() {
60714       context.map().on("move.edit-menu", null).on("drawn.edit-menu", null);
60715       _menu.remove();
60716       _tooltips = [];
60717       dispatch12.call("toggled", this, false);
60718     };
60719     editMenu.anchorLoc = function(val) {
60720       if (!arguments.length) return _anchorLoc;
60721       _anchorLoc = val;
60722       _anchorLocLonLat = context.projection.invert(_anchorLoc);
60723       return editMenu;
60724     };
60725     editMenu.triggerType = function(val) {
60726       if (!arguments.length) return _triggerType;
60727       _triggerType = val;
60728       return editMenu;
60729     };
60730     editMenu.operations = function(val) {
60731       if (!arguments.length) return _operations;
60732       _operations = val;
60733       return editMenu;
60734     };
60735     return utilRebind(editMenu, dispatch12, "on");
60736   }
60737
60738   // modules/ui/feature_info.js
60739   function uiFeatureInfo(context) {
60740     function update(selection2) {
60741       var features = context.features();
60742       var stats = features.stats();
60743       var count = 0;
60744       var hiddenList = features.hidden().map(function(k3) {
60745         if (stats[k3]) {
60746           count += stats[k3];
60747           return _t.append("inspector.title_count", {
60748             title: _t("feature." + k3 + ".description"),
60749             count: stats[k3]
60750           });
60751         }
60752         return null;
60753       }).filter(Boolean);
60754       selection2.text("");
60755       if (hiddenList.length) {
60756         var tooltipBehavior = uiTooltip().placement("top").title(function() {
60757           return (selection3) => {
60758             hiddenList.forEach((hiddenFeature) => {
60759               selection3.append("div").call(hiddenFeature);
60760             });
60761           };
60762         });
60763         selection2.append("a").attr("class", "chip").attr("href", "#").call(_t.append("feature_info.hidden_warning", { count })).call(tooltipBehavior).on("click", function(d3_event) {
60764           tooltipBehavior.hide();
60765           d3_event.preventDefault();
60766           context.ui().togglePanes(context.container().select(".map-panes .map-data-pane"));
60767         });
60768       }
60769       selection2.classed("hide", !hiddenList.length);
60770     }
60771     return function(selection2) {
60772       update(selection2);
60773       context.features().on("change.feature_info", function() {
60774         update(selection2);
60775       });
60776     };
60777   }
60778
60779   // modules/ui/flash.js
60780   function uiFlash(context) {
60781     var _flashTimer;
60782     var _duration = 2e3;
60783     var _iconName = "#iD-icon-no";
60784     var _iconClass = "disabled";
60785     var _label = (s2) => s2.text("");
60786     function flash() {
60787       if (_flashTimer) {
60788         _flashTimer.stop();
60789       }
60790       context.container().select(".main-footer-wrap").classed("footer-hide", true).classed("footer-show", false);
60791       context.container().select(".flash-wrap").classed("footer-hide", false).classed("footer-show", true);
60792       var content = context.container().select(".flash-wrap").selectAll(".flash-content").data([0]);
60793       var contentEnter = content.enter().append("div").attr("class", "flash-content");
60794       var iconEnter = contentEnter.append("svg").attr("class", "flash-icon icon").append("g").attr("transform", "translate(10,10)");
60795       iconEnter.append("circle").attr("r", 9);
60796       iconEnter.append("use").attr("transform", "translate(-7,-7)").attr("width", "14").attr("height", "14");
60797       contentEnter.append("div").attr("class", "flash-text");
60798       content = content.merge(contentEnter);
60799       content.selectAll(".flash-icon").attr("class", "icon flash-icon " + (_iconClass || ""));
60800       content.selectAll(".flash-icon use").attr("xlink:href", _iconName);
60801       content.selectAll(".flash-text").attr("class", "flash-text").call(_label);
60802       _flashTimer = timeout_default(function() {
60803         _flashTimer = null;
60804         context.container().select(".main-footer-wrap").classed("footer-hide", false).classed("footer-show", true);
60805         context.container().select(".flash-wrap").classed("footer-hide", true).classed("footer-show", false);
60806       }, _duration);
60807       return content;
60808     }
60809     flash.duration = function(_3) {
60810       if (!arguments.length) return _duration;
60811       _duration = _3;
60812       return flash;
60813     };
60814     flash.label = function(_3) {
60815       if (!arguments.length) return _label;
60816       if (typeof _3 !== "function") {
60817         _label = (selection2) => selection2.text(_3);
60818       } else {
60819         _label = (selection2) => selection2.text("").call(_3);
60820       }
60821       return flash;
60822     };
60823     flash.iconName = function(_3) {
60824       if (!arguments.length) return _iconName;
60825       _iconName = _3;
60826       return flash;
60827     };
60828     flash.iconClass = function(_3) {
60829       if (!arguments.length) return _iconClass;
60830       _iconClass = _3;
60831       return flash;
60832     };
60833     return flash;
60834   }
60835
60836   // modules/ui/full_screen.js
60837   function uiFullScreen(context) {
60838     var element = context.container().node();
60839     function getFullScreenFn() {
60840       if (element.requestFullscreen) {
60841         return element.requestFullscreen;
60842       } else if (element.msRequestFullscreen) {
60843         return element.msRequestFullscreen;
60844       } else if (element.mozRequestFullScreen) {
60845         return element.mozRequestFullScreen;
60846       } else if (element.webkitRequestFullscreen) {
60847         return element.webkitRequestFullscreen;
60848       }
60849     }
60850     function getExitFullScreenFn() {
60851       if (document.exitFullscreen) {
60852         return document.exitFullscreen;
60853       } else if (document.msExitFullscreen) {
60854         return document.msExitFullscreen;
60855       } else if (document.mozCancelFullScreen) {
60856         return document.mozCancelFullScreen;
60857       } else if (document.webkitExitFullscreen) {
60858         return document.webkitExitFullscreen;
60859       }
60860     }
60861     function isFullScreen() {
60862       return document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement;
60863     }
60864     function isSupported() {
60865       return !!getFullScreenFn();
60866     }
60867     function fullScreen(d3_event) {
60868       d3_event.preventDefault();
60869       if (!isFullScreen()) {
60870         getFullScreenFn().apply(element);
60871       } else {
60872         getExitFullScreenFn().apply(document);
60873       }
60874     }
60875     return function() {
60876       if (!isSupported()) return;
60877       var detected = utilDetect();
60878       var keys2 = detected.os === "mac" ? [uiCmd("\u2303\u2318F"), "f11"] : ["f11"];
60879       context.keybinding().on(keys2, fullScreen);
60880     };
60881   }
60882
60883   // modules/ui/geolocate.js
60884   function uiGeolocate(context) {
60885     var _geolocationOptions = {
60886       // prioritize speed and power usage over precision
60887       enableHighAccuracy: false,
60888       // don't hang indefinitely getting the location
60889       timeout: 6e3
60890       // 6sec
60891     };
60892     var _locating = uiLoading(context).message(_t.html("geolocate.locating")).blocking(true);
60893     var _layer = context.layers().layer("geolocate");
60894     var _position;
60895     var _extent;
60896     var _timeoutID;
60897     var _button = select_default2(null);
60898     function click() {
60899       if (context.inIntro()) return;
60900       if (!_layer.enabled() && !_locating.isShown()) {
60901         _timeoutID = setTimeout(
60902           error,
60903           1e4
60904           /* 10sec */
60905         );
60906         context.container().call(_locating);
60907         navigator.geolocation.getCurrentPosition(success, error, _geolocationOptions);
60908       } else {
60909         _locating.close();
60910         _layer.enabled(null, false);
60911         updateButtonState();
60912       }
60913     }
60914     function zoomTo() {
60915       context.enter(modeBrowse(context));
60916       var map2 = context.map();
60917       _layer.enabled(_position, true);
60918       updateButtonState();
60919       map2.centerZoomEase(_extent.center(), Math.min(20, map2.extentZoom(_extent)));
60920     }
60921     function success(geolocation) {
60922       _position = geolocation;
60923       var coords = _position.coords;
60924       _extent = geoExtent([coords.longitude, coords.latitude]).padByMeters(coords.accuracy);
60925       zoomTo();
60926       finish();
60927     }
60928     function error() {
60929       if (_position) {
60930         zoomTo();
60931       } else {
60932         context.ui().flash.label(_t.append("geolocate.location_unavailable")).iconName("#iD-icon-geolocate")();
60933       }
60934       finish();
60935     }
60936     function finish() {
60937       _locating.close();
60938       if (_timeoutID) {
60939         clearTimeout(_timeoutID);
60940       }
60941       _timeoutID = void 0;
60942     }
60943     function updateButtonState() {
60944       _button.classed("active", _layer.enabled());
60945       _button.attr("aria-pressed", _layer.enabled());
60946     }
60947     return function(selection2) {
60948       if (!navigator.geolocation || !navigator.geolocation.getCurrentPosition) return;
60949       _button = selection2.append("button").on("click", click).attr("aria-pressed", false).call(svgIcon("#iD-icon-geolocate", "light")).call(
60950         uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _t.append("geolocate.title"))
60951       );
60952     };
60953   }
60954
60955   // modules/ui/panels/background.js
60956   function uiPanelBackground(context) {
60957     const background = context.background();
60958     let _currSource = null;
60959     let _metadata = {};
60960     const _metadataKeys = [
60961       "zoom",
60962       "vintage",
60963       "source",
60964       "description",
60965       "resolution",
60966       "accuracy"
60967     ];
60968     var debouncedRedraw = debounce_default(redraw, 250);
60969     function redraw(selection2) {
60970       var source = background.baseLayerSource();
60971       if (!source) return;
60972       if ((_currSource == null ? void 0 : _currSource.id) !== source.id) {
60973         _currSource = source;
60974         _metadata = {};
60975       }
60976       selection2.text("");
60977       var list = selection2.append("ul").attr("class", "background-info");
60978       list.append("li").call(_currSource.label());
60979       _metadataKeys.forEach(function(k3) {
60980         list.append("li").attr("class", "background-info-list-" + k3).classed("hide", !_metadata[k3]).call(_t.append("info_panels.background." + k3, { suffix: ":" })).append("span").attr("class", "background-info-span-" + k3).text(_metadata[k3]);
60981       });
60982       debouncedGetMetadata(selection2);
60983       var toggleTiles = context.getDebug("tile") ? "hide_tiles" : "show_tiles";
60984       selection2.append("a").call(_t.append("info_panels.background." + toggleTiles)).attr("href", "#").attr("class", "button button-toggle-tiles").on("click", function(d3_event) {
60985         d3_event.preventDefault();
60986         context.setDebug("tile", !context.getDebug("tile"));
60987         selection2.call(redraw);
60988       });
60989     }
60990     var debouncedGetMetadata = debounce_default(getMetadata, 250);
60991     function getMetadata(selection2) {
60992       var tile = context.container().select(".layer-background img.tile-center");
60993       if (tile.empty()) return;
60994       var sourceId = _currSource.id;
60995       var d2 = tile.datum();
60996       var zoom = d2 && d2.length >= 3 && d2[2] || Math.floor(context.map().zoom());
60997       var center = context.map().center();
60998       _metadata.zoom = String(zoom);
60999       selection2.selectAll(".background-info-list-zoom").classed("hide", false).selectAll(".background-info-span-zoom").text(_metadata.zoom);
61000       if (!d2 || !d2.length >= 3) return;
61001       background.baseLayerSource().getMetadata(center, d2, function(err, result) {
61002         if (err || _currSource.id !== sourceId) return;
61003         var vintage = result.vintage;
61004         _metadata.vintage = vintage && vintage.range || _t("info_panels.background.unknown");
61005         selection2.selectAll(".background-info-list-vintage").classed("hide", false).selectAll(".background-info-span-vintage").text(_metadata.vintage);
61006         _metadataKeys.forEach(function(k3) {
61007           if (k3 === "zoom" || k3 === "vintage") return;
61008           var val = result[k3];
61009           _metadata[k3] = val;
61010           selection2.selectAll(".background-info-list-" + k3).classed("hide", !val).selectAll(".background-info-span-" + k3).text(val);
61011         });
61012       });
61013     }
61014     var panel = function(selection2) {
61015       selection2.call(redraw);
61016       context.map().on("drawn.info-background", function() {
61017         selection2.call(debouncedRedraw);
61018       }).on("move.info-background", function() {
61019         selection2.call(debouncedGetMetadata);
61020       });
61021     };
61022     panel.off = function() {
61023       context.map().on("drawn.info-background", null).on("move.info-background", null);
61024     };
61025     panel.id = "background";
61026     panel.label = _t.append("info_panels.background.title");
61027     panel.key = _t("info_panels.background.key");
61028     return panel;
61029   }
61030
61031   // modules/ui/panels/history.js
61032   function uiPanelHistory(context) {
61033     var osm;
61034     function displayTimestamp(timestamp) {
61035       if (!timestamp) return _t("info_panels.history.unknown");
61036       var options = {
61037         day: "numeric",
61038         month: "short",
61039         year: "numeric",
61040         hour: "numeric",
61041         minute: "numeric",
61042         second: "numeric"
61043       };
61044       var d2 = new Date(timestamp);
61045       if (isNaN(d2.getTime())) return _t("info_panels.history.unknown");
61046       return d2.toLocaleString(_mainLocalizer.localeCode(), options);
61047     }
61048     function displayUser(selection2, userName) {
61049       if (!userName) {
61050         selection2.append("span").call(_t.append("info_panels.history.unknown"));
61051         return;
61052       }
61053       selection2.append("span").attr("class", "user-name").text(userName);
61054       var links = selection2.append("div").attr("class", "links");
61055       if (osm) {
61056         links.append("a").attr("class", "user-osm-link").attr("href", osm.userURL(userName)).attr("target", "_blank").call(_t.append("info_panels.history.profile_link"));
61057       }
61058       links.append("a").attr("class", "user-hdyc-link").attr("href", "https://hdyc.neis-one.org/?" + userName).attr("target", "_blank").attr("tabindex", -1).text("HDYC");
61059     }
61060     function displayChangeset(selection2, changeset) {
61061       if (!changeset) {
61062         selection2.append("span").call(_t.append("info_panels.history.unknown"));
61063         return;
61064       }
61065       selection2.append("span").attr("class", "changeset-id").text(changeset);
61066       var links = selection2.append("div").attr("class", "links");
61067       if (osm) {
61068         links.append("a").attr("class", "changeset-osm-link").attr("href", osm.changesetURL(changeset)).attr("target", "_blank").call(_t.append("info_panels.history.changeset_link"));
61069       }
61070       links.append("a").attr("class", "changeset-osmcha-link").attr("href", "https://osmcha.org/changesets/" + changeset).attr("target", "_blank").text("OSMCha");
61071       links.append("a").attr("class", "changeset-achavi-link").attr("href", "https://overpass-api.de/achavi/?changeset=" + changeset).attr("target", "_blank").text("Achavi");
61072     }
61073     function redraw(selection2) {
61074       var selectedNoteID = context.selectedNoteID();
61075       osm = context.connection();
61076       var selected, note, entity;
61077       if (selectedNoteID && osm) {
61078         selected = [_t.html("note.note") + " " + selectedNoteID];
61079         note = osm.getNote(selectedNoteID);
61080       } else {
61081         selected = context.selectedIDs().filter(function(e3) {
61082           return context.hasEntity(e3);
61083         });
61084         if (selected.length) {
61085           entity = context.entity(selected[0]);
61086         }
61087       }
61088       var singular = selected.length === 1 ? selected[0] : null;
61089       selection2.html("");
61090       if (singular) {
61091         selection2.append("h4").attr("class", "history-heading").html(singular);
61092       } else {
61093         selection2.append("h4").attr("class", "history-heading").call(_t.append("info_panels.selected", { n: selected.length }));
61094       }
61095       if (!singular) return;
61096       if (entity) {
61097         selection2.call(redrawEntity, entity);
61098       } else if (note) {
61099         selection2.call(redrawNote, note);
61100       }
61101     }
61102     function redrawNote(selection2, note) {
61103       if (!note || note.isNew()) {
61104         selection2.append("div").call(_t.append("info_panels.history.note_no_history"));
61105         return;
61106       }
61107       var list = selection2.append("ul");
61108       list.append("li").call(_t.append("info_panels.history.note_comments", { suffix: ":" })).append("span").text(note.comments.length);
61109       if (note.comments.length) {
61110         list.append("li").call(_t.append("info_panels.history.note_created_date", { suffix: ":" })).append("span").text(displayTimestamp(note.comments[0].date));
61111         list.append("li").call(_t.append("info_panels.history.note_created_user", { suffix: ":" })).call(displayUser, note.comments[0].user);
61112       }
61113       if (osm) {
61114         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"));
61115       }
61116     }
61117     function redrawEntity(selection2, entity) {
61118       if (!entity || entity.isNew()) {
61119         selection2.append("div").call(_t.append("info_panels.history.no_history"));
61120         return;
61121       }
61122       var links = selection2.append("div").attr("class", "links");
61123       if (osm) {
61124         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"));
61125       }
61126       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");
61127       var list = selection2.append("ul");
61128       list.append("li").call(_t.append("info_panels.history.version", { suffix: ":" })).append("span").text(entity.version);
61129       list.append("li").call(_t.append("info_panels.history.last_edit", { suffix: ":" })).append("span").text(displayTimestamp(entity.timestamp));
61130       list.append("li").call(_t.append("info_panels.history.edited_by", { suffix: ":" })).call(displayUser, entity.user);
61131       list.append("li").call(_t.append("info_panels.history.changeset", { suffix: ":" })).call(displayChangeset, entity.changeset);
61132     }
61133     var panel = function(selection2) {
61134       selection2.call(redraw);
61135       context.map().on("drawn.info-history", function() {
61136         selection2.call(redraw);
61137       });
61138       context.on("enter.info-history", function() {
61139         selection2.call(redraw);
61140       });
61141     };
61142     panel.off = function() {
61143       context.map().on("drawn.info-history", null);
61144       context.on("enter.info-history", null);
61145     };
61146     panel.id = "history";
61147     panel.label = _t.append("info_panels.history.title");
61148     panel.key = _t("info_panels.history.key");
61149     return panel;
61150   }
61151
61152   // modules/ui/panels/location.js
61153   function uiPanelLocation(context) {
61154     var currLocation = "";
61155     function redraw(selection2) {
61156       selection2.html("");
61157       var list = selection2.append("ul");
61158       var coord2 = context.map().mouseCoordinates();
61159       if (coord2.some(isNaN)) {
61160         coord2 = context.map().center();
61161       }
61162       list.append("li").text(dmsCoordinatePair(coord2)).append("li").text(decimalCoordinatePair(coord2));
61163       selection2.append("div").attr("class", "location-info").text(currLocation || " ");
61164       debouncedGetLocation(selection2, coord2);
61165     }
61166     var debouncedGetLocation = debounce_default(getLocation, 250);
61167     function getLocation(selection2, coord2) {
61168       if (!services.geocoder) {
61169         currLocation = _t("info_panels.location.unknown_location");
61170         selection2.selectAll(".location-info").text(currLocation);
61171       } else {
61172         services.geocoder.reverse(coord2, function(err, result) {
61173           currLocation = result ? result.display_name : _t("info_panels.location.unknown_location");
61174           selection2.selectAll(".location-info").text(currLocation);
61175         });
61176       }
61177     }
61178     var panel = function(selection2) {
61179       selection2.call(redraw);
61180       context.surface().on(("PointerEvent" in window ? "pointer" : "mouse") + "move.info-location", function() {
61181         selection2.call(redraw);
61182       });
61183     };
61184     panel.off = function() {
61185       context.surface().on(".info-location", null);
61186     };
61187     panel.id = "location";
61188     panel.label = _t.append("info_panels.location.title");
61189     panel.key = _t("info_panels.location.key");
61190     return panel;
61191   }
61192
61193   // modules/ui/panels/measurement.js
61194   function uiPanelMeasurement(context) {
61195     function radiansToMeters(r2) {
61196       return r2 * 63710071809e-4;
61197     }
61198     function steradiansToSqmeters(r2) {
61199       return r2 / (4 * Math.PI) * 510065621724e3;
61200     }
61201     function toLineString(feature4) {
61202       if (feature4.type === "LineString") return feature4;
61203       var result = { type: "LineString", coordinates: [] };
61204       if (feature4.type === "Polygon") {
61205         result.coordinates = feature4.coordinates[0];
61206       } else if (feature4.type === "MultiPolygon") {
61207         result.coordinates = feature4.coordinates[0][0];
61208       }
61209       return result;
61210     }
61211     var _isImperial = !_mainLocalizer.usesMetric();
61212     function redraw(selection2) {
61213       var graph = context.graph();
61214       var selectedNoteID = context.selectedNoteID();
61215       var osm = services.osm;
61216       var localeCode = _mainLocalizer.localeCode();
61217       var heading;
61218       var center, location, centroid;
61219       var closed, geometry;
61220       var totalNodeCount, length2 = 0, area = 0, distance;
61221       if (selectedNoteID && osm) {
61222         var note = osm.getNote(selectedNoteID);
61223         heading = _t.html("note.note") + " " + selectedNoteID;
61224         location = note.loc;
61225         geometry = "note";
61226       } else {
61227         var selectedIDs = context.selectedIDs().filter(function(id2) {
61228           return context.hasEntity(id2);
61229         });
61230         var selected = selectedIDs.map(function(id2) {
61231           return context.entity(id2);
61232         });
61233         heading = selected.length === 1 ? selected[0].id : _t.html("info_panels.selected", { n: selected.length });
61234         if (selected.length) {
61235           var extent = geoExtent();
61236           for (var i3 in selected) {
61237             var entity = selected[i3];
61238             extent._extend(entity.extent(graph));
61239             geometry = entity.geometry(graph);
61240             if (geometry === "line" || geometry === "area") {
61241               closed = entity.type === "relation" || entity.isClosed() && !entity.isDegenerate();
61242               var feature4 = entity.asGeoJSON(graph);
61243               length2 += radiansToMeters(length_default(toLineString(feature4)));
61244               centroid = path_default(context.projection).centroid(entity.asGeoJSON(graph));
61245               centroid = centroid && context.projection.invert(centroid);
61246               if (!centroid || !isFinite(centroid[0]) || !isFinite(centroid[1])) {
61247                 centroid = entity.extent(graph).center();
61248               }
61249               if (closed) {
61250                 area += steradiansToSqmeters(entity.area(graph));
61251               }
61252             }
61253           }
61254           if (selected.length > 1) {
61255             geometry = null;
61256             closed = null;
61257             centroid = null;
61258           }
61259           if (selected.length === 2 && selected[0].type === "node" && selected[1].type === "node") {
61260             distance = geoSphericalDistance(selected[0].loc, selected[1].loc);
61261           }
61262           if (selected.length === 1 && selected[0].type === "node") {
61263             location = selected[0].loc;
61264           } else {
61265             totalNodeCount = utilGetAllNodes(selectedIDs, context.graph()).length;
61266           }
61267           if (!location && !centroid) {
61268             center = extent.center();
61269           }
61270         }
61271       }
61272       selection2.html("");
61273       if (heading) {
61274         selection2.append("h4").attr("class", "measurement-heading").html(heading);
61275       }
61276       var list = selection2.append("ul");
61277       var coordItem;
61278       if (geometry) {
61279         list.append("li").call(_t.append("info_panels.measurement.geometry", { suffix: ":" })).append("span").html(
61280           closed ? _t.html("info_panels.measurement.closed_" + geometry) : _t.html("geometry." + geometry)
61281         );
61282       }
61283       if (totalNodeCount) {
61284         list.append("li").call(_t.append("info_panels.measurement.node_count", { suffix: ":" })).append("span").text(totalNodeCount.toLocaleString(localeCode));
61285       }
61286       if (area) {
61287         list.append("li").call(_t.append("info_panels.measurement.area", { suffix: ":" })).append("span").text(displayArea(area, _isImperial));
61288       }
61289       if (length2) {
61290         list.append("li").call(_t.append("info_panels.measurement." + (closed ? "perimeter" : "length"), { suffix: ":" })).append("span").text(displayLength(length2, _isImperial));
61291       }
61292       if (typeof distance === "number") {
61293         list.append("li").call(_t.append("info_panels.measurement.distance", { suffix: ":" })).append("span").text(displayLength(distance, _isImperial));
61294       }
61295       if (location) {
61296         coordItem = list.append("li").call(_t.append("info_panels.measurement.location", { suffix: ":" }));
61297         coordItem.append("span").text(dmsCoordinatePair(location));
61298         coordItem.append("span").text(decimalCoordinatePair(location));
61299       }
61300       if (centroid) {
61301         coordItem = list.append("li").call(_t.append("info_panels.measurement.centroid", { suffix: ":" }));
61302         coordItem.append("span").text(dmsCoordinatePair(centroid));
61303         coordItem.append("span").text(decimalCoordinatePair(centroid));
61304       }
61305       if (center) {
61306         coordItem = list.append("li").call(_t.append("info_panels.measurement.center", { suffix: ":" }));
61307         coordItem.append("span").text(dmsCoordinatePair(center));
61308         coordItem.append("span").text(decimalCoordinatePair(center));
61309       }
61310       if (length2 || area || typeof distance === "number") {
61311         var toggle = _isImperial ? "imperial" : "metric";
61312         selection2.append("a").call(_t.append("info_panels.measurement." + toggle)).attr("href", "#").attr("class", "button button-toggle-units").on("click", function(d3_event) {
61313           d3_event.preventDefault();
61314           _isImperial = !_isImperial;
61315           selection2.call(redraw);
61316         });
61317       }
61318     }
61319     var panel = function(selection2) {
61320       selection2.call(redraw);
61321       context.map().on("drawn.info-measurement", function() {
61322         selection2.call(redraw);
61323       });
61324       context.on("enter.info-measurement", function() {
61325         selection2.call(redraw);
61326       });
61327     };
61328     panel.off = function() {
61329       context.map().on("drawn.info-measurement", null);
61330       context.on("enter.info-measurement", null);
61331     };
61332     panel.id = "measurement";
61333     panel.label = _t.append("info_panels.measurement.title");
61334     panel.key = _t("info_panels.measurement.key");
61335     return panel;
61336   }
61337
61338   // modules/ui/panels/index.js
61339   var uiInfoPanels = {
61340     background: uiPanelBackground,
61341     history: uiPanelHistory,
61342     location: uiPanelLocation,
61343     measurement: uiPanelMeasurement
61344   };
61345
61346   // modules/ui/info.js
61347   function uiInfo(context) {
61348     var ids = Object.keys(uiInfoPanels);
61349     var wasActive = ["measurement"];
61350     var panels = {};
61351     var active = {};
61352     ids.forEach(function(k3) {
61353       if (!panels[k3]) {
61354         panels[k3] = uiInfoPanels[k3](context);
61355         active[k3] = false;
61356       }
61357     });
61358     function info(selection2) {
61359       function redraw() {
61360         var activeids = ids.filter(function(k3) {
61361           return active[k3];
61362         }).sort();
61363         var containers = infoPanels.selectAll(".panel-container").data(activeids, function(k3) {
61364           return k3;
61365         });
61366         containers.exit().style("opacity", 1).transition().duration(200).style("opacity", 0).on("end", function(d2) {
61367           select_default2(this).call(panels[d2].off).remove();
61368         });
61369         var enter = containers.enter().append("div").attr("class", function(d2) {
61370           return "fillD2 panel-container panel-container-" + d2;
61371         });
61372         enter.style("opacity", 0).transition().duration(200).style("opacity", 1);
61373         var title = enter.append("div").attr("class", "panel-title fillD2");
61374         title.append("h3").each(function(d2) {
61375           return panels[d2].label(select_default2(this));
61376         });
61377         title.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function(d3_event, d2) {
61378           d3_event.stopImmediatePropagation();
61379           d3_event.preventDefault();
61380           info.toggle(d2);
61381         }).call(svgIcon("#iD-icon-close"));
61382         enter.append("div").attr("class", function(d2) {
61383           return "panel-content panel-content-" + d2;
61384         });
61385         infoPanels.selectAll(".panel-content").each(function(d2) {
61386           select_default2(this).call(panels[d2]);
61387         });
61388       }
61389       info.toggle = function(which) {
61390         var activeids = ids.filter(function(k3) {
61391           return active[k3];
61392         });
61393         if (which) {
61394           active[which] = !active[which];
61395           if (activeids.length === 1 && activeids[0] === which) {
61396             wasActive = [which];
61397           }
61398           context.container().select("." + which + "-panel-toggle-item").classed("active", active[which]).select("input").property("checked", active[which]);
61399         } else {
61400           if (activeids.length) {
61401             wasActive = activeids;
61402             activeids.forEach(function(k3) {
61403               active[k3] = false;
61404             });
61405           } else {
61406             wasActive.forEach(function(k3) {
61407               active[k3] = true;
61408             });
61409           }
61410         }
61411         redraw();
61412       };
61413       var infoPanels = selection2.selectAll(".info-panels").data([0]);
61414       infoPanels = infoPanels.enter().append("div").attr("class", "info-panels").merge(infoPanels);
61415       redraw();
61416       context.keybinding().on(uiCmd("\u2318" + _t("info_panels.key")), function(d3_event) {
61417         if (d3_event.shiftKey) return;
61418         d3_event.stopImmediatePropagation();
61419         d3_event.preventDefault();
61420         info.toggle();
61421       });
61422       ids.forEach(function(k3) {
61423         var key = _t("info_panels." + k3 + ".key", { default: null });
61424         if (!key) return;
61425         context.keybinding().on(uiCmd("\u2318\u21E7" + key), function(d3_event) {
61426           d3_event.stopImmediatePropagation();
61427           d3_event.preventDefault();
61428           info.toggle(k3);
61429         });
61430       });
61431     }
61432     return info;
61433   }
61434
61435   // modules/ui/curtain.js
61436   function uiCurtain(containerNode) {
61437     var surface = select_default2(null), tooltip = select_default2(null), darkness = select_default2(null);
61438     function curtain(selection2) {
61439       surface = selection2.append("svg").attr("class", "curtain").style("top", 0).style("left", 0);
61440       darkness = surface.append("path").attr("x", 0).attr("y", 0).attr("class", "curtain-darkness");
61441       select_default2(window).on("resize.curtain", resize);
61442       tooltip = selection2.append("div").attr("class", "tooltip");
61443       tooltip.append("div").attr("class", "popover-arrow");
61444       tooltip.append("div").attr("class", "popover-inner");
61445       resize();
61446       function resize() {
61447         surface.attr("width", containerNode.clientWidth).attr("height", containerNode.clientHeight);
61448         curtain.cut(darkness.datum());
61449       }
61450     }
61451     curtain.reveal = function(box, html2, options) {
61452       options = options || {};
61453       if (typeof box === "string") {
61454         box = select_default2(box).node();
61455       }
61456       if (box && box.getBoundingClientRect) {
61457         box = copyBox(box.getBoundingClientRect());
61458       }
61459       if (box) {
61460         var containerRect = containerNode.getBoundingClientRect();
61461         box.top -= containerRect.top;
61462         box.left -= containerRect.left;
61463       }
61464       if (box && options.padding) {
61465         box.top -= options.padding;
61466         box.left -= options.padding;
61467         box.bottom += options.padding;
61468         box.right += options.padding;
61469         box.height += options.padding * 2;
61470         box.width += options.padding * 2;
61471       }
61472       var tooltipBox;
61473       if (options.tooltipBox) {
61474         tooltipBox = options.tooltipBox;
61475         if (typeof tooltipBox === "string") {
61476           tooltipBox = select_default2(tooltipBox).node();
61477         }
61478         if (tooltipBox && tooltipBox.getBoundingClientRect) {
61479           tooltipBox = copyBox(tooltipBox.getBoundingClientRect());
61480         }
61481       } else {
61482         tooltipBox = box;
61483       }
61484       if (tooltipBox && html2) {
61485         if (html2.indexOf("**") !== -1) {
61486           if (html2.indexOf("<span") === 0) {
61487             html2 = html2.replace(/^(<span.*?>)(.+?)(\*\*)/, "$1<span>$2</span>$3");
61488           } else {
61489             html2 = html2.replace(/^(.+?)(\*\*)/, "<span>$1</span>$2");
61490           }
61491           html2 = html2.replace(/\*\*(.*?)\*\*/g, '<span class="instruction">$1</span>');
61492         }
61493         html2 = html2.replace(/\*(.*?)\*/g, "<em>$1</em>");
61494         html2 = html2.replace(/\{br\}/g, "<br/><br/>");
61495         if (options.buttonText && options.buttonCallback) {
61496           html2 += '<div class="button-section"><button href="#" class="button action">' + options.buttonText + "</button></div>";
61497         }
61498         var classes = "curtain-tooltip popover tooltip arrowed in " + (options.tooltipClass || "");
61499         tooltip.classed(classes, true).selectAll(".popover-inner").html(html2);
61500         if (options.buttonText && options.buttonCallback) {
61501           var button = tooltip.selectAll(".button-section .button.action");
61502           button.on("click", function(d3_event) {
61503             d3_event.preventDefault();
61504             options.buttonCallback();
61505           });
61506         }
61507         var tip = copyBox(tooltip.node().getBoundingClientRect()), w3 = containerNode.clientWidth, h3 = containerNode.clientHeight, tooltipWidth = 200, tooltipArrow = 5, side, pos;
61508         if (options.tooltipClass === "intro-mouse") {
61509           tip.height += 80;
61510         }
61511         if (tooltipBox.top + tooltipBox.height > h3) {
61512           tooltipBox.height -= tooltipBox.top + tooltipBox.height - h3;
61513         }
61514         if (tooltipBox.left + tooltipBox.width > w3) {
61515           tooltipBox.width -= tooltipBox.left + tooltipBox.width - w3;
61516         }
61517         const onLeftOrRightEdge = tooltipBox.left + tooltipBox.width / 2 > w3 - 100 || tooltipBox.left + tooltipBox.width / 2 < 100;
61518         if (tooltipBox.top + tooltipBox.height < 100 && !onLeftOrRightEdge) {
61519           side = "bottom";
61520           pos = [
61521             tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
61522             tooltipBox.top + tooltipBox.height
61523           ];
61524         } else if (tooltipBox.top > h3 - 140 && !onLeftOrRightEdge) {
61525           side = "top";
61526           pos = [
61527             tooltipBox.left + tooltipBox.width / 2 - tip.width / 2,
61528             tooltipBox.top - tip.height
61529           ];
61530         } else {
61531           var tipY = tooltipBox.top + tooltipBox.height / 2 - tip.height / 2;
61532           if (_mainLocalizer.textDirection() === "rtl") {
61533             if (tooltipBox.left - tooltipWidth - tooltipArrow < 70) {
61534               side = "right";
61535               pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
61536             } else {
61537               side = "left";
61538               pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
61539             }
61540           } else {
61541             if (tooltipBox.left + tooltipBox.width + tooltipArrow + tooltipWidth > w3 - 70) {
61542               side = "left";
61543               pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
61544             } else {
61545               side = "right";
61546               pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
61547             }
61548           }
61549         }
61550         if (options.duration !== 0 || !tooltip.classed(side)) {
61551           tooltip.call(uiToggle(true));
61552         }
61553         tooltip.style("top", pos[1] + "px").style("left", pos[0] + "px").attr("class", classes + " " + side);
61554         var shiftY = 0;
61555         if (side === "left" || side === "right") {
61556           if (pos[1] < 60) {
61557             shiftY = 60 - pos[1];
61558           } else if (pos[1] + tip.height > h3 - 100) {
61559             shiftY = h3 - pos[1] - tip.height - 100;
61560           }
61561         }
61562         tooltip.selectAll(".popover-inner").style("top", shiftY + "px");
61563       } else {
61564         tooltip.classed("in", false).call(uiToggle(false));
61565       }
61566       curtain.cut(box, options.duration);
61567       return tooltip;
61568     };
61569     curtain.cut = function(datum2, duration) {
61570       darkness.datum(datum2).interrupt();
61571       var selection2;
61572       if (duration === 0) {
61573         selection2 = darkness;
61574       } else {
61575         selection2 = darkness.transition().duration(duration || 600).ease(linear2);
61576       }
61577       selection2.attr("d", function(d2) {
61578         var containerWidth = containerNode.clientWidth;
61579         var containerHeight = containerNode.clientHeight;
61580         var string = "M 0,0 L 0," + containerHeight + " L " + containerWidth + "," + containerHeight + "L" + containerWidth + ",0 Z";
61581         if (!d2) return string;
61582         return string + "M" + d2.left + "," + d2.top + "L" + d2.left + "," + (d2.top + d2.height) + "L" + (d2.left + d2.width) + "," + (d2.top + d2.height) + "L" + (d2.left + d2.width) + "," + d2.top + "Z";
61583       });
61584     };
61585     curtain.remove = function() {
61586       surface.remove();
61587       tooltip.remove();
61588       select_default2(window).on("resize.curtain", null);
61589     };
61590     function copyBox(src) {
61591       return {
61592         top: src.top,
61593         right: src.right,
61594         bottom: src.bottom,
61595         left: src.left,
61596         width: src.width,
61597         height: src.height
61598       };
61599     }
61600     return curtain;
61601   }
61602
61603   // modules/ui/intro/welcome.js
61604   function uiIntroWelcome(context, reveal) {
61605     var dispatch12 = dispatch_default("done");
61606     var chapter = {
61607       title: "intro.welcome.title"
61608     };
61609     function welcome() {
61610       context.map().centerZoom([-85.63591, 41.94285], 19);
61611       reveal(
61612         ".intro-nav-wrap .chapter-welcome",
61613         helpHtml("intro.welcome.welcome"),
61614         { buttonText: _t.html("intro.ok"), buttonCallback: practice }
61615       );
61616     }
61617     function practice() {
61618       reveal(
61619         ".intro-nav-wrap .chapter-welcome",
61620         helpHtml("intro.welcome.practice"),
61621         { buttonText: _t.html("intro.ok"), buttonCallback: words }
61622       );
61623     }
61624     function words() {
61625       reveal(
61626         ".intro-nav-wrap .chapter-welcome",
61627         helpHtml("intro.welcome.words"),
61628         { buttonText: _t.html("intro.ok"), buttonCallback: chapters }
61629       );
61630     }
61631     function chapters() {
61632       dispatch12.call("done");
61633       reveal(
61634         ".intro-nav-wrap .chapter-navigation",
61635         helpHtml("intro.welcome.chapters", { next: _t("intro.navigation.title") })
61636       );
61637     }
61638     chapter.enter = function() {
61639       welcome();
61640     };
61641     chapter.exit = function() {
61642       context.container().select(".curtain-tooltip.intro-mouse").selectAll(".counter").remove();
61643     };
61644     chapter.restart = function() {
61645       chapter.exit();
61646       chapter.enter();
61647     };
61648     return utilRebind(chapter, dispatch12, "on");
61649   }
61650
61651   // modules/ui/intro/navigation.js
61652   function uiIntroNavigation(context, reveal) {
61653     var dispatch12 = dispatch_default("done");
61654     var timeouts = [];
61655     var hallId = "n2061";
61656     var townHall = [-85.63591, 41.94285];
61657     var springStreetId = "w397";
61658     var springStreetEndId = "n1834";
61659     var springStreet = [-85.63582, 41.94255];
61660     var onewayField = _mainPresetIndex.field("oneway");
61661     var maxspeedField = _mainPresetIndex.field("maxspeed");
61662     var chapter = {
61663       title: "intro.navigation.title"
61664     };
61665     function timeout2(f2, t2) {
61666       timeouts.push(window.setTimeout(f2, t2));
61667     }
61668     function eventCancel(d3_event) {
61669       d3_event.stopPropagation();
61670       d3_event.preventDefault();
61671     }
61672     function isTownHallSelected() {
61673       var ids = context.selectedIDs();
61674       return ids.length === 1 && ids[0] === hallId;
61675     }
61676     function dragMap() {
61677       context.enter(modeBrowse(context));
61678       context.history().reset("initial");
61679       var msec = transitionTime(townHall, context.map().center());
61680       if (msec) {
61681         reveal(null, null, { duration: 0 });
61682       }
61683       context.map().centerZoomEase(townHall, 19, msec);
61684       timeout2(function() {
61685         var centerStart = context.map().center();
61686         var textId = context.lastPointerType() === "mouse" ? "drag" : "drag_touch";
61687         var dragString = helpHtml("intro.navigation.map_info") + "{br}" + helpHtml("intro.navigation." + textId);
61688         reveal(".main-map .surface", dragString);
61689         context.map().on("drawn.intro", function() {
61690           reveal(".main-map .surface", dragString, { duration: 0 });
61691         });
61692         context.map().on("move.intro", function() {
61693           var centerNow = context.map().center();
61694           if (centerStart[0] !== centerNow[0] || centerStart[1] !== centerNow[1]) {
61695             context.map().on("move.intro", null);
61696             timeout2(function() {
61697               continueTo(zoomMap);
61698             }, 3e3);
61699           }
61700         });
61701       }, msec + 100);
61702       function continueTo(nextStep) {
61703         context.map().on("move.intro drawn.intro", null);
61704         nextStep();
61705       }
61706     }
61707     function zoomMap() {
61708       var zoomStart = context.map().zoom();
61709       var textId = context.lastPointerType() === "mouse" ? "zoom" : "zoom_touch";
61710       var zoomString = helpHtml("intro.navigation." + textId);
61711       reveal(".main-map .surface", zoomString);
61712       context.map().on("drawn.intro", function() {
61713         reveal(".main-map .surface", zoomString, { duration: 0 });
61714       });
61715       context.map().on("move.intro", function() {
61716         if (context.map().zoom() !== zoomStart) {
61717           context.map().on("move.intro", null);
61718           timeout2(function() {
61719             continueTo(features);
61720           }, 3e3);
61721         }
61722       });
61723       function continueTo(nextStep) {
61724         context.map().on("move.intro drawn.intro", null);
61725         nextStep();
61726       }
61727     }
61728     function features() {
61729       var onClick = function() {
61730         continueTo(pointsLinesAreas);
61731       };
61732       reveal(
61733         ".main-map .surface",
61734         helpHtml("intro.navigation.features"),
61735         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61736       );
61737       context.map().on("drawn.intro", function() {
61738         reveal(
61739           ".main-map .surface",
61740           helpHtml("intro.navigation.features"),
61741           { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61742         );
61743       });
61744       function continueTo(nextStep) {
61745         context.map().on("drawn.intro", null);
61746         nextStep();
61747       }
61748     }
61749     function pointsLinesAreas() {
61750       var onClick = function() {
61751         continueTo(nodesWays);
61752       };
61753       reveal(
61754         ".main-map .surface",
61755         helpHtml("intro.navigation.points_lines_areas"),
61756         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61757       );
61758       context.map().on("drawn.intro", function() {
61759         reveal(
61760           ".main-map .surface",
61761           helpHtml("intro.navigation.points_lines_areas"),
61762           { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61763         );
61764       });
61765       function continueTo(nextStep) {
61766         context.map().on("drawn.intro", null);
61767         nextStep();
61768       }
61769     }
61770     function nodesWays() {
61771       var onClick = function() {
61772         continueTo(clickTownHall);
61773       };
61774       reveal(
61775         ".main-map .surface",
61776         helpHtml("intro.navigation.nodes_ways"),
61777         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61778       );
61779       context.map().on("drawn.intro", function() {
61780         reveal(
61781           ".main-map .surface",
61782           helpHtml("intro.navigation.nodes_ways"),
61783           { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61784         );
61785       });
61786       function continueTo(nextStep) {
61787         context.map().on("drawn.intro", null);
61788         nextStep();
61789       }
61790     }
61791     function clickTownHall() {
61792       context.enter(modeBrowse(context));
61793       context.history().reset("initial");
61794       var entity = context.hasEntity(hallId);
61795       if (!entity) return;
61796       reveal(null, null, { duration: 0 });
61797       context.map().centerZoomEase(entity.loc, 19, 500);
61798       timeout2(function() {
61799         var entity2 = context.hasEntity(hallId);
61800         if (!entity2) return;
61801         var box = pointBox(entity2.loc, context);
61802         var textId = context.lastPointerType() === "mouse" ? "click_townhall" : "tap_townhall";
61803         reveal(box, helpHtml("intro.navigation." + textId));
61804         context.map().on("move.intro drawn.intro", function() {
61805           var entity3 = context.hasEntity(hallId);
61806           if (!entity3) return;
61807           var box2 = pointBox(entity3.loc, context);
61808           reveal(box2, helpHtml("intro.navigation." + textId), { duration: 0 });
61809         });
61810         context.on("enter.intro", function() {
61811           if (isTownHallSelected()) continueTo(selectedTownHall);
61812         });
61813       }, 550);
61814       context.history().on("change.intro", function() {
61815         if (!context.hasEntity(hallId)) {
61816           continueTo(clickTownHall);
61817         }
61818       });
61819       function continueTo(nextStep) {
61820         context.on("enter.intro", null);
61821         context.map().on("move.intro drawn.intro", null);
61822         context.history().on("change.intro", null);
61823         nextStep();
61824       }
61825     }
61826     function selectedTownHall() {
61827       if (!isTownHallSelected()) return clickTownHall();
61828       var entity = context.hasEntity(hallId);
61829       if (!entity) return clickTownHall();
61830       var box = pointBox(entity.loc, context);
61831       var onClick = function() {
61832         continueTo(editorTownHall);
61833       };
61834       reveal(
61835         box,
61836         helpHtml("intro.navigation.selected_townhall"),
61837         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61838       );
61839       context.map().on("move.intro drawn.intro", function() {
61840         var entity2 = context.hasEntity(hallId);
61841         if (!entity2) return;
61842         var box2 = pointBox(entity2.loc, context);
61843         reveal(
61844           box2,
61845           helpHtml("intro.navigation.selected_townhall"),
61846           { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61847         );
61848       });
61849       context.history().on("change.intro", function() {
61850         if (!context.hasEntity(hallId)) {
61851           continueTo(clickTownHall);
61852         }
61853       });
61854       function continueTo(nextStep) {
61855         context.map().on("move.intro drawn.intro", null);
61856         context.history().on("change.intro", null);
61857         nextStep();
61858       }
61859     }
61860     function editorTownHall() {
61861       if (!isTownHallSelected()) return clickTownHall();
61862       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
61863       var onClick = function() {
61864         continueTo(presetTownHall);
61865       };
61866       reveal(
61867         ".entity-editor-pane",
61868         helpHtml("intro.navigation.editor_townhall"),
61869         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61870       );
61871       context.on("exit.intro", function() {
61872         continueTo(clickTownHall);
61873       });
61874       context.history().on("change.intro", function() {
61875         if (!context.hasEntity(hallId)) {
61876           continueTo(clickTownHall);
61877         }
61878       });
61879       function continueTo(nextStep) {
61880         context.on("exit.intro", null);
61881         context.history().on("change.intro", null);
61882         context.container().select(".inspector-wrap").on("wheel.intro", null);
61883         nextStep();
61884       }
61885     }
61886     function presetTownHall() {
61887       if (!isTownHallSelected()) return clickTownHall();
61888       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
61889       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
61890       var entity = context.entity(context.selectedIDs()[0]);
61891       var preset = _mainPresetIndex.match(entity, context.graph());
61892       var onClick = function() {
61893         continueTo(fieldsTownHall);
61894       };
61895       reveal(
61896         ".entity-editor-pane .section-feature-type",
61897         helpHtml("intro.navigation.preset_townhall", { preset: preset.name() }),
61898         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61899       );
61900       context.on("exit.intro", function() {
61901         continueTo(clickTownHall);
61902       });
61903       context.history().on("change.intro", function() {
61904         if (!context.hasEntity(hallId)) {
61905           continueTo(clickTownHall);
61906         }
61907       });
61908       function continueTo(nextStep) {
61909         context.on("exit.intro", null);
61910         context.history().on("change.intro", null);
61911         context.container().select(".inspector-wrap").on("wheel.intro", null);
61912         nextStep();
61913       }
61914     }
61915     function fieldsTownHall() {
61916       if (!isTownHallSelected()) return clickTownHall();
61917       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
61918       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
61919       var onClick = function() {
61920         continueTo(closeTownHall);
61921       };
61922       reveal(
61923         ".entity-editor-pane .section-preset-fields",
61924         helpHtml("intro.navigation.fields_townhall"),
61925         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
61926       );
61927       context.on("exit.intro", function() {
61928         continueTo(clickTownHall);
61929       });
61930       context.history().on("change.intro", function() {
61931         if (!context.hasEntity(hallId)) {
61932           continueTo(clickTownHall);
61933         }
61934       });
61935       function continueTo(nextStep) {
61936         context.on("exit.intro", null);
61937         context.history().on("change.intro", null);
61938         context.container().select(".inspector-wrap").on("wheel.intro", null);
61939         nextStep();
61940       }
61941     }
61942     function closeTownHall() {
61943       if (!isTownHallSelected()) return clickTownHall();
61944       var selector = ".entity-editor-pane button.close svg use";
61945       var href = select_default2(selector).attr("href") || "#iD-icon-close";
61946       reveal(
61947         ".entity-editor-pane",
61948         helpHtml("intro.navigation.close_townhall", { button: { html: icon(href, "inline") } })
61949       );
61950       context.on("exit.intro", function() {
61951         continueTo(searchStreet);
61952       });
61953       context.history().on("change.intro", function() {
61954         var selector2 = ".entity-editor-pane button.close svg use";
61955         var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
61956         reveal(
61957           ".entity-editor-pane",
61958           helpHtml("intro.navigation.close_townhall", { button: { html: icon(href2, "inline") } }),
61959           { duration: 0 }
61960         );
61961       });
61962       function continueTo(nextStep) {
61963         context.on("exit.intro", null);
61964         context.history().on("change.intro", null);
61965         nextStep();
61966       }
61967     }
61968     function searchStreet() {
61969       context.enter(modeBrowse(context));
61970       context.history().reset("initial");
61971       var msec = transitionTime(springStreet, context.map().center());
61972       if (msec) {
61973         reveal(null, null, { duration: 0 });
61974       }
61975       context.map().centerZoomEase(springStreet, 19, msec);
61976       timeout2(function() {
61977         reveal(
61978           ".search-header input",
61979           helpHtml("intro.navigation.search_street", { name: _t("intro.graph.name.spring-street") })
61980         );
61981         context.container().select(".search-header input").on("keyup.intro", checkSearchResult);
61982       }, msec + 100);
61983     }
61984     function checkSearchResult() {
61985       var first = context.container().select(".feature-list-item:nth-child(0n+2)");
61986       var firstName = first.select(".entity-name");
61987       var name = _t("intro.graph.name.spring-street");
61988       if (!firstName.empty() && firstName.html() === name) {
61989         reveal(
61990           first.node(),
61991           helpHtml("intro.navigation.choose_street", { name }),
61992           { duration: 300 }
61993         );
61994         context.on("exit.intro", function() {
61995           continueTo(selectedStreet);
61996         });
61997         context.container().select(".search-header input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
61998       }
61999       function continueTo(nextStep) {
62000         context.on("exit.intro", null);
62001         context.container().select(".search-header input").on("keydown.intro", null).on("keyup.intro", null);
62002         nextStep();
62003       }
62004     }
62005     function selectedStreet() {
62006       if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
62007         return searchStreet();
62008       }
62009       var onClick = function() {
62010         continueTo(editorStreet);
62011       };
62012       var entity = context.entity(springStreetEndId);
62013       var box = pointBox(entity.loc, context);
62014       box.height = 500;
62015       reveal(
62016         box,
62017         helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
62018         { duration: 600, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
62019       );
62020       timeout2(function() {
62021         context.map().on("move.intro drawn.intro", function() {
62022           var entity2 = context.hasEntity(springStreetEndId);
62023           if (!entity2) return;
62024           var box2 = pointBox(entity2.loc, context);
62025           box2.height = 500;
62026           reveal(
62027             box2,
62028             helpHtml("intro.navigation.selected_street", { name: _t("intro.graph.name.spring-street") }),
62029             { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
62030           );
62031         });
62032       }, 600);
62033       context.on("enter.intro", function(mode) {
62034         if (!context.hasEntity(springStreetId)) {
62035           return continueTo(searchStreet);
62036         }
62037         var ids = context.selectedIDs();
62038         if (mode.id !== "select" || !ids.length || ids[0] !== springStreetId) {
62039           context.enter(modeSelect(context, [springStreetId]));
62040         }
62041       });
62042       context.history().on("change.intro", function() {
62043         if (!context.hasEntity(springStreetEndId) || !context.hasEntity(springStreetId)) {
62044           timeout2(function() {
62045             continueTo(searchStreet);
62046           }, 300);
62047         }
62048       });
62049       function continueTo(nextStep) {
62050         context.map().on("move.intro drawn.intro", null);
62051         context.on("enter.intro", null);
62052         context.history().on("change.intro", null);
62053         nextStep();
62054       }
62055     }
62056     function editorStreet() {
62057       var selector = ".entity-editor-pane button.close svg use";
62058       var href = select_default2(selector).attr("href") || "#iD-icon-close";
62059       reveal(".entity-editor-pane", helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
62060         button: { html: icon(href, "inline") },
62061         field1: onewayField.title(),
62062         field2: maxspeedField.title()
62063       }));
62064       context.on("exit.intro", function() {
62065         continueTo(play);
62066       });
62067       context.history().on("change.intro", function() {
62068         var selector2 = ".entity-editor-pane button.close svg use";
62069         var href2 = select_default2(selector2).attr("href") || "#iD-icon-close";
62070         reveal(
62071           ".entity-editor-pane",
62072           helpHtml("intro.navigation.street_different_fields") + "{br}" + helpHtml("intro.navigation.editor_street", {
62073             button: { html: icon(href2, "inline") },
62074             field1: onewayField.title(),
62075             field2: maxspeedField.title()
62076           }),
62077           { duration: 0 }
62078         );
62079       });
62080       function continueTo(nextStep) {
62081         context.on("exit.intro", null);
62082         context.history().on("change.intro", null);
62083         nextStep();
62084       }
62085     }
62086     function play() {
62087       dispatch12.call("done");
62088       reveal(
62089         ".ideditor",
62090         helpHtml("intro.navigation.play", { next: _t("intro.points.title") }),
62091         {
62092           tooltipBox: ".intro-nav-wrap .chapter-point",
62093           buttonText: _t.html("intro.ok"),
62094           buttonCallback: function() {
62095             reveal(".ideditor");
62096           }
62097         }
62098       );
62099     }
62100     chapter.enter = function() {
62101       dragMap();
62102     };
62103     chapter.exit = function() {
62104       timeouts.forEach(window.clearTimeout);
62105       context.on("enter.intro exit.intro", null);
62106       context.map().on("move.intro drawn.intro", null);
62107       context.history().on("change.intro", null);
62108       context.container().select(".inspector-wrap").on("wheel.intro", null);
62109       context.container().select(".search-header input").on("keydown.intro keyup.intro", null);
62110     };
62111     chapter.restart = function() {
62112       chapter.exit();
62113       chapter.enter();
62114     };
62115     return utilRebind(chapter, dispatch12, "on");
62116   }
62117
62118   // modules/ui/intro/point.js
62119   function uiIntroPoint(context, reveal) {
62120     var dispatch12 = dispatch_default("done");
62121     var timeouts = [];
62122     var intersection2 = [-85.63279, 41.94394];
62123     var building = [-85.632422, 41.944045];
62124     var cafePreset = _mainPresetIndex.item("amenity/cafe");
62125     var _pointID = null;
62126     var chapter = {
62127       title: "intro.points.title"
62128     };
62129     function timeout2(f2, t2) {
62130       timeouts.push(window.setTimeout(f2, t2));
62131     }
62132     function eventCancel(d3_event) {
62133       d3_event.stopPropagation();
62134       d3_event.preventDefault();
62135     }
62136     function addPoint() {
62137       context.enter(modeBrowse(context));
62138       context.history().reset("initial");
62139       var msec = transitionTime(intersection2, context.map().center());
62140       if (msec) {
62141         reveal(null, null, { duration: 0 });
62142       }
62143       context.map().centerZoomEase(intersection2, 19, msec);
62144       timeout2(function() {
62145         var tooltip = reveal(
62146           "button.add-point",
62147           helpHtml("intro.points.points_info") + "{br}" + helpHtml("intro.points.add_point")
62148         );
62149         _pointID = null;
62150         tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-points");
62151         context.on("enter.intro", function(mode) {
62152           if (mode.id !== "add-point") return;
62153           continueTo(placePoint);
62154         });
62155       }, msec + 100);
62156       function continueTo(nextStep) {
62157         context.on("enter.intro", null);
62158         nextStep();
62159       }
62160     }
62161     function placePoint() {
62162       if (context.mode().id !== "add-point") {
62163         return chapter.restart();
62164       }
62165       var pointBox2 = pad(building, 150, context);
62166       var textId = context.lastPointerType() === "mouse" ? "place_point" : "place_point_touch";
62167       reveal(pointBox2, helpHtml("intro.points." + textId));
62168       context.map().on("move.intro drawn.intro", function() {
62169         pointBox2 = pad(building, 150, context);
62170         reveal(pointBox2, helpHtml("intro.points." + textId), { duration: 0 });
62171       });
62172       context.on("enter.intro", function(mode) {
62173         if (mode.id !== "select") return chapter.restart();
62174         _pointID = context.mode().selectedIDs()[0];
62175         if (context.graph().geometry(_pointID) === "vertex") {
62176           context.map().on("move.intro drawn.intro", null);
62177           context.on("enter.intro", null);
62178           reveal(pointBox2, helpHtml("intro.points.place_point_error"), {
62179             buttonText: _t.html("intro.ok"),
62180             buttonCallback: function() {
62181               return chapter.restart();
62182             }
62183           });
62184         } else {
62185           continueTo(searchPreset);
62186         }
62187       });
62188       function continueTo(nextStep) {
62189         context.map().on("move.intro drawn.intro", null);
62190         context.on("enter.intro", null);
62191         nextStep();
62192       }
62193     }
62194     function searchPreset() {
62195       if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
62196         return addPoint();
62197       }
62198       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
62199       context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
62200       reveal(
62201         ".preset-search-input",
62202         helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
62203       );
62204       context.on("enter.intro", function(mode) {
62205         if (!_pointID || !context.hasEntity(_pointID)) {
62206           return continueTo(addPoint);
62207         }
62208         var ids = context.selectedIDs();
62209         if (mode.id !== "select" || !ids.length || ids[0] !== _pointID) {
62210           context.enter(modeSelect(context, [_pointID]));
62211           context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
62212           context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
62213           reveal(
62214             ".preset-search-input",
62215             helpHtml("intro.points.search_cafe", { preset: cafePreset.name() })
62216           );
62217           context.history().on("change.intro", null);
62218         }
62219       });
62220       function checkPresetSearch() {
62221         var first = context.container().select(".preset-list-item:first-child");
62222         if (first.classed("preset-amenity-cafe")) {
62223           context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
62224           reveal(
62225             first.select(".preset-list-button").node(),
62226             helpHtml("intro.points.choose_cafe", { preset: cafePreset.name() }),
62227             { duration: 300 }
62228           );
62229           context.history().on("change.intro", function() {
62230             continueTo(aboutFeatureEditor);
62231           });
62232         }
62233       }
62234       function continueTo(nextStep) {
62235         context.on("enter.intro", null);
62236         context.history().on("change.intro", null);
62237         context.container().select(".inspector-wrap").on("wheel.intro", null);
62238         context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
62239         nextStep();
62240       }
62241     }
62242     function aboutFeatureEditor() {
62243       if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
62244         return addPoint();
62245       }
62246       timeout2(function() {
62247         reveal(".entity-editor-pane", helpHtml("intro.points.feature_editor"), {
62248           tooltipClass: "intro-points-describe",
62249           buttonText: _t.html("intro.ok"),
62250           buttonCallback: function() {
62251             continueTo(addName);
62252           }
62253         });
62254       }, 400);
62255       context.on("exit.intro", function() {
62256         continueTo(reselectPoint);
62257       });
62258       function continueTo(nextStep) {
62259         context.on("exit.intro", null);
62260         nextStep();
62261       }
62262     }
62263     function addName() {
62264       if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
62265         return addPoint();
62266       }
62267       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
62268       var addNameString = helpHtml("intro.points.fields_info") + "{br}" + helpHtml("intro.points.add_name") + "{br}" + helpHtml("intro.points.add_reminder");
62269       timeout2(function() {
62270         var entity = context.entity(_pointID);
62271         if (entity.tags.name) {
62272           var tooltip = reveal(".entity-editor-pane", addNameString, {
62273             tooltipClass: "intro-points-describe",
62274             buttonText: _t.html("intro.ok"),
62275             buttonCallback: function() {
62276               continueTo(addCloseEditor);
62277             }
62278           });
62279           tooltip.select(".instruction").style("display", "none");
62280         } else {
62281           reveal(
62282             ".entity-editor-pane",
62283             addNameString,
62284             { tooltipClass: "intro-points-describe" }
62285           );
62286         }
62287       }, 400);
62288       context.history().on("change.intro", function() {
62289         continueTo(addCloseEditor);
62290       });
62291       context.on("exit.intro", function() {
62292         continueTo(reselectPoint);
62293       });
62294       function continueTo(nextStep) {
62295         context.on("exit.intro", null);
62296         context.history().on("change.intro", null);
62297         nextStep();
62298       }
62299     }
62300     function addCloseEditor() {
62301       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
62302       var selector = ".entity-editor-pane button.close svg use";
62303       var href = select_default2(selector).attr("href") || "#iD-icon-close";
62304       context.on("exit.intro", function() {
62305         continueTo(reselectPoint);
62306       });
62307       reveal(
62308         ".entity-editor-pane",
62309         helpHtml("intro.points.add_close", { button: { html: icon(href, "inline") } })
62310       );
62311       function continueTo(nextStep) {
62312         context.on("exit.intro", null);
62313         nextStep();
62314       }
62315     }
62316     function reselectPoint() {
62317       if (!_pointID) return chapter.restart();
62318       var entity = context.hasEntity(_pointID);
62319       if (!entity) return chapter.restart();
62320       var oldPreset = _mainPresetIndex.match(entity, context.graph());
62321       context.replace(actionChangePreset(_pointID, oldPreset, cafePreset));
62322       context.enter(modeBrowse(context));
62323       var msec = transitionTime(entity.loc, context.map().center());
62324       if (msec) {
62325         reveal(null, null, { duration: 0 });
62326       }
62327       context.map().centerEase(entity.loc, msec);
62328       timeout2(function() {
62329         var box = pointBox(entity.loc, context);
62330         reveal(box, helpHtml("intro.points.reselect"), { duration: 600 });
62331         timeout2(function() {
62332           context.map().on("move.intro drawn.intro", function() {
62333             var entity2 = context.hasEntity(_pointID);
62334             if (!entity2) return chapter.restart();
62335             var box2 = pointBox(entity2.loc, context);
62336             reveal(box2, helpHtml("intro.points.reselect"), { duration: 0 });
62337           });
62338         }, 600);
62339         context.on("enter.intro", function(mode) {
62340           if (mode.id !== "select") return;
62341           continueTo(updatePoint);
62342         });
62343       }, msec + 100);
62344       function continueTo(nextStep) {
62345         context.map().on("move.intro drawn.intro", null);
62346         context.on("enter.intro", null);
62347         nextStep();
62348       }
62349     }
62350     function updatePoint() {
62351       if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
62352         return continueTo(reselectPoint);
62353       }
62354       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
62355       context.on("exit.intro", function() {
62356         continueTo(reselectPoint);
62357       });
62358       context.history().on("change.intro", function() {
62359         continueTo(updateCloseEditor);
62360       });
62361       timeout2(function() {
62362         reveal(
62363           ".entity-editor-pane",
62364           helpHtml("intro.points.update"),
62365           { tooltipClass: "intro-points-describe" }
62366         );
62367       }, 400);
62368       function continueTo(nextStep) {
62369         context.on("exit.intro", null);
62370         context.history().on("change.intro", null);
62371         nextStep();
62372       }
62373     }
62374     function updateCloseEditor() {
62375       if (context.mode().id !== "select" || !_pointID || !context.hasEntity(_pointID)) {
62376         return continueTo(reselectPoint);
62377       }
62378       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
62379       context.on("exit.intro", function() {
62380         continueTo(rightClickPoint);
62381       });
62382       timeout2(function() {
62383         reveal(
62384           ".entity-editor-pane",
62385           helpHtml("intro.points.update_close", { button: { html: icon("#iD-icon-close", "inline") } })
62386         );
62387       }, 500);
62388       function continueTo(nextStep) {
62389         context.on("exit.intro", null);
62390         nextStep();
62391       }
62392     }
62393     function rightClickPoint() {
62394       if (!_pointID) return chapter.restart();
62395       var entity = context.hasEntity(_pointID);
62396       if (!entity) return chapter.restart();
62397       context.enter(modeBrowse(context));
62398       var box = pointBox(entity.loc, context);
62399       var textId = context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch";
62400       reveal(box, helpHtml("intro.points." + textId), { duration: 600 });
62401       timeout2(function() {
62402         context.map().on("move.intro", function() {
62403           var entity2 = context.hasEntity(_pointID);
62404           if (!entity2) return chapter.restart();
62405           var box2 = pointBox(entity2.loc, context);
62406           reveal(box2, helpHtml("intro.points." + textId), { duration: 0 });
62407         });
62408       }, 600);
62409       context.on("enter.intro", function(mode) {
62410         if (mode.id !== "select") return;
62411         var ids = context.selectedIDs();
62412         if (ids.length !== 1 || ids[0] !== _pointID) return;
62413         timeout2(function() {
62414           var node = selectMenuItem(context, "delete").node();
62415           if (!node) return;
62416           continueTo(enterDelete);
62417         }, 50);
62418       });
62419       function continueTo(nextStep) {
62420         context.on("enter.intro", null);
62421         context.map().on("move.intro", null);
62422         nextStep();
62423       }
62424     }
62425     function enterDelete() {
62426       if (!_pointID) return chapter.restart();
62427       var entity = context.hasEntity(_pointID);
62428       if (!entity) return chapter.restart();
62429       var node = selectMenuItem(context, "delete").node();
62430       if (!node) {
62431         return continueTo(rightClickPoint);
62432       }
62433       reveal(
62434         ".edit-menu",
62435         helpHtml("intro.points.delete"),
62436         { padding: 50 }
62437       );
62438       timeout2(function() {
62439         context.map().on("move.intro", function() {
62440           if (selectMenuItem(context, "delete").empty()) {
62441             return continueTo(rightClickPoint);
62442           }
62443           reveal(
62444             ".edit-menu",
62445             helpHtml("intro.points.delete"),
62446             { duration: 0, padding: 50 }
62447           );
62448         });
62449       }, 300);
62450       context.on("exit.intro", function() {
62451         if (!_pointID) return chapter.restart();
62452         var entity2 = context.hasEntity(_pointID);
62453         if (entity2) return continueTo(rightClickPoint);
62454       });
62455       context.history().on("change.intro", function(changed) {
62456         if (changed.deleted().length) {
62457           continueTo(undo);
62458         }
62459       });
62460       function continueTo(nextStep) {
62461         context.map().on("move.intro", null);
62462         context.history().on("change.intro", null);
62463         context.on("exit.intro", null);
62464         nextStep();
62465       }
62466     }
62467     function undo() {
62468       context.history().on("change.intro", function() {
62469         continueTo(play);
62470       });
62471       reveal(
62472         ".top-toolbar button.undo-button",
62473         helpHtml("intro.points.undo")
62474       );
62475       function continueTo(nextStep) {
62476         context.history().on("change.intro", null);
62477         nextStep();
62478       }
62479     }
62480     function play() {
62481       dispatch12.call("done");
62482       reveal(
62483         ".ideditor",
62484         helpHtml("intro.points.play", { next: _t("intro.areas.title") }),
62485         {
62486           tooltipBox: ".intro-nav-wrap .chapter-area",
62487           buttonText: _t.html("intro.ok"),
62488           buttonCallback: function() {
62489             reveal(".ideditor");
62490           }
62491         }
62492       );
62493     }
62494     chapter.enter = function() {
62495       addPoint();
62496     };
62497     chapter.exit = function() {
62498       timeouts.forEach(window.clearTimeout);
62499       context.on("enter.intro exit.intro", null);
62500       context.map().on("move.intro drawn.intro", null);
62501       context.history().on("change.intro", null);
62502       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
62503       context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
62504     };
62505     chapter.restart = function() {
62506       chapter.exit();
62507       chapter.enter();
62508     };
62509     return utilRebind(chapter, dispatch12, "on");
62510   }
62511
62512   // modules/ui/intro/area.js
62513   function uiIntroArea(context, reveal) {
62514     var dispatch12 = dispatch_default("done");
62515     var playground = [-85.63552, 41.94159];
62516     var playgroundPreset = _mainPresetIndex.item("leisure/playground");
62517     var nameField = _mainPresetIndex.field("name");
62518     var descriptionField = _mainPresetIndex.field("description");
62519     var timeouts = [];
62520     var _areaID;
62521     var chapter = {
62522       title: "intro.areas.title"
62523     };
62524     function timeout2(f2, t2) {
62525       timeouts.push(window.setTimeout(f2, t2));
62526     }
62527     function eventCancel(d3_event) {
62528       d3_event.stopPropagation();
62529       d3_event.preventDefault();
62530     }
62531     function revealPlayground(center, text, options) {
62532       var padding = 180 * Math.pow(2, context.map().zoom() - 19.5);
62533       var box = pad(center, padding, context);
62534       reveal(box, text, options);
62535     }
62536     function addArea() {
62537       context.enter(modeBrowse(context));
62538       context.history().reset("initial");
62539       _areaID = null;
62540       var msec = transitionTime(playground, context.map().center());
62541       if (msec) {
62542         reveal(null, null, { duration: 0 });
62543       }
62544       context.map().centerZoomEase(playground, 19, msec);
62545       timeout2(function() {
62546         var tooltip = reveal(
62547           "button.add-area",
62548           helpHtml("intro.areas.add_playground")
62549         );
62550         tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-areas");
62551         context.on("enter.intro", function(mode) {
62552           if (mode.id !== "add-area") return;
62553           continueTo(startPlayground);
62554         });
62555       }, msec + 100);
62556       function continueTo(nextStep) {
62557         context.on("enter.intro", null);
62558         nextStep();
62559       }
62560     }
62561     function startPlayground() {
62562       if (context.mode().id !== "add-area") {
62563         return chapter.restart();
62564       }
62565       _areaID = null;
62566       context.map().zoomEase(19.5, 500);
62567       timeout2(function() {
62568         var textId = context.lastPointerType() === "mouse" ? "starting_node_click" : "starting_node_tap";
62569         var startDrawString = helpHtml("intro.areas.start_playground") + helpHtml("intro.areas." + textId);
62570         revealPlayground(
62571           playground,
62572           startDrawString,
62573           { duration: 250 }
62574         );
62575         timeout2(function() {
62576           context.map().on("move.intro drawn.intro", function() {
62577             revealPlayground(
62578               playground,
62579               startDrawString,
62580               { duration: 0 }
62581             );
62582           });
62583           context.on("enter.intro", function(mode) {
62584             if (mode.id !== "draw-area") return chapter.restart();
62585             continueTo(continuePlayground);
62586           });
62587         }, 250);
62588       }, 550);
62589       function continueTo(nextStep) {
62590         context.map().on("move.intro drawn.intro", null);
62591         context.on("enter.intro", null);
62592         nextStep();
62593       }
62594     }
62595     function continuePlayground() {
62596       if (context.mode().id !== "draw-area") {
62597         return chapter.restart();
62598       }
62599       _areaID = null;
62600       revealPlayground(
62601         playground,
62602         helpHtml("intro.areas.continue_playground"),
62603         { duration: 250 }
62604       );
62605       timeout2(function() {
62606         context.map().on("move.intro drawn.intro", function() {
62607           revealPlayground(
62608             playground,
62609             helpHtml("intro.areas.continue_playground"),
62610             { duration: 0 }
62611           );
62612         });
62613       }, 250);
62614       context.on("enter.intro", function(mode) {
62615         if (mode.id === "draw-area") {
62616           var entity = context.hasEntity(context.selectedIDs()[0]);
62617           if (entity && entity.nodes.length >= 6) {
62618             return continueTo(finishPlayground);
62619           } else {
62620             return;
62621           }
62622         } else if (mode.id === "select") {
62623           _areaID = context.selectedIDs()[0];
62624           return continueTo(searchPresets);
62625         } else {
62626           return chapter.restart();
62627         }
62628       });
62629       function continueTo(nextStep) {
62630         context.map().on("move.intro drawn.intro", null);
62631         context.on("enter.intro", null);
62632         nextStep();
62633       }
62634     }
62635     function finishPlayground() {
62636       if (context.mode().id !== "draw-area") {
62637         return chapter.restart();
62638       }
62639       _areaID = null;
62640       var finishString = helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.areas.finish_playground");
62641       revealPlayground(
62642         playground,
62643         finishString,
62644         { duration: 250 }
62645       );
62646       timeout2(function() {
62647         context.map().on("move.intro drawn.intro", function() {
62648           revealPlayground(
62649             playground,
62650             finishString,
62651             { duration: 0 }
62652           );
62653         });
62654       }, 250);
62655       context.on("enter.intro", function(mode) {
62656         if (mode.id === "draw-area") {
62657           return;
62658         } else if (mode.id === "select") {
62659           _areaID = context.selectedIDs()[0];
62660           return continueTo(searchPresets);
62661         } else {
62662           return chapter.restart();
62663         }
62664       });
62665       function continueTo(nextStep) {
62666         context.map().on("move.intro drawn.intro", null);
62667         context.on("enter.intro", null);
62668         nextStep();
62669       }
62670     }
62671     function searchPresets() {
62672       if (!_areaID || !context.hasEntity(_areaID)) {
62673         return addArea();
62674       }
62675       var ids = context.selectedIDs();
62676       if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
62677         context.enter(modeSelect(context, [_areaID]));
62678       }
62679       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
62680       timeout2(function() {
62681         context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
62682         context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
62683         reveal(
62684           ".preset-search-input",
62685           helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
62686         );
62687       }, 400);
62688       context.on("enter.intro", function(mode) {
62689         if (!_areaID || !context.hasEntity(_areaID)) {
62690           return continueTo(addArea);
62691         }
62692         var ids2 = context.selectedIDs();
62693         if (mode.id !== "select" || !ids2.length || ids2[0] !== _areaID) {
62694           context.enter(modeSelect(context, [_areaID]));
62695           context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
62696           context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
62697           context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
62698           reveal(
62699             ".preset-search-input",
62700             helpHtml("intro.areas.search_playground", { preset: playgroundPreset.name() })
62701           );
62702           context.history().on("change.intro", null);
62703         }
62704       });
62705       function checkPresetSearch() {
62706         var first = context.container().select(".preset-list-item:first-child");
62707         if (first.classed("preset-leisure-playground")) {
62708           reveal(
62709             first.select(".preset-list-button").node(),
62710             helpHtml("intro.areas.choose_playground", { preset: playgroundPreset.name() }),
62711             { duration: 300 }
62712           );
62713           context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
62714           context.history().on("change.intro", function() {
62715             continueTo(clickAddField);
62716           });
62717         }
62718       }
62719       function continueTo(nextStep) {
62720         context.container().select(".inspector-wrap").on("wheel.intro", null);
62721         context.on("enter.intro", null);
62722         context.history().on("change.intro", null);
62723         context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
62724         nextStep();
62725       }
62726     }
62727     function clickAddField() {
62728       if (!_areaID || !context.hasEntity(_areaID)) {
62729         return addArea();
62730       }
62731       var ids = context.selectedIDs();
62732       if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
62733         return searchPresets();
62734       }
62735       if (!context.container().select(".form-field-description").empty()) {
62736         return continueTo(describePlayground);
62737       }
62738       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
62739       timeout2(function() {
62740         context.container().select(".inspector-wrap .panewrap").style("right", "0%");
62741         var entity = context.entity(_areaID);
62742         if (entity.tags.description) {
62743           return continueTo(play);
62744         }
62745         var box = context.container().select(".more-fields").node().getBoundingClientRect();
62746         if (box.top > 300) {
62747           var pane = context.container().select(".entity-editor-pane .inspector-body");
62748           var start2 = pane.node().scrollTop;
62749           var end = start2 + (box.top - 300);
62750           pane.transition().duration(250).tween("scroll.inspector", function() {
62751             var node = this;
62752             var i3 = number_default(start2, end);
62753             return function(t2) {
62754               node.scrollTop = i3(t2);
62755             };
62756           });
62757         }
62758         timeout2(function() {
62759           reveal(
62760             ".more-fields .combobox-input",
62761             helpHtml("intro.areas.add_field", {
62762               name: nameField.title(),
62763               description: descriptionField.title()
62764             }),
62765             { duration: 300 }
62766           );
62767           context.container().select(".more-fields .combobox-input").on("click.intro", function() {
62768             var watcher;
62769             watcher = window.setInterval(function() {
62770               if (!context.container().select("div.combobox").empty()) {
62771                 window.clearInterval(watcher);
62772                 continueTo(chooseDescriptionField);
62773               }
62774             }, 300);
62775           });
62776         }, 300);
62777       }, 400);
62778       context.on("exit.intro", function() {
62779         return continueTo(searchPresets);
62780       });
62781       function continueTo(nextStep) {
62782         context.container().select(".inspector-wrap").on("wheel.intro", null);
62783         context.container().select(".more-fields .combobox-input").on("click.intro", null);
62784         context.on("exit.intro", null);
62785         nextStep();
62786       }
62787     }
62788     function chooseDescriptionField() {
62789       if (!_areaID || !context.hasEntity(_areaID)) {
62790         return addArea();
62791       }
62792       var ids = context.selectedIDs();
62793       if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
62794         return searchPresets();
62795       }
62796       if (!context.container().select(".form-field-description").empty()) {
62797         return continueTo(describePlayground);
62798       }
62799       if (context.container().select("div.combobox").empty()) {
62800         return continueTo(clickAddField);
62801       }
62802       var watcher;
62803       watcher = window.setInterval(function() {
62804         if (context.container().select("div.combobox").empty()) {
62805           window.clearInterval(watcher);
62806           timeout2(function() {
62807             if (context.container().select(".form-field-description").empty()) {
62808               continueTo(retryChooseDescription);
62809             } else {
62810               continueTo(describePlayground);
62811             }
62812           }, 300);
62813         }
62814       }, 300);
62815       reveal(
62816         "div.combobox",
62817         helpHtml("intro.areas.choose_field", { field: descriptionField.title() }),
62818         { duration: 300 }
62819       );
62820       context.on("exit.intro", function() {
62821         return continueTo(searchPresets);
62822       });
62823       function continueTo(nextStep) {
62824         if (watcher) window.clearInterval(watcher);
62825         context.on("exit.intro", null);
62826         nextStep();
62827       }
62828     }
62829     function describePlayground() {
62830       if (!_areaID || !context.hasEntity(_areaID)) {
62831         return addArea();
62832       }
62833       var ids = context.selectedIDs();
62834       if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
62835         return searchPresets();
62836       }
62837       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
62838       if (context.container().select(".form-field-description").empty()) {
62839         return continueTo(retryChooseDescription);
62840       }
62841       context.on("exit.intro", function() {
62842         continueTo(play);
62843       });
62844       reveal(
62845         ".entity-editor-pane",
62846         helpHtml("intro.areas.describe_playground", { button: { html: icon("#iD-icon-close", "inline") } }),
62847         { duration: 300 }
62848       );
62849       function continueTo(nextStep) {
62850         context.on("exit.intro", null);
62851         nextStep();
62852       }
62853     }
62854     function retryChooseDescription() {
62855       if (!_areaID || !context.hasEntity(_areaID)) {
62856         return addArea();
62857       }
62858       var ids = context.selectedIDs();
62859       if (context.mode().id !== "select" || !ids.length || ids[0] !== _areaID) {
62860         return searchPresets();
62861       }
62862       context.container().select(".inspector-wrap .panewrap").style("right", "0%");
62863       reveal(
62864         ".entity-editor-pane",
62865         helpHtml("intro.areas.retry_add_field", { field: descriptionField.title() }),
62866         {
62867           buttonText: _t.html("intro.ok"),
62868           buttonCallback: function() {
62869             continueTo(clickAddField);
62870           }
62871         }
62872       );
62873       context.on("exit.intro", function() {
62874         return continueTo(searchPresets);
62875       });
62876       function continueTo(nextStep) {
62877         context.on("exit.intro", null);
62878         nextStep();
62879       }
62880     }
62881     function play() {
62882       dispatch12.call("done");
62883       reveal(
62884         ".ideditor",
62885         helpHtml("intro.areas.play", { next: _t("intro.lines.title") }),
62886         {
62887           tooltipBox: ".intro-nav-wrap .chapter-line",
62888           buttonText: _t.html("intro.ok"),
62889           buttonCallback: function() {
62890             reveal(".ideditor");
62891           }
62892         }
62893       );
62894     }
62895     chapter.enter = function() {
62896       addArea();
62897     };
62898     chapter.exit = function() {
62899       timeouts.forEach(window.clearTimeout);
62900       context.on("enter.intro exit.intro", null);
62901       context.map().on("move.intro drawn.intro", null);
62902       context.history().on("change.intro", null);
62903       context.container().select(".inspector-wrap").on("wheel.intro", null);
62904       context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
62905       context.container().select(".more-fields .combobox-input").on("click.intro", null);
62906     };
62907     chapter.restart = function() {
62908       chapter.exit();
62909       chapter.enter();
62910     };
62911     return utilRebind(chapter, dispatch12, "on");
62912   }
62913
62914   // modules/ui/intro/line.js
62915   function uiIntroLine(context, reveal) {
62916     var dispatch12 = dispatch_default("done");
62917     var timeouts = [];
62918     var _tulipRoadID = null;
62919     var flowerRoadID = "w646";
62920     var tulipRoadStart = [-85.6297754121684, 41.95805253325314];
62921     var tulipRoadMidpoint = [-85.62975395449628, 41.95787501510204];
62922     var tulipRoadIntersection = [-85.62974496187628, 41.95742515554585];
62923     var roadCategory = _mainPresetIndex.item("category-road_minor");
62924     var residentialPreset = _mainPresetIndex.item("highway/residential");
62925     var woodRoadID = "w525";
62926     var woodRoadEndID = "n2862";
62927     var woodRoadAddNode = [-85.62390110349587, 41.95397111462291];
62928     var woodRoadDragEndpoint = [-85.623867390213, 41.95466987786487];
62929     var woodRoadDragMidpoint = [-85.62386254803509, 41.95430395953872];
62930     var washingtonStreetID = "w522";
62931     var twelfthAvenueID = "w1";
62932     var eleventhAvenueEndID = "n3550";
62933     var twelfthAvenueEndID = "n5";
62934     var _washingtonSegmentID = null;
62935     var eleventhAvenueEnd = context.entity(eleventhAvenueEndID).loc;
62936     var twelfthAvenueEnd = context.entity(twelfthAvenueEndID).loc;
62937     var deleteLinesLoc = [-85.6219395542764, 41.95228033922477];
62938     var twelfthAvenue = [-85.62219310052491, 41.952505413152956];
62939     var chapter = {
62940       title: "intro.lines.title"
62941     };
62942     function timeout2(f2, t2) {
62943       timeouts.push(window.setTimeout(f2, t2));
62944     }
62945     function eventCancel(d3_event) {
62946       d3_event.stopPropagation();
62947       d3_event.preventDefault();
62948     }
62949     function addLine() {
62950       context.enter(modeBrowse(context));
62951       context.history().reset("initial");
62952       var msec = transitionTime(tulipRoadStart, context.map().center());
62953       if (msec) {
62954         reveal(null, null, { duration: 0 });
62955       }
62956       context.map().centerZoomEase(tulipRoadStart, 18.5, msec);
62957       timeout2(function() {
62958         var tooltip = reveal(
62959           "button.add-line",
62960           helpHtml("intro.lines.add_line")
62961         );
62962         tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-lines");
62963         context.on("enter.intro", function(mode) {
62964           if (mode.id !== "add-line") return;
62965           continueTo(startLine);
62966         });
62967       }, msec + 100);
62968       function continueTo(nextStep) {
62969         context.on("enter.intro", null);
62970         nextStep();
62971       }
62972     }
62973     function startLine() {
62974       if (context.mode().id !== "add-line") return chapter.restart();
62975       _tulipRoadID = null;
62976       var padding = 70 * Math.pow(2, context.map().zoom() - 18);
62977       var box = pad(tulipRoadStart, padding, context);
62978       box.height = box.height + 100;
62979       var textId = context.lastPointerType() === "mouse" ? "start_line" : "start_line_tap";
62980       var startLineString = helpHtml("intro.lines.missing_road") + "{br}" + helpHtml("intro.lines.line_draw_info") + helpHtml("intro.lines." + textId);
62981       reveal(box, startLineString);
62982       context.map().on("move.intro drawn.intro", function() {
62983         padding = 70 * Math.pow(2, context.map().zoom() - 18);
62984         box = pad(tulipRoadStart, padding, context);
62985         box.height = box.height + 100;
62986         reveal(box, startLineString, { duration: 0 });
62987       });
62988       context.on("enter.intro", function(mode) {
62989         if (mode.id !== "draw-line") return chapter.restart();
62990         continueTo(drawLine);
62991       });
62992       function continueTo(nextStep) {
62993         context.map().on("move.intro drawn.intro", null);
62994         context.on("enter.intro", null);
62995         nextStep();
62996       }
62997     }
62998     function drawLine() {
62999       if (context.mode().id !== "draw-line") return chapter.restart();
63000       _tulipRoadID = context.mode().selectedIDs()[0];
63001       context.map().centerEase(tulipRoadMidpoint, 500);
63002       timeout2(function() {
63003         var padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
63004         var box = pad(tulipRoadMidpoint, padding, context);
63005         box.height = box.height * 2;
63006         reveal(
63007           box,
63008           helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") })
63009         );
63010         context.map().on("move.intro drawn.intro", function() {
63011           padding = 200 * Math.pow(2, context.map().zoom() - 18.5);
63012           box = pad(tulipRoadMidpoint, padding, context);
63013           box.height = box.height * 2;
63014           reveal(
63015             box,
63016             helpHtml("intro.lines.intersect", { name: _t("intro.graph.name.flower-street") }),
63017             { duration: 0 }
63018           );
63019         });
63020       }, 550);
63021       context.history().on("change.intro", function() {
63022         if (isLineConnected()) {
63023           continueTo(continueLine);
63024         }
63025       });
63026       context.on("enter.intro", function(mode) {
63027         if (mode.id === "draw-line") {
63028           return;
63029         } else if (mode.id === "select") {
63030           continueTo(retryIntersect);
63031           return;
63032         } else {
63033           return chapter.restart();
63034         }
63035       });
63036       function continueTo(nextStep) {
63037         context.map().on("move.intro drawn.intro", null);
63038         context.history().on("change.intro", null);
63039         context.on("enter.intro", null);
63040         nextStep();
63041       }
63042     }
63043     function isLineConnected() {
63044       var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
63045       if (!entity) return false;
63046       var drawNodes = context.graph().childNodes(entity);
63047       return drawNodes.some(function(node) {
63048         return context.graph().parentWays(node).some(function(parent2) {
63049           return parent2.id === flowerRoadID;
63050         });
63051       });
63052     }
63053     function retryIntersect() {
63054       select_default2(window).on("pointerdown.intro mousedown.intro", eventCancel, true);
63055       var box = pad(tulipRoadIntersection, 80, context);
63056       reveal(
63057         box,
63058         helpHtml("intro.lines.retry_intersect", { name: _t("intro.graph.name.flower-street") })
63059       );
63060       timeout2(chapter.restart, 3e3);
63061     }
63062     function continueLine() {
63063       if (context.mode().id !== "draw-line") return chapter.restart();
63064       var entity = _tulipRoadID && context.hasEntity(_tulipRoadID);
63065       if (!entity) return chapter.restart();
63066       context.map().centerEase(tulipRoadIntersection, 500);
63067       var continueLineText = helpHtml("intro.lines.continue_line") + "{br}" + helpHtml("intro.lines.finish_line_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.lines.finish_road");
63068       reveal(".main-map .surface", continueLineText);
63069       context.on("enter.intro", function(mode) {
63070         if (mode.id === "draw-line") {
63071           return;
63072         } else if (mode.id === "select") {
63073           return continueTo(chooseCategoryRoad);
63074         } else {
63075           return chapter.restart();
63076         }
63077       });
63078       function continueTo(nextStep) {
63079         context.on("enter.intro", null);
63080         nextStep();
63081       }
63082     }
63083     function chooseCategoryRoad() {
63084       if (context.mode().id !== "select") return chapter.restart();
63085       context.on("exit.intro", function() {
63086         return chapter.restart();
63087       });
63088       var button = context.container().select(".preset-category-road_minor .preset-list-button");
63089       if (button.empty()) return chapter.restart();
63090       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
63091       timeout2(function() {
63092         context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
63093         reveal(
63094           button.node(),
63095           helpHtml("intro.lines.choose_category_road", { category: roadCategory.name() })
63096         );
63097         button.on("click.intro", function() {
63098           continueTo(choosePresetResidential);
63099         });
63100       }, 400);
63101       function continueTo(nextStep) {
63102         context.container().select(".inspector-wrap").on("wheel.intro", null);
63103         context.container().select(".preset-list-button").on("click.intro", null);
63104         context.on("exit.intro", null);
63105         nextStep();
63106       }
63107     }
63108     function choosePresetResidential() {
63109       if (context.mode().id !== "select") return chapter.restart();
63110       context.on("exit.intro", function() {
63111         return chapter.restart();
63112       });
63113       var subgrid = context.container().select(".preset-category-road_minor .subgrid");
63114       if (subgrid.empty()) return chapter.restart();
63115       subgrid.selectAll(":not(.preset-highway-residential) .preset-list-button").on("click.intro", function() {
63116         continueTo(retryPresetResidential);
63117       });
63118       subgrid.selectAll(".preset-highway-residential .preset-list-button").on("click.intro", function() {
63119         continueTo(nameRoad);
63120       });
63121       timeout2(function() {
63122         reveal(
63123           subgrid.node(),
63124           helpHtml("intro.lines.choose_preset_residential", { preset: residentialPreset.name() }),
63125           { tooltipBox: ".preset-highway-residential .preset-list-button", duration: 300 }
63126         );
63127       }, 300);
63128       function continueTo(nextStep) {
63129         context.container().select(".preset-list-button").on("click.intro", null);
63130         context.on("exit.intro", null);
63131         nextStep();
63132       }
63133     }
63134     function retryPresetResidential() {
63135       if (context.mode().id !== "select") return chapter.restart();
63136       context.on("exit.intro", function() {
63137         return chapter.restart();
63138       });
63139       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
63140       timeout2(function() {
63141         var button = context.container().select(".entity-editor-pane .preset-list-button");
63142         reveal(
63143           button.node(),
63144           helpHtml("intro.lines.retry_preset_residential", { preset: residentialPreset.name() })
63145         );
63146         button.on("click.intro", function() {
63147           continueTo(chooseCategoryRoad);
63148         });
63149       }, 500);
63150       function continueTo(nextStep) {
63151         context.container().select(".inspector-wrap").on("wheel.intro", null);
63152         context.container().select(".preset-list-button").on("click.intro", null);
63153         context.on("exit.intro", null);
63154         nextStep();
63155       }
63156     }
63157     function nameRoad() {
63158       context.on("exit.intro", function() {
63159         continueTo(didNameRoad);
63160       });
63161       timeout2(function() {
63162         reveal(
63163           ".entity-editor-pane",
63164           helpHtml("intro.lines.name_road", { button: { html: icon("#iD-icon-close", "inline") } }),
63165           { tooltipClass: "intro-lines-name_road" }
63166         );
63167       }, 500);
63168       function continueTo(nextStep) {
63169         context.on("exit.intro", null);
63170         nextStep();
63171       }
63172     }
63173     function didNameRoad() {
63174       context.history().checkpoint("doneAddLine");
63175       timeout2(function() {
63176         reveal(".main-map .surface", helpHtml("intro.lines.did_name_road"), {
63177           buttonText: _t.html("intro.ok"),
63178           buttonCallback: function() {
63179             continueTo(updateLine);
63180           }
63181         });
63182       }, 500);
63183       function continueTo(nextStep) {
63184         nextStep();
63185       }
63186     }
63187     function updateLine() {
63188       context.history().reset("doneAddLine");
63189       if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63190         return chapter.restart();
63191       }
63192       var msec = transitionTime(woodRoadDragMidpoint, context.map().center());
63193       if (msec) {
63194         reveal(null, null, { duration: 0 });
63195       }
63196       context.map().centerZoomEase(woodRoadDragMidpoint, 19, msec);
63197       timeout2(function() {
63198         var padding = 250 * Math.pow(2, context.map().zoom() - 19);
63199         var box = pad(woodRoadDragMidpoint, padding, context);
63200         var advance = function() {
63201           continueTo(addNode);
63202         };
63203         reveal(
63204           box,
63205           helpHtml("intro.lines.update_line"),
63206           { buttonText: _t.html("intro.ok"), buttonCallback: advance }
63207         );
63208         context.map().on("move.intro drawn.intro", function() {
63209           var padding2 = 250 * Math.pow(2, context.map().zoom() - 19);
63210           var box2 = pad(woodRoadDragMidpoint, padding2, context);
63211           reveal(
63212             box2,
63213             helpHtml("intro.lines.update_line"),
63214             { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
63215           );
63216         });
63217       }, msec + 100);
63218       function continueTo(nextStep) {
63219         context.map().on("move.intro drawn.intro", null);
63220         nextStep();
63221       }
63222     }
63223     function addNode() {
63224       context.history().reset("doneAddLine");
63225       if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63226         return chapter.restart();
63227       }
63228       var padding = 40 * Math.pow(2, context.map().zoom() - 19);
63229       var box = pad(woodRoadAddNode, padding, context);
63230       var addNodeString = helpHtml("intro.lines.add_node" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
63231       reveal(box, addNodeString);
63232       context.map().on("move.intro drawn.intro", function() {
63233         var padding2 = 40 * Math.pow(2, context.map().zoom() - 19);
63234         var box2 = pad(woodRoadAddNode, padding2, context);
63235         reveal(box2, addNodeString, { duration: 0 });
63236       });
63237       context.history().on("change.intro", function(changed) {
63238         if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63239           return continueTo(updateLine);
63240         }
63241         if (changed.created().length === 1) {
63242           timeout2(function() {
63243             continueTo(startDragEndpoint);
63244           }, 500);
63245         }
63246       });
63247       context.on("enter.intro", function(mode) {
63248         if (mode.id !== "select") {
63249           continueTo(updateLine);
63250         }
63251       });
63252       function continueTo(nextStep) {
63253         context.map().on("move.intro drawn.intro", null);
63254         context.history().on("change.intro", null);
63255         context.on("enter.intro", null);
63256         nextStep();
63257       }
63258     }
63259     function startDragEndpoint() {
63260       if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63261         return continueTo(updateLine);
63262       }
63263       var padding = 100 * Math.pow(2, context.map().zoom() - 19);
63264       var box = pad(woodRoadDragEndpoint, padding, context);
63265       var startDragString = helpHtml("intro.lines.start_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch")) + helpHtml("intro.lines.drag_to_intersection");
63266       reveal(box, startDragString);
63267       context.map().on("move.intro drawn.intro", function() {
63268         if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63269           return continueTo(updateLine);
63270         }
63271         var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
63272         var box2 = pad(woodRoadDragEndpoint, padding2, context);
63273         reveal(box2, startDragString, { duration: 0 });
63274         var entity = context.entity(woodRoadEndID);
63275         if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) <= 4) {
63276           continueTo(finishDragEndpoint);
63277         }
63278       });
63279       function continueTo(nextStep) {
63280         context.map().on("move.intro drawn.intro", null);
63281         nextStep();
63282       }
63283     }
63284     function finishDragEndpoint() {
63285       if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63286         return continueTo(updateLine);
63287       }
63288       var padding = 100 * Math.pow(2, context.map().zoom() - 19);
63289       var box = pad(woodRoadDragEndpoint, padding, context);
63290       var finishDragString = helpHtml("intro.lines.spot_looks_good") + helpHtml("intro.lines.finish_drag_endpoint" + (context.lastPointerType() === "mouse" ? "" : "_touch"));
63291       reveal(box, finishDragString);
63292       context.map().on("move.intro drawn.intro", function() {
63293         if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63294           return continueTo(updateLine);
63295         }
63296         var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
63297         var box2 = pad(woodRoadDragEndpoint, padding2, context);
63298         reveal(box2, finishDragString, { duration: 0 });
63299         var entity = context.entity(woodRoadEndID);
63300         if (geoSphericalDistance(entity.loc, woodRoadDragEndpoint) > 4) {
63301           continueTo(startDragEndpoint);
63302         }
63303       });
63304       context.on("enter.intro", function() {
63305         continueTo(startDragMidpoint);
63306       });
63307       function continueTo(nextStep) {
63308         context.map().on("move.intro drawn.intro", null);
63309         context.on("enter.intro", null);
63310         nextStep();
63311       }
63312     }
63313     function startDragMidpoint() {
63314       if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63315         return continueTo(updateLine);
63316       }
63317       if (context.selectedIDs().indexOf(woodRoadID) === -1) {
63318         context.enter(modeSelect(context, [woodRoadID]));
63319       }
63320       var padding = 80 * Math.pow(2, context.map().zoom() - 19);
63321       var box = pad(woodRoadDragMidpoint, padding, context);
63322       reveal(box, helpHtml("intro.lines.start_drag_midpoint"));
63323       context.map().on("move.intro drawn.intro", function() {
63324         if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63325           return continueTo(updateLine);
63326         }
63327         var padding2 = 80 * Math.pow(2, context.map().zoom() - 19);
63328         var box2 = pad(woodRoadDragMidpoint, padding2, context);
63329         reveal(box2, helpHtml("intro.lines.start_drag_midpoint"), { duration: 0 });
63330       });
63331       context.history().on("change.intro", function(changed) {
63332         if (changed.created().length === 1) {
63333           continueTo(continueDragMidpoint);
63334         }
63335       });
63336       context.on("enter.intro", function(mode) {
63337         if (mode.id !== "select") {
63338           context.enter(modeSelect(context, [woodRoadID]));
63339         }
63340       });
63341       function continueTo(nextStep) {
63342         context.map().on("move.intro drawn.intro", null);
63343         context.history().on("change.intro", null);
63344         context.on("enter.intro", null);
63345         nextStep();
63346       }
63347     }
63348     function continueDragMidpoint() {
63349       if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63350         return continueTo(updateLine);
63351       }
63352       var padding = 100 * Math.pow(2, context.map().zoom() - 19);
63353       var box = pad(woodRoadDragEndpoint, padding, context);
63354       box.height += 400;
63355       var advance = function() {
63356         context.history().checkpoint("doneUpdateLine");
63357         continueTo(deleteLines);
63358       };
63359       reveal(
63360         box,
63361         helpHtml("intro.lines.continue_drag_midpoint"),
63362         { buttonText: _t.html("intro.ok"), buttonCallback: advance }
63363       );
63364       context.map().on("move.intro drawn.intro", function() {
63365         if (!context.hasEntity(woodRoadID) || !context.hasEntity(woodRoadEndID)) {
63366           return continueTo(updateLine);
63367         }
63368         var padding2 = 100 * Math.pow(2, context.map().zoom() - 19);
63369         var box2 = pad(woodRoadDragEndpoint, padding2, context);
63370         box2.height += 400;
63371         reveal(
63372           box2,
63373           helpHtml("intro.lines.continue_drag_midpoint"),
63374           { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
63375         );
63376       });
63377       function continueTo(nextStep) {
63378         context.map().on("move.intro drawn.intro", null);
63379         nextStep();
63380       }
63381     }
63382     function deleteLines() {
63383       context.history().reset("doneUpdateLine");
63384       context.enter(modeBrowse(context));
63385       if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63386         return chapter.restart();
63387       }
63388       var msec = transitionTime(deleteLinesLoc, context.map().center());
63389       if (msec) {
63390         reveal(null, null, { duration: 0 });
63391       }
63392       context.map().centerZoomEase(deleteLinesLoc, 18, msec);
63393       timeout2(function() {
63394         var padding = 200 * Math.pow(2, context.map().zoom() - 18);
63395         var box = pad(deleteLinesLoc, padding, context);
63396         box.top -= 200;
63397         box.height += 400;
63398         var advance = function() {
63399           continueTo(rightClickIntersection);
63400         };
63401         reveal(
63402           box,
63403           helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
63404           { buttonText: _t.html("intro.ok"), buttonCallback: advance }
63405         );
63406         context.map().on("move.intro drawn.intro", function() {
63407           var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
63408           var box2 = pad(deleteLinesLoc, padding2, context);
63409           box2.top -= 200;
63410           box2.height += 400;
63411           reveal(
63412             box2,
63413             helpHtml("intro.lines.delete_lines", { street: _t("intro.graph.name.12th-avenue") }),
63414             { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
63415           );
63416         });
63417         context.history().on("change.intro", function() {
63418           timeout2(function() {
63419             continueTo(deleteLines);
63420           }, 500);
63421         });
63422       }, msec + 100);
63423       function continueTo(nextStep) {
63424         context.map().on("move.intro drawn.intro", null);
63425         context.history().on("change.intro", null);
63426         nextStep();
63427       }
63428     }
63429     function rightClickIntersection() {
63430       context.history().reset("doneUpdateLine");
63431       context.enter(modeBrowse(context));
63432       context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
63433       var rightClickString = helpHtml("intro.lines.split_street", {
63434         street1: _t("intro.graph.name.11th-avenue"),
63435         street2: _t("intro.graph.name.washington-street")
63436       }) + helpHtml("intro.lines." + (context.lastPointerType() === "mouse" ? "rightclick_intersection" : "edit_menu_intersection_touch"));
63437       timeout2(function() {
63438         var padding = 60 * Math.pow(2, context.map().zoom() - 18);
63439         var box = pad(eleventhAvenueEnd, padding, context);
63440         reveal(box, rightClickString);
63441         context.map().on("move.intro drawn.intro", function() {
63442           var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
63443           var box2 = pad(eleventhAvenueEnd, padding2, context);
63444           reveal(
63445             box2,
63446             rightClickString,
63447             { duration: 0 }
63448           );
63449         });
63450         context.on("enter.intro", function(mode) {
63451           if (mode.id !== "select") return;
63452           var ids = context.selectedIDs();
63453           if (ids.length !== 1 || ids[0] !== eleventhAvenueEndID) return;
63454           timeout2(function() {
63455             var node = selectMenuItem(context, "split").node();
63456             if (!node) return;
63457             continueTo(splitIntersection);
63458           }, 50);
63459         });
63460         context.history().on("change.intro", function() {
63461           timeout2(function() {
63462             continueTo(deleteLines);
63463           }, 300);
63464         });
63465       }, 600);
63466       function continueTo(nextStep) {
63467         context.map().on("move.intro drawn.intro", null);
63468         context.on("enter.intro", null);
63469         context.history().on("change.intro", null);
63470         nextStep();
63471       }
63472     }
63473     function splitIntersection() {
63474       if (!context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63475         return continueTo(deleteLines);
63476       }
63477       var node = selectMenuItem(context, "split").node();
63478       if (!node) {
63479         return continueTo(rightClickIntersection);
63480       }
63481       var wasChanged = false;
63482       _washingtonSegmentID = null;
63483       reveal(
63484         ".edit-menu",
63485         helpHtml(
63486           "intro.lines.split_intersection",
63487           { street: _t("intro.graph.name.washington-street") }
63488         ),
63489         { padding: 50 }
63490       );
63491       context.map().on("move.intro drawn.intro", function() {
63492         var node2 = selectMenuItem(context, "split").node();
63493         if (!wasChanged && !node2) {
63494           return continueTo(rightClickIntersection);
63495         }
63496         reveal(
63497           ".edit-menu",
63498           helpHtml(
63499             "intro.lines.split_intersection",
63500             { street: _t("intro.graph.name.washington-street") }
63501           ),
63502           { duration: 0, padding: 50 }
63503         );
63504       });
63505       context.history().on("change.intro", function(changed) {
63506         wasChanged = true;
63507         timeout2(function() {
63508           if (context.history().undoAnnotation() === _t("operations.split.annotation.line", { n: 1 })) {
63509             _washingtonSegmentID = changed.created()[0].id;
63510             continueTo(didSplit);
63511           } else {
63512             _washingtonSegmentID = null;
63513             continueTo(retrySplit);
63514           }
63515         }, 300);
63516       });
63517       function continueTo(nextStep) {
63518         context.map().on("move.intro drawn.intro", null);
63519         context.history().on("change.intro", null);
63520         nextStep();
63521       }
63522     }
63523     function retrySplit() {
63524       context.enter(modeBrowse(context));
63525       context.map().centerZoomEase(eleventhAvenueEnd, 18, 500);
63526       var advance = function() {
63527         continueTo(rightClickIntersection);
63528       };
63529       var padding = 60 * Math.pow(2, context.map().zoom() - 18);
63530       var box = pad(eleventhAvenueEnd, padding, context);
63531       reveal(
63532         box,
63533         helpHtml("intro.lines.retry_split"),
63534         { buttonText: _t.html("intro.ok"), buttonCallback: advance }
63535       );
63536       context.map().on("move.intro drawn.intro", function() {
63537         var padding2 = 60 * Math.pow(2, context.map().zoom() - 18);
63538         var box2 = pad(eleventhAvenueEnd, padding2, context);
63539         reveal(
63540           box2,
63541           helpHtml("intro.lines.retry_split"),
63542           { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: advance }
63543         );
63544       });
63545       function continueTo(nextStep) {
63546         context.map().on("move.intro drawn.intro", null);
63547         nextStep();
63548       }
63549     }
63550     function didSplit() {
63551       if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63552         return continueTo(rightClickIntersection);
63553       }
63554       var ids = context.selectedIDs();
63555       var string = "intro.lines.did_split_" + (ids.length > 1 ? "multi" : "single");
63556       var street = _t("intro.graph.name.washington-street");
63557       var padding = 200 * Math.pow(2, context.map().zoom() - 18);
63558       var box = pad(twelfthAvenue, padding, context);
63559       box.width = box.width / 2;
63560       reveal(
63561         box,
63562         helpHtml(string, { street1: street, street2: street }),
63563         { duration: 500 }
63564       );
63565       timeout2(function() {
63566         context.map().centerZoomEase(twelfthAvenue, 18, 500);
63567         context.map().on("move.intro drawn.intro", function() {
63568           var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
63569           var box2 = pad(twelfthAvenue, padding2, context);
63570           box2.width = box2.width / 2;
63571           reveal(
63572             box2,
63573             helpHtml(string, { street1: street, street2: street }),
63574             { duration: 0 }
63575           );
63576         });
63577       }, 600);
63578       context.on("enter.intro", function() {
63579         var ids2 = context.selectedIDs();
63580         if (ids2.length === 1 && ids2[0] === _washingtonSegmentID) {
63581           continueTo(multiSelect2);
63582         }
63583       });
63584       context.history().on("change.intro", function() {
63585         if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63586           return continueTo(rightClickIntersection);
63587         }
63588       });
63589       function continueTo(nextStep) {
63590         context.map().on("move.intro drawn.intro", null);
63591         context.on("enter.intro", null);
63592         context.history().on("change.intro", null);
63593         nextStep();
63594       }
63595     }
63596     function multiSelect2() {
63597       if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63598         return continueTo(rightClickIntersection);
63599       }
63600       var ids = context.selectedIDs();
63601       var hasWashington = ids.indexOf(_washingtonSegmentID) !== -1;
63602       var hasTwelfth = ids.indexOf(twelfthAvenueID) !== -1;
63603       if (hasWashington && hasTwelfth) {
63604         return continueTo(multiRightClick);
63605       } else if (!hasWashington && !hasTwelfth) {
63606         return continueTo(didSplit);
63607       }
63608       context.map().centerZoomEase(twelfthAvenue, 18, 500);
63609       timeout2(function() {
63610         var selected, other, padding, box;
63611         if (hasWashington) {
63612           selected = _t("intro.graph.name.washington-street");
63613           other = _t("intro.graph.name.12th-avenue");
63614           padding = 60 * Math.pow(2, context.map().zoom() - 18);
63615           box = pad(twelfthAvenueEnd, padding, context);
63616           box.width *= 3;
63617         } else {
63618           selected = _t("intro.graph.name.12th-avenue");
63619           other = _t("intro.graph.name.washington-street");
63620           padding = 200 * Math.pow(2, context.map().zoom() - 18);
63621           box = pad(twelfthAvenue, padding, context);
63622           box.width /= 2;
63623         }
63624         reveal(
63625           box,
63626           helpHtml(
63627             "intro.lines.multi_select",
63628             { selected, other1: other }
63629           ) + " " + helpHtml(
63630             "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
63631             { selected, other2: other }
63632           )
63633         );
63634         context.map().on("move.intro drawn.intro", function() {
63635           if (hasWashington) {
63636             selected = _t("intro.graph.name.washington-street");
63637             other = _t("intro.graph.name.12th-avenue");
63638             padding = 60 * Math.pow(2, context.map().zoom() - 18);
63639             box = pad(twelfthAvenueEnd, padding, context);
63640             box.width *= 3;
63641           } else {
63642             selected = _t("intro.graph.name.12th-avenue");
63643             other = _t("intro.graph.name.washington-street");
63644             padding = 200 * Math.pow(2, context.map().zoom() - 18);
63645             box = pad(twelfthAvenue, padding, context);
63646             box.width /= 2;
63647           }
63648           reveal(
63649             box,
63650             helpHtml(
63651               "intro.lines.multi_select",
63652               { selected, other1: other }
63653             ) + " " + helpHtml(
63654               "intro.lines.add_to_selection_" + (context.lastPointerType() === "mouse" ? "click" : "touch"),
63655               { selected, other2: other }
63656             ),
63657             { duration: 0 }
63658           );
63659         });
63660         context.on("enter.intro", function() {
63661           continueTo(multiSelect2);
63662         });
63663         context.history().on("change.intro", function() {
63664           if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63665             return continueTo(rightClickIntersection);
63666           }
63667         });
63668       }, 600);
63669       function continueTo(nextStep) {
63670         context.map().on("move.intro drawn.intro", null);
63671         context.on("enter.intro", null);
63672         context.history().on("change.intro", null);
63673         nextStep();
63674       }
63675     }
63676     function multiRightClick() {
63677       if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63678         return continueTo(rightClickIntersection);
63679       }
63680       var padding = 200 * Math.pow(2, context.map().zoom() - 18);
63681       var box = pad(twelfthAvenue, padding, context);
63682       var rightClickString = helpHtml("intro.lines.multi_select_success") + helpHtml("intro.lines.multi_" + (context.lastPointerType() === "mouse" ? "rightclick" : "edit_menu_touch"));
63683       reveal(box, rightClickString);
63684       context.map().on("move.intro drawn.intro", function() {
63685         var padding2 = 200 * Math.pow(2, context.map().zoom() - 18);
63686         var box2 = pad(twelfthAvenue, padding2, context);
63687         reveal(box2, rightClickString, { duration: 0 });
63688       });
63689       context.ui().editMenu().on("toggled.intro", function(open) {
63690         if (!open) return;
63691         timeout2(function() {
63692           var ids = context.selectedIDs();
63693           if (ids.length === 2 && ids.indexOf(twelfthAvenueID) !== -1 && ids.indexOf(_washingtonSegmentID) !== -1) {
63694             var node = selectMenuItem(context, "delete").node();
63695             if (!node) return;
63696             continueTo(multiDelete);
63697           } else if (ids.length === 1 && ids.indexOf(_washingtonSegmentID) !== -1) {
63698             return continueTo(multiSelect2);
63699           } else {
63700             return continueTo(didSplit);
63701           }
63702         }, 300);
63703       });
63704       context.history().on("change.intro", function() {
63705         if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63706           return continueTo(rightClickIntersection);
63707         }
63708       });
63709       function continueTo(nextStep) {
63710         context.map().on("move.intro drawn.intro", null);
63711         context.ui().editMenu().on("toggled.intro", null);
63712         context.history().on("change.intro", null);
63713         nextStep();
63714       }
63715     }
63716     function multiDelete() {
63717       if (!_washingtonSegmentID || !context.hasEntity(_washingtonSegmentID) || !context.hasEntity(washingtonStreetID) || !context.hasEntity(twelfthAvenueID) || !context.hasEntity(eleventhAvenueEndID)) {
63718         return continueTo(rightClickIntersection);
63719       }
63720       var node = selectMenuItem(context, "delete").node();
63721       if (!node) return continueTo(multiRightClick);
63722       reveal(
63723         ".edit-menu",
63724         helpHtml("intro.lines.multi_delete"),
63725         { padding: 50 }
63726       );
63727       context.map().on("move.intro drawn.intro", function() {
63728         reveal(
63729           ".edit-menu",
63730           helpHtml("intro.lines.multi_delete"),
63731           { duration: 0, padding: 50 }
63732         );
63733       });
63734       context.on("exit.intro", function() {
63735         if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
63736           return continueTo(multiSelect2);
63737         }
63738       });
63739       context.history().on("change.intro", function() {
63740         if (context.hasEntity(_washingtonSegmentID) || context.hasEntity(twelfthAvenueID)) {
63741           continueTo(retryDelete);
63742         } else {
63743           continueTo(play);
63744         }
63745       });
63746       function continueTo(nextStep) {
63747         context.map().on("move.intro drawn.intro", null);
63748         context.on("exit.intro", null);
63749         context.history().on("change.intro", null);
63750         nextStep();
63751       }
63752     }
63753     function retryDelete() {
63754       context.enter(modeBrowse(context));
63755       var padding = 200 * Math.pow(2, context.map().zoom() - 18);
63756       var box = pad(twelfthAvenue, padding, context);
63757       reveal(box, helpHtml("intro.lines.retry_delete"), {
63758         buttonText: _t.html("intro.ok"),
63759         buttonCallback: function() {
63760           continueTo(multiSelect2);
63761         }
63762       });
63763       function continueTo(nextStep) {
63764         nextStep();
63765       }
63766     }
63767     function play() {
63768       dispatch12.call("done");
63769       reveal(
63770         ".ideditor",
63771         helpHtml("intro.lines.play", { next: _t("intro.buildings.title") }),
63772         {
63773           tooltipBox: ".intro-nav-wrap .chapter-building",
63774           buttonText: _t.html("intro.ok"),
63775           buttonCallback: function() {
63776             reveal(".ideditor");
63777           }
63778         }
63779       );
63780     }
63781     chapter.enter = function() {
63782       addLine();
63783     };
63784     chapter.exit = function() {
63785       timeouts.forEach(window.clearTimeout);
63786       select_default2(window).on("pointerdown.intro mousedown.intro", null, true);
63787       context.on("enter.intro exit.intro", null);
63788       context.map().on("move.intro drawn.intro", null);
63789       context.history().on("change.intro", null);
63790       context.container().select(".inspector-wrap").on("wheel.intro", null);
63791       context.container().select(".preset-list-button").on("click.intro", null);
63792     };
63793     chapter.restart = function() {
63794       chapter.exit();
63795       chapter.enter();
63796     };
63797     return utilRebind(chapter, dispatch12, "on");
63798   }
63799
63800   // modules/ui/intro/building.js
63801   function uiIntroBuilding(context, reveal) {
63802     var dispatch12 = dispatch_default("done");
63803     var house = [-85.62815, 41.95638];
63804     var tank = [-85.62732, 41.95347];
63805     var buildingCatetory = _mainPresetIndex.item("category-building");
63806     var housePreset = _mainPresetIndex.item("building/house");
63807     var tankPreset = _mainPresetIndex.item("man_made/storage_tank");
63808     var timeouts = [];
63809     var _houseID = null;
63810     var _tankID = null;
63811     var chapter = {
63812       title: "intro.buildings.title"
63813     };
63814     function timeout2(f2, t2) {
63815       timeouts.push(window.setTimeout(f2, t2));
63816     }
63817     function eventCancel(d3_event) {
63818       d3_event.stopPropagation();
63819       d3_event.preventDefault();
63820     }
63821     function revealHouse(center, text, options) {
63822       var padding = 160 * Math.pow(2, context.map().zoom() - 20);
63823       var box = pad(center, padding, context);
63824       reveal(box, text, options);
63825     }
63826     function revealTank(center, text, options) {
63827       var padding = 190 * Math.pow(2, context.map().zoom() - 19.5);
63828       var box = pad(center, padding, context);
63829       reveal(box, text, options);
63830     }
63831     function addHouse() {
63832       context.enter(modeBrowse(context));
63833       context.history().reset("initial");
63834       _houseID = null;
63835       var msec = transitionTime(house, context.map().center());
63836       if (msec) {
63837         reveal(null, null, { duration: 0 });
63838       }
63839       context.map().centerZoomEase(house, 19, msec);
63840       timeout2(function() {
63841         var tooltip = reveal(
63842           "button.add-area",
63843           helpHtml("intro.buildings.add_building")
63844         );
63845         tooltip.selectAll(".popover-inner").insert("svg", "span").attr("class", "tooltip-illustration").append("use").attr("xlink:href", "#iD-graphic-buildings");
63846         context.on("enter.intro", function(mode) {
63847           if (mode.id !== "add-area") return;
63848           continueTo(startHouse);
63849         });
63850       }, msec + 100);
63851       function continueTo(nextStep) {
63852         context.on("enter.intro", null);
63853         nextStep();
63854       }
63855     }
63856     function startHouse() {
63857       if (context.mode().id !== "add-area") {
63858         return continueTo(addHouse);
63859       }
63860       _houseID = null;
63861       context.map().zoomEase(20, 500);
63862       timeout2(function() {
63863         var startString = helpHtml("intro.buildings.start_building") + helpHtml("intro.buildings.building_corner_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
63864         revealHouse(house, startString);
63865         context.map().on("move.intro drawn.intro", function() {
63866           revealHouse(house, startString, { duration: 0 });
63867         });
63868         context.on("enter.intro", function(mode) {
63869           if (mode.id !== "draw-area") return chapter.restart();
63870           continueTo(continueHouse);
63871         });
63872       }, 550);
63873       function continueTo(nextStep) {
63874         context.map().on("move.intro drawn.intro", null);
63875         context.on("enter.intro", null);
63876         nextStep();
63877       }
63878     }
63879     function continueHouse() {
63880       if (context.mode().id !== "draw-area") {
63881         return continueTo(addHouse);
63882       }
63883       _houseID = null;
63884       var continueString = helpHtml("intro.buildings.continue_building") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_building");
63885       revealHouse(house, continueString);
63886       context.map().on("move.intro drawn.intro", function() {
63887         revealHouse(house, continueString, { duration: 0 });
63888       });
63889       context.on("enter.intro", function(mode) {
63890         if (mode.id === "draw-area") {
63891           return;
63892         } else if (mode.id === "select") {
63893           var graph = context.graph();
63894           var way = context.entity(context.selectedIDs()[0]);
63895           var nodes = graph.childNodes(way);
63896           var points = utilArrayUniq(nodes).map(function(n3) {
63897             return context.projection(n3.loc);
63898           });
63899           if (isMostlySquare(points)) {
63900             _houseID = way.id;
63901             return continueTo(chooseCategoryBuilding);
63902           } else {
63903             return continueTo(retryHouse);
63904           }
63905         } else {
63906           return chapter.restart();
63907         }
63908       });
63909       function continueTo(nextStep) {
63910         context.map().on("move.intro drawn.intro", null);
63911         context.on("enter.intro", null);
63912         nextStep();
63913       }
63914     }
63915     function retryHouse() {
63916       var onClick = function() {
63917         continueTo(addHouse);
63918       };
63919       revealHouse(
63920         house,
63921         helpHtml("intro.buildings.retry_building"),
63922         { buttonText: _t.html("intro.ok"), buttonCallback: onClick }
63923       );
63924       context.map().on("move.intro drawn.intro", function() {
63925         revealHouse(
63926           house,
63927           helpHtml("intro.buildings.retry_building"),
63928           { duration: 0, buttonText: _t.html("intro.ok"), buttonCallback: onClick }
63929         );
63930       });
63931       function continueTo(nextStep) {
63932         context.map().on("move.intro drawn.intro", null);
63933         nextStep();
63934       }
63935     }
63936     function chooseCategoryBuilding() {
63937       if (!_houseID || !context.hasEntity(_houseID)) {
63938         return addHouse();
63939       }
63940       var ids = context.selectedIDs();
63941       if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
63942         context.enter(modeSelect(context, [_houseID]));
63943       }
63944       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
63945       timeout2(function() {
63946         context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
63947         var button = context.container().select(".preset-category-building .preset-list-button");
63948         reveal(
63949           button.node(),
63950           helpHtml("intro.buildings.choose_category_building", { category: buildingCatetory.name() })
63951         );
63952         button.on("click.intro", function() {
63953           button.on("click.intro", null);
63954           continueTo(choosePresetHouse);
63955         });
63956       }, 400);
63957       context.on("enter.intro", function(mode) {
63958         if (!_houseID || !context.hasEntity(_houseID)) {
63959           return continueTo(addHouse);
63960         }
63961         var ids2 = context.selectedIDs();
63962         if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
63963           return continueTo(chooseCategoryBuilding);
63964         }
63965       });
63966       function continueTo(nextStep) {
63967         context.container().select(".inspector-wrap").on("wheel.intro", null);
63968         context.container().select(".preset-list-button").on("click.intro", null);
63969         context.on("enter.intro", null);
63970         nextStep();
63971       }
63972     }
63973     function choosePresetHouse() {
63974       if (!_houseID || !context.hasEntity(_houseID)) {
63975         return addHouse();
63976       }
63977       var ids = context.selectedIDs();
63978       if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
63979         context.enter(modeSelect(context, [_houseID]));
63980       }
63981       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
63982       timeout2(function() {
63983         context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
63984         var button = context.container().select(".preset-building-house .preset-list-button");
63985         reveal(
63986           button.node(),
63987           helpHtml("intro.buildings.choose_preset_house", { preset: housePreset.name() }),
63988           { duration: 300 }
63989         );
63990         button.on("click.intro", function() {
63991           button.on("click.intro", null);
63992           continueTo(closeEditorHouse);
63993         });
63994       }, 400);
63995       context.on("enter.intro", function(mode) {
63996         if (!_houseID || !context.hasEntity(_houseID)) {
63997           return continueTo(addHouse);
63998         }
63999         var ids2 = context.selectedIDs();
64000         if (mode.id !== "select" || !ids2.length || ids2[0] !== _houseID) {
64001           return continueTo(chooseCategoryBuilding);
64002         }
64003       });
64004       function continueTo(nextStep) {
64005         context.container().select(".inspector-wrap").on("wheel.intro", null);
64006         context.container().select(".preset-list-button").on("click.intro", null);
64007         context.on("enter.intro", null);
64008         nextStep();
64009       }
64010     }
64011     function closeEditorHouse() {
64012       if (!_houseID || !context.hasEntity(_houseID)) {
64013         return addHouse();
64014       }
64015       var ids = context.selectedIDs();
64016       if (context.mode().id !== "select" || !ids.length || ids[0] !== _houseID) {
64017         context.enter(modeSelect(context, [_houseID]));
64018       }
64019       context.history().checkpoint("hasHouse");
64020       context.on("exit.intro", function() {
64021         continueTo(rightClickHouse);
64022       });
64023       timeout2(function() {
64024         reveal(
64025           ".entity-editor-pane",
64026           helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
64027         );
64028       }, 500);
64029       function continueTo(nextStep) {
64030         context.on("exit.intro", null);
64031         nextStep();
64032       }
64033     }
64034     function rightClickHouse() {
64035       if (!_houseID) return chapter.restart();
64036       context.enter(modeBrowse(context));
64037       context.history().reset("hasHouse");
64038       var zoom = context.map().zoom();
64039       if (zoom < 20) {
64040         zoom = 20;
64041       }
64042       context.map().centerZoomEase(house, zoom, 500);
64043       context.on("enter.intro", function(mode) {
64044         if (mode.id !== "select") return;
64045         var ids = context.selectedIDs();
64046         if (ids.length !== 1 || ids[0] !== _houseID) return;
64047         timeout2(function() {
64048           var node = selectMenuItem(context, "orthogonalize").node();
64049           if (!node) return;
64050           continueTo(clickSquare);
64051         }, 50);
64052       });
64053       context.map().on("move.intro drawn.intro", function() {
64054         var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_building" : "edit_menu_building_touch"));
64055         revealHouse(house, rightclickString, { duration: 0 });
64056       });
64057       context.history().on("change.intro", function() {
64058         continueTo(rightClickHouse);
64059       });
64060       function continueTo(nextStep) {
64061         context.on("enter.intro", null);
64062         context.map().on("move.intro drawn.intro", null);
64063         context.history().on("change.intro", null);
64064         nextStep();
64065       }
64066     }
64067     function clickSquare() {
64068       if (!_houseID) return chapter.restart();
64069       var entity = context.hasEntity(_houseID);
64070       if (!entity) return continueTo(rightClickHouse);
64071       var node = selectMenuItem(context, "orthogonalize").node();
64072       if (!node) {
64073         return continueTo(rightClickHouse);
64074       }
64075       var wasChanged = false;
64076       reveal(
64077         ".edit-menu",
64078         helpHtml("intro.buildings.square_building"),
64079         { padding: 50 }
64080       );
64081       context.on("enter.intro", function(mode) {
64082         if (mode.id === "browse") {
64083           continueTo(rightClickHouse);
64084         } else if (mode.id === "move" || mode.id === "rotate") {
64085           continueTo(retryClickSquare);
64086         }
64087       });
64088       context.map().on("move.intro", function() {
64089         var node2 = selectMenuItem(context, "orthogonalize").node();
64090         if (!wasChanged && !node2) {
64091           return continueTo(rightClickHouse);
64092         }
64093         reveal(
64094           ".edit-menu",
64095           helpHtml("intro.buildings.square_building"),
64096           { duration: 0, padding: 50 }
64097         );
64098       });
64099       context.history().on("change.intro", function() {
64100         wasChanged = true;
64101         context.history().on("change.intro", null);
64102         timeout2(function() {
64103           if (context.history().undoAnnotation() === _t("operations.orthogonalize.annotation.feature", { n: 1 })) {
64104             continueTo(doneSquare);
64105           } else {
64106             continueTo(retryClickSquare);
64107           }
64108         }, 500);
64109       });
64110       function continueTo(nextStep) {
64111         context.on("enter.intro", null);
64112         context.map().on("move.intro", null);
64113         context.history().on("change.intro", null);
64114         nextStep();
64115       }
64116     }
64117     function retryClickSquare() {
64118       context.enter(modeBrowse(context));
64119       revealHouse(house, helpHtml("intro.buildings.retry_square"), {
64120         buttonText: _t.html("intro.ok"),
64121         buttonCallback: function() {
64122           continueTo(rightClickHouse);
64123         }
64124       });
64125       function continueTo(nextStep) {
64126         nextStep();
64127       }
64128     }
64129     function doneSquare() {
64130       context.history().checkpoint("doneSquare");
64131       revealHouse(house, helpHtml("intro.buildings.done_square"), {
64132         buttonText: _t.html("intro.ok"),
64133         buttonCallback: function() {
64134           continueTo(addTank);
64135         }
64136       });
64137       function continueTo(nextStep) {
64138         nextStep();
64139       }
64140     }
64141     function addTank() {
64142       context.enter(modeBrowse(context));
64143       context.history().reset("doneSquare");
64144       _tankID = null;
64145       var msec = transitionTime(tank, context.map().center());
64146       if (msec) {
64147         reveal(null, null, { duration: 0 });
64148       }
64149       context.map().centerZoomEase(tank, 19.5, msec);
64150       timeout2(function() {
64151         reveal(
64152           "button.add-area",
64153           helpHtml("intro.buildings.add_tank")
64154         );
64155         context.on("enter.intro", function(mode) {
64156           if (mode.id !== "add-area") return;
64157           continueTo(startTank);
64158         });
64159       }, msec + 100);
64160       function continueTo(nextStep) {
64161         context.on("enter.intro", null);
64162         nextStep();
64163       }
64164     }
64165     function startTank() {
64166       if (context.mode().id !== "add-area") {
64167         return continueTo(addTank);
64168       }
64169       _tankID = null;
64170       timeout2(function() {
64171         var startString = helpHtml("intro.buildings.start_tank") + helpHtml("intro.buildings.tank_edge_" + (context.lastPointerType() === "mouse" ? "click" : "tap"));
64172         revealTank(tank, startString);
64173         context.map().on("move.intro drawn.intro", function() {
64174           revealTank(tank, startString, { duration: 0 });
64175         });
64176         context.on("enter.intro", function(mode) {
64177           if (mode.id !== "draw-area") return chapter.restart();
64178           continueTo(continueTank);
64179         });
64180       }, 550);
64181       function continueTo(nextStep) {
64182         context.map().on("move.intro drawn.intro", null);
64183         context.on("enter.intro", null);
64184         nextStep();
64185       }
64186     }
64187     function continueTank() {
64188       if (context.mode().id !== "draw-area") {
64189         return continueTo(addTank);
64190       }
64191       _tankID = null;
64192       var continueString = helpHtml("intro.buildings.continue_tank") + "{br}" + helpHtml("intro.areas.finish_area_" + (context.lastPointerType() === "mouse" ? "click" : "tap")) + helpHtml("intro.buildings.finish_tank");
64193       revealTank(tank, continueString);
64194       context.map().on("move.intro drawn.intro", function() {
64195         revealTank(tank, continueString, { duration: 0 });
64196       });
64197       context.on("enter.intro", function(mode) {
64198         if (mode.id === "draw-area") {
64199           return;
64200         } else if (mode.id === "select") {
64201           _tankID = context.selectedIDs()[0];
64202           return continueTo(searchPresetTank);
64203         } else {
64204           return continueTo(addTank);
64205         }
64206       });
64207       function continueTo(nextStep) {
64208         context.map().on("move.intro drawn.intro", null);
64209         context.on("enter.intro", null);
64210         nextStep();
64211       }
64212     }
64213     function searchPresetTank() {
64214       if (!_tankID || !context.hasEntity(_tankID)) {
64215         return addTank();
64216       }
64217       var ids = context.selectedIDs();
64218       if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
64219         context.enter(modeSelect(context, [_tankID]));
64220       }
64221       context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
64222       timeout2(function() {
64223         context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
64224         context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
64225         reveal(
64226           ".preset-search-input",
64227           helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
64228         );
64229       }, 400);
64230       context.on("enter.intro", function(mode) {
64231         if (!_tankID || !context.hasEntity(_tankID)) {
64232           return continueTo(addTank);
64233         }
64234         var ids2 = context.selectedIDs();
64235         if (mode.id !== "select" || !ids2.length || ids2[0] !== _tankID) {
64236           context.enter(modeSelect(context, [_tankID]));
64237           context.container().select(".inspector-wrap .panewrap").style("right", "-100%");
64238           context.container().select(".inspector-wrap").on("wheel.intro", eventCancel);
64239           context.container().select(".preset-search-input").on("keydown.intro", null).on("keyup.intro", checkPresetSearch);
64240           reveal(
64241             ".preset-search-input",
64242             helpHtml("intro.buildings.search_tank", { preset: tankPreset.name() })
64243           );
64244           context.history().on("change.intro", null);
64245         }
64246       });
64247       function checkPresetSearch() {
64248         var first = context.container().select(".preset-list-item:first-child");
64249         if (first.classed("preset-man_made-storage_tank")) {
64250           reveal(
64251             first.select(".preset-list-button").node(),
64252             helpHtml("intro.buildings.choose_tank", { preset: tankPreset.name() }),
64253             { duration: 300 }
64254           );
64255           context.container().select(".preset-search-input").on("keydown.intro", eventCancel, true).on("keyup.intro", null);
64256           context.history().on("change.intro", function() {
64257             continueTo(closeEditorTank);
64258           });
64259         }
64260       }
64261       function continueTo(nextStep) {
64262         context.container().select(".inspector-wrap").on("wheel.intro", null);
64263         context.on("enter.intro", null);
64264         context.history().on("change.intro", null);
64265         context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
64266         nextStep();
64267       }
64268     }
64269     function closeEditorTank() {
64270       if (!_tankID || !context.hasEntity(_tankID)) {
64271         return addTank();
64272       }
64273       var ids = context.selectedIDs();
64274       if (context.mode().id !== "select" || !ids.length || ids[0] !== _tankID) {
64275         context.enter(modeSelect(context, [_tankID]));
64276       }
64277       context.history().checkpoint("hasTank");
64278       context.on("exit.intro", function() {
64279         continueTo(rightClickTank);
64280       });
64281       timeout2(function() {
64282         reveal(
64283           ".entity-editor-pane",
64284           helpHtml("intro.buildings.close", { button: { html: icon("#iD-icon-close", "inline") } })
64285         );
64286       }, 500);
64287       function continueTo(nextStep) {
64288         context.on("exit.intro", null);
64289         nextStep();
64290       }
64291     }
64292     function rightClickTank() {
64293       if (!_tankID) return continueTo(addTank);
64294       context.enter(modeBrowse(context));
64295       context.history().reset("hasTank");
64296       context.map().centerEase(tank, 500);
64297       timeout2(function() {
64298         context.on("enter.intro", function(mode) {
64299           if (mode.id !== "select") return;
64300           var ids = context.selectedIDs();
64301           if (ids.length !== 1 || ids[0] !== _tankID) return;
64302           timeout2(function() {
64303             var node = selectMenuItem(context, "circularize").node();
64304             if (!node) return;
64305             continueTo(clickCircle);
64306           }, 50);
64307         });
64308         var rightclickString = helpHtml("intro.buildings." + (context.lastPointerType() === "mouse" ? "rightclick_tank" : "edit_menu_tank_touch"));
64309         revealTank(tank, rightclickString);
64310         context.map().on("move.intro drawn.intro", function() {
64311           revealTank(tank, rightclickString, { duration: 0 });
64312         });
64313         context.history().on("change.intro", function() {
64314           continueTo(rightClickTank);
64315         });
64316       }, 600);
64317       function continueTo(nextStep) {
64318         context.on("enter.intro", null);
64319         context.map().on("move.intro drawn.intro", null);
64320         context.history().on("change.intro", null);
64321         nextStep();
64322       }
64323     }
64324     function clickCircle() {
64325       if (!_tankID) return chapter.restart();
64326       var entity = context.hasEntity(_tankID);
64327       if (!entity) return continueTo(rightClickTank);
64328       var node = selectMenuItem(context, "circularize").node();
64329       if (!node) {
64330         return continueTo(rightClickTank);
64331       }
64332       var wasChanged = false;
64333       reveal(
64334         ".edit-menu",
64335         helpHtml("intro.buildings.circle_tank"),
64336         { padding: 50 }
64337       );
64338       context.on("enter.intro", function(mode) {
64339         if (mode.id === "browse") {
64340           continueTo(rightClickTank);
64341         } else if (mode.id === "move" || mode.id === "rotate") {
64342           continueTo(retryClickCircle);
64343         }
64344       });
64345       context.map().on("move.intro", function() {
64346         var node2 = selectMenuItem(context, "circularize").node();
64347         if (!wasChanged && !node2) {
64348           return continueTo(rightClickTank);
64349         }
64350         reveal(
64351           ".edit-menu",
64352           helpHtml("intro.buildings.circle_tank"),
64353           { duration: 0, padding: 50 }
64354         );
64355       });
64356       context.history().on("change.intro", function() {
64357         wasChanged = true;
64358         context.history().on("change.intro", null);
64359         timeout2(function() {
64360           if (context.history().undoAnnotation() === _t("operations.circularize.annotation.feature", { n: 1 })) {
64361             continueTo(play);
64362           } else {
64363             continueTo(retryClickCircle);
64364           }
64365         }, 500);
64366       });
64367       function continueTo(nextStep) {
64368         context.on("enter.intro", null);
64369         context.map().on("move.intro", null);
64370         context.history().on("change.intro", null);
64371         nextStep();
64372       }
64373     }
64374     function retryClickCircle() {
64375       context.enter(modeBrowse(context));
64376       revealTank(tank, helpHtml("intro.buildings.retry_circle"), {
64377         buttonText: _t.html("intro.ok"),
64378         buttonCallback: function() {
64379           continueTo(rightClickTank);
64380         }
64381       });
64382       function continueTo(nextStep) {
64383         nextStep();
64384       }
64385     }
64386     function play() {
64387       dispatch12.call("done");
64388       reveal(
64389         ".ideditor",
64390         helpHtml("intro.buildings.play", { next: _t("intro.startediting.title") }),
64391         {
64392           tooltipBox: ".intro-nav-wrap .chapter-startEditing",
64393           buttonText: _t.html("intro.ok"),
64394           buttonCallback: function() {
64395             reveal(".ideditor");
64396           }
64397         }
64398       );
64399     }
64400     chapter.enter = function() {
64401       addHouse();
64402     };
64403     chapter.exit = function() {
64404       timeouts.forEach(window.clearTimeout);
64405       context.on("enter.intro exit.intro", null);
64406       context.map().on("move.intro drawn.intro", null);
64407       context.history().on("change.intro", null);
64408       context.container().select(".inspector-wrap").on("wheel.intro", null);
64409       context.container().select(".preset-search-input").on("keydown.intro keyup.intro", null);
64410       context.container().select(".more-fields .combobox-input").on("click.intro", null);
64411     };
64412     chapter.restart = function() {
64413       chapter.exit();
64414       chapter.enter();
64415     };
64416     return utilRebind(chapter, dispatch12, "on");
64417   }
64418
64419   // modules/ui/intro/start_editing.js
64420   function uiIntroStartEditing(context, reveal) {
64421     var dispatch12 = dispatch_default("done", "startEditing");
64422     var modalSelection = select_default2(null);
64423     var chapter = {
64424       title: "intro.startediting.title"
64425     };
64426     function showHelp() {
64427       reveal(
64428         ".map-control.help-control",
64429         helpHtml("intro.startediting.help"),
64430         {
64431           buttonText: _t.html("intro.ok"),
64432           buttonCallback: function() {
64433             shortcuts();
64434           }
64435         }
64436       );
64437     }
64438     function shortcuts() {
64439       reveal(
64440         ".map-control.help-control",
64441         helpHtml("intro.startediting.shortcuts"),
64442         {
64443           buttonText: _t.html("intro.ok"),
64444           buttonCallback: function() {
64445             showSave();
64446           }
64447         }
64448       );
64449     }
64450     function showSave() {
64451       context.container().selectAll(".shaded").remove();
64452       reveal(
64453         ".top-toolbar button.save",
64454         helpHtml("intro.startediting.save"),
64455         {
64456           buttonText: _t.html("intro.ok"),
64457           buttonCallback: function() {
64458             showStart();
64459           }
64460         }
64461       );
64462     }
64463     function showStart() {
64464       context.container().selectAll(".shaded").remove();
64465       modalSelection = uiModal(context.container());
64466       modalSelection.select(".modal").attr("class", "modal-splash modal");
64467       modalSelection.selectAll(".close").remove();
64468       var startbutton = modalSelection.select(".content").attr("class", "fillL").append("button").attr("class", "modal-section huge-modal-button").on("click", function() {
64469         modalSelection.remove();
64470       });
64471       startbutton.append("svg").attr("class", "illustration").append("use").attr("xlink:href", "#iD-logo-walkthrough");
64472       startbutton.append("h2").call(_t.append("intro.startediting.start"));
64473       dispatch12.call("startEditing");
64474     }
64475     chapter.enter = function() {
64476       showHelp();
64477     };
64478     chapter.exit = function() {
64479       modalSelection.remove();
64480       context.container().selectAll(".shaded").remove();
64481     };
64482     return utilRebind(chapter, dispatch12, "on");
64483   }
64484
64485   // modules/ui/intro/intro.js
64486   var chapterUi = {
64487     welcome: uiIntroWelcome,
64488     navigation: uiIntroNavigation,
64489     point: uiIntroPoint,
64490     area: uiIntroArea,
64491     line: uiIntroLine,
64492     building: uiIntroBuilding,
64493     startEditing: uiIntroStartEditing
64494   };
64495   var chapterFlow = [
64496     "welcome",
64497     "navigation",
64498     "point",
64499     "area",
64500     "line",
64501     "building",
64502     "startEditing"
64503   ];
64504   function uiIntro(context) {
64505     const INTRO_IMAGERY = "Bing";
64506     let _introGraph = {};
64507     let _currChapter;
64508     function intro(selection2) {
64509       _mainFileFetcher.get("intro_graph").then((dataIntroGraph) => {
64510         for (let id2 in dataIntroGraph) {
64511           if (!_introGraph[id2]) {
64512             _introGraph[id2] = osmEntity(localize(dataIntroGraph[id2]));
64513           }
64514         }
64515         selection2.call(startIntro);
64516       }).catch(function() {
64517       });
64518     }
64519     function startIntro(selection2) {
64520       context.enter(modeBrowse(context));
64521       let osm = context.connection();
64522       let history = context.history().toJSON();
64523       let hash2 = window.location.hash;
64524       let center = context.map().center();
64525       let zoom = context.map().zoom();
64526       let background = context.background().baseLayerSource();
64527       let overlays = context.background().overlayLayerSources();
64528       let opacity = context.container().selectAll(".main-map .layer-background").style("opacity");
64529       let caches = osm && osm.caches();
64530       let baseEntities = context.history().graph().base().entities;
64531       context.ui().sidebar.expand();
64532       context.container().selectAll("button.sidebar-toggle").classed("disabled", true);
64533       context.inIntro(true);
64534       if (osm) {
64535         osm.toggle(false).reset();
64536       }
64537       context.history().reset();
64538       context.history().merge(Object.values(coreGraph().load(_introGraph).entities));
64539       context.history().checkpoint("initial");
64540       let imagery = context.background().findSource(INTRO_IMAGERY);
64541       if (imagery) {
64542         context.background().baseLayerSource(imagery);
64543       } else {
64544         context.background().bing();
64545       }
64546       overlays.forEach((d2) => context.background().toggleOverlayLayer(d2));
64547       let layers = context.layers();
64548       layers.all().forEach((item) => {
64549         if (typeof item.layer.enabled === "function") {
64550           item.layer.enabled(item.id === "osm");
64551         }
64552       });
64553       context.container().selectAll(".main-map .layer-background").style("opacity", 1);
64554       let curtain = uiCurtain(context.container().node());
64555       selection2.call(curtain);
64556       corePreferences("walkthrough_started", "yes");
64557       let storedProgress = corePreferences("walkthrough_progress") || "";
64558       let progress = storedProgress.split(";").filter(Boolean);
64559       let chapters = chapterFlow.map((chapter, i3) => {
64560         let s2 = chapterUi[chapter](context, curtain.reveal).on("done", () => {
64561           buttons.filter((d2) => d2.title === s2.title).classed("finished", true);
64562           if (i3 < chapterFlow.length - 1) {
64563             const next = chapterFlow[i3 + 1];
64564             context.container().select("button.chapter-".concat(next)).classed("next", true);
64565           }
64566           progress.push(chapter);
64567           corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
64568         });
64569         return s2;
64570       });
64571       chapters[chapters.length - 1].on("startEditing", () => {
64572         progress.push("startEditing");
64573         corePreferences("walkthrough_progress", utilArrayUniq(progress).join(";"));
64574         let incomplete = utilArrayDifference(chapterFlow, progress);
64575         if (!incomplete.length) {
64576           corePreferences("walkthrough_completed", "yes");
64577         }
64578         curtain.remove();
64579         navwrap.remove();
64580         context.container().selectAll(".main-map .layer-background").style("opacity", opacity);
64581         context.container().selectAll("button.sidebar-toggle").classed("disabled", false);
64582         if (osm) {
64583           osm.toggle(true).reset().caches(caches);
64584         }
64585         context.history().reset().merge(Object.values(baseEntities));
64586         context.background().baseLayerSource(background);
64587         overlays.forEach((d2) => context.background().toggleOverlayLayer(d2));
64588         if (history) {
64589           context.history().fromJSON(history, false);
64590         }
64591         context.map().centerZoom(center, zoom);
64592         window.history.replaceState(null, "", hash2);
64593         context.inIntro(false);
64594       });
64595       let navwrap = selection2.append("div").attr("class", "intro-nav-wrap fillD");
64596       navwrap.append("svg").attr("class", "intro-nav-wrap-logo").append("use").attr("xlink:href", "#iD-logo-walkthrough");
64597       let buttonwrap = navwrap.append("div").attr("class", "joined").selectAll("button.chapter");
64598       let buttons = buttonwrap.data(chapters).enter().append("button").attr("class", (d2, i3) => "chapter chapter-".concat(chapterFlow[i3])).on("click", enterChapter);
64599       buttons.append("span").html((d2) => _t.html(d2.title));
64600       buttons.append("span").attr("class", "status").call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
64601       enterChapter(null, chapters[0]);
64602       function enterChapter(d3_event, newChapter) {
64603         if (_currChapter) {
64604           _currChapter.exit();
64605         }
64606         context.enter(modeBrowse(context));
64607         _currChapter = newChapter;
64608         _currChapter.enter();
64609         buttons.classed("next", false).classed("active", (d2) => d2.title === _currChapter.title);
64610       }
64611     }
64612     return intro;
64613   }
64614
64615   // modules/ui/issues_info.js
64616   function uiIssuesInfo(context) {
64617     var warningsItem = {
64618       id: "warnings",
64619       count: 0,
64620       iconID: "iD-icon-alert",
64621       descriptionID: "issues.warnings_and_errors"
64622     };
64623     var resolvedItem = {
64624       id: "resolved",
64625       count: 0,
64626       iconID: "iD-icon-apply",
64627       descriptionID: "issues.user_resolved_issues"
64628     };
64629     function update(selection2) {
64630       var shownItems = [];
64631       var liveIssues = context.validator().getIssues({
64632         what: corePreferences("validate-what") || "edited",
64633         where: corePreferences("validate-where") || "all"
64634       }).filter((issue) => issue.severity !== "suggestion");
64635       if (liveIssues.length) {
64636         warningsItem.count = liveIssues.length;
64637         shownItems.push(warningsItem);
64638       }
64639       if (corePreferences("validate-what") === "all") {
64640         var resolvedIssues = context.validator().getResolvedIssues();
64641         if (resolvedIssues.length) {
64642           resolvedItem.count = resolvedIssues.length;
64643           shownItems.push(resolvedItem);
64644         }
64645       }
64646       var chips = selection2.selectAll(".chip").data(shownItems, function(d2) {
64647         return d2.id;
64648       });
64649       chips.exit().remove();
64650       var enter = chips.enter().append("a").attr("class", function(d2) {
64651         return "chip " + d2.id + "-count";
64652       }).attr("href", "#").each(function(d2) {
64653         var chipSelection = select_default2(this);
64654         var tooltipBehavior = uiTooltip().placement("top").title(() => _t.append(d2.descriptionID));
64655         chipSelection.call(tooltipBehavior).on("click", function(d3_event) {
64656           d3_event.preventDefault();
64657           tooltipBehavior.hide(select_default2(this));
64658           context.ui().togglePanes(context.container().select(".map-panes .issues-pane"));
64659         });
64660         chipSelection.call(svgIcon("#" + d2.iconID));
64661       });
64662       enter.append("span").attr("class", "count");
64663       enter.merge(chips).selectAll("span.count").text(function(d2) {
64664         return d2.count.toString();
64665       });
64666     }
64667     return function(selection2) {
64668       update(selection2);
64669       context.validator().on("validated.infobox", function() {
64670         update(selection2);
64671       });
64672     };
64673   }
64674
64675   // modules/util/IntervalTasksQueue.js
64676   var IntervalTasksQueue = class {
64677     /**
64678      * Interval in milliseconds inside which only 1 task can execute.
64679      * e.g. if interval is 200ms, and 5 async tasks are unqueued,
64680      * they will complete in ~1s if not cleared
64681      * @param {number} intervalInMs
64682      */
64683     constructor(intervalInMs) {
64684       this.intervalInMs = intervalInMs;
64685       this.pendingHandles = [];
64686       this.time = 0;
64687     }
64688     enqueue(task) {
64689       let taskTimeout = this.time;
64690       this.time += this.intervalInMs;
64691       this.pendingHandles.push(setTimeout(() => {
64692         this.time -= this.intervalInMs;
64693         task();
64694       }, taskTimeout));
64695     }
64696     clear() {
64697       this.pendingHandles.forEach((timeoutHandle) => {
64698         clearTimeout(timeoutHandle);
64699       });
64700       this.pendingHandles = [];
64701       this.time = 0;
64702     }
64703   };
64704
64705   // modules/renderer/background_source.js
64706   var isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
64707   var _a4;
64708   (_a4 = window.matchMedia) == null ? void 0 : _a4.call(window, "\n        (-webkit-min-device-pixel-ratio: 2), /* Safari */\n        (min-resolution: 2dppx),             /* standard */\n        (min-resolution: 192dpi)             /* fallback */\n    ").addListener(function() {
64709     isRetina = window.devicePixelRatio && window.devicePixelRatio >= 2;
64710   });
64711   function localeDateString(s2) {
64712     if (!s2) return null;
64713     var options = { day: "numeric", month: "short", year: "numeric" };
64714     var d2 = new Date(s2);
64715     if (isNaN(d2.getTime())) return null;
64716     return d2.toLocaleDateString(_mainLocalizer.localeCode(), options);
64717   }
64718   function vintageRange(vintage) {
64719     var s2;
64720     if (vintage.start || vintage.end) {
64721       s2 = vintage.start || "?";
64722       if (vintage.start !== vintage.end) {
64723         s2 += " - " + (vintage.end || "?");
64724       }
64725     }
64726     return s2;
64727   }
64728   function rendererBackgroundSource(data) {
64729     var source = Object.assign({}, data);
64730     var _offset = [0, 0];
64731     var _name = source.name;
64732     var _description = source.description;
64733     var _best = !!source.best;
64734     var _template = source.encrypted ? utilAesDecrypt(source.template) : source.template;
64735     source.tileSize = data.tileSize || 256;
64736     source.zoomExtent = data.zoomExtent || [0, 22];
64737     source.overzoom = data.overzoom !== false;
64738     source.offset = function(val) {
64739       if (!arguments.length) return _offset;
64740       _offset = val;
64741       return source;
64742     };
64743     source.nudge = function(val, zoomlevel) {
64744       _offset[0] += val[0] / Math.pow(2, zoomlevel);
64745       _offset[1] += val[1] / Math.pow(2, zoomlevel);
64746       return source;
64747     };
64748     source.name = function() {
64749       var id_safe = source.id.replace(/\./g, "<TX_DOT>");
64750       return _t("imagery." + id_safe + ".name", { default: escape_default(_name) });
64751     };
64752     source.label = function() {
64753       var id_safe = source.id.replace(/\./g, "<TX_DOT>");
64754       return _t.append("imagery." + id_safe + ".name", { default: escape_default(_name) });
64755     };
64756     source.hasDescription = function() {
64757       var id_safe = source.id.replace(/\./g, "<TX_DOT>");
64758       var descriptionText = _mainLocalizer.tInfo("imagery." + id_safe + ".description", { default: escape_default(_description) }).text;
64759       return descriptionText !== "";
64760     };
64761     source.description = function() {
64762       var id_safe = source.id.replace(/\./g, "<TX_DOT>");
64763       return _t.append("imagery." + id_safe + ".description", { default: escape_default(_description) });
64764     };
64765     source.best = function() {
64766       return _best;
64767     };
64768     source.area = function() {
64769       if (!data.polygon) return Number.MAX_VALUE;
64770       var area = area_default2({ type: "MultiPolygon", coordinates: [data.polygon] });
64771       return isNaN(area) ? 0 : area;
64772     };
64773     source.imageryUsed = function() {
64774       return _name || source.id;
64775     };
64776     source.template = function(val) {
64777       if (!arguments.length) return _template;
64778       if (source.id === "custom" || source.id === "Bing") {
64779         _template = val;
64780       }
64781       return source;
64782     };
64783     source.url = function(coord2) {
64784       var result = _template.replace(new RegExp("#[\\s\\S]*", "u"), "");
64785       if (result === "") return result;
64786       if (!source.type || source.id === "custom") {
64787         if (/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(result)) {
64788           source.type = "wms";
64789           source.projection = "EPSG:3857";
64790         } else if (/\{(x|y)\}/.test(result)) {
64791           source.type = "tms";
64792         } else if (/\{u\}/.test(result)) {
64793           source.type = "bing";
64794         }
64795       }
64796       if (source.type === "wms") {
64797         var tileToProjectedCoords = (function(x3, y3, z3) {
64798           var zoomSize = Math.pow(2, z3);
64799           var lon = x3 / zoomSize * Math.PI * 2 - Math.PI;
64800           var lat = Math.atan(Math.sinh(Math.PI * (1 - 2 * y3 / zoomSize)));
64801           switch (source.projection) {
64802             case "EPSG:4326":
64803               return {
64804                 x: lon * 180 / Math.PI,
64805                 y: lat * 180 / Math.PI
64806               };
64807             default:
64808               var mercCoords = mercatorRaw(lon, lat);
64809               return {
64810                 x: 2003750834e-2 / Math.PI * mercCoords[0],
64811                 y: 2003750834e-2 / Math.PI * mercCoords[1]
64812               };
64813           }
64814         });
64815         var tileSize = source.tileSize;
64816         var projection2 = source.projection;
64817         var minXmaxY = tileToProjectedCoords(coord2[0], coord2[1], coord2[2]);
64818         var maxXminY = tileToProjectedCoords(coord2[0] + 1, coord2[1] + 1, coord2[2]);
64819         result = result.replace(/\{(\w+)\}/g, function(token, key) {
64820           switch (key) {
64821             case "width":
64822             case "height":
64823               return tileSize;
64824             case "proj":
64825               return projection2;
64826             case "wkid":
64827               return projection2.replace(/^EPSG:/, "");
64828             case "bbox":
64829               if (projection2 === "EPSG:4326" && // The CRS parameter implies version 1.3 (prior versions use SRS)
64830               /VERSION=1.3|CRS={proj}/.test(source.template().toUpperCase())) {
64831                 return maxXminY.y + "," + minXmaxY.x + "," + minXmaxY.y + "," + maxXminY.x;
64832               } else {
64833                 return minXmaxY.x + "," + maxXminY.y + "," + maxXminY.x + "," + minXmaxY.y;
64834               }
64835             case "w":
64836               return minXmaxY.x;
64837             case "s":
64838               return maxXminY.y;
64839             case "n":
64840               return maxXminY.x;
64841             case "e":
64842               return minXmaxY.y;
64843             default:
64844               return token;
64845           }
64846         });
64847       } else if (source.type === "tms") {
64848         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" : "");
64849       } else if (source.type === "bing") {
64850         result = result.replace("{u}", function() {
64851           var u4 = "";
64852           for (var zoom = coord2[2]; zoom > 0; zoom--) {
64853             var b3 = 0;
64854             var mask = 1 << zoom - 1;
64855             if ((coord2[0] & mask) !== 0) b3++;
64856             if ((coord2[1] & mask) !== 0) b3 += 2;
64857             u4 += b3.toString();
64858           }
64859           return u4;
64860         });
64861       }
64862       result = result.replace(/\{switch:([^}]+)\}/, function(s2, r2) {
64863         var subdomains = r2.split(",");
64864         return subdomains[(coord2[0] + coord2[1]) % subdomains.length];
64865       });
64866       return result;
64867     };
64868     source.validZoom = function(z3, underzoom) {
64869       if (underzoom === void 0) underzoom = 0;
64870       return source.zoomExtent[0] - underzoom <= z3 && (source.overzoom || source.zoomExtent[1] > z3);
64871     };
64872     source.isLocatorOverlay = function() {
64873       return source.id === "mapbox_locator_overlay";
64874     };
64875     source.isHidden = function() {
64876       return false;
64877     };
64878     source.copyrightNotices = function() {
64879     };
64880     source.getMetadata = function(center, tileCoord, callback) {
64881       var vintage = {
64882         start: localeDateString(source.startDate),
64883         end: localeDateString(source.endDate)
64884       };
64885       vintage.range = vintageRange(vintage);
64886       var metadata = { vintage };
64887       callback(null, metadata);
64888     };
64889     return source;
64890   }
64891   rendererBackgroundSource.Bing = function(data, dispatch12) {
64892     data.template = "https://ecn.t{switch:0,1,2,3}.tiles.virtualearth.net/tiles/a{u}.jpeg?g=1&pr=odbl&n=z";
64893     var bing = rendererBackgroundSource(data);
64894     var key = utilAesDecrypt("5c875730b09c6b422433e807e1ff060b6536c791dbfffcffc4c6b18a1bdba1f14593d151adb50e19e1be1ab19aef813bf135d0f103475e5c724dec94389e45d0");
64895     const strictParam = "n";
64896     var url = "https://dev.virtualearth.net/REST/v1/Imagery/Metadata/AerialOSM?include=ImageryProviders&uriScheme=https&key=" + key;
64897     var cache = {};
64898     var inflight = {};
64899     var providers = [];
64900     var taskQueue = new IntervalTasksQueue(250);
64901     var metadataLastZoom = -1;
64902     json_default(url).then(function(json) {
64903       let imageryResource = json.resourceSets[0].resources[0];
64904       let template = imageryResource.imageUrl;
64905       let subDomains = imageryResource.imageUrlSubdomains;
64906       let subDomainNumbers = subDomains.map((subDomain) => {
64907         return subDomain.substring(1);
64908       }).join(",");
64909       template = template.replace("{subdomain}", "t{switch:".concat(subDomainNumbers, "}")).replace("{quadkey}", "{u}");
64910       if (!new URLSearchParams(template).has(strictParam)) {
64911         template += "&".concat(strictParam, "=z");
64912       }
64913       bing.template(template);
64914       providers = imageryResource.imageryProviders.map(function(provider) {
64915         return {
64916           attribution: provider.attribution,
64917           areas: provider.coverageAreas.map(function(area) {
64918             return {
64919               zoom: [area.zoomMin, area.zoomMax],
64920               extent: geoExtent([area.bbox[1], area.bbox[0]], [area.bbox[3], area.bbox[2]])
64921             };
64922           })
64923         };
64924       });
64925       dispatch12.call("change");
64926     }).catch(function() {
64927     });
64928     bing.copyrightNotices = function(zoom, extent) {
64929       zoom = Math.min(zoom, 21);
64930       return providers.filter(function(provider) {
64931         return provider.areas.some(function(area) {
64932           return extent.intersects(area.extent) && area.zoom[0] <= zoom && area.zoom[1] >= zoom;
64933         });
64934       }).map(function(provider) {
64935         return provider.attribution;
64936       }).join(", ");
64937     };
64938     bing.getMetadata = function(center, tileCoord, callback) {
64939       var tileID = tileCoord.slice(0, 3).join("/");
64940       var zoom = Math.min(tileCoord[2], 21);
64941       var centerPoint = center[1] + "," + center[0];
64942       var url2 = "https://dev.virtualearth.net/REST/v1/Imagery/BasicMetadata/AerialOSM/" + centerPoint + "?zl=" + zoom + "&key=" + key;
64943       if (inflight[tileID]) return;
64944       if (!cache[tileID]) {
64945         cache[tileID] = {};
64946       }
64947       if (cache[tileID] && cache[tileID].metadata) {
64948         return callback(null, cache[tileID].metadata);
64949       }
64950       inflight[tileID] = true;
64951       if (metadataLastZoom !== tileCoord[2]) {
64952         metadataLastZoom = tileCoord[2];
64953         taskQueue.clear();
64954       }
64955       taskQueue.enqueue(() => {
64956         json_default(url2).then(function(result) {
64957           delete inflight[tileID];
64958           if (!result) {
64959             throw new Error("Unknown Error");
64960           }
64961           var vintage = {
64962             start: localeDateString(result.resourceSets[0].resources[0].vintageStart),
64963             end: localeDateString(result.resourceSets[0].resources[0].vintageEnd)
64964           };
64965           vintage.range = vintageRange(vintage);
64966           var metadata = { vintage };
64967           cache[tileID].metadata = metadata;
64968           if (callback) callback(null, metadata);
64969         }).catch(function(err) {
64970           delete inflight[tileID];
64971           if (callback) callback(err.message);
64972         });
64973       });
64974     };
64975     bing.terms_url = "https://blog.openstreetmap.org/2010/11/30/microsoft-imagery-details";
64976     return bing;
64977   };
64978   rendererBackgroundSource.Esri = function(data) {
64979     if (data.template.match(/blankTile/) === null) {
64980       data.template = data.template + "?blankTile=false";
64981     }
64982     var esri = rendererBackgroundSource(data);
64983     var cache = {};
64984     var inflight = {};
64985     var _prevCenter;
64986     esri.fetchTilemap = function(center) {
64987       if (_prevCenter && geoSphericalDistance(center, _prevCenter) < 5e3) return;
64988       _prevCenter = center;
64989       var z3 = 20;
64990       var dummyUrl = esri.url([1, 2, 3]);
64991       var x3 = Math.floor((center[0] + 180) / 360 * Math.pow(2, z3));
64992       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));
64993       var tilemapUrl = dummyUrl.replace(/tile\/[0-9]+\/[0-9]+\/[0-9]+\?blankTile=false/, "tilemap") + "/" + z3 + "/" + y3 + "/" + x3 + "/8/8";
64994       json_default(tilemapUrl).then(function(tilemap) {
64995         if (!tilemap) {
64996           throw new Error("Unknown Error");
64997         }
64998         var hasTiles = true;
64999         for (var i3 = 0; i3 < tilemap.data.length; i3++) {
65000           if (!tilemap.data[i3]) {
65001             hasTiles = false;
65002             break;
65003           }
65004         }
65005         esri.zoomExtent[1] = hasTiles ? 22 : 19;
65006       }).catch(function() {
65007       });
65008     };
65009     esri.getMetadata = function(center, tileCoord, callback) {
65010       if (esri.id !== "EsriWorldImagery") {
65011         return callback(null, {});
65012       }
65013       var tileID = tileCoord.slice(0, 3).join("/");
65014       var zoom = Math.min(tileCoord[2], esri.zoomExtent[1]);
65015       var centerPoint = center[0] + "," + center[1];
65016       var unknown = _t("info_panels.background.unknown");
65017       var vintage = {};
65018       var metadata = {};
65019       if (inflight[tileID]) return;
65020       var url = "https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/4/query";
65021       url += "?returnGeometry=false&geometry=" + centerPoint + "&inSR=4326&geometryType=esriGeometryPoint&outFields=*&f=json";
65022       if (!cache[tileID]) {
65023         cache[tileID] = {};
65024       }
65025       if (cache[tileID] && cache[tileID].metadata) {
65026         return callback(null, cache[tileID].metadata);
65027       }
65028       inflight[tileID] = true;
65029       json_default(url).then(function(result) {
65030         delete inflight[tileID];
65031         result = result.features.map((f2) => f2.attributes).filter((a2) => a2.MinMapLevel <= zoom && a2.MaxMapLevel >= zoom)[0];
65032         if (!result) {
65033           throw new Error("Unknown Error");
65034         } else if (result.features && result.features.length < 1) {
65035           throw new Error("No Results");
65036         } else if (result.error && result.error.message) {
65037           throw new Error(result.error.message);
65038         }
65039         var captureDate = localeDateString(result.SRC_DATE2);
65040         vintage = {
65041           start: captureDate,
65042           end: captureDate,
65043           range: captureDate
65044         };
65045         metadata = {
65046           vintage,
65047           source: clean2(result.NICE_NAME),
65048           description: clean2(result.NICE_DESC),
65049           resolution: clean2(+Number(result.SRC_RES).toFixed(4)),
65050           accuracy: clean2(+Number(result.SRC_ACC).toFixed(4))
65051         };
65052         if (isFinite(metadata.resolution)) {
65053           metadata.resolution += " m";
65054         }
65055         if (isFinite(metadata.accuracy)) {
65056           metadata.accuracy += " m";
65057         }
65058         cache[tileID].metadata = metadata;
65059         if (callback) callback(null, metadata);
65060       }).catch(function(err) {
65061         delete inflight[tileID];
65062         if (callback) callback(err.message);
65063       });
65064       function clean2(val) {
65065         return String(val).trim() || unknown;
65066       }
65067     };
65068     return esri;
65069   };
65070   rendererBackgroundSource.None = function() {
65071     var source = rendererBackgroundSource({ id: "none", template: "" });
65072     source.name = function() {
65073       return _t("background.none");
65074     };
65075     source.label = function() {
65076       return _t.append("background.none");
65077     };
65078     source.imageryUsed = function() {
65079       return null;
65080     };
65081     source.area = function() {
65082       return -1;
65083     };
65084     return source;
65085   };
65086   rendererBackgroundSource.Custom = function(template) {
65087     var source = rendererBackgroundSource({ id: "custom", template });
65088     source.name = function() {
65089       return _t("background.custom");
65090     };
65091     source.label = function() {
65092       return _t.append("background.custom");
65093     };
65094     source.imageryUsed = function() {
65095       var cleaned = source.template();
65096       if (cleaned.indexOf("?") !== -1) {
65097         var parts = cleaned.split("?", 2);
65098         var qs = utilStringQs(parts[1]);
65099         ["access_token", "connectId", "token", "Signature"].forEach(function(param) {
65100           if (qs[param]) {
65101             qs[param] = "{apikey}";
65102           }
65103         });
65104         cleaned = parts[0] + "?" + utilQsString(qs, true);
65105       }
65106       cleaned = cleaned.replace(/token\/(\w+)/, "token/{apikey}").replace(/key=(\w+)/, "key={apikey}");
65107       return "Custom (" + cleaned + " )";
65108     };
65109     source.area = function() {
65110       return -2;
65111     };
65112     return source;
65113   };
65114
65115   // node_modules/@turf/meta/dist/esm/index.js
65116   function coordEach(geojson, callback, excludeWrapCoord) {
65117     if (geojson === null) return;
65118     var j3, k3, l2, geometry, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type2 = geojson.type, isFeatureCollection = type2 === "FeatureCollection", isFeature = type2 === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
65119     for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
65120       geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
65121       isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
65122       stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
65123       for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
65124         var multiFeatureIndex = 0;
65125         var geometryIndex = 0;
65126         geometry = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
65127         if (geometry === null) continue;
65128         coords = geometry.coordinates;
65129         var geomType = geometry.type;
65130         wrapShrink = excludeWrapCoord && (geomType === "Polygon" || geomType === "MultiPolygon") ? 1 : 0;
65131         switch (geomType) {
65132           case null:
65133             break;
65134           case "Point":
65135             if (callback(
65136               coords,
65137               coordIndex,
65138               featureIndex,
65139               multiFeatureIndex,
65140               geometryIndex
65141             ) === false)
65142               return false;
65143             coordIndex++;
65144             multiFeatureIndex++;
65145             break;
65146           case "LineString":
65147           case "MultiPoint":
65148             for (j3 = 0; j3 < coords.length; j3++) {
65149               if (callback(
65150                 coords[j3],
65151                 coordIndex,
65152                 featureIndex,
65153                 multiFeatureIndex,
65154                 geometryIndex
65155               ) === false)
65156                 return false;
65157               coordIndex++;
65158               if (geomType === "MultiPoint") multiFeatureIndex++;
65159             }
65160             if (geomType === "LineString") multiFeatureIndex++;
65161             break;
65162           case "Polygon":
65163           case "MultiLineString":
65164             for (j3 = 0; j3 < coords.length; j3++) {
65165               for (k3 = 0; k3 < coords[j3].length - wrapShrink; k3++) {
65166                 if (callback(
65167                   coords[j3][k3],
65168                   coordIndex,
65169                   featureIndex,
65170                   multiFeatureIndex,
65171                   geometryIndex
65172                 ) === false)
65173                   return false;
65174                 coordIndex++;
65175               }
65176               if (geomType === "MultiLineString") multiFeatureIndex++;
65177               if (geomType === "Polygon") geometryIndex++;
65178             }
65179             if (geomType === "Polygon") multiFeatureIndex++;
65180             break;
65181           case "MultiPolygon":
65182             for (j3 = 0; j3 < coords.length; j3++) {
65183               geometryIndex = 0;
65184               for (k3 = 0; k3 < coords[j3].length; k3++) {
65185                 for (l2 = 0; l2 < coords[j3][k3].length - wrapShrink; l2++) {
65186                   if (callback(
65187                     coords[j3][k3][l2],
65188                     coordIndex,
65189                     featureIndex,
65190                     multiFeatureIndex,
65191                     geometryIndex
65192                   ) === false)
65193                     return false;
65194                   coordIndex++;
65195                 }
65196                 geometryIndex++;
65197               }
65198               multiFeatureIndex++;
65199             }
65200             break;
65201           case "GeometryCollection":
65202             for (j3 = 0; j3 < geometry.geometries.length; j3++)
65203               if (coordEach(geometry.geometries[j3], callback, excludeWrapCoord) === false)
65204                 return false;
65205             break;
65206           default:
65207             throw new Error("Unknown Geometry Type");
65208         }
65209       }
65210     }
65211   }
65212
65213   // node_modules/@turf/bbox/dist/esm/index.js
65214   function bbox(geojson, options = {}) {
65215     if (geojson.bbox != null && true !== options.recompute) {
65216       return geojson.bbox;
65217     }
65218     const result = [Infinity, Infinity, -Infinity, -Infinity];
65219     coordEach(geojson, (coord2) => {
65220       if (result[0] > coord2[0]) {
65221         result[0] = coord2[0];
65222       }
65223       if (result[1] > coord2[1]) {
65224         result[1] = coord2[1];
65225       }
65226       if (result[2] < coord2[0]) {
65227         result[2] = coord2[0];
65228       }
65229       if (result[3] < coord2[1]) {
65230         result[3] = coord2[1];
65231       }
65232     });
65233     return result;
65234   }
65235   var turf_bbox_default = bbox;
65236
65237   // modules/renderer/background.js
65238   var import_which_polygon5 = __toESM(require_which_polygon(), 1);
65239
65240   // modules/renderer/tile_layer.js
65241   function rendererTileLayer(context) {
65242     var transformProp = utilPrefixCSSProperty("Transform");
65243     var tiler8 = utilTiler();
65244     var _tileSize = 256;
65245     var _projection;
65246     var _cache5 = {};
65247     var _tileOrigin;
65248     var _zoom;
65249     var _source;
65250     var _underzoom = 0;
65251     function tileSizeAtZoom(d2, z3) {
65252       return d2.tileSize * Math.pow(2, z3 - d2[2]) / d2.tileSize;
65253     }
65254     function atZoom(t2, distance) {
65255       var power = Math.pow(2, distance);
65256       return [
65257         Math.floor(t2[0] * power),
65258         Math.floor(t2[1] * power),
65259         t2[2] + distance
65260       ];
65261     }
65262     function lookUp(d2) {
65263       for (var up = -1; up > -d2[2]; up--) {
65264         var tile = atZoom(d2, up);
65265         if (_cache5[_source.url(tile)] !== false) {
65266           return tile;
65267         }
65268       }
65269     }
65270     function uniqueBy(a2, n3) {
65271       var o2 = [];
65272       var seen = {};
65273       for (var i3 = 0; i3 < a2.length; i3++) {
65274         if (seen[a2[i3][n3]] === void 0) {
65275           o2.push(a2[i3]);
65276           seen[a2[i3][n3]] = true;
65277         }
65278       }
65279       return o2;
65280     }
65281     function addSource(d2) {
65282       d2.url = _source.url(d2);
65283       d2.tileSize = _tileSize;
65284       d2.source = _source;
65285       return d2;
65286     }
65287     function background(selection2) {
65288       _zoom = geoScaleToZoom(_projection.scale(), _tileSize);
65289       var pixelOffset;
65290       if (_source) {
65291         pixelOffset = [
65292           _source.offset()[0] * Math.pow(2, _zoom),
65293           _source.offset()[1] * Math.pow(2, _zoom)
65294         ];
65295       } else {
65296         pixelOffset = [0, 0];
65297       }
65298       tiler8.scale(_projection.scale() * 2 * Math.PI).translate([
65299         _projection.translate()[0] + pixelOffset[0],
65300         _projection.translate()[1] + pixelOffset[1]
65301       ]);
65302       _tileOrigin = [
65303         _projection.scale() * Math.PI - _projection.translate()[0],
65304         _projection.scale() * Math.PI - _projection.translate()[1]
65305       ];
65306       render(selection2);
65307     }
65308     function render(selection2) {
65309       if (!_source) return;
65310       var requests = [];
65311       var showDebug = context.getDebug("tile") && !_source.overlay;
65312       if (_source.validZoom(_zoom, _underzoom)) {
65313         tiler8.skipNullIsland(!!_source.overlay);
65314         tiler8().forEach(function(d2) {
65315           addSource(d2);
65316           if (d2.url === "") return;
65317           if (typeof d2.url !== "string") return;
65318           requests.push(d2);
65319           if (_cache5[d2.url] === false && lookUp(d2)) {
65320             requests.push(addSource(lookUp(d2)));
65321           }
65322         });
65323         requests = uniqueBy(requests, "url").filter(function(r2) {
65324           return _cache5[r2.url] !== false;
65325         });
65326       }
65327       function load(d3_event, d2) {
65328         _cache5[d2.url] = true;
65329         select_default2(this).on("error", null).on("load", null);
65330         render(selection2);
65331       }
65332       function error(d3_event, d2) {
65333         _cache5[d2.url] = false;
65334         select_default2(this).on("error", null).on("load", null).remove();
65335         render(selection2);
65336       }
65337       function imageTransform(d2) {
65338         var ts = d2.tileSize * Math.pow(2, _zoom - d2[2]);
65339         var scale = tileSizeAtZoom(d2, _zoom);
65340         return "translate(" + ((d2[0] * ts + d2.source.offset()[0] * Math.pow(2, _zoom)) * _tileSize / d2.tileSize - _tileOrigin[0]) + "px," + ((d2[1] * ts + d2.source.offset()[1] * Math.pow(2, _zoom)) * _tileSize / d2.tileSize - _tileOrigin[1]) + "px) scale(" + scale * _tileSize / d2.tileSize + "," + scale * _tileSize / d2.tileSize + ")";
65341       }
65342       function tileCenter(d2) {
65343         var ts = d2.tileSize * Math.pow(2, _zoom - d2[2]);
65344         return [
65345           d2[0] * ts - _tileOrigin[0] + ts / 2,
65346           d2[1] * ts - _tileOrigin[1] + ts / 2
65347         ];
65348       }
65349       function debugTransform(d2) {
65350         var coord2 = tileCenter(d2);
65351         return "translate(" + coord2[0] + "px," + coord2[1] + "px)";
65352       }
65353       var dims = tiler8.size();
65354       var mapCenter = [dims[0] / 2, dims[1] / 2];
65355       var minDist = Math.max(dims[0], dims[1]);
65356       var nearCenter;
65357       requests.forEach(function(d2) {
65358         var c2 = tileCenter(d2);
65359         var dist = geoVecLength(c2, mapCenter);
65360         if (dist < minDist) {
65361           minDist = dist;
65362           nearCenter = d2;
65363         }
65364       });
65365       var image = selection2.selectAll("img").data(requests, function(d2) {
65366         return d2.url;
65367       });
65368       image.exit().style(transformProp, imageTransform).classed("tile-removing", true).classed("tile-center", false).on("transitionend", function() {
65369         const tile = select_default2(this);
65370         if (tile.classed("tile-removing")) {
65371           tile.remove();
65372         }
65373       });
65374       image.enter().append("img").attr("class", "tile").attr("alt", "").attr("draggable", "false").style("width", _tileSize + "px").style("height", _tileSize + "px").attr("src", function(d2) {
65375         return d2.url;
65376       }).on("error", error).on("load", load).merge(image).style(transformProp, imageTransform).classed("tile-debug", showDebug).classed("tile-removing", false).classed("tile-center", function(d2) {
65377         return d2 === nearCenter;
65378       }).sort((a2, b3) => a2[2] - b3[2]);
65379       var debug2 = selection2.selectAll(".tile-label-debug").data(showDebug ? requests : [], function(d2) {
65380         return d2.url;
65381       });
65382       debug2.exit().remove();
65383       if (showDebug) {
65384         var debugEnter = debug2.enter().append("div").attr("class", "tile-label-debug");
65385         debugEnter.append("div").attr("class", "tile-label-debug-coord");
65386         debugEnter.append("div").attr("class", "tile-label-debug-vintage");
65387         debug2 = debug2.merge(debugEnter);
65388         debug2.style(transformProp, debugTransform);
65389         debug2.selectAll(".tile-label-debug-coord").text(function(d2) {
65390           return d2[2] + " / " + d2[0] + " / " + d2[1];
65391         });
65392         debug2.selectAll(".tile-label-debug-vintage").each(function(d2) {
65393           var span = select_default2(this);
65394           var center = context.projection.invert(tileCenter(d2));
65395           _source.getMetadata(center, d2, function(err, result) {
65396             if (result && result.vintage && result.vintage.range) {
65397               span.text(result.vintage.range);
65398             } else {
65399               span.text("");
65400               span.call(_t.append("info_panels.background.vintage"));
65401               span.append("span").text(": ");
65402               span.call(_t.append("info_panels.background.unknown"));
65403             }
65404           });
65405         });
65406       }
65407     }
65408     background.projection = function(val) {
65409       if (!arguments.length) return _projection;
65410       _projection = val;
65411       return background;
65412     };
65413     background.dimensions = function(val) {
65414       if (!arguments.length) return tiler8.size();
65415       tiler8.size(val);
65416       return background;
65417     };
65418     background.source = function(val) {
65419       if (!arguments.length) return _source;
65420       _source = val;
65421       _tileSize = _source.tileSize;
65422       _cache5 = {};
65423       tiler8.tileSize(_source.tileSize).zoomExtent(_source.zoomExtent);
65424       return background;
65425     };
65426     background.underzoom = function(amount) {
65427       if (!arguments.length) return _underzoom;
65428       _underzoom = amount;
65429       return background;
65430     };
65431     return background;
65432   }
65433
65434   // modules/renderer/background.js
65435   var _imageryIndex = null;
65436   function rendererBackground(context) {
65437     const dispatch12 = dispatch_default("change");
65438     const baseLayer = rendererTileLayer(context).projection(context.projection);
65439     let _checkedBlocklists = [];
65440     let _isValid = true;
65441     let _overlayLayers = [];
65442     let _brightness = 1;
65443     let _contrast = 1;
65444     let _saturation = 1;
65445     let _sharpness = 1;
65446     function ensureImageryIndex() {
65447       return _mainFileFetcher.get("imagery").then((sources) => {
65448         if (_imageryIndex) return _imageryIndex;
65449         _imageryIndex = {
65450           imagery: sources,
65451           features: {}
65452         };
65453         const features = sources.map((source) => {
65454           if (!source.polygon) return null;
65455           const rings = source.polygon.map((ring) => [ring]);
65456           const feature4 = {
65457             type: "Feature",
65458             properties: { id: source.id },
65459             geometry: { type: "MultiPolygon", coordinates: rings }
65460           };
65461           _imageryIndex.features[source.id] = feature4;
65462           return feature4;
65463         }).filter(Boolean);
65464         _imageryIndex.query = (0, import_which_polygon5.default)({ type: "FeatureCollection", features });
65465         _imageryIndex.backgrounds = sources.map((source) => {
65466           if (source.type === "bing") {
65467             return rendererBackgroundSource.Bing(source, dispatch12);
65468           } else if (/^EsriWorldImagery/.test(source.id)) {
65469             return rendererBackgroundSource.Esri(source);
65470           } else {
65471             return rendererBackgroundSource(source);
65472           }
65473         });
65474         _imageryIndex.backgrounds.unshift(rendererBackgroundSource.None());
65475         let template = corePreferences("background-custom-template") || "";
65476         const custom = rendererBackgroundSource.Custom(template);
65477         _imageryIndex.backgrounds.unshift(custom);
65478         return _imageryIndex;
65479       });
65480     }
65481     function background(selection2) {
65482       const currSource = baseLayer.source();
65483       if (context.map().zoom() > 18) {
65484         if (currSource && /^EsriWorldImagery/.test(currSource.id)) {
65485           const center = context.map().center();
65486           currSource.fetchTilemap(center);
65487         }
65488       }
65489       const sources = background.sources(context.map().extent());
65490       const wasValid = _isValid;
65491       _isValid = !!sources.filter((d2) => d2 === currSource).length;
65492       if (wasValid !== _isValid) {
65493         background.updateImagery();
65494       }
65495       let baseFilter = "";
65496       if (_brightness !== 1) {
65497         baseFilter += " brightness(".concat(_brightness, ")");
65498       }
65499       if (_contrast !== 1) {
65500         baseFilter += " contrast(".concat(_contrast, ")");
65501       }
65502       if (_saturation !== 1) {
65503         baseFilter += " saturate(".concat(_saturation, ")");
65504       }
65505       if (_sharpness < 1) {
65506         const blur = number_default(0.5, 5)(1 - _sharpness);
65507         baseFilter += " blur(".concat(blur, "px)");
65508       }
65509       let base = selection2.selectAll(".layer-background").data([0]);
65510       base = base.enter().insert("div", ".layer-data").attr("class", "layer layer-background").merge(base);
65511       base.style("filter", baseFilter || null);
65512       let imagery = base.selectAll(".layer-imagery").data([0]);
65513       imagery.enter().append("div").attr("class", "layer layer-imagery").merge(imagery).call(baseLayer);
65514       let maskFilter = "";
65515       let mixBlendMode = "";
65516       if (_sharpness > 1) {
65517         mixBlendMode = "overlay";
65518         maskFilter = "saturate(0) blur(3px) invert(1)";
65519         let contrast = _sharpness - 1;
65520         maskFilter += " contrast(".concat(contrast, ")");
65521         let brightness = number_default(1, 0.85)(_sharpness - 1);
65522         maskFilter += " brightness(".concat(brightness, ")");
65523       }
65524       let mask = base.selectAll(".layer-unsharp-mask").data(_sharpness > 1 ? [0] : []);
65525       mask.exit().remove();
65526       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);
65527       let overlays = selection2.selectAll(".layer-overlay").data(_overlayLayers, (d2) => d2.source().name());
65528       overlays.exit().remove();
65529       overlays.enter().insert("div", ".layer-data").attr("class", "layer layer-overlay").merge(overlays).each((layer, i3, nodes) => select_default2(nodes[i3]).call(layer));
65530     }
65531     background.updateImagery = function() {
65532       let currSource = baseLayer.source();
65533       if (context.inIntro() || !currSource) return;
65534       let o2 = _overlayLayers.filter((d2) => !d2.source().isLocatorOverlay() && !d2.source().isHidden()).map((d2) => d2.source().id).join(",");
65535       const meters = geoOffsetToMeters(currSource.offset());
65536       const EPSILON = 0.01;
65537       const x3 = +meters[0].toFixed(2);
65538       const y3 = +meters[1].toFixed(2);
65539       let hash2 = utilStringQs(window.location.hash);
65540       let id2 = currSource.id;
65541       if (id2 === "custom") {
65542         id2 = "custom:".concat(currSource.template());
65543       }
65544       if (id2) {
65545         hash2.background = id2;
65546       } else {
65547         delete hash2.background;
65548       }
65549       if (o2) {
65550         hash2.overlays = o2;
65551       } else {
65552         delete hash2.overlays;
65553       }
65554       if (Math.abs(x3) > EPSILON || Math.abs(y3) > EPSILON) {
65555         hash2.offset = "".concat(x3, ",").concat(y3);
65556       } else {
65557         delete hash2.offset;
65558       }
65559       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
65560       let imageryUsed = [];
65561       let photoOverlaysUsed = [];
65562       const currUsed = currSource.imageryUsed();
65563       if (currUsed && _isValid) {
65564         imageryUsed.push(currUsed);
65565       }
65566       _overlayLayers.filter((d2) => !d2.source().isLocatorOverlay() && !d2.source().isHidden()).forEach((d2) => imageryUsed.push(d2.source().imageryUsed()));
65567       const dataLayer = context.layers().layer("data");
65568       if (dataLayer && dataLayer.enabled() && dataLayer.hasData()) {
65569         imageryUsed.push(dataLayer.getSrc());
65570       }
65571       const photoOverlayLayers = {
65572         streetside: "Bing Streetside",
65573         mapillary: "Mapillary Images",
65574         "mapillary-map-features": "Mapillary Map Features",
65575         "mapillary-signs": "Mapillary Signs",
65576         kartaview: "KartaView Images",
65577         vegbilder: "Norwegian Road Administration Images",
65578         mapilio: "Mapilio Images",
65579         panoramax: "Panoramax Images"
65580       };
65581       for (let layerID in photoOverlayLayers) {
65582         const layer = context.layers().layer(layerID);
65583         if (layer && layer.enabled()) {
65584           photoOverlaysUsed.push(layerID);
65585           imageryUsed.push(photoOverlayLayers[layerID]);
65586         }
65587       }
65588       context.history().imageryUsed(imageryUsed);
65589       context.history().photoOverlaysUsed(photoOverlaysUsed);
65590     };
65591     background.sources = (extent, zoom, includeCurrent) => {
65592       if (!_imageryIndex) return [];
65593       let visible = {};
65594       (_imageryIndex.query.bbox(extent.rectangle(), true) || []).forEach((d2) => visible[d2.id] = true);
65595       const currSource = baseLayer.source();
65596       const osm = context.connection();
65597       const blocklists = osm && osm.imageryBlocklists() || [];
65598       const blocklistChanged = blocklists.length !== _checkedBlocklists.length || blocklists.some((regex, index) => String(regex) !== _checkedBlocklists[index]);
65599       if (blocklistChanged) {
65600         _imageryIndex.backgrounds.forEach((source) => {
65601           source.isBlocked = blocklists.some((regex) => regex.test(source.template()));
65602         });
65603         _checkedBlocklists = blocklists.map((regex) => String(regex));
65604       }
65605       return _imageryIndex.backgrounds.filter((source) => {
65606         if (includeCurrent && currSource === source) return true;
65607         if (source.isBlocked) return false;
65608         if (!source.polygon) return true;
65609         if (zoom && zoom < 6) return false;
65610         return visible[source.id];
65611       });
65612     };
65613     background.dimensions = (val) => {
65614       if (!val) return;
65615       baseLayer.dimensions(val);
65616       _overlayLayers.forEach((layer) => layer.dimensions(val));
65617     };
65618     background.baseLayerSource = function(d2) {
65619       if (!arguments.length) return baseLayer.source();
65620       const osm = context.connection();
65621       if (!osm) return background;
65622       const blocklists = osm.imageryBlocklists();
65623       const template = d2.template();
65624       let fail = false;
65625       let tested = 0;
65626       let regex;
65627       for (let i3 = 0; i3 < blocklists.length; i3++) {
65628         regex = blocklists[i3];
65629         fail = regex.test(template);
65630         tested++;
65631         if (fail) break;
65632       }
65633       if (!tested) {
65634         regex = /.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/;
65635         fail = regex.test(template);
65636       }
65637       baseLayer.source(!fail ? d2 : background.findSource("none"));
65638       dispatch12.call("change");
65639       background.updateImagery();
65640       return background;
65641     };
65642     background.findSource = (id2) => {
65643       if (!id2 || !_imageryIndex) return null;
65644       return _imageryIndex.backgrounds.find((d2) => d2.id && d2.id === id2);
65645     };
65646     background.bing = () => {
65647       background.baseLayerSource(background.findSource("Bing"));
65648     };
65649     background.showsLayer = (d2) => {
65650       const currSource = baseLayer.source();
65651       if (!d2 || !currSource) return false;
65652       return d2.id === currSource.id || _overlayLayers.some((layer) => d2.id === layer.source().id);
65653     };
65654     background.overlayLayerSources = () => {
65655       return _overlayLayers.map((layer) => layer.source());
65656     };
65657     background.toggleOverlayLayer = (d2) => {
65658       let layer;
65659       for (let i3 = 0; i3 < _overlayLayers.length; i3++) {
65660         layer = _overlayLayers[i3];
65661         if (layer.source() === d2) {
65662           _overlayLayers.splice(i3, 1);
65663           dispatch12.call("change");
65664           background.updateImagery();
65665           return;
65666         }
65667       }
65668       layer = rendererTileLayer(context).source(d2).projection(context.projection).dimensions(
65669         baseLayer.dimensions()
65670       );
65671       _overlayLayers.push(layer);
65672       dispatch12.call("change");
65673       background.updateImagery();
65674     };
65675     background.nudge = (d2, zoom) => {
65676       const currSource = baseLayer.source();
65677       if (currSource) {
65678         currSource.nudge(d2, zoom);
65679         dispatch12.call("change");
65680         background.updateImagery();
65681       }
65682       return background;
65683     };
65684     background.offset = function(d2) {
65685       const currSource = baseLayer.source();
65686       if (!arguments.length) {
65687         return currSource && currSource.offset() || [0, 0];
65688       }
65689       if (currSource) {
65690         currSource.offset(d2);
65691         dispatch12.call("change");
65692         background.updateImagery();
65693       }
65694       return background;
65695     };
65696     background.brightness = function(d2) {
65697       if (!arguments.length) return _brightness;
65698       _brightness = d2;
65699       if (context.mode()) dispatch12.call("change");
65700       return background;
65701     };
65702     background.contrast = function(d2) {
65703       if (!arguments.length) return _contrast;
65704       _contrast = d2;
65705       if (context.mode()) dispatch12.call("change");
65706       return background;
65707     };
65708     background.saturation = function(d2) {
65709       if (!arguments.length) return _saturation;
65710       _saturation = d2;
65711       if (context.mode()) dispatch12.call("change");
65712       return background;
65713     };
65714     background.sharpness = function(d2) {
65715       if (!arguments.length) return _sharpness;
65716       _sharpness = d2;
65717       if (context.mode()) dispatch12.call("change");
65718       return background;
65719     };
65720     let _loadPromise;
65721     background.ensureLoaded = () => {
65722       if (_loadPromise) return _loadPromise;
65723       return _loadPromise = ensureImageryIndex();
65724     };
65725     background.init = () => {
65726       const loadPromise = background.ensureLoaded();
65727       const hash2 = utilStringQs(window.location.hash);
65728       const requestedBackground = hash2.background || hash2.layer;
65729       const lastUsedBackground = corePreferences("background-last-used");
65730       return loadPromise.then((imageryIndex) => {
65731         const extent = context.map().extent();
65732         const validBackgrounds = background.sources(extent).filter((d2) => d2.id !== "none" && d2.id !== "custom");
65733         const first = validBackgrounds.length && validBackgrounds[0];
65734         const isLastUsedValid = !!validBackgrounds.find((d2) => d2.id && d2.id === lastUsedBackground);
65735         let best;
65736         if (!requestedBackground && extent) {
65737           const viewArea = extent.area();
65738           best = validBackgrounds.find((s2) => {
65739             if (!s2.best() || s2.overlay) return false;
65740             let bbox2 = turf_bbox_default(turf_bbox_clip_default(
65741               { type: "MultiPolygon", coordinates: [s2.polygon || [extent.polygon()]] },
65742               extent.rectangle()
65743             ));
65744             let area = geoExtent(bbox2.slice(0, 2), bbox2.slice(2, 4)).area();
65745             return area / viewArea > 0.5;
65746           });
65747         }
65748         if (requestedBackground && requestedBackground.indexOf("custom:") === 0) {
65749           const template = requestedBackground.replace(/^custom:/, "");
65750           const custom = background.findSource("custom");
65751           background.baseLayerSource(custom.template(template));
65752           corePreferences("background-custom-template", template);
65753         } else {
65754           background.baseLayerSource(
65755             background.findSource(requestedBackground) || best || isLastUsedValid && background.findSource(lastUsedBackground) || background.findSource("Bing") || first || background.findSource("none")
65756           );
65757         }
65758         const locator = imageryIndex.backgrounds.find((d2) => d2.overlay && d2.default);
65759         if (locator) {
65760           background.toggleOverlayLayer(locator);
65761         }
65762         const overlays = (hash2.overlays || "").split(",");
65763         overlays.forEach((overlay) => {
65764           overlay = background.findSource(overlay);
65765           if (overlay) {
65766             background.toggleOverlayLayer(overlay);
65767           }
65768         });
65769         if (hash2.gpx) {
65770           const gpx2 = context.layers().layer("data");
65771           if (gpx2) {
65772             gpx2.url(hash2.gpx, ".gpx");
65773           }
65774         }
65775         if (hash2.offset) {
65776           const offset = hash2.offset.replace(/;/g, ",").split(",").map((n3) => !isNaN(n3) && n3);
65777           if (offset.length === 2) {
65778             background.offset(geoMetersToOffset(offset));
65779           }
65780         }
65781       }).catch((err) => {
65782         console.error(err);
65783       });
65784     };
65785     return utilRebind(background, dispatch12, "on");
65786   }
65787
65788   // modules/renderer/features.js
65789   function rendererFeatures(context) {
65790     var dispatch12 = dispatch_default("change", "redraw");
65791     const features = {};
65792     var _deferred2 = /* @__PURE__ */ new Set();
65793     var traffic_roads = {
65794       "motorway": true,
65795       "motorway_link": true,
65796       "trunk": true,
65797       "trunk_link": true,
65798       "primary": true,
65799       "primary_link": true,
65800       "secondary": true,
65801       "secondary_link": true,
65802       "tertiary": true,
65803       "tertiary_link": true,
65804       "residential": true,
65805       "unclassified": true,
65806       "living_street": true,
65807       "busway": true
65808     };
65809     var service_roads = {
65810       "service": true,
65811       "road": true,
65812       "track": true
65813     };
65814     var paths = {
65815       "path": true,
65816       "footway": true,
65817       "cycleway": true,
65818       "bridleway": true,
65819       "steps": true,
65820       "ladder": true,
65821       "pedestrian": true
65822     };
65823     var _cullFactor = 1;
65824     var _cache5 = {};
65825     var _rules = {};
65826     var _stats = {};
65827     var _keys = [];
65828     var _hidden = [];
65829     var _forceVisible = {};
65830     function update() {
65831       const hash2 = utilStringQs(window.location.hash);
65832       const disabled = features.disabled();
65833       if (disabled.length) {
65834         hash2.disable_features = disabled.join(",");
65835       } else {
65836         delete hash2.disable_features;
65837       }
65838       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
65839       corePreferences("disabled-features", disabled.join(","));
65840       _hidden = features.hidden();
65841       dispatch12.call("change");
65842       dispatch12.call("redraw");
65843     }
65844     function defineRule(k3, filter2, max3) {
65845       var isEnabled = true;
65846       _keys.push(k3);
65847       _rules[k3] = {
65848         filter: filter2,
65849         enabled: isEnabled,
65850         // whether the user wants it enabled..
65851         count: 0,
65852         currentMax: max3 || Infinity,
65853         defaultMax: max3 || Infinity,
65854         enable: function() {
65855           this.enabled = true;
65856           this.currentMax = this.defaultMax;
65857         },
65858         disable: function() {
65859           this.enabled = false;
65860           this.currentMax = 0;
65861         },
65862         hidden: function() {
65863           return this.count === 0 && !this.enabled || this.count > this.currentMax * _cullFactor;
65864         },
65865         autoHidden: function() {
65866           return this.hidden() && this.currentMax > 0;
65867         }
65868       };
65869     }
65870     defineRule(
65871       "address_points",
65872       (tags, geometry) => geometry === "point" && isAddressPoint(tags),
65873       100
65874     );
65875     defineRule(
65876       "points",
65877       (tags, geometry) => geometry === "point" && !isAddressPoint(tags, geometry),
65878       200
65879     );
65880     defineRule("traffic_roads", function isTrafficRoad(tags) {
65881       return traffic_roads[tags.highway];
65882     });
65883     defineRule("service_roads", function isServiceRoad(tags) {
65884       return service_roads[tags.highway];
65885     });
65886     defineRule("paths", function isPath(tags) {
65887       return paths[tags.highway];
65888     });
65889     defineRule("buildings", function isBuilding(tags) {
65890       return !!tags.building && tags.building !== "no" || tags.parking === "multi-storey" || tags.parking === "sheds" || tags.parking === "carports" || tags.parking === "garage_boxes";
65891     }, 250);
65892     defineRule("building_parts", function isBuildingPart(tags) {
65893       return !!tags["building:part"];
65894     });
65895     defineRule("indoor", function isIndoor(tags) {
65896       return !!tags.indoor && tags.indoor !== "no" || !!tags.indoormark && tags.indoormark !== "no";
65897     });
65898     defineRule("landuse", function isLanduse(tags, geometry) {
65899       if (geometry !== "area") return false;
65900       let hasLanduseTag = false;
65901       for (const key in osmLanduseTags) {
65902         if (osmLanduseTags[key] === true && tags[key] || osmLanduseTags[key][tags[key]] === true) {
65903           hasLanduseTag = true;
65904         }
65905       }
65906       return hasLanduseTag && !_rules.buildings.filter(tags) && !_rules.building_parts.filter(tags) && !_rules.indoor.filter(tags) && !_rules.water.filter(tags) && !_rules.pistes.filter(tags);
65907     });
65908     defineRule("boundaries", function isBoundary(tags, geometry) {
65909       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);
65910     });
65911     defineRule("water", function isWater(tags) {
65912       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";
65913     });
65914     defineRule("rail", function isRail(tags) {
65915       return (!!tags.railway || tags.landuse === "railway") && !(traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]);
65916     });
65917     defineRule("pistes", function isPiste(tags) {
65918       return tags["piste:type"];
65919     });
65920     defineRule("aerialways", function isAerialways(tags) {
65921       return !!(tags == null ? void 0 : tags.aerialway) && tags.aerialway !== "yes" && tags.aerialway !== "station";
65922     });
65923     defineRule("power", function isPower(tags) {
65924       return !!tags.power;
65925     });
65926     defineRule("past_future", function isPastFuture(tags) {
65927       if (traffic_roads[tags.highway] || service_roads[tags.highway] || paths[tags.highway]) {
65928         return false;
65929       }
65930       const keys2 = Object.keys(tags);
65931       for (const key of keys2) {
65932         if (osmLifecyclePrefixes[tags[key]]) return true;
65933         const parts = key.split(":");
65934         if (parts.length === 1) continue;
65935         const prefix = parts[0];
65936         if (osmLifecyclePrefixes[prefix]) return true;
65937       }
65938       return false;
65939     });
65940     defineRule("others", function isOther(tags, geometry) {
65941       return geometry === "line" || geometry === "area";
65942     });
65943     features.features = function() {
65944       return _rules;
65945     };
65946     features.keys = function() {
65947       return _keys;
65948     };
65949     features.enabled = function(k3) {
65950       if (!arguments.length) {
65951         return _keys.filter(function(k4) {
65952           return _rules[k4].enabled;
65953         });
65954       }
65955       return _rules[k3] && _rules[k3].enabled;
65956     };
65957     features.disabled = function(k3) {
65958       if (!arguments.length) {
65959         return _keys.filter(function(k4) {
65960           return !_rules[k4].enabled;
65961         });
65962       }
65963       return _rules[k3] && !_rules[k3].enabled;
65964     };
65965     features.hidden = function(k3) {
65966       var _a5;
65967       if (!arguments.length) {
65968         return _keys.filter(function(k4) {
65969           return _rules[k4].hidden();
65970         });
65971       }
65972       return (_a5 = _rules[k3]) == null ? void 0 : _a5.hidden();
65973     };
65974     features.autoHidden = function(k3) {
65975       if (!arguments.length) {
65976         return _keys.filter(function(k4) {
65977           return _rules[k4].autoHidden();
65978         });
65979       }
65980       return _rules[k3] && _rules[k3].autoHidden();
65981     };
65982     features.enable = function(k3) {
65983       if (_rules[k3] && !_rules[k3].enabled) {
65984         _rules[k3].enable();
65985         update();
65986       }
65987     };
65988     features.enableAll = function() {
65989       var didEnable = false;
65990       for (var k3 in _rules) {
65991         if (!_rules[k3].enabled) {
65992           didEnable = true;
65993           _rules[k3].enable();
65994         }
65995       }
65996       if (didEnable) update();
65997     };
65998     features.disable = function(k3) {
65999       if (_rules[k3] && _rules[k3].enabled) {
66000         _rules[k3].disable();
66001         update();
66002       }
66003     };
66004     features.disableAll = function() {
66005       var didDisable = false;
66006       for (var k3 in _rules) {
66007         if (_rules[k3].enabled) {
66008           didDisable = true;
66009           _rules[k3].disable();
66010         }
66011       }
66012       if (didDisable) update();
66013     };
66014     features.toggle = function(k3) {
66015       if (_rules[k3]) {
66016         (function(f2) {
66017           return f2.enabled ? f2.disable() : f2.enable();
66018         })(_rules[k3]);
66019         update();
66020       }
66021     };
66022     features.resetStats = function() {
66023       for (var i3 = 0; i3 < _keys.length; i3++) {
66024         _rules[_keys[i3]].count = 0;
66025       }
66026       dispatch12.call("change");
66027     };
66028     features.gatherStats = function(d2, resolver, dimensions) {
66029       var needsRedraw = false;
66030       var types = utilArrayGroupBy(d2, "type");
66031       var entities = [].concat(types.relation || [], types.way || [], types.node || []);
66032       var currHidden, geometry, matches, i3, j3;
66033       for (i3 = 0; i3 < _keys.length; i3++) {
66034         _rules[_keys[i3]].count = 0;
66035       }
66036       _cullFactor = dimensions[0] * dimensions[1] / 1e6;
66037       for (i3 = 0; i3 < entities.length; i3++) {
66038         geometry = entities[i3].geometry(resolver);
66039         matches = Object.keys(features.getMatches(entities[i3], resolver, geometry));
66040         for (j3 = 0; j3 < matches.length; j3++) {
66041           _rules[matches[j3]].count++;
66042         }
66043       }
66044       currHidden = features.hidden();
66045       if (currHidden !== _hidden) {
66046         _hidden = currHidden;
66047         needsRedraw = true;
66048         dispatch12.call("change");
66049       }
66050       return needsRedraw;
66051     };
66052     features.stats = function() {
66053       for (var i3 = 0; i3 < _keys.length; i3++) {
66054         _stats[_keys[i3]] = _rules[_keys[i3]].count;
66055       }
66056       return _stats;
66057     };
66058     features.clear = function(d2) {
66059       for (var i3 = 0; i3 < d2.length; i3++) {
66060         features.clearEntity(d2[i3]);
66061       }
66062     };
66063     features.clearEntity = function(entity) {
66064       delete _cache5[osmEntity.key(entity)];
66065       for (const key in _cache5) {
66066         if (_cache5[key].parents) {
66067           for (const parent2 of _cache5[key].parents) {
66068             if (parent2.id === entity.id) {
66069               delete _cache5[key];
66070               break;
66071             }
66072           }
66073         }
66074       }
66075     };
66076     features.reset = function() {
66077       Array.from(_deferred2).forEach(function(handle) {
66078         window.cancelIdleCallback(handle);
66079         _deferred2.delete(handle);
66080       });
66081       _cache5 = {};
66082     };
66083     function relationShouldBeChecked(relation) {
66084       return relation.tags.type === "boundary";
66085     }
66086     features.getMatches = function(entity, resolver, geometry) {
66087       if (geometry === "vertex" || geometry === "relation" && !relationShouldBeChecked(entity)) return {};
66088       var ent = osmEntity.key(entity);
66089       if (!_cache5[ent]) {
66090         _cache5[ent] = {};
66091       }
66092       if (!_cache5[ent].matches) {
66093         var matches = {};
66094         var hasMatch = false;
66095         for (var i3 = 0; i3 < _keys.length; i3++) {
66096           if (_keys[i3] === "others") {
66097             if (hasMatch) continue;
66098             if (entity.type === "way") {
66099               var parents = features.getParents(entity, resolver, geometry);
66100               if (parents.length === 1 && parents[0].isMultipolygon() || // 2b. or belongs only to boundary relations
66101               parents.length > 0 && parents.every(function(parent2) {
66102                 return parent2.tags.type === "boundary";
66103               })) {
66104                 var pkey = osmEntity.key(parents[0]);
66105                 if (_cache5[pkey] && _cache5[pkey].matches) {
66106                   matches = Object.assign({}, _cache5[pkey].matches);
66107                   continue;
66108                 }
66109               }
66110             }
66111           }
66112           if (_rules[_keys[i3]].filter(entity.tags, geometry)) {
66113             matches[_keys[i3]] = hasMatch = true;
66114           }
66115         }
66116         _cache5[ent].matches = matches;
66117       }
66118       return _cache5[ent].matches;
66119     };
66120     features.getParents = function(entity, resolver, geometry) {
66121       if (geometry === "point") return [];
66122       const ent = osmEntity.key(entity);
66123       if (!_cache5[ent]) {
66124         _cache5[ent] = {};
66125       }
66126       if (!_cache5[ent].parents) {
66127         let parents;
66128         if (geometry === "vertex") {
66129           parents = resolver.parentWays(entity);
66130         } else {
66131           parents = resolver.parentRelations(entity);
66132         }
66133         _cache5[ent].parents = parents;
66134       }
66135       return _cache5[ent].parents;
66136     };
66137     features.isHiddenPreset = function(preset, geometry) {
66138       if (!_hidden.length) return false;
66139       if (!preset.tags) return false;
66140       var test = preset.setTags(__spreadValues({}, preset.tags), geometry);
66141       for (var key in _rules) {
66142         if (_rules[key].filter(test, geometry)) {
66143           if (_hidden.indexOf(key) !== -1) {
66144             return key;
66145           }
66146           return false;
66147         }
66148       }
66149       return false;
66150     };
66151     features.isHiddenFeature = function(entity, resolver, geometry) {
66152       if (!_hidden.length) return false;
66153       if (!entity.version) return false;
66154       if (_forceVisible[entity.id]) return false;
66155       var matches = Object.keys(features.getMatches(entity, resolver, geometry));
66156       return matches.length && matches.every(function(k3) {
66157         return features.hidden(k3);
66158       });
66159     };
66160     features.isHiddenChild = function(entity, resolver, geometry) {
66161       if (!_hidden.length) return false;
66162       if (!entity.version || geometry === "point") return false;
66163       if (_forceVisible[entity.id]) return false;
66164       var parents = features.getParents(entity, resolver, geometry);
66165       if (!parents.length) return false;
66166       for (var i3 = 0; i3 < parents.length; i3++) {
66167         if (!features.isHidden(parents[i3], resolver, parents[i3].geometry(resolver))) {
66168           return false;
66169         }
66170       }
66171       return true;
66172     };
66173     features.hasHiddenConnections = function(entity, resolver) {
66174       if (!_hidden.length) return false;
66175       var childNodes, connections;
66176       if (entity.type === "midpoint") {
66177         childNodes = [resolver.entity(entity.edge[0]), resolver.entity(entity.edge[1])];
66178         connections = [];
66179       } else {
66180         childNodes = entity.nodes ? resolver.childNodes(entity) : [];
66181         connections = features.getParents(entity, resolver, entity.geometry(resolver));
66182       }
66183       connections = childNodes.reduce(function(result, e3) {
66184         return resolver.isShared(e3) ? utilArrayUnion(result, resolver.parentWays(e3)) : result;
66185       }, connections);
66186       return connections.some(function(e3) {
66187         return features.isHidden(e3, resolver, e3.geometry(resolver));
66188       });
66189     };
66190     features.isHidden = function(entity, resolver, geometry) {
66191       if (!_hidden.length) return false;
66192       if (!entity.version) return false;
66193       var fn = geometry === "vertex" ? features.isHiddenChild : features.isHiddenFeature;
66194       return fn(entity, resolver, geometry);
66195     };
66196     features.filter = function(d2, resolver) {
66197       if (!_hidden.length) return d2;
66198       var result = [];
66199       for (var i3 = 0; i3 < d2.length; i3++) {
66200         var entity = d2[i3];
66201         if (!features.isHidden(entity, resolver, entity.geometry(resolver))) {
66202           result.push(entity);
66203         }
66204       }
66205       return result;
66206     };
66207     features.forceVisible = function(entityIDs) {
66208       if (!arguments.length) return Object.keys(_forceVisible);
66209       _forceVisible = {};
66210       for (var i3 = 0; i3 < entityIDs.length; i3++) {
66211         _forceVisible[entityIDs[i3]] = true;
66212         var entity = context.hasEntity(entityIDs[i3]);
66213         if (entity && entity.type === "relation") {
66214           for (var j3 in entity.members) {
66215             _forceVisible[entity.members[j3].id] = true;
66216           }
66217         }
66218       }
66219       return features;
66220     };
66221     features.init = function() {
66222       var storage = corePreferences("disabled-features");
66223       if (storage) {
66224         var storageDisabled = storage.replace(/;/g, ",").split(",");
66225         storageDisabled.forEach(features.disable);
66226       }
66227       var hash2 = utilStringQs(window.location.hash);
66228       if (hash2.disable_features) {
66229         var hashDisabled = hash2.disable_features.replace(/;/g, ",").split(",");
66230         hashDisabled.forEach(features.disable);
66231       }
66232     };
66233     context.history().on("merge.features", function(newEntities) {
66234       if (!newEntities) return;
66235       var handle = window.requestIdleCallback(function() {
66236         var graph = context.graph();
66237         var types = utilArrayGroupBy(newEntities, "type");
66238         var entities = [].concat(types.relation || [], types.way || [], types.node || []);
66239         for (var i3 = 0; i3 < entities.length; i3++) {
66240           var geometry = entities[i3].geometry(graph);
66241           features.getMatches(entities[i3], graph, geometry);
66242         }
66243       });
66244       _deferred2.add(handle);
66245     });
66246     return utilRebind(features, dispatch12, "on");
66247   }
66248
66249   // modules/util/bind_once.js
66250   function utilBindOnce(target, type2, listener, capture) {
66251     var typeOnce = type2 + ".once";
66252     function one2() {
66253       target.on(typeOnce, null);
66254       listener.apply(this, arguments);
66255     }
66256     target.on(typeOnce, one2, capture);
66257     return this;
66258   }
66259
66260   // modules/util/zoom_pan.js
66261   function defaultFilter3(d3_event) {
66262     return !d3_event.ctrlKey && !d3_event.button;
66263   }
66264   function defaultExtent2() {
66265     var e3 = this;
66266     if (e3 instanceof SVGElement) {
66267       e3 = e3.ownerSVGElement || e3;
66268       if (e3.hasAttribute("viewBox")) {
66269         e3 = e3.viewBox.baseVal;
66270         return [[e3.x, e3.y], [e3.x + e3.width, e3.y + e3.height]];
66271       }
66272       return [[0, 0], [e3.width.baseVal.value, e3.height.baseVal.value]];
66273     }
66274     return [[0, 0], [e3.clientWidth, e3.clientHeight]];
66275   }
66276   function defaultWheelDelta2(d3_event) {
66277     return -d3_event.deltaY * (d3_event.deltaMode === 1 ? 0.05 : d3_event.deltaMode ? 1 : 2e-3);
66278   }
66279   function defaultConstrain2(transform2, extent, translateExtent) {
66280     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];
66281     return transform2.translate(
66282       dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
66283       dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
66284     );
66285   }
66286   function utilZoomPan() {
66287     var filter2 = defaultFilter3, extent = defaultExtent2, constrain = defaultConstrain2, wheelDelta = defaultWheelDelta2, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], interpolate = zoom_default, dispatch12 = dispatch_default("start", "zoom", "end"), _wheelDelay = 150, _transform = identity3, _activeGesture;
66288     function zoom(selection2) {
66289       selection2.on("pointerdown.zoom", pointerdown).on("wheel.zoom", wheeled).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
66290       select_default2(window).on("pointermove.zoompan", pointermove).on("pointerup.zoompan pointercancel.zoompan", pointerup);
66291     }
66292     zoom.transform = function(collection, transform2, point) {
66293       var selection2 = collection.selection ? collection.selection() : collection;
66294       if (collection !== selection2) {
66295         schedule(collection, transform2, point);
66296       } else {
66297         selection2.interrupt().each(function() {
66298           gesture(this, arguments).start(null).zoom(null, null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end(null);
66299         });
66300       }
66301     };
66302     zoom.scaleBy = function(selection2, k3, p2) {
66303       zoom.scaleTo(selection2, function() {
66304         var k0 = _transform.k, k1 = typeof k3 === "function" ? k3.apply(this, arguments) : k3;
66305         return k0 * k1;
66306       }, p2);
66307     };
66308     zoom.scaleTo = function(selection2, k3, p2) {
66309       zoom.transform(selection2, function() {
66310         var e3 = extent.apply(this, arguments), t0 = _transform, p02 = !p2 ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2, p1 = t0.invert(p02), k1 = typeof k3 === "function" ? k3.apply(this, arguments) : k3;
66311         return constrain(translate(scale(t0, k1), p02, p1), e3, translateExtent);
66312       }, p2);
66313     };
66314     zoom.translateBy = function(selection2, x3, y3) {
66315       zoom.transform(selection2, function() {
66316         return constrain(_transform.translate(
66317           typeof x3 === "function" ? x3.apply(this, arguments) : x3,
66318           typeof y3 === "function" ? y3.apply(this, arguments) : y3
66319         ), extent.apply(this, arguments), translateExtent);
66320       });
66321     };
66322     zoom.translateTo = function(selection2, x3, y3, p2) {
66323       zoom.transform(selection2, function() {
66324         var e3 = extent.apply(this, arguments), t2 = _transform, p02 = !p2 ? centroid(e3) : typeof p2 === "function" ? p2.apply(this, arguments) : p2;
66325         return constrain(identity3.translate(p02[0], p02[1]).scale(t2.k).translate(
66326           typeof x3 === "function" ? -x3.apply(this, arguments) : -x3,
66327           typeof y3 === "function" ? -y3.apply(this, arguments) : -y3
66328         ), e3, translateExtent);
66329       }, p2);
66330     };
66331     function scale(transform2, k3) {
66332       k3 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k3));
66333       return k3 === transform2.k ? transform2 : new Transform(k3, transform2.x, transform2.y);
66334     }
66335     function translate(transform2, p02, p1) {
66336       var x3 = p02[0] - p1[0] * transform2.k, y3 = p02[1] - p1[1] * transform2.k;
66337       return x3 === transform2.x && y3 === transform2.y ? transform2 : new Transform(transform2.k, x3, y3);
66338     }
66339     function centroid(extent2) {
66340       return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
66341     }
66342     function schedule(transition2, transform2, point) {
66343       transition2.on("start.zoom", function() {
66344         gesture(this, arguments).start(null);
66345       }).on("interrupt.zoom end.zoom", function() {
66346         gesture(this, arguments).end(null);
66347       }).tween("zoom", function() {
66348         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));
66349         return function(t2) {
66350           if (t2 === 1) {
66351             t2 = b3;
66352           } else {
66353             var l2 = i3(t2);
66354             var k3 = w3 / l2[2];
66355             t2 = new Transform(k3, p2[0] - l2[0] * k3, p2[1] - l2[1] * k3);
66356           }
66357           g3.zoom(null, null, t2);
66358         };
66359       });
66360     }
66361     function gesture(that, args, clean2) {
66362       return !clean2 && _activeGesture || new Gesture(that, args);
66363     }
66364     function Gesture(that, args) {
66365       this.that = that;
66366       this.args = args;
66367       this.active = 0;
66368       this.extent = extent.apply(that, args);
66369     }
66370     Gesture.prototype = {
66371       start: function(d3_event) {
66372         if (++this.active === 1) {
66373           _activeGesture = this;
66374           dispatch12.call("start", this, d3_event);
66375         }
66376         return this;
66377       },
66378       zoom: function(d3_event, key, transform2) {
66379         if (this.mouse && key !== "mouse") this.mouse[1] = transform2.invert(this.mouse[0]);
66380         if (this.pointer0 && key !== "touch") this.pointer0[1] = transform2.invert(this.pointer0[0]);
66381         if (this.pointer1 && key !== "touch") this.pointer1[1] = transform2.invert(this.pointer1[0]);
66382         _transform = transform2;
66383         dispatch12.call("zoom", this, d3_event, key, transform2);
66384         return this;
66385       },
66386       end: function(d3_event) {
66387         if (--this.active === 0) {
66388           _activeGesture = null;
66389           dispatch12.call("end", this, d3_event);
66390         }
66391         return this;
66392       }
66393     };
66394     function wheeled(d3_event) {
66395       if (!filter2.apply(this, arguments)) return;
66396       var g3 = gesture(this, arguments), t2 = _transform, k3 = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t2.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p2 = utilFastMouse(this)(d3_event);
66397       if (g3.wheel) {
66398         if (g3.mouse[0][0] !== p2[0] || g3.mouse[0][1] !== p2[1]) {
66399           g3.mouse[1] = t2.invert(g3.mouse[0] = p2);
66400         }
66401         clearTimeout(g3.wheel);
66402       } else {
66403         g3.mouse = [p2, t2.invert(p2)];
66404         interrupt_default(this);
66405         g3.start(d3_event);
66406       }
66407       d3_event.preventDefault();
66408       d3_event.stopImmediatePropagation();
66409       g3.wheel = setTimeout(wheelidled, _wheelDelay);
66410       g3.zoom(d3_event, "mouse", constrain(translate(scale(t2, k3), g3.mouse[0], g3.mouse[1]), g3.extent, translateExtent));
66411       function wheelidled() {
66412         g3.wheel = null;
66413         g3.end(d3_event);
66414       }
66415     }
66416     var _downPointerIDs = /* @__PURE__ */ new Set();
66417     var _pointerLocGetter;
66418     function pointerdown(d3_event) {
66419       _downPointerIDs.add(d3_event.pointerId);
66420       if (!filter2.apply(this, arguments)) return;
66421       var g3 = gesture(this, arguments, _downPointerIDs.size === 1);
66422       var started;
66423       d3_event.stopImmediatePropagation();
66424       _pointerLocGetter = utilFastMouse(this);
66425       var loc = _pointerLocGetter(d3_event);
66426       var p2 = [loc, _transform.invert(loc), d3_event.pointerId];
66427       if (!g3.pointer0) {
66428         g3.pointer0 = p2;
66429         started = true;
66430       } else if (!g3.pointer1 && g3.pointer0[2] !== p2[2]) {
66431         g3.pointer1 = p2;
66432       }
66433       if (started) {
66434         interrupt_default(this);
66435         g3.start(d3_event);
66436       }
66437     }
66438     function pointermove(d3_event) {
66439       if (!_downPointerIDs.has(d3_event.pointerId)) return;
66440       if (!_activeGesture || !_pointerLocGetter) return;
66441       var g3 = gesture(this, arguments);
66442       var isPointer0 = g3.pointer0 && g3.pointer0[2] === d3_event.pointerId;
66443       var isPointer1 = !isPointer0 && g3.pointer1 && g3.pointer1[2] === d3_event.pointerId;
66444       if ((isPointer0 || isPointer1) && "buttons" in d3_event && !d3_event.buttons) {
66445         if (g3.pointer0) _downPointerIDs.delete(g3.pointer0[2]);
66446         if (g3.pointer1) _downPointerIDs.delete(g3.pointer1[2]);
66447         g3.end(d3_event);
66448         return;
66449       }
66450       d3_event.preventDefault();
66451       d3_event.stopImmediatePropagation();
66452       var loc = _pointerLocGetter(d3_event);
66453       var t2, p2, l2;
66454       if (isPointer0) g3.pointer0[0] = loc;
66455       else if (isPointer1) g3.pointer1[0] = loc;
66456       t2 = _transform;
66457       if (g3.pointer1) {
66458         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;
66459         t2 = scale(t2, Math.sqrt(dp / dl));
66460         p2 = [(p02[0] + p1[0]) / 2, (p02[1] + p1[1]) / 2];
66461         l2 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
66462       } else if (g3.pointer0) {
66463         p2 = g3.pointer0[0];
66464         l2 = g3.pointer0[1];
66465       } else {
66466         return;
66467       }
66468       g3.zoom(d3_event, "touch", constrain(translate(t2, p2, l2), g3.extent, translateExtent));
66469     }
66470     function pointerup(d3_event) {
66471       if (!_downPointerIDs.has(d3_event.pointerId)) return;
66472       _downPointerIDs.delete(d3_event.pointerId);
66473       if (!_activeGesture) return;
66474       var g3 = gesture(this, arguments);
66475       d3_event.stopImmediatePropagation();
66476       if (g3.pointer0 && g3.pointer0[2] === d3_event.pointerId) delete g3.pointer0;
66477       else if (g3.pointer1 && g3.pointer1[2] === d3_event.pointerId) delete g3.pointer1;
66478       if (g3.pointer1 && !g3.pointer0) {
66479         g3.pointer0 = g3.pointer1;
66480         delete g3.pointer1;
66481       }
66482       if (g3.pointer0) {
66483         g3.pointer0[1] = _transform.invert(g3.pointer0[0]);
66484       } else {
66485         g3.end(d3_event);
66486       }
66487     }
66488     zoom.wheelDelta = function(_3) {
66489       return arguments.length ? (wheelDelta = utilFunctor(+_3), zoom) : wheelDelta;
66490     };
66491     zoom.filter = function(_3) {
66492       return arguments.length ? (filter2 = utilFunctor(!!_3), zoom) : filter2;
66493     };
66494     zoom.extent = function(_3) {
66495       return arguments.length ? (extent = utilFunctor([[+_3[0][0], +_3[0][1]], [+_3[1][0], +_3[1][1]]]), zoom) : extent;
66496     };
66497     zoom.scaleExtent = function(_3) {
66498       return arguments.length ? (scaleExtent[0] = +_3[0], scaleExtent[1] = +_3[1], zoom) : [scaleExtent[0], scaleExtent[1]];
66499     };
66500     zoom.translateExtent = function(_3) {
66501       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]]];
66502     };
66503     zoom.constrain = function(_3) {
66504       return arguments.length ? (constrain = _3, zoom) : constrain;
66505     };
66506     zoom.interpolate = function(_3) {
66507       return arguments.length ? (interpolate = _3, zoom) : interpolate;
66508     };
66509     zoom._transform = function(_3) {
66510       return arguments.length ? (_transform = _3, zoom) : _transform;
66511     };
66512     return utilRebind(zoom, dispatch12, "on");
66513   }
66514
66515   // modules/util/double_up.js
66516   function utilDoubleUp() {
66517     var dispatch12 = dispatch_default("doubleUp");
66518     var _maxTimespan = 500;
66519     var _maxDistance = 20;
66520     var _pointer;
66521     function pointerIsValidFor(loc) {
66522       return (/* @__PURE__ */ new Date()).getTime() - _pointer.startTime <= _maxTimespan && // all pointer events must occur within a small distance of the first pointerdown
66523       geoVecLength(_pointer.startLoc, loc) <= _maxDistance;
66524     }
66525     function pointerdown(d3_event) {
66526       if (d3_event.ctrlKey || d3_event.button === 2) return;
66527       var loc = [d3_event.clientX, d3_event.clientY];
66528       if (_pointer && !pointerIsValidFor(loc)) {
66529         _pointer = void 0;
66530       }
66531       if (!_pointer) {
66532         _pointer = {
66533           startLoc: loc,
66534           startTime: (/* @__PURE__ */ new Date()).getTime(),
66535           upCount: 0,
66536           pointerId: d3_event.pointerId
66537         };
66538       } else {
66539         _pointer.pointerId = d3_event.pointerId;
66540       }
66541     }
66542     function pointerup(d3_event) {
66543       if (d3_event.ctrlKey || d3_event.button === 2) return;
66544       if (!_pointer || _pointer.pointerId !== d3_event.pointerId) return;
66545       _pointer.upCount += 1;
66546       if (_pointer.upCount === 2) {
66547         var loc = [d3_event.clientX, d3_event.clientY];
66548         if (pointerIsValidFor(loc)) {
66549           var locInThis = utilFastMouse(this)(d3_event);
66550           dispatch12.call("doubleUp", this, d3_event, locInThis);
66551         }
66552         _pointer = void 0;
66553       }
66554     }
66555     function doubleUp(selection2) {
66556       if ("PointerEvent" in window) {
66557         selection2.on("pointerdown.doubleUp", pointerdown).on("pointerup.doubleUp", pointerup);
66558       } else {
66559         selection2.on("dblclick.doubleUp", function(d3_event) {
66560           dispatch12.call("doubleUp", this, d3_event, utilFastMouse(this)(d3_event));
66561         });
66562       }
66563     }
66564     doubleUp.off = function(selection2) {
66565       selection2.on("pointerdown.doubleUp", null).on("pointerup.doubleUp", null).on("dblclick.doubleUp", null);
66566     };
66567     return utilRebind(doubleUp, dispatch12, "on");
66568   }
66569
66570   // modules/renderer/map.js
66571   var TILESIZE = 256;
66572   var minZoom4 = 2;
66573   var maxZoom = 24;
66574   var kMin = geoZoomToScale(minZoom4, TILESIZE);
66575   var kMax = geoZoomToScale(maxZoom, TILESIZE);
66576   function rendererMap(context) {
66577     var dispatch12 = dispatch_default(
66578       "move",
66579       "drawn",
66580       "crossEditableZoom",
66581       "hitMinZoom",
66582       "changeHighlighting",
66583       "changeAreaFill"
66584     );
66585     var projection2 = context.projection;
66586     var curtainProjection = context.curtainProjection;
66587     var drawLayers;
66588     var drawPoints;
66589     var drawVertices;
66590     var drawLines;
66591     var drawAreas;
66592     var drawMidpoints;
66593     var drawLabels;
66594     var _selection = select_default2(null);
66595     var supersurface = select_default2(null);
66596     var wrapper = select_default2(null);
66597     var surface = select_default2(null);
66598     var _dimensions = [1, 1];
66599     var _dblClickZoomEnabled = true;
66600     var _redrawEnabled = true;
66601     var _gestureTransformStart;
66602     var _transformStart = projection2.transform();
66603     var _transformLast;
66604     var _isTransformed = false;
66605     var _minzoom = 0;
66606     var _getMouseCoords;
66607     var _lastPointerEvent;
66608     var _lastWithinEditableZoom;
66609     var _pointerDown = false;
66610     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
66611     var _zoomerPannerFunction = "PointerEvent" in window ? utilZoomPan : zoom_default2;
66612     var _zoomerPanner = _zoomerPannerFunction().scaleExtent([kMin, kMax]).interpolate(value_default).filter(zoomEventFilter).on("zoom.map", zoomPan).on("start.map", function(d3_event) {
66613       _pointerDown = d3_event && (d3_event.type === "pointerdown" || d3_event.sourceEvent && d3_event.sourceEvent.type === "pointerdown");
66614     }).on("end.map", function() {
66615       _pointerDown = false;
66616     });
66617     var _doubleUpHandler = utilDoubleUp();
66618     var scheduleRedraw = throttle_default(redraw, 750);
66619     function cancelPendingRedraw() {
66620       scheduleRedraw.cancel();
66621     }
66622     function map2(selection2) {
66623       _selection = selection2;
66624       context.on("change.map", immediateRedraw);
66625       var osm = context.connection();
66626       if (osm) {
66627         osm.on("change.map", immediateRedraw);
66628       }
66629       function didUndoOrRedo(targetTransform) {
66630         var mode = context.mode().id;
66631         if (mode !== "browse" && mode !== "select") return;
66632         if (targetTransform) {
66633           map2.transformEase(targetTransform);
66634         }
66635       }
66636       context.history().on("merge.map", function() {
66637         scheduleRedraw();
66638       }).on("change.map", immediateRedraw).on("undone.map", function(stack, fromStack) {
66639         didUndoOrRedo(fromStack.transform);
66640       }).on("redone.map", function(stack) {
66641         didUndoOrRedo(stack.transform);
66642       });
66643       context.background().on("change.map", immediateRedraw);
66644       context.features().on("redraw.map", immediateRedraw);
66645       drawLayers.on("change.map", function() {
66646         context.background().updateImagery();
66647         immediateRedraw();
66648       });
66649       selection2.on("wheel.map mousewheel.map", function(d3_event) {
66650         d3_event.preventDefault();
66651       }).call(_zoomerPanner).call(_zoomerPanner.transform, projection2.transform()).on("dblclick.zoom", null);
66652       map2.supersurface = supersurface = selection2.append("div").attr("class", "supersurface").call(utilSetTransform, 0, 0);
66653       wrapper = supersurface.append("div").attr("class", "layer layer-data");
66654       map2.surface = surface = wrapper.call(drawLayers).selectAll(".surface");
66655       surface.call(drawLabels.observe).call(_doubleUpHandler).on(_pointerPrefix + "down.zoom", function(d3_event) {
66656         _lastPointerEvent = d3_event;
66657         if (d3_event.button === 2) {
66658           d3_event.stopPropagation();
66659         }
66660       }, true).on(_pointerPrefix + "up.zoom", function(d3_event) {
66661         _lastPointerEvent = d3_event;
66662         if (resetTransform()) {
66663           immediateRedraw();
66664         }
66665       }).on(_pointerPrefix + "move.map", function(d3_event) {
66666         _lastPointerEvent = d3_event;
66667       }).on(_pointerPrefix + "over.vertices", function(d3_event) {
66668         if (map2.editableDataEnabled() && !_isTransformed) {
66669           var hover = d3_event.target.__data__;
66670           surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
66671           dispatch12.call("drawn", this, { full: false });
66672         }
66673       }).on(_pointerPrefix + "out.vertices", function(d3_event) {
66674         if (map2.editableDataEnabled() && !_isTransformed) {
66675           var hover = d3_event.relatedTarget && d3_event.relatedTarget.__data__;
66676           surface.call(drawVertices.drawHover, context.graph(), hover, map2.extent());
66677           dispatch12.call("drawn", this, { full: false });
66678         }
66679       });
66680       var detected = utilDetect();
66681       if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
66682       // but we only need to do this on desktop Safari anyway. – #7694
66683       !detected.isMobileWebKit) {
66684         surface.on("gesturestart.surface", function(d3_event) {
66685           d3_event.preventDefault();
66686           _gestureTransformStart = projection2.transform();
66687         }).on("gesturechange.surface", gestureChange);
66688       }
66689       updateAreaFill();
66690       _doubleUpHandler.on("doubleUp.map", function(d3_event, p02) {
66691         if (!_dblClickZoomEnabled) return;
66692         if (typeof d3_event.target.__data__ === "object" && // or area fills
66693         !select_default2(d3_event.target).classed("fill")) return;
66694         var zoomOut2 = d3_event.shiftKey;
66695         var t2 = projection2.transform();
66696         var p1 = t2.invert(p02);
66697         t2 = t2.scale(zoomOut2 ? 0.5 : 2);
66698         t2.x = p02[0] - p1[0] * t2.k;
66699         t2.y = p02[1] - p1[1] * t2.k;
66700         map2.transformEase(t2);
66701       });
66702       context.on("enter.map", function() {
66703         if (!map2.editableDataEnabled(
66704           true
66705           /* skip zoom check */
66706         )) return;
66707         if (_isTransformed) return;
66708         var graph = context.graph();
66709         var selectedAndParents = {};
66710         context.selectedIDs().forEach(function(id2) {
66711           var entity = graph.hasEntity(id2);
66712           if (entity) {
66713             selectedAndParents[entity.id] = entity;
66714             if (entity.type === "node") {
66715               graph.parentWays(entity).forEach(function(parent2) {
66716                 selectedAndParents[parent2.id] = parent2;
66717               });
66718             }
66719           }
66720         });
66721         var data = Object.values(selectedAndParents);
66722         var filter2 = function(d2) {
66723           return d2.id in selectedAndParents;
66724         };
66725         data = context.features().filter(data, graph);
66726         surface.call(drawVertices.drawSelected, graph, map2.extent()).call(drawLines, graph, data, filter2).call(drawAreas, graph, data, filter2).call(drawMidpoints, graph, data, filter2, map2.trimmedExtent());
66727         dispatch12.call("drawn", this, { full: false });
66728         scheduleRedraw();
66729       });
66730       map2.dimensions(utilGetDimensions(selection2));
66731     }
66732     function zoomEventFilter(d3_event) {
66733       if (d3_event.type === "mousedown") {
66734         var hasOrphan = false;
66735         var listeners = window.__on;
66736         for (var i3 = 0; i3 < listeners.length; i3++) {
66737           var listener = listeners[i3];
66738           if (listener.name === "zoom" && listener.type === "mouseup") {
66739             hasOrphan = true;
66740             break;
66741           }
66742         }
66743         if (hasOrphan) {
66744           var event = window.CustomEvent;
66745           if (event) {
66746             event = new event("mouseup");
66747           } else {
66748             event = window.document.createEvent("Event");
66749             event.initEvent("mouseup", false, false);
66750           }
66751           event.view = window;
66752           window.dispatchEvent(event);
66753         }
66754       }
66755       return d3_event.button !== 2;
66756     }
66757     function pxCenter() {
66758       return [_dimensions[0] / 2, _dimensions[1] / 2];
66759     }
66760     function drawEditable(difference2, extent) {
66761       var mode = context.mode();
66762       var graph = context.graph();
66763       var features = context.features();
66764       var all = context.history().intersects(map2.extent());
66765       var fullRedraw = false;
66766       var data;
66767       var set5;
66768       var filter2;
66769       var applyFeatureLayerFilters = true;
66770       if (map2.isInWideSelection()) {
66771         data = [];
66772         utilEntityAndDeepMemberIDs(mode.selectedIDs(), context.graph()).forEach(function(id2) {
66773           var entity = context.hasEntity(id2);
66774           if (entity) data.push(entity);
66775         });
66776         fullRedraw = true;
66777         filter2 = utilFunctor(true);
66778         applyFeatureLayerFilters = false;
66779       } else if (difference2) {
66780         var complete = difference2.complete(map2.extent());
66781         data = Object.values(complete).filter(Boolean);
66782         set5 = new Set(Object.keys(complete));
66783         filter2 = function(d2) {
66784           return set5.has(d2.id);
66785         };
66786         features.clear(data);
66787       } else {
66788         if (features.gatherStats(all, graph, _dimensions)) {
66789           extent = void 0;
66790         }
66791         if (extent) {
66792           data = context.history().intersects(map2.extent().intersection(extent));
66793           set5 = new Set(data.map(function(entity) {
66794             return entity.id;
66795           }));
66796           filter2 = function(d2) {
66797             return set5.has(d2.id);
66798           };
66799         } else {
66800           data = all;
66801           fullRedraw = true;
66802           filter2 = utilFunctor(true);
66803         }
66804       }
66805       if (applyFeatureLayerFilters) {
66806         data = features.filter(data, graph);
66807       } else {
66808         context.features().resetStats();
66809       }
66810       if (mode && mode.id === "select") {
66811         surface.call(drawVertices.drawSelected, graph, map2.extent());
66812       }
66813       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);
66814       dispatch12.call("drawn", this, { full: true });
66815     }
66816     map2.init = function() {
66817       drawLayers = svgLayers(projection2, context);
66818       drawPoints = svgPoints(projection2, context);
66819       drawVertices = svgVertices(projection2, context);
66820       drawLines = svgLines(projection2, context);
66821       drawAreas = svgAreas(projection2, context);
66822       drawMidpoints = svgMidpoints(projection2, context);
66823       drawLabels = svgLabels(projection2, context);
66824     };
66825     function editOff() {
66826       context.features().resetStats();
66827       surface.selectAll(".layer-osm *").remove();
66828       surface.selectAll(".layer-touch:not(.markers) *").remove();
66829       var allowed = {
66830         "browse": true,
66831         "save": true,
66832         "select-note": true,
66833         "select-data": true,
66834         "select-error": true
66835       };
66836       var mode = context.mode();
66837       if (mode && !allowed[mode.id]) {
66838         context.enter(modeBrowse(context));
66839       }
66840       dispatch12.call("drawn", this, { full: true });
66841     }
66842     function gestureChange(d3_event) {
66843       var e3 = d3_event;
66844       e3.preventDefault();
66845       var props = {
66846         deltaMode: 0,
66847         // dummy values to ignore in zoomPan
66848         deltaY: 1,
66849         // dummy values to ignore in zoomPan
66850         clientX: e3.clientX,
66851         clientY: e3.clientY,
66852         screenX: e3.screenX,
66853         screenY: e3.screenY,
66854         x: e3.x,
66855         y: e3.y
66856       };
66857       var e22 = new WheelEvent("wheel", props);
66858       e22._scale = e3.scale;
66859       e22._rotation = e3.rotation;
66860       _selection.node().dispatchEvent(e22);
66861     }
66862     function zoomPan(event, key, transform2) {
66863       var source = event && event.sourceEvent || event;
66864       var eventTransform = transform2 || event && event.transform;
66865       var x3 = eventTransform.x;
66866       var y3 = eventTransform.y;
66867       var k3 = eventTransform.k;
66868       if (source && source.type === "wheel") {
66869         if (_pointerDown) return;
66870         var detected = utilDetect();
66871         var dX = source.deltaX;
66872         var dY = source.deltaY;
66873         var x22 = x3;
66874         var y22 = y3;
66875         var k22 = k3;
66876         var t0, p02, p1;
66877         if (source.deltaMode === 1) {
66878           var lines = Math.abs(source.deltaY);
66879           var sign2 = source.deltaY > 0 ? 1 : -1;
66880           dY = sign2 * clamp_default(
66881             lines * 18.001,
66882             4.000244140625,
66883             // min
66884             350.000244140625
66885             // max
66886           );
66887           t0 = _isTransformed ? _transformLast : _transformStart;
66888           p02 = _getMouseCoords(source);
66889           p1 = t0.invert(p02);
66890           k22 = t0.k * Math.pow(2, -dY / 500);
66891           k22 = clamp_default(k22, kMin, kMax);
66892           x22 = p02[0] - p1[0] * k22;
66893           y22 = p02[1] - p1[1] * k22;
66894         } else if (source._scale) {
66895           t0 = _gestureTransformStart;
66896           p02 = _getMouseCoords(source);
66897           p1 = t0.invert(p02);
66898           k22 = t0.k * source._scale;
66899           k22 = clamp_default(k22, kMin, kMax);
66900           x22 = p02[0] - p1[0] * k22;
66901           y22 = p02[1] - p1[1] * k22;
66902         } else if (source.ctrlKey && !isInteger(dY)) {
66903           dY *= 6;
66904           t0 = _isTransformed ? _transformLast : _transformStart;
66905           p02 = _getMouseCoords(source);
66906           p1 = t0.invert(p02);
66907           k22 = t0.k * Math.pow(2, -dY / 500);
66908           k22 = clamp_default(k22, kMin, kMax);
66909           x22 = p02[0] - p1[0] * k22;
66910           y22 = p02[1] - p1[1] * k22;
66911         } else if ((source.altKey || source.shiftKey) && isInteger(dY)) {
66912           t0 = _isTransformed ? _transformLast : _transformStart;
66913           p02 = _getMouseCoords(source);
66914           p1 = t0.invert(p02);
66915           k22 = t0.k * Math.pow(2, -dY / 500);
66916           k22 = clamp_default(k22, kMin, kMax);
66917           x22 = p02[0] - p1[0] * k22;
66918           y22 = p02[1] - p1[1] * k22;
66919         } else if (detected.os === "mac" && detected.browser !== "Firefox" && !source.ctrlKey && isInteger(dX) && isInteger(dY)) {
66920           p1 = projection2.translate();
66921           x22 = p1[0] - dX;
66922           y22 = p1[1] - dY;
66923           k22 = projection2.scale();
66924           k22 = clamp_default(k22, kMin, kMax);
66925         }
66926         if (x22 !== x3 || y22 !== y3 || k22 !== k3) {
66927           x3 = x22;
66928           y3 = y22;
66929           k3 = k22;
66930           eventTransform = identity3.translate(x22, y22).scale(k22);
66931           if (_zoomerPanner._transform) {
66932             _zoomerPanner._transform(eventTransform);
66933           } else {
66934             _selection.node().__zoom = eventTransform;
66935           }
66936         }
66937       }
66938       if (_transformStart.x === x3 && _transformStart.y === y3 && _transformStart.k === k3) {
66939         return;
66940       }
66941       if (geoScaleToZoom(k3, TILESIZE) < _minzoom) {
66942         surface.interrupt();
66943         dispatch12.call("hitMinZoom", this, map2);
66944         setCenterZoom(map2.center(), context.minEditableZoom(), 0, true);
66945         scheduleRedraw();
66946         dispatch12.call("move", this, map2);
66947         return;
66948       }
66949       projection2.transform(eventTransform);
66950       var withinEditableZoom = map2.withinEditableZoom();
66951       if (_lastWithinEditableZoom !== withinEditableZoom) {
66952         if (_lastWithinEditableZoom !== void 0) {
66953           dispatch12.call("crossEditableZoom", this, withinEditableZoom);
66954         }
66955         _lastWithinEditableZoom = withinEditableZoom;
66956       }
66957       var scale = k3 / _transformStart.k;
66958       var tX = (x3 / scale - _transformStart.x) * scale;
66959       var tY = (y3 / scale - _transformStart.y) * scale;
66960       if (context.inIntro()) {
66961         curtainProjection.transform({
66962           x: x3 - tX,
66963           y: y3 - tY,
66964           k: k3
66965         });
66966       }
66967       if (source) {
66968         _lastPointerEvent = event;
66969       }
66970       _isTransformed = true;
66971       _transformLast = eventTransform;
66972       utilSetTransform(supersurface, tX, tY, scale);
66973       scheduleRedraw();
66974       dispatch12.call("move", this, map2);
66975       function isInteger(val) {
66976         return typeof val === "number" && isFinite(val) && Math.floor(val) === val;
66977       }
66978     }
66979     function resetTransform() {
66980       if (!_isTransformed) return false;
66981       utilSetTransform(supersurface, 0, 0);
66982       _isTransformed = false;
66983       if (context.inIntro()) {
66984         curtainProjection.transform(projection2.transform());
66985       }
66986       return true;
66987     }
66988     function redraw(difference2, extent) {
66989       if (typeof window === "undefined") return;
66990       if (surface.empty() || !_redrawEnabled) return;
66991       if (resetTransform()) {
66992         difference2 = extent = void 0;
66993       }
66994       var zoom = map2.zoom();
66995       var z3 = String(~~zoom);
66996       if (surface.attr("data-zoom") !== z3) {
66997         surface.attr("data-zoom", z3);
66998       }
66999       var lat = map2.center()[1];
67000       var lowzoom = linear3().domain([-60, 0, 60]).range([17, 18.5, 17]).clamp(true);
67001       surface.classed("low-zoom", zoom <= lowzoom(lat));
67002       if (!difference2) {
67003         supersurface.call(context.background());
67004         wrapper.call(drawLayers);
67005       }
67006       if (map2.editableDataEnabled() || map2.isInWideSelection()) {
67007         context.loadTiles(projection2);
67008         drawEditable(difference2, extent);
67009       } else {
67010         editOff();
67011       }
67012       _transformStart = projection2.transform();
67013       return map2;
67014     }
67015     var immediateRedraw = function(difference2, extent) {
67016       if (!difference2 && !extent) cancelPendingRedraw();
67017       redraw(difference2, extent);
67018     };
67019     map2.lastPointerEvent = function() {
67020       return _lastPointerEvent;
67021     };
67022     map2.mouse = function(d3_event) {
67023       var event = d3_event || _lastPointerEvent;
67024       if (event) {
67025         var s2;
67026         while (s2 = event.sourceEvent) {
67027           event = s2;
67028         }
67029         return _getMouseCoords(event);
67030       }
67031       return null;
67032     };
67033     map2.mouseCoordinates = function() {
67034       var coord2 = map2.mouse() || pxCenter();
67035       return projection2.invert(coord2);
67036     };
67037     map2.dblclickZoomEnable = function(val) {
67038       if (!arguments.length) return _dblClickZoomEnabled;
67039       _dblClickZoomEnabled = val;
67040       return map2;
67041     };
67042     map2.redrawEnable = function(val) {
67043       if (!arguments.length) return _redrawEnabled;
67044       _redrawEnabled = val;
67045       return map2;
67046     };
67047     map2.isTransformed = function() {
67048       return _isTransformed;
67049     };
67050     function setTransform(t2, duration, force) {
67051       var t3 = projection2.transform();
67052       if (!force && t2.k === t3.k && t2.x === t3.x && t2.y === t3.y) return false;
67053       if (duration) {
67054         _selection.transition().duration(duration).on("start", function() {
67055           map2.startEase();
67056         }).call(_zoomerPanner.transform, identity3.translate(t2.x, t2.y).scale(t2.k));
67057       } else {
67058         projection2.transform(t2);
67059         _transformStart = t2;
67060         _selection.call(_zoomerPanner.transform, _transformStart);
67061       }
67062       return true;
67063     }
67064     function setCenterZoom(loc2, z22, duration, force) {
67065       var c2 = map2.center();
67066       var z3 = map2.zoom();
67067       if (loc2[0] === c2[0] && loc2[1] === c2[1] && z22 === z3 && !force) return false;
67068       var proj = geoRawMercator().transform(projection2.transform());
67069       var k22 = clamp_default(geoZoomToScale(z22, TILESIZE), kMin, kMax);
67070       proj.scale(k22);
67071       var t2 = proj.translate();
67072       var point = proj(loc2);
67073       var center = pxCenter();
67074       t2[0] += center[0] - point[0];
67075       t2[1] += center[1] - point[1];
67076       return setTransform(identity3.translate(t2[0], t2[1]).scale(k22), duration, force);
67077     }
67078     map2.pan = function(delta, duration) {
67079       var t2 = projection2.translate();
67080       var k3 = projection2.scale();
67081       t2[0] += delta[0];
67082       t2[1] += delta[1];
67083       if (duration) {
67084         _selection.transition().duration(duration).on("start", function() {
67085           map2.startEase();
67086         }).call(_zoomerPanner.transform, identity3.translate(t2[0], t2[1]).scale(k3));
67087       } else {
67088         projection2.translate(t2);
67089         _transformStart = projection2.transform();
67090         _selection.call(_zoomerPanner.transform, _transformStart);
67091         dispatch12.call("move", this, map2);
67092         immediateRedraw();
67093       }
67094       return map2;
67095     };
67096     map2.dimensions = function(val) {
67097       if (!arguments.length) return _dimensions;
67098       _dimensions = val;
67099       drawLayers.dimensions(_dimensions);
67100       context.background().dimensions(_dimensions);
67101       projection2.clipExtent([[0, 0], _dimensions]);
67102       _getMouseCoords = utilFastMouse(supersurface.node());
67103       scheduleRedraw();
67104       return map2;
67105     };
67106     function zoomIn(delta) {
67107       setCenterZoom(map2.center(), Math.trunc(map2.zoom() + 0.45) + delta, 150, true);
67108     }
67109     function zoomOut(delta) {
67110       setCenterZoom(map2.center(), Math.ceil(map2.zoom() - 0.45) - delta, 150, true);
67111     }
67112     map2.zoomIn = function() {
67113       zoomIn(1);
67114     };
67115     map2.zoomInFurther = function() {
67116       zoomIn(4);
67117     };
67118     map2.canZoomIn = function() {
67119       return map2.zoom() < maxZoom;
67120     };
67121     map2.zoomOut = function() {
67122       zoomOut(1);
67123     };
67124     map2.zoomOutFurther = function() {
67125       zoomOut(4);
67126     };
67127     map2.canZoomOut = function() {
67128       return map2.zoom() > minZoom4;
67129     };
67130     map2.center = function(loc2) {
67131       if (!arguments.length) {
67132         return projection2.invert(pxCenter());
67133       }
67134       if (setCenterZoom(loc2, map2.zoom())) {
67135         dispatch12.call("move", this, map2);
67136       }
67137       scheduleRedraw();
67138       return map2;
67139     };
67140     function trimmedCenter(loc, zoom) {
67141       var offset = [paneWidth() / 2, (footerHeight() - toolbarHeight()) / 2];
67142       var proj = geoRawMercator().transform(projection2.transform());
67143       proj.scale(geoZoomToScale(zoom, TILESIZE));
67144       var locPx = proj(loc);
67145       var offsetLocPx = [locPx[0] + offset[0], locPx[1] + offset[1]];
67146       var offsetLoc = proj.invert(offsetLocPx);
67147       return offsetLoc;
67148     }
67149     ;
67150     function paneWidth() {
67151       const openPane = context.container().select(".map-panes .map-pane.shown");
67152       if (!openPane.empty()) {
67153         return openPane.node().offsetWidth;
67154       }
67155       return 0;
67156     }
67157     ;
67158     function toolbarHeight() {
67159       const toolbar = context.container().select(".top-toolbar");
67160       return toolbar.node().offsetHeight;
67161     }
67162     ;
67163     function footerHeight() {
67164       const footer = context.container().select(".map-footer-bar");
67165       return footer.node().offsetHeight;
67166     }
67167     map2.zoom = function(z22) {
67168       if (!arguments.length) {
67169         return Math.max(geoScaleToZoom(projection2.scale(), TILESIZE), 0);
67170       }
67171       if (z22 < _minzoom) {
67172         surface.interrupt();
67173         dispatch12.call("hitMinZoom", this, map2);
67174         z22 = context.minEditableZoom();
67175       }
67176       if (setCenterZoom(map2.center(), z22)) {
67177         dispatch12.call("move", this, map2);
67178       }
67179       scheduleRedraw();
67180       return map2;
67181     };
67182     map2.centerZoom = function(loc2, z22) {
67183       if (setCenterZoom(loc2, z22)) {
67184         dispatch12.call("move", this, map2);
67185       }
67186       scheduleRedraw();
67187       return map2;
67188     };
67189     map2.zoomTo = function(what) {
67190       return map2.zoomToEase(what, 0);
67191     };
67192     map2.centerEase = function(loc2, duration) {
67193       duration = duration || 250;
67194       setCenterZoom(loc2, map2.zoom(), duration);
67195       return map2;
67196     };
67197     map2.zoomEase = function(z22, duration) {
67198       duration = duration || 250;
67199       setCenterZoom(map2.center(), z22, duration, false);
67200       return map2;
67201     };
67202     map2.centerZoomEase = function(loc2, z22, duration) {
67203       duration = duration || 250;
67204       setCenterZoom(loc2, z22, duration, false);
67205       return map2;
67206     };
67207     map2.transformEase = function(t2, duration) {
67208       duration = duration || 250;
67209       setTransform(
67210         t2,
67211         duration,
67212         false
67213         /* don't force */
67214       );
67215       return map2;
67216     };
67217     map2.zoomToEase = function(what, duration) {
67218       let extent;
67219       if (what instanceof geoExtent) {
67220         extent = what;
67221       } else {
67222         if (!isArray_default(what)) what = [what];
67223         extent = what.map((entity) => entity.extent(context.graph())).reduce((a2, b3) => a2.extend(b3));
67224       }
67225       if (!isFinite(extent.area())) return map2;
67226       var z3 = clamp_default(map2.trimmedExtentZoom(extent), 0, 20);
67227       const loc = trimmedCenter(extent.center(), z3);
67228       if (duration === 0) {
67229         return map2.centerZoom(loc, z3);
67230       } else {
67231         return map2.centerZoomEase(loc, z3, duration);
67232       }
67233     };
67234     map2.startEase = function() {
67235       utilBindOnce(surface, _pointerPrefix + "down.ease", function() {
67236         map2.cancelEase();
67237       });
67238       return map2;
67239     };
67240     map2.cancelEase = function() {
67241       _selection.interrupt();
67242       return map2;
67243     };
67244     map2.extent = function(val) {
67245       if (!arguments.length) {
67246         return new geoExtent(
67247           projection2.invert([0, _dimensions[1]]),
67248           projection2.invert([_dimensions[0], 0])
67249         );
67250       } else {
67251         var extent = geoExtent(val);
67252         map2.centerZoom(extent.center(), map2.extentZoom(extent));
67253       }
67254     };
67255     map2.trimmedExtent = function(val) {
67256       if (!arguments.length) {
67257         var headerY = 71;
67258         var footerY = 30;
67259         var pad2 = 10;
67260         return new geoExtent(
67261           projection2.invert([pad2, _dimensions[1] - footerY - pad2]),
67262           projection2.invert([_dimensions[0] - pad2, headerY + pad2])
67263         );
67264       } else {
67265         var extent = geoExtent(val);
67266         map2.centerZoom(extent.center(), map2.trimmedExtentZoom(extent));
67267       }
67268     };
67269     function calcExtentZoom(extent, dim) {
67270       var tl = projection2([extent[0][0], extent[1][1]]);
67271       var br = projection2([extent[1][0], extent[0][1]]);
67272       var hFactor = (br[0] - tl[0]) / dim[0];
67273       var vFactor = (br[1] - tl[1]) / dim[1];
67274       var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
67275       var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
67276       var newZoom = map2.zoom() - Math.max(hZoomDiff, vZoomDiff);
67277       return newZoom;
67278     }
67279     map2.extentZoom = function(val) {
67280       return calcExtentZoom(geoExtent(val), _dimensions);
67281     };
67282     map2.trimmedExtentZoom = function(val) {
67283       const trim = 40;
67284       const trimmed = [
67285         _dimensions[0] - trim - paneWidth(),
67286         _dimensions[1] - trim - toolbarHeight() - footerHeight()
67287       ];
67288       return calcExtentZoom(geoExtent(val), trimmed);
67289     };
67290     map2.withinEditableZoom = function() {
67291       return map2.zoom() >= context.minEditableZoom();
67292     };
67293     map2.isInWideSelection = function() {
67294       return !map2.withinEditableZoom() && context.selectedIDs().length;
67295     };
67296     map2.editableDataEnabled = function(skipZoomCheck) {
67297       var layer = context.layers().layer("osm");
67298       if (!layer || !layer.enabled()) return false;
67299       return skipZoomCheck || map2.withinEditableZoom();
67300     };
67301     map2.notesEditable = function() {
67302       var layer = context.layers().layer("notes");
67303       if (!layer || !layer.enabled()) return false;
67304       return map2.withinEditableZoom();
67305     };
67306     map2.minzoom = function(val) {
67307       if (!arguments.length) return _minzoom;
67308       _minzoom = val;
67309       return map2;
67310     };
67311     map2.toggleHighlightEdited = function() {
67312       surface.classed("highlight-edited", !surface.classed("highlight-edited"));
67313       map2.pan([0, 0]);
67314       dispatch12.call("changeHighlighting", this);
67315     };
67316     map2.areaFillOptions = ["wireframe", "partial", "full"];
67317     map2.activeAreaFill = function(val) {
67318       if (!arguments.length) return corePreferences("area-fill") || "partial";
67319       corePreferences("area-fill", val);
67320       if (val !== "wireframe") {
67321         corePreferences("area-fill-toggle", val);
67322       }
67323       updateAreaFill();
67324       map2.pan([0, 0]);
67325       dispatch12.call("changeAreaFill", this);
67326       return map2;
67327     };
67328     map2.toggleWireframe = function() {
67329       var activeFill = map2.activeAreaFill();
67330       if (activeFill === "wireframe") {
67331         activeFill = corePreferences("area-fill-toggle") || "partial";
67332       } else {
67333         activeFill = "wireframe";
67334       }
67335       map2.activeAreaFill(activeFill);
67336     };
67337     function updateAreaFill() {
67338       var activeFill = map2.activeAreaFill();
67339       map2.areaFillOptions.forEach(function(opt) {
67340         surface.classed("fill-" + opt, Boolean(opt === activeFill));
67341       });
67342     }
67343     map2.layers = () => drawLayers;
67344     map2.doubleUpHandler = function() {
67345       return _doubleUpHandler;
67346     };
67347     return utilRebind(map2, dispatch12, "on");
67348   }
67349
67350   // modules/renderer/photos.js
67351   function rendererPhotos(context) {
67352     var dispatch12 = dispatch_default("change");
67353     var _layerIDs = ["streetside", "mapillary", "mapillary-map-features", "mapillary-signs", "kartaview", "mapilio", "vegbilder", "panoramax"];
67354     var _allPhotoTypes = ["flat", "panoramic"];
67355     var _shownPhotoTypes = _allPhotoTypes.slice();
67356     var _dateFilters = ["fromDate", "toDate"];
67357     var _fromDate;
67358     var _toDate;
67359     var _usernames;
67360     function photos() {
67361     }
67362     function updateStorage() {
67363       var hash2 = utilStringQs(window.location.hash);
67364       var enabled = context.layers().all().filter(function(d2) {
67365         return _layerIDs.indexOf(d2.id) !== -1 && d2.layer && d2.layer.supported() && d2.layer.enabled();
67366       }).map(function(d2) {
67367         return d2.id;
67368       });
67369       if (enabled.length) {
67370         hash2.photo_overlay = enabled.join(",");
67371       } else {
67372         delete hash2.photo_overlay;
67373       }
67374       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
67375     }
67376     photos.overlayLayerIDs = function() {
67377       return _layerIDs;
67378     };
67379     photos.allPhotoTypes = function() {
67380       return _allPhotoTypes;
67381     };
67382     photos.dateFilters = function() {
67383       return _dateFilters;
67384     };
67385     photos.dateFilterValue = function(val) {
67386       return val === _dateFilters[0] ? _fromDate : _toDate;
67387     };
67388     photos.setDateFilter = function(type2, val, updateUrl) {
67389       var date = val && new Date(val);
67390       if (date && !isNaN(date)) {
67391         val = date.toISOString().slice(0, 10);
67392       } else {
67393         val = null;
67394       }
67395       if (type2 === _dateFilters[0]) {
67396         _fromDate = val;
67397         if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
67398           _toDate = _fromDate;
67399         }
67400       }
67401       if (type2 === _dateFilters[1]) {
67402         _toDate = val;
67403         if (_fromDate && _toDate && new Date(_toDate) < new Date(_fromDate)) {
67404           _fromDate = _toDate;
67405         }
67406       }
67407       dispatch12.call("change", this);
67408       if (updateUrl) {
67409         var rangeString;
67410         if (_fromDate || _toDate) {
67411           rangeString = (_fromDate || "") + "_" + (_toDate || "");
67412         }
67413         setUrlFilterValue("photo_dates", rangeString);
67414       }
67415     };
67416     photos.setUsernameFilter = function(val, updateUrl) {
67417       if (val && typeof val === "string") val = val.replace(/;/g, ",").split(",");
67418       if (val) {
67419         val = val.map((d2) => d2.trim()).filter(Boolean);
67420         if (!val.length) {
67421           val = null;
67422         }
67423       }
67424       _usernames = val;
67425       dispatch12.call("change", this);
67426       if (updateUrl) {
67427         var hashString;
67428         if (_usernames) {
67429           hashString = _usernames.join(",");
67430         }
67431         setUrlFilterValue("photo_username", hashString);
67432       }
67433     };
67434     photos.togglePhotoType = function(val, updateUrl) {
67435       var index = _shownPhotoTypes.indexOf(val);
67436       if (index !== -1) {
67437         _shownPhotoTypes.splice(index, 1);
67438       } else {
67439         _shownPhotoTypes.push(val);
67440       }
67441       if (updateUrl) {
67442         var hashString;
67443         if (_shownPhotoTypes) {
67444           hashString = _shownPhotoTypes.join(",");
67445         }
67446         setUrlFilterValue("photo_type", hashString);
67447       }
67448       dispatch12.call("change", this);
67449       return photos;
67450     };
67451     function setUrlFilterValue(property, val) {
67452       const hash2 = utilStringQs(window.location.hash);
67453       if (val) {
67454         if (hash2[property] === val) return;
67455         hash2[property] = val;
67456       } else {
67457         if (!(property in hash2)) return;
67458         delete hash2[property];
67459       }
67460       window.history.replaceState(null, "", "#" + utilQsString(hash2, true));
67461     }
67462     function showsLayer(id2) {
67463       var layer = context.layers().layer(id2);
67464       return layer && layer.supported() && layer.enabled();
67465     }
67466     photos.shouldFilterDateBySlider = function() {
67467       return showsLayer("mapillary") || showsLayer("kartaview") || showsLayer("mapilio") || showsLayer("streetside") || showsLayer("vegbilder") || showsLayer("panoramax");
67468     };
67469     photos.shouldFilterByPhotoType = function() {
67470       return showsLayer("mapillary") || showsLayer("streetside") && showsLayer("kartaview") || showsLayer("vegbilder") || showsLayer("panoramax");
67471     };
67472     photos.shouldFilterByUsername = function() {
67473       return !showsLayer("mapillary") && showsLayer("kartaview") && !showsLayer("streetside") || showsLayer("panoramax");
67474     };
67475     photos.showsPhotoType = function(val) {
67476       if (!photos.shouldFilterByPhotoType()) return true;
67477       return _shownPhotoTypes.indexOf(val) !== -1;
67478     };
67479     photos.showsFlat = function() {
67480       return photos.showsPhotoType("flat");
67481     };
67482     photos.showsPanoramic = function() {
67483       return photos.showsPhotoType("panoramic");
67484     };
67485     photos.fromDate = function() {
67486       return _fromDate;
67487     };
67488     photos.toDate = function() {
67489       return _toDate;
67490     };
67491     photos.usernames = function() {
67492       return _usernames;
67493     };
67494     photos.init = function() {
67495       var hash2 = utilStringQs(window.location.hash);
67496       var parts;
67497       if (hash2.photo_dates) {
67498         parts = /^(.*)[–_](.*)$/g.exec(hash2.photo_dates.trim());
67499         this.setDateFilter("fromDate", parts && parts.length >= 2 && parts[1], false);
67500         this.setDateFilter("toDate", parts && parts.length >= 3 && parts[2], false);
67501       }
67502       if (hash2.photo_username) {
67503         this.setUsernameFilter(hash2.photo_username, false);
67504       }
67505       if (hash2.photo_type) {
67506         parts = hash2.photo_type.replace(/;/g, ",").split(",");
67507         _allPhotoTypes.forEach((d2) => {
67508           if (!parts.includes(d2)) this.togglePhotoType(d2, false);
67509         });
67510       }
67511       if (hash2.photo_overlay) {
67512         var hashOverlayIDs = hash2.photo_overlay.replace(/;/g, ",").split(",");
67513         hashOverlayIDs.forEach(function(id2) {
67514           if (id2 === "openstreetcam") id2 = "kartaview";
67515           var layer2 = _layerIDs.indexOf(id2) !== -1 && context.layers().layer(id2);
67516           if (layer2 && !layer2.enabled()) layer2.enabled(true);
67517         });
67518       }
67519       if (hash2.photo) {
67520         var photoIds = hash2.photo.replace(/;/g, ",").split(",");
67521         var photoId = photoIds.length && photoIds[0].trim();
67522         var results = /(.*)\/(.*)/g.exec(photoId);
67523         if (results && results.length >= 3) {
67524           var serviceId = results[1];
67525           if (serviceId === "openstreetcam") serviceId = "kartaview";
67526           var photoKey = results[2];
67527           var service = services[serviceId];
67528           if (service && service.ensureViewerLoaded) {
67529             var layer = _layerIDs.indexOf(serviceId) !== -1 && context.layers().layer(serviceId);
67530             if (layer && !layer.enabled()) layer.enabled(true);
67531             var baselineTime = Date.now();
67532             service.on("loadedImages.rendererPhotos", function() {
67533               if (Date.now() - baselineTime > 45e3) {
67534                 service.on("loadedImages.rendererPhotos", null);
67535                 return;
67536               }
67537               if (!service.cachedImage(photoKey)) return;
67538               service.on("loadedImages.rendererPhotos", null);
67539               service.ensureViewerLoaded(context).then(function() {
67540                 service.selectImage(context, photoKey).showViewer(context);
67541               });
67542             });
67543           }
67544         }
67545       }
67546       context.layers().on("change.rendererPhotos", updateStorage);
67547     };
67548     return utilRebind(photos, dispatch12, "on");
67549   }
67550
67551   // modules/ui/map_in_map.js
67552   function uiMapInMap(context) {
67553     function mapInMap(selection2) {
67554       var backgroundLayer = rendererTileLayer(context).underzoom(2);
67555       var overlayLayers = {};
67556       var projection2 = geoRawMercator();
67557       var dataLayer = svgData(projection2, context).showLabels(false);
67558       var debugLayer = svgDebug(projection2, context);
67559       var zoom = zoom_default2().scaleExtent([geoZoomToScale(0.5), geoZoomToScale(24)]).on("start", zoomStarted).on("zoom", zoomed).on("end", zoomEnded);
67560       var wrap2 = select_default2(null);
67561       var tiles = select_default2(null);
67562       var viewport = select_default2(null);
67563       var _isTransformed = false;
67564       var _isHidden = true;
67565       var _skipEvents = false;
67566       var _gesture = null;
67567       var _zDiff = 6;
67568       var _dMini;
67569       var _cMini;
67570       var _tStart;
67571       var _tCurr;
67572       var _timeoutID;
67573       function zoomStarted() {
67574         if (_skipEvents) return;
67575         _tStart = _tCurr = projection2.transform();
67576         _gesture = null;
67577       }
67578       function zoomed(d3_event) {
67579         if (_skipEvents) return;
67580         var x3 = d3_event.transform.x;
67581         var y3 = d3_event.transform.y;
67582         var k3 = d3_event.transform.k;
67583         var isZooming = k3 !== _tStart.k;
67584         var isPanning = x3 !== _tStart.x || y3 !== _tStart.y;
67585         if (!isZooming && !isPanning) {
67586           return;
67587         }
67588         if (!_gesture) {
67589           _gesture = isZooming ? "zoom" : "pan";
67590         }
67591         var tMini = projection2.transform();
67592         var tX, tY, scale;
67593         if (_gesture === "zoom") {
67594           scale = k3 / tMini.k;
67595           tX = (_cMini[0] / scale - _cMini[0]) * scale;
67596           tY = (_cMini[1] / scale - _cMini[1]) * scale;
67597         } else {
67598           k3 = tMini.k;
67599           scale = 1;
67600           tX = x3 - tMini.x;
67601           tY = y3 - tMini.y;
67602         }
67603         utilSetTransform(tiles, tX, tY, scale);
67604         utilSetTransform(viewport, 0, 0, scale);
67605         _isTransformed = true;
67606         _tCurr = identity3.translate(x3, y3).scale(k3);
67607         var zMain = geoScaleToZoom(context.projection.scale());
67608         var zMini = geoScaleToZoom(k3);
67609         _zDiff = zMain - zMini;
67610         queueRedraw();
67611       }
67612       function zoomEnded() {
67613         if (_skipEvents) return;
67614         if (_gesture !== "pan") return;
67615         updateProjection();
67616         _gesture = null;
67617         context.map().center(projection2.invert(_cMini));
67618       }
67619       function updateProjection() {
67620         var loc = context.map().center();
67621         var tMain = context.projection.transform();
67622         var zMain = geoScaleToZoom(tMain.k);
67623         var zMini = Math.max(zMain - _zDiff, 0.5);
67624         var kMini = geoZoomToScale(zMini);
67625         projection2.translate([tMain.x, tMain.y]).scale(kMini);
67626         var point = projection2(loc);
67627         var mouse = _gesture === "pan" ? geoVecSubtract([_tCurr.x, _tCurr.y], [_tStart.x, _tStart.y]) : [0, 0];
67628         var xMini = _cMini[0] - point[0] + tMain.x + mouse[0];
67629         var yMini = _cMini[1] - point[1] + tMain.y + mouse[1];
67630         projection2.translate([xMini, yMini]).clipExtent([[0, 0], _dMini]);
67631         _tCurr = projection2.transform();
67632         if (_isTransformed) {
67633           utilSetTransform(tiles, 0, 0);
67634           utilSetTransform(viewport, 0, 0);
67635           _isTransformed = false;
67636         }
67637         zoom.scaleExtent([geoZoomToScale(0.5), geoZoomToScale(zMain - 3)]);
67638         _skipEvents = true;
67639         wrap2.call(zoom.transform, _tCurr);
67640         _skipEvents = false;
67641       }
67642       function redraw() {
67643         clearTimeout(_timeoutID);
67644         if (_isHidden) return;
67645         updateProjection();
67646         var zMini = geoScaleToZoom(projection2.scale());
67647         tiles = wrap2.selectAll(".map-in-map-tiles").data([0]);
67648         tiles = tiles.enter().append("div").attr("class", "map-in-map-tiles").merge(tiles);
67649         backgroundLayer.source(context.background().baseLayerSource()).projection(projection2).dimensions(_dMini);
67650         var background = tiles.selectAll(".map-in-map-background").data([0]);
67651         background.enter().append("div").attr("class", "map-in-map-background").merge(background).call(backgroundLayer);
67652         var overlaySources = context.background().overlayLayerSources();
67653         var activeOverlayLayers = [];
67654         for (var i3 = 0; i3 < overlaySources.length; i3++) {
67655           if (overlaySources[i3].validZoom(zMini)) {
67656             if (!overlayLayers[i3]) overlayLayers[i3] = rendererTileLayer(context);
67657             activeOverlayLayers.push(overlayLayers[i3].source(overlaySources[i3]).projection(projection2).dimensions(_dMini));
67658           }
67659         }
67660         var overlay = tiles.selectAll(".map-in-map-overlay").data([0]);
67661         overlay = overlay.enter().append("div").attr("class", "map-in-map-overlay").merge(overlay);
67662         var overlays = overlay.selectAll("div").data(activeOverlayLayers, function(d2) {
67663           return d2.source().name();
67664         });
67665         overlays.exit().remove();
67666         overlays = overlays.enter().append("div").merge(overlays).each(function(layer) {
67667           select_default2(this).call(layer);
67668         });
67669         var dataLayers = tiles.selectAll(".map-in-map-data").data([0]);
67670         dataLayers.exit().remove();
67671         dataLayers = dataLayers.enter().append("svg").attr("class", "map-in-map-data").merge(dataLayers).call(dataLayer).call(debugLayer);
67672         if (_gesture !== "pan") {
67673           var getPath = path_default(projection2);
67674           var bbox2 = { type: "Polygon", coordinates: [context.map().extent().polygon()] };
67675           viewport = wrap2.selectAll(".map-in-map-viewport").data([0]);
67676           viewport = viewport.enter().append("svg").attr("class", "map-in-map-viewport").merge(viewport);
67677           var path = viewport.selectAll(".map-in-map-bbox").data([bbox2]);
67678           path.enter().append("path").attr("class", "map-in-map-bbox").merge(path).attr("d", getPath).classed("thick", function(d2) {
67679             return getPath.area(d2) < 30;
67680           });
67681         }
67682       }
67683       function queueRedraw() {
67684         clearTimeout(_timeoutID);
67685         _timeoutID = setTimeout(function() {
67686           redraw();
67687         }, 750);
67688       }
67689       function toggle(d3_event) {
67690         if (d3_event) d3_event.preventDefault();
67691         _isHidden = !_isHidden;
67692         context.container().select(".minimap-toggle-item").classed("active", !_isHidden).select("input").property("checked", !_isHidden);
67693         if (_isHidden) {
67694           wrap2.style("display", "block").style("opacity", "1").transition().duration(200).style("opacity", "0").on("end", function() {
67695             selection2.selectAll(".map-in-map").style("display", "none");
67696           });
67697         } else {
67698           wrap2.style("display", "block").style("opacity", "0").transition().duration(200).style("opacity", "1").on("end", function() {
67699             redraw();
67700           });
67701         }
67702       }
67703       uiMapInMap.toggle = toggle;
67704       wrap2 = selection2.selectAll(".map-in-map").data([0]);
67705       wrap2 = wrap2.enter().append("div").attr("class", "map-in-map").style("display", _isHidden ? "none" : "block").call(zoom).on("dblclick.zoom", null).merge(wrap2);
67706       _dMini = [200, 150];
67707       _cMini = geoVecScale(_dMini, 0.5);
67708       context.map().on("drawn.map-in-map", function(drawn) {
67709         if (drawn.full === true) {
67710           redraw();
67711         }
67712       });
67713       redraw();
67714       context.keybinding().on(_t("background.minimap.key"), toggle);
67715     }
67716     return mapInMap;
67717   }
67718
67719   // modules/ui/notice.js
67720   function uiNotice(context) {
67721     return function(selection2) {
67722       var div = selection2.append("div").attr("class", "notice");
67723       var button = div.append("button").attr("class", "zoom-to notice fillD").on("click", function() {
67724         context.map().zoomEase(context.minEditableZoom());
67725       }).on("wheel", function(d3_event) {
67726         var e22 = new WheelEvent(d3_event.type, d3_event);
67727         context.surface().node().dispatchEvent(e22);
67728       });
67729       button.call(svgIcon("#iD-icon-plus", "pre-text")).append("span").attr("class", "label").call(_t.append("zoom_in_edit"));
67730       function disableTooHigh() {
67731         var canEdit = context.map().zoom() >= context.minEditableZoom();
67732         div.style("display", canEdit ? "none" : "block");
67733       }
67734       context.map().on("move.notice", debounce_default(disableTooHigh, 500));
67735       disableTooHigh();
67736     };
67737   }
67738
67739   // modules/ui/photoviewer.js
67740   function uiPhotoviewer(context) {
67741     var dispatch12 = dispatch_default("resize");
67742     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
67743     const addPhotoIdButton = /* @__PURE__ */ new Set(["mapillary", "panoramax"]);
67744     function photoviewer(selection2) {
67745       selection2.append("button").attr("class", "thumb-hide").attr("title", _t("icons.close")).on("click", function() {
67746         for (const service of Object.values(services)) {
67747           if (typeof service.hideViewer === "function") {
67748             service.hideViewer(context);
67749           }
67750         }
67751       }).append("div").call(svgIcon("#iD-icon-close"));
67752       function preventDefault(d3_event) {
67753         d3_event.preventDefault();
67754       }
67755       selection2.append("button").attr("class", "resize-handle-xy").on("touchstart touchdown touchend", preventDefault).on(
67756         _pointerPrefix + "down",
67757         buildResizeListener(selection2, "resize", dispatch12, { resizeOnX: true, resizeOnY: true })
67758       );
67759       selection2.append("button").attr("class", "resize-handle-x").on("touchstart touchdown touchend", preventDefault).on(
67760         _pointerPrefix + "down",
67761         buildResizeListener(selection2, "resize", dispatch12, { resizeOnX: true })
67762       );
67763       selection2.append("button").attr("class", "resize-handle-y").on("touchstart touchdown touchend", preventDefault).on(
67764         _pointerPrefix + "down",
67765         buildResizeListener(selection2, "resize", dispatch12, { resizeOnY: true })
67766       );
67767       context.features().on("change.setPhotoFromViewer", function() {
67768         setPhotoTagButton();
67769       });
67770       context.history().on("change.setPhotoFromViewer", function() {
67771         setPhotoTagButton();
67772       });
67773       function setPhotoTagButton() {
67774         const service = getServiceId();
67775         const isActiveForService = addPhotoIdButton.has(service) && services[service].isViewerOpen() && layerEnabled(service) && context.mode().id === "select";
67776         renderAddPhotoIdButton(service, isActiveForService);
67777         function layerEnabled(which) {
67778           const layers = context.layers();
67779           const layer = layers.layer(which);
67780           return layer.enabled();
67781         }
67782         function getServiceId() {
67783           for (const serviceId in services) {
67784             const service2 = services[serviceId];
67785             if (typeof service2.isViewerOpen === "function") {
67786               if (service2.isViewerOpen()) {
67787                 return serviceId;
67788               }
67789             }
67790           }
67791           return false;
67792         }
67793         function renderAddPhotoIdButton(service2, shouldDisplay) {
67794           const button = selection2.selectAll(".set-photo-from-viewer").data(shouldDisplay ? [0] : []);
67795           button.exit().remove();
67796           const buttonEnter = button.enter().append("button").attr("class", "set-photo-from-viewer").call(svgIcon("#fas-eye-dropper")).call(
67797             uiTooltip().title(() => _t.append("inspector.set_photo_from_viewer.enable")).placement("right")
67798           );
67799           buttonEnter.select(".tooltip").classed("dark", true).style("width", "300px");
67800           buttonEnter.merge(button).on("click", function(e3) {
67801             e3.preventDefault();
67802             e3.stopPropagation();
67803             const activeServiceId = getServiceId();
67804             const image = services[activeServiceId].getActiveImage();
67805             const action = (graph2) => context.selectedIDs().reduce((graph3, entityID) => {
67806               const tags = graph3.entity(entityID).tags;
67807               const action2 = actionChangeTags(entityID, __spreadProps(__spreadValues({}, tags), { [activeServiceId]: image.id }));
67808               return action2(graph3);
67809             }, graph2);
67810             const annotation = _t("operations.change_tags.annotation");
67811             context.perform(action, annotation);
67812             buttonDisable("already_set");
67813           });
67814           if (service2 === "panoramax") {
67815             const panoramaxControls = selection2.select(".panoramax-wrapper .pnlm-zoom-controls.pnlm-controls");
67816             panoramaxControls.style("margin-top", shouldDisplay ? "36px" : "6px");
67817           }
67818           if (!shouldDisplay) return;
67819           const activeImage = services[service2].getActiveImage();
67820           const graph = context.graph();
67821           const entities = context.selectedIDs().map((id2) => graph.hasEntity(id2)).filter(Boolean);
67822           if (entities.map((entity) => entity.tags[service2]).every((value) => value === (activeImage == null ? void 0 : activeImage.id))) {
67823             buttonDisable("already_set");
67824           } else if (activeImage && entities.map((entity) => entity.extent(context.graph()).center()).every((loc) => geoSphericalDistance(loc, activeImage.loc) > 100)) {
67825             buttonDisable("too_far");
67826           } else {
67827             buttonDisable(false);
67828           }
67829         }
67830         function buttonDisable(reason) {
67831           const disabled = reason !== false;
67832           const button = selection2.selectAll(".set-photo-from-viewer").data([0]);
67833           button.attr("disabled", disabled ? "true" : null);
67834           button.classed("disabled", disabled);
67835           button.call(uiTooltip().destroyAny);
67836           if (disabled) {
67837             button.call(
67838               uiTooltip().title(() => _t.append("inspector.set_photo_from_viewer.disable.".concat(reason))).placement("right")
67839             );
67840           } else {
67841             button.call(
67842               uiTooltip().title(() => _t.append("inspector.set_photo_from_viewer.enable")).placement("right")
67843             );
67844           }
67845           button.select(".tooltip").classed("dark", true).style("width", "300px");
67846         }
67847       }
67848       function buildResizeListener(target, eventName, dispatch13, options) {
67849         var resizeOnX = !!options.resizeOnX;
67850         var resizeOnY = !!options.resizeOnY;
67851         var minHeight = options.minHeight || 240;
67852         var minWidth = options.minWidth || 320;
67853         var pointerId;
67854         var startX;
67855         var startY;
67856         var startWidth;
67857         var startHeight;
67858         function startResize(d3_event) {
67859           if (pointerId !== (d3_event.pointerId || "mouse")) return;
67860           d3_event.preventDefault();
67861           d3_event.stopPropagation();
67862           var mapSize = context.map().dimensions();
67863           if (resizeOnX) {
67864             var mapWidth = mapSize[0];
67865             const viewerMargin = parseInt(select_default2(".photoviewer").style("margin-left"), 10);
67866             var newWidth = clamp_default(startWidth + d3_event.clientX - startX, minWidth, mapWidth - viewerMargin * 2);
67867             target.style("width", newWidth + "px");
67868           }
67869           if (resizeOnY) {
67870             const menuHeight = utilGetDimensions(select_default2(".top-toolbar"))[1] + utilGetDimensions(select_default2(".map-footer"))[1];
67871             const viewerMargin = parseInt(select_default2(".photoviewer").style("margin-bottom"), 10);
67872             var maxHeight = mapSize[1] - menuHeight - viewerMargin * 2;
67873             var newHeight = clamp_default(startHeight + startY - d3_event.clientY, minHeight, maxHeight);
67874             target.style("height", newHeight + "px");
67875           }
67876           dispatch13.call(eventName, target, subtractPadding(utilGetDimensions(target, true), target));
67877         }
67878         function stopResize(d3_event) {
67879           if (pointerId !== (d3_event.pointerId || "mouse")) return;
67880           d3_event.preventDefault();
67881           d3_event.stopPropagation();
67882           select_default2(window).on("." + eventName, null);
67883         }
67884         return function initResize(d3_event) {
67885           d3_event.preventDefault();
67886           d3_event.stopPropagation();
67887           pointerId = d3_event.pointerId || "mouse";
67888           startX = d3_event.clientX;
67889           startY = d3_event.clientY;
67890           var targetRect = target.node().getBoundingClientRect();
67891           startWidth = targetRect.width;
67892           startHeight = targetRect.height;
67893           select_default2(window).on(_pointerPrefix + "move." + eventName, startResize, false).on(_pointerPrefix + "up." + eventName, stopResize, false);
67894           if (_pointerPrefix === "pointer") {
67895             select_default2(window).on("pointercancel." + eventName, stopResize, false);
67896           }
67897         };
67898       }
67899     }
67900     photoviewer.onMapResize = function() {
67901       var photoviewer2 = context.container().select(".photoviewer");
67902       var content = context.container().select(".main-content");
67903       var mapDimensions = utilGetDimensions(content, true);
67904       const menuHeight = utilGetDimensions(select_default2(".top-toolbar"))[1] + utilGetDimensions(select_default2(".map-footer"))[1];
67905       const viewerMargin = parseInt(select_default2(".photoviewer").style("margin-bottom"), 10);
67906       var photoDimensions = utilGetDimensions(photoviewer2, true);
67907       if (photoDimensions[0] > mapDimensions[0] || photoDimensions[1] > mapDimensions[1] - menuHeight - viewerMargin * 2) {
67908         var setPhotoDimensions = [
67909           Math.min(photoDimensions[0], mapDimensions[0]),
67910           Math.min(photoDimensions[1], mapDimensions[1] - menuHeight - viewerMargin * 2)
67911         ];
67912         photoviewer2.style("width", setPhotoDimensions[0] + "px").style("height", setPhotoDimensions[1] + "px");
67913         dispatch12.call("resize", photoviewer2, subtractPadding(setPhotoDimensions, photoviewer2));
67914       } else {
67915         dispatch12.call("resize", photoviewer2, subtractPadding(photoDimensions, photoviewer2));
67916       }
67917     };
67918     function subtractPadding(dimensions, selection2) {
67919       return [
67920         dimensions[0] - parseFloat(selection2.style("padding-left")) - parseFloat(selection2.style("padding-right")),
67921         dimensions[1] - parseFloat(selection2.style("padding-top")) - parseFloat(selection2.style("padding-bottom"))
67922       ];
67923     }
67924     photoviewer.viewerSize = function() {
67925       const photoviewer2 = context.container().select(".photoviewer");
67926       return subtractPadding(utilGetDimensions(photoviewer2, true), photoviewer2);
67927     };
67928     return utilRebind(photoviewer, dispatch12, "on");
67929   }
67930
67931   // modules/ui/restore.js
67932   function uiRestore(context) {
67933     return function(selection2) {
67934       if (!context.history().hasRestorableChanges()) return;
67935       let modalSelection = uiModal(selection2, true);
67936       modalSelection.select(".modal").attr("class", "modal fillL");
67937       let introModal = modalSelection.select(".content");
67938       introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("restore.heading"));
67939       introModal.append("div").attr("class", "modal-section").append("p").call(_t.append("restore.description"));
67940       let buttonWrap = introModal.append("div").attr("class", "modal-actions");
67941       let restore = buttonWrap.append("button").attr("class", "restore").on("click", () => {
67942         context.history().restore();
67943         modalSelection.remove();
67944       });
67945       restore.append("svg").attr("class", "logo logo-restore").append("use").attr("xlink:href", "#iD-logo-restore");
67946       restore.append("div").call(_t.append("restore.restore"));
67947       let reset = buttonWrap.append("button").attr("class", "reset").on("click", () => {
67948         context.history().clearSaved();
67949         modalSelection.remove();
67950       });
67951       reset.append("svg").attr("class", "logo logo-reset").append("use").attr("xlink:href", "#iD-logo-reset");
67952       reset.append("div").call(_t.append("restore.reset"));
67953       restore.node().focus();
67954     };
67955   }
67956
67957   // modules/ui/scale.js
67958   function uiScale(context) {
67959     var projection2 = context.projection, isImperial = !_mainLocalizer.usesMetric(), maxLength = 180, tickHeight = 8;
67960     function scaleDefs(loc1, loc2) {
67961       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;
67962       if (isImperial) {
67963         buckets = [528e4, 528e3, 52800, 5280, 500, 50, 5, 1];
67964       } else {
67965         buckets = [5e6, 5e5, 5e4, 5e3, 500, 50, 5, 1];
67966       }
67967       for (i3 = 0; i3 < buckets.length; i3++) {
67968         val = buckets[i3];
67969         if (dist >= val) {
67970           scale.dist = Math.floor(dist / val) * val;
67971           break;
67972         } else {
67973           scale.dist = +dist.toFixed(2);
67974         }
67975       }
67976       dLon = geoMetersToLon(scale.dist / conversion, lat);
67977       scale.px = Math.round(projection2([loc1[0] + dLon, loc1[1]])[0]);
67978       scale.text = displayLength(scale.dist / conversion, isImperial);
67979       return scale;
67980     }
67981     function update(selection2) {
67982       var dims = context.map().dimensions(), loc1 = projection2.invert([0, dims[1]]), loc2 = projection2.invert([maxLength, dims[1]]), scale = scaleDefs(loc1, loc2);
67983       selection2.select(".scale-path").attr("d", "M0.5,0.5v" + tickHeight + "h" + scale.px + "v-" + tickHeight);
67984       selection2.select(".scale-text").style(_mainLocalizer.textDirection() === "ltr" ? "left" : "right", scale.px + 16 + "px").text(scale.text);
67985     }
67986     return function(selection2) {
67987       function switchUnits() {
67988         isImperial = !isImperial;
67989         selection2.call(update);
67990       }
67991       var scalegroup = selection2.append("svg").attr("class", "scale").on("click", switchUnits).append("g").attr("transform", "translate(10,11)");
67992       scalegroup.append("path").attr("class", "scale-path");
67993       selection2.append("div").attr("class", "scale-text");
67994       selection2.call(update);
67995       context.map().on("move.scale", function() {
67996         update(selection2);
67997       });
67998     };
67999   }
68000
68001   // modules/ui/shortcuts.js
68002   function uiShortcuts(context) {
68003     var detected = utilDetect();
68004     var _activeTab = 0;
68005     var _modalSelection;
68006     var _selection = select_default2(null);
68007     var _dataShortcuts;
68008     function shortcutsModal(_modalSelection2) {
68009       _modalSelection2.select(".modal").classed("modal-shortcuts", true);
68010       var content = _modalSelection2.select(".content");
68011       content.append("div").attr("class", "modal-section header").append("h2").call(_t.append("shortcuts.title"));
68012       _mainFileFetcher.get("shortcuts").then(function(data) {
68013         _dataShortcuts = data;
68014         content.call(render);
68015       }).catch(function() {
68016       });
68017     }
68018     function render(selection2) {
68019       if (!_dataShortcuts) return;
68020       var wrapper = selection2.selectAll(".wrapper").data([0]);
68021       var wrapperEnter = wrapper.enter().append("div").attr("class", "wrapper modal-section");
68022       var tabsBar = wrapperEnter.append("div").attr("class", "tabs-bar");
68023       var shortcutsList = wrapperEnter.append("div").attr("class", "shortcuts-list");
68024       wrapper = wrapper.merge(wrapperEnter);
68025       var tabs = tabsBar.selectAll(".tab").data(_dataShortcuts);
68026       var tabsEnter = tabs.enter().append("a").attr("class", "tab").attr("href", "#").on("click", function(d3_event, d2) {
68027         d3_event.preventDefault();
68028         var i3 = _dataShortcuts.indexOf(d2);
68029         _activeTab = i3;
68030         render(selection2);
68031       });
68032       tabsEnter.append("span").html(function(d2) {
68033         return _t.html(d2.text);
68034       });
68035       wrapper.selectAll(".tab").classed("active", function(d2, i3) {
68036         return i3 === _activeTab;
68037       });
68038       var shortcuts = shortcutsList.selectAll(".shortcut-tab").data(_dataShortcuts);
68039       var shortcutsEnter = shortcuts.enter().append("div").attr("class", function(d2) {
68040         return "shortcut-tab shortcut-tab-" + d2.tab;
68041       });
68042       var columnsEnter = shortcutsEnter.selectAll(".shortcut-column").data(function(d2) {
68043         return d2.columns;
68044       }).enter().append("table").attr("class", "shortcut-column");
68045       var rowsEnter = columnsEnter.selectAll(".shortcut-row").data(function(d2) {
68046         return d2.rows;
68047       }).enter().append("tr").attr("class", "shortcut-row");
68048       var sectionRows = rowsEnter.filter(function(d2) {
68049         return !d2.shortcuts;
68050       });
68051       sectionRows.append("td");
68052       sectionRows.append("td").attr("class", "shortcut-section").append("h3").html(function(d2) {
68053         return _t.html(d2.text);
68054       });
68055       var shortcutRows = rowsEnter.filter(function(d2) {
68056         return d2.shortcuts;
68057       });
68058       var shortcutKeys = shortcutRows.append("td").attr("class", "shortcut-keys");
68059       var modifierKeys = shortcutKeys.filter(function(d2) {
68060         return d2.modifiers;
68061       });
68062       modifierKeys.selectAll("kbd.modifier").data(function(d2) {
68063         if (detected.os === "win" && d2.text === "shortcuts.editing.commands.redo") {
68064           return ["\u2318"];
68065         } else if (detected.os !== "mac" && d2.text === "shortcuts.browsing.display_options.fullscreen") {
68066           return [];
68067         } else {
68068           return d2.modifiers;
68069         }
68070       }).enter().each(function() {
68071         var selection3 = select_default2(this);
68072         selection3.append("kbd").attr("class", "modifier").text(function(d2) {
68073           return uiCmd.display(d2);
68074         });
68075         selection3.append("span").text("+");
68076       });
68077       shortcutKeys.selectAll("kbd.shortcut").data(function(d2) {
68078         var arr = d2.shortcuts;
68079         if (detected.os === "win" && d2.text === "shortcuts.editing.commands.redo") {
68080           arr = ["Y"];
68081         } else if (detected.os !== "mac" && d2.text === "shortcuts.browsing.display_options.fullscreen") {
68082           arr = ["F11"];
68083         }
68084         arr = arr.map(function(s2) {
68085           return uiCmd.display(s2.indexOf(".") !== -1 ? _t(s2) : s2);
68086         });
68087         return utilArrayUniq(arr).map(function(s2) {
68088           return {
68089             shortcut: s2,
68090             separator: d2.separator,
68091             suffix: d2.suffix
68092           };
68093         });
68094       }).enter().each(function(d2, i3, nodes) {
68095         var selection3 = select_default2(this);
68096         var click = d2.shortcut.toLowerCase().match(/(.*).click/);
68097         if (click && click[1]) {
68098           selection3.call(svgIcon("#iD-walkthrough-mouse-" + click[1], "operation"));
68099         } else if (d2.shortcut.toLowerCase() === "long-press") {
68100           selection3.call(svgIcon("#iD-walkthrough-longpress", "longpress operation"));
68101         } else if (d2.shortcut.toLowerCase() === "tap") {
68102           selection3.call(svgIcon("#iD-walkthrough-tap", "tap operation"));
68103         } else {
68104           selection3.append("kbd").attr("class", "shortcut").text(function(d4) {
68105             return d4.shortcut;
68106           });
68107         }
68108         if (i3 < nodes.length - 1) {
68109           selection3.append("span").html(d2.separator || "\xA0" + _t.html("shortcuts.or") + "\xA0");
68110         } else if (i3 === nodes.length - 1 && d2.suffix) {
68111           selection3.append("span").text(d2.suffix);
68112         }
68113       });
68114       shortcutKeys.filter(function(d2) {
68115         return d2.gesture;
68116       }).each(function() {
68117         var selection3 = select_default2(this);
68118         selection3.append("span").text("+");
68119         selection3.append("span").attr("class", "gesture").html(function(d2) {
68120           return _t.html(d2.gesture);
68121         });
68122       });
68123       shortcutRows.append("td").attr("class", "shortcut-desc").html(function(d2) {
68124         return d2.text ? _t.html(d2.text) : "\xA0";
68125       });
68126       wrapper.selectAll(".shortcut-tab").style("display", function(d2, i3) {
68127         return i3 === _activeTab ? "flex" : "none";
68128       });
68129     }
68130     return function(selection2, show) {
68131       _selection = selection2;
68132       if (show) {
68133         _modalSelection = uiModal(selection2);
68134         _modalSelection.call(shortcutsModal);
68135       } else {
68136         context.keybinding().on([_t("shortcuts.toggle.key"), "?"], function() {
68137           if (context.container().selectAll(".modal-shortcuts").size()) {
68138             if (_modalSelection) {
68139               _modalSelection.close();
68140               _modalSelection = null;
68141             }
68142           } else {
68143             _modalSelection = uiModal(_selection);
68144             _modalSelection.call(shortcutsModal);
68145           }
68146         });
68147       }
68148     };
68149   }
68150
68151   // modules/ui/feature_list.js
68152   var sexagesimal = __toESM(require_sexagesimal(), 1);
68153   var idMatch = (q3) => {
68154     const idMatchRegex = /(?:^|\W)(node|way|relation|note|[nwr])\W{0,2}0*([1-9]\d*)(?:\W|$)/i;
68155     const idMatch2 = q3.match(idMatchRegex);
68156     if (!idMatch2) return false;
68157     return {
68158       type: idMatch2[1] === "note" ? idMatch2[1] : idMatch2[1].charAt(0),
68159       id: idMatch2[2]
68160     };
68161   };
68162   function uiFeatureList(context) {
68163     var _geocodeResults;
68164     function featureList(selection2) {
68165       var header = selection2.append("div").attr("class", "header fillL");
68166       header.append("h2").call(_t.append("inspector.feature_list"));
68167       var searchWrap = selection2.append("div").attr("class", "search-header");
68168       searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
68169       var search = searchWrap.append("input").attr("placeholder", _t("inspector.search")).attr("type", "search").call(utilNoAuto).on("keypress", keypress).on("keydown", keydown).on("input", inputevent);
68170       var listWrap = selection2.append("div").attr("class", "inspector-body");
68171       var list = listWrap.append("div").attr("class", "feature-list");
68172       context.on("exit.feature-list", clearSearch);
68173       context.map().on("drawn.feature-list", mapDrawn);
68174       context.keybinding().on(uiCmd("\u2318F"), focusSearch);
68175       function focusSearch(d3_event) {
68176         var mode = context.mode() && context.mode().id;
68177         if (mode !== "browse") return;
68178         d3_event.preventDefault();
68179         search.node().focus();
68180       }
68181       function keydown(d3_event) {
68182         if (d3_event.keyCode === 27) {
68183           search.node().blur();
68184         }
68185       }
68186       function keypress(d3_event) {
68187         var q3 = search.property("value"), items = list.selectAll(".feature-list-item");
68188         if (d3_event.keyCode === 13 && // ↩ Return
68189         q3.length && items.size()) {
68190           click(d3_event, items.datum());
68191         }
68192       }
68193       function inputevent() {
68194         _geocodeResults = void 0;
68195         drawList();
68196       }
68197       function clearSearch() {
68198         search.property("value", "");
68199         drawList();
68200       }
68201       function mapDrawn(e3) {
68202         if (e3.full) {
68203           drawList();
68204         }
68205       }
68206       function features() {
68207         var graph = context.graph();
68208         var visibleCenter = context.map().extent().center();
68209         var q3 = search.property("value").toLowerCase().trim();
68210         if (!q3) return [];
68211         const locationMatch = sexagesimal.pair(q3.toUpperCase()) || dmsMatcher(q3);
68212         const coordResult = [];
68213         if (locationMatch) {
68214           const latLon = [Number(locationMatch[0]), Number(locationMatch[1])];
68215           const lonLat = [latLon[1], latLon[0]];
68216           const isLatLonValid = latLon[0] >= -90 && latLon[0] <= 90 && latLon[1] >= -180 && latLon[1] <= 180;
68217           let isLonLatValid = lonLat[0] >= -90 && lonLat[0] <= 90 && lonLat[1] >= -180 && lonLat[1] <= 180;
68218           isLonLatValid && (isLonLatValid = !q3.match(/[NSEW]/i));
68219           isLonLatValid && (isLonLatValid = !locationMatch[2]);
68220           isLonLatValid && (isLonLatValid = lonLat[0] !== lonLat[1]);
68221           if (isLatLonValid) {
68222             coordResult.push({
68223               id: latLon[0] + "/" + latLon[1],
68224               geometry: "point",
68225               type: _t("inspector.location"),
68226               name: dmsCoordinatePair([latLon[1], latLon[0]]),
68227               location: latLon,
68228               zoom: locationMatch[2]
68229             });
68230           }
68231           if (isLonLatValid) {
68232             coordResult.push({
68233               id: lonLat[0] + "/" + lonLat[1],
68234               geometry: "point",
68235               type: _t("inspector.location"),
68236               name: dmsCoordinatePair([lonLat[1], lonLat[0]]),
68237               location: lonLat
68238             });
68239           }
68240         }
68241         const idMatchResult = !locationMatch && idMatch(q3);
68242         const idResult = [];
68243         if (idMatchResult) {
68244           const elemType = idMatchResult.type;
68245           const elemId = idMatchResult.id;
68246           idResult.push({
68247             id: elemType + elemId,
68248             geometry: elemType === "n" ? "point" : elemType === "w" ? "line" : elemType === "note" ? "note" : "relation",
68249             type: elemType === "n" ? _t("inspector.node") : elemType === "w" ? _t("inspector.way") : elemType === "note" ? _t("note.note") : _t("inspector.relation"),
68250             name: elemId
68251           });
68252         }
68253         var allEntities = graph.entities;
68254         const localResults = [];
68255         for (var id2 in allEntities) {
68256           var entity = allEntities[id2];
68257           if (!entity) continue;
68258           var name = utilDisplayName(entity) || "";
68259           if (name.toLowerCase().indexOf(q3) < 0) continue;
68260           var matched = _mainPresetIndex.match(entity, graph);
68261           var type2 = matched && matched.name() || utilDisplayType(entity.id);
68262           var extent = entity.extent(graph);
68263           var distance = extent ? geoSphericalDistance(visibleCenter, extent.center()) : 0;
68264           localResults.push({
68265             id: entity.id,
68266             entity,
68267             geometry: entity.geometry(graph),
68268             type: type2,
68269             name,
68270             distance
68271           });
68272           if (localResults.length > 100) break;
68273         }
68274         localResults.sort((a2, b3) => a2.distance - b3.distance);
68275         const geocodeResults = [];
68276         (_geocodeResults || []).forEach(function(d2) {
68277           if (d2.osm_type && d2.osm_id) {
68278             var id3 = osmEntity.id.fromOSM(d2.osm_type, d2.osm_id);
68279             var tags = {};
68280             tags[d2.class] = d2.type;
68281             var attrs = { id: id3, type: d2.osm_type, tags };
68282             if (d2.osm_type === "way") {
68283               attrs.nodes = ["a", "a"];
68284             }
68285             var tempEntity = osmEntity(attrs);
68286             var tempGraph = coreGraph([tempEntity]);
68287             var matched2 = _mainPresetIndex.match(tempEntity, tempGraph);
68288             var type3 = matched2 && matched2.name() || utilDisplayType(id3);
68289             geocodeResults.push({
68290               id: tempEntity.id,
68291               geometry: tempEntity.geometry(tempGraph),
68292               type: type3,
68293               name: d2.display_name,
68294               extent: new geoExtent(
68295                 [Number(d2.boundingbox[3]), Number(d2.boundingbox[0])],
68296                 [Number(d2.boundingbox[2]), Number(d2.boundingbox[1])]
68297               )
68298             });
68299           }
68300         });
68301         const extraResults = [];
68302         if (q3.match(/^[0-9]+$/)) {
68303           extraResults.push({
68304             id: "n" + q3,
68305             geometry: "point",
68306             type: _t("inspector.node"),
68307             name: q3
68308           });
68309           extraResults.push({
68310             id: "w" + q3,
68311             geometry: "line",
68312             type: _t("inspector.way"),
68313             name: q3
68314           });
68315           extraResults.push({
68316             id: "r" + q3,
68317             geometry: "relation",
68318             type: _t("inspector.relation"),
68319             name: q3
68320           });
68321           extraResults.push({
68322             id: "note" + q3,
68323             geometry: "note",
68324             type: _t("note.note"),
68325             name: q3
68326           });
68327         }
68328         return [...idResult, ...localResults, ...coordResult, ...geocodeResults, ...extraResults];
68329       }
68330       function drawList() {
68331         var value = search.property("value");
68332         var results = features();
68333         list.classed("filtered", value.length);
68334         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"));
68335         resultsIndicator.append("span").attr("class", "entity-name");
68336         list.selectAll(".no-results-item .entity-name").html("").call(_t.append("geocoder.no_results_worldwide"));
68337         if (services.geocoder) {
68338           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"));
68339         }
68340         list.selectAll(".no-results-item").style("display", value.length && !results.length ? "block" : "none");
68341         list.selectAll(".geocode-item").style("display", value && _geocodeResults === void 0 ? "block" : "none");
68342         var items = list.selectAll(".feature-list-item").data(results, function(d2) {
68343           return d2.id;
68344         });
68345         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);
68346         var label = enter.append("div").attr("class", "label");
68347         label.each(function(d2) {
68348           select_default2(this).call(svgIcon("#iD-icon-" + d2.geometry, "pre-text"));
68349         });
68350         label.append("span").attr("class", "entity-type").text(function(d2) {
68351           return d2.type;
68352         });
68353         label.append("span").attr("class", "entity-name").classed("has-colour", (d2) => d2.entity && d2.entity.type === "relation" && d2.entity.tags.colour && isColourValid(d2.entity.tags.colour)).style("border-color", (d2) => d2.entity && d2.entity.type === "relation" && d2.entity.tags.colour).text(function(d2) {
68354           return d2.name;
68355         });
68356         enter.style("opacity", 0).transition().style("opacity", 1);
68357         items.exit().each((d2) => mouseout(void 0, d2)).remove();
68358         items.merge(enter).order();
68359       }
68360       function mouseover(d3_event, d2) {
68361         if (d2.location !== void 0) return;
68362         utilHighlightEntities([d2.id], true, context);
68363       }
68364       function mouseout(d3_event, d2) {
68365         if (d2.location !== void 0) return;
68366         utilHighlightEntities([d2.id], false, context);
68367       }
68368       function click(d3_event, d2) {
68369         d3_event.preventDefault();
68370         if (d2.location) {
68371           context.map().centerZoomEase([d2.location[1], d2.location[0]], d2.zoom || 19);
68372         } else if (d2.entity) {
68373           utilHighlightEntities([d2.id], false, context);
68374           context.enter(modeSelect(context, [d2.entity.id]));
68375           context.map().zoomToEase(d2.entity);
68376         } else if (d2.geometry === "note") {
68377           const noteId = d2.id.replace(/\D/g, "");
68378           context.moveToNote(noteId);
68379         } else {
68380           context.zoomToEntity(d2.id);
68381         }
68382       }
68383       function geocoderSearch() {
68384         services.geocoder.search(search.property("value"), function(err, resp) {
68385           _geocodeResults = resp || [];
68386           drawList();
68387         });
68388       }
68389     }
68390     return featureList;
68391   }
68392
68393   // modules/ui/entity_editor.js
68394   var import_fast_deep_equal10 = __toESM(require_fast_deep_equal(), 1);
68395
68396   // modules/ui/sections/entity_issues.js
68397   function uiSectionEntityIssues(context) {
68398     var preference = corePreferences("entity-issues.reference.expanded");
68399     var _expanded = preference === null ? true : preference === "true";
68400     var _entityIDs = [];
68401     var _issues = [];
68402     var _activeIssueID;
68403     var section = uiSection("entity-issues", context).shouldDisplay(function() {
68404       return _issues.length > 0;
68405     }).label(function() {
68406       return _t.append("inspector.title_count", { title: _t("issues.list_title"), count: _issues.length });
68407     }).disclosureContent(renderDisclosureContent);
68408     context.validator().on("validated.entity_issues", function() {
68409       reloadIssues();
68410       section.reRender();
68411     }).on("focusedIssue.entity_issues", function(issue) {
68412       makeActiveIssue(issue.id);
68413     });
68414     function reloadIssues() {
68415       _issues = context.validator().getSharedEntityIssues(_entityIDs, { includeDisabledRules: true });
68416     }
68417     function makeActiveIssue(issueID) {
68418       _activeIssueID = issueID;
68419       section.selection().selectAll(".issue-container").classed("active", function(d2) {
68420         return d2.id === _activeIssueID;
68421       });
68422     }
68423     function renderDisclosureContent(selection2) {
68424       selection2.classed("grouped-items-area", true);
68425       _activeIssueID = _issues.length > 0 ? _issues[0].id : null;
68426       var containers = selection2.selectAll(".issue-container").data(_issues, function(d2) {
68427         return d2.key;
68428       });
68429       containers.exit().remove();
68430       var containersEnter = containers.enter().append("div").attr("class", "issue-container");
68431       var itemsEnter = containersEnter.append("div").attr("class", function(d2) {
68432         return "issue severity-" + d2.severity;
68433       }).on("mouseover.highlight", function(d3_event, d2) {
68434         var ids = d2.entityIds.filter(function(e3) {
68435           return _entityIDs.indexOf(e3) === -1;
68436         });
68437         utilHighlightEntities(ids, true, context);
68438       }).on("mouseout.highlight", function(d3_event, d2) {
68439         var ids = d2.entityIds.filter(function(e3) {
68440           return _entityIDs.indexOf(e3) === -1;
68441         });
68442         utilHighlightEntities(ids, false, context);
68443       });
68444       var labelsEnter = itemsEnter.append("div").attr("class", "issue-label");
68445       var textEnter = labelsEnter.append("button").attr("class", "issue-text").on("click", function(d3_event, d2) {
68446         makeActiveIssue(d2.id);
68447         const extent = d2.extent(context.graph());
68448         if (extent) {
68449           context.map().zoomToEase(extent);
68450         }
68451       });
68452       textEnter.each(function(d2) {
68453         select_default2(this).call(svgIcon(validationIssue.ICONS[d2.severity], "issue-icon"));
68454       });
68455       textEnter.append("span").attr("class", "issue-message");
68456       var infoButton = labelsEnter.append("button").attr("class", "issue-info-button").attr("title", _t("icons.information")).call(svgIcon("#iD-icon-inspect"));
68457       infoButton.on("click", function(d3_event) {
68458         d3_event.stopPropagation();
68459         d3_event.preventDefault();
68460         this.blur();
68461         var container = select_default2(this.parentNode.parentNode.parentNode);
68462         var info = container.selectAll(".issue-info");
68463         var isExpanded = info.classed("expanded");
68464         _expanded = !isExpanded;
68465         corePreferences("entity-issues.reference.expanded", _expanded);
68466         if (isExpanded) {
68467           info.transition().duration(200).style("max-height", "0px").style("opacity", "0").on("end", function() {
68468             info.classed("expanded", false);
68469           });
68470         } else {
68471           info.classed("expanded", true).transition().duration(200).style("max-height", "200px").style("opacity", "1").on("end", function() {
68472             info.style("max-height", null);
68473           });
68474         }
68475       });
68476       itemsEnter.append("ul").attr("class", "issue-fix-list");
68477       containersEnter.append("div").attr("class", "issue-info" + (_expanded ? " expanded" : "")).style("max-height", _expanded ? null : "0").style("opacity", _expanded ? "1" : "0").each(function(d2) {
68478         if (typeof d2.reference === "function") {
68479           select_default2(this).call(d2.reference);
68480         } else {
68481           select_default2(this).call(_t.append("inspector.no_documentation_key"));
68482         }
68483       });
68484       containers = containers.merge(containersEnter).classed("active", function(d2) {
68485         return d2.id === _activeIssueID;
68486       });
68487       containers.selectAll(".issue-message").text("").each(function(d2) {
68488         return d2.message(context)(select_default2(this));
68489       });
68490       var fixLists = containers.selectAll(".issue-fix-list");
68491       var fixes = fixLists.selectAll(".issue-fix-item").data(function(d2) {
68492         return d2.fixes ? d2.fixes(context) : [];
68493       }, function(fix) {
68494         return fix.id;
68495       });
68496       fixes.exit().remove();
68497       var fixesEnter = fixes.enter().append("li").attr("class", "issue-fix-item");
68498       var buttons = fixesEnter.append("button").on("click", function(d3_event, d2) {
68499         if (select_default2(this).attr("disabled") || !d2.onClick) return;
68500         if (d2.issue.dateLastRanFix && /* @__PURE__ */ new Date() - d2.issue.dateLastRanFix < 1e3) return;
68501         d2.issue.dateLastRanFix = /* @__PURE__ */ new Date();
68502         utilHighlightEntities(d2.issue.entityIds.concat(d2.entityIds), false, context);
68503         new Promise(function(resolve, reject) {
68504           d2.onClick(context, resolve, reject);
68505           if (d2.onClick.length <= 1) {
68506             resolve();
68507           }
68508         }).then(function() {
68509           context.validator().validate();
68510         });
68511       }).on("mouseover.highlight", function(d3_event, d2) {
68512         utilHighlightEntities(d2.entityIds, true, context);
68513       }).on("mouseout.highlight", function(d3_event, d2) {
68514         utilHighlightEntities(d2.entityIds, false, context);
68515       });
68516       buttons.each(function(d2) {
68517         var iconName = d2.icon || "iD-icon-wrench";
68518         if (iconName.startsWith("maki")) {
68519           iconName += "-15";
68520         }
68521         select_default2(this).call(svgIcon("#" + iconName, "fix-icon"));
68522       });
68523       buttons.append("span").attr("class", "fix-message").each(function(d2) {
68524         return d2.title(select_default2(this));
68525       });
68526       fixesEnter.merge(fixes).selectAll("button").classed("actionable", function(d2) {
68527         return d2.onClick;
68528       }).attr("disabled", function(d2) {
68529         return d2.onClick ? null : "true";
68530       }).attr("title", function(d2) {
68531         if (d2.disabledReason) {
68532           return d2.disabledReason;
68533         }
68534         return null;
68535       });
68536     }
68537     section.entityIDs = function(val) {
68538       if (!arguments.length) return _entityIDs;
68539       if (!_entityIDs || !val || !utilArrayIdentical(_entityIDs, val)) {
68540         _entityIDs = val;
68541         _activeIssueID = null;
68542         reloadIssues();
68543       }
68544       return section;
68545     };
68546     return section;
68547   }
68548
68549   // modules/ui/preset_icon.js
68550   function uiPresetIcon() {
68551     let _preset;
68552     let _geometry;
68553     function presetIcon(selection2) {
68554       selection2.each(render);
68555     }
68556     function getIcon(p2, geom) {
68557       if (p2.isFallback && p2.isFallback()) return geom === "vertex" ? "" : "iD-icon-" + p2.id;
68558       if (p2.icon) return p2.icon;
68559       if (geom === "line") return "iD-other-line";
68560       if (geom === "vertex") return "temaki-vertex";
68561       return "maki-marker-stroked";
68562     }
68563     function renderPointBorder(container, drawPoint) {
68564       let pointBorder = container.selectAll(".preset-icon-point-border").data(drawPoint ? [0] : []);
68565       pointBorder.exit().remove();
68566       let pointBorderEnter = pointBorder.enter();
68567       const w3 = 40;
68568       const h3 = 40;
68569       pointBorderEnter.append("svg").attr("class", "preset-icon-fill preset-icon-point-border").attr("width", w3).attr("height", h3).attr("viewBox", "0 0 ".concat(w3, " ").concat(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");
68570       pointBorder = pointBorderEnter.merge(pointBorder);
68571     }
68572     function renderCategoryBorder(container, category) {
68573       let categoryBorder = container.selectAll(".preset-icon-category-border").data(category ? [0] : []);
68574       categoryBorder.exit().remove();
68575       let categoryBorderEnter = categoryBorder.enter();
68576       const d2 = 60;
68577       let svgEnter = categoryBorderEnter.append("svg").attr("class", "preset-icon-fill preset-icon-category-border").attr("width", d2).attr("height", d2).attr("viewBox", "0 0 ".concat(d2, " ").concat(d2));
68578       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");
68579       categoryBorder = categoryBorderEnter.merge(categoryBorder);
68580       if (category) {
68581         categoryBorder.selectAll("path").attr("class", "area ".concat(category.id));
68582       }
68583     }
68584     function renderCircleFill(container, drawVertex) {
68585       let vertexFill = container.selectAll(".preset-icon-fill-vertex").data(drawVertex ? [0] : []);
68586       vertexFill.exit().remove();
68587       let vertexFillEnter = vertexFill.enter();
68588       const w3 = 60;
68589       const h3 = 60;
68590       const d2 = 40;
68591       vertexFillEnter.append("svg").attr("class", "preset-icon-fill preset-icon-fill-vertex").attr("width", w3).attr("height", h3).attr("viewBox", "0 0 ".concat(w3, " ").concat(h3)).append("circle").attr("cx", w3 / 2).attr("cy", h3 / 2).attr("r", d2 / 2);
68592       vertexFill = vertexFillEnter.merge(vertexFill);
68593     }
68594     function renderSquareFill(container, drawArea, tagClasses) {
68595       let fill = container.selectAll(".preset-icon-fill-area").data(drawArea ? [0] : []);
68596       fill.exit().remove();
68597       let fillEnter = fill.enter();
68598       const d2 = 60;
68599       const w3 = d2;
68600       const h3 = d2;
68601       const l2 = d2 * 2 / 3;
68602       const c1 = (w3 - l2) / 2;
68603       const c2 = c1 + l2;
68604       fillEnter = fillEnter.append("svg").attr("class", "preset-icon-fill preset-icon-fill-area").attr("width", w3).attr("height", h3).attr("viewBox", "0 0 ".concat(w3, " ").concat(h3));
68605       ["fill", "stroke"].forEach((klass) => {
68606         fillEnter.append("path").attr("d", "M".concat(c1, " ").concat(c1, " L").concat(c1, " ").concat(c2, " L").concat(c2, " ").concat(c2, " L").concat(c2, " ").concat(c1, " Z")).attr("class", "area ".concat(klass));
68607       });
68608       const rVertex = 2.5;
68609       [[c1, c1], [c1, c2], [c2, c2], [c2, c1]].forEach((point) => {
68610         fillEnter.append("circle").attr("class", "vertex").attr("cx", point[0]).attr("cy", point[1]).attr("r", rVertex);
68611       });
68612       const rMidpoint = 1.25;
68613       [[c1, w3 / 2], [c2, w3 / 2], [h3 / 2, c1], [h3 / 2, c2]].forEach((point) => {
68614         fillEnter.append("circle").attr("class", "midpoint").attr("cx", point[0]).attr("cy", point[1]).attr("r", rMidpoint);
68615       });
68616       fill = fillEnter.merge(fill);
68617       fill.selectAll("path.stroke").attr("class", "area stroke ".concat(tagClasses));
68618       fill.selectAll("path.fill").attr("class", "area fill ".concat(tagClasses));
68619     }
68620     function renderLine(container, drawLine, tagClasses) {
68621       let line = container.selectAll(".preset-icon-line").data(drawLine ? [0] : []);
68622       line.exit().remove();
68623       let lineEnter = line.enter();
68624       const d2 = 60;
68625       const w3 = d2;
68626       const h3 = d2;
68627       const y3 = Math.round(d2 * 0.72);
68628       const l2 = Math.round(d2 * 0.6);
68629       const r2 = 2.5;
68630       const x12 = (w3 - l2) / 2;
68631       const x22 = x12 + l2;
68632       lineEnter = lineEnter.append("svg").attr("class", "preset-icon-line").attr("width", w3).attr("height", h3).attr("viewBox", "0 0 ".concat(w3, " ").concat(h3));
68633       ["casing", "stroke"].forEach((klass) => {
68634         lineEnter.append("path").attr("d", "M".concat(x12, " ").concat(y3, " L").concat(x22, " ").concat(y3)).attr("class", "line ".concat(klass));
68635       });
68636       [[x12 - 1, y3], [x22 + 1, y3]].forEach((point) => {
68637         lineEnter.append("circle").attr("class", "vertex").attr("cx", point[0]).attr("cy", point[1]).attr("r", r2);
68638       });
68639       line = lineEnter.merge(line);
68640       line.selectAll("path.stroke").attr("class", "line stroke ".concat(tagClasses));
68641       line.selectAll("path.casing").attr("class", "line casing ".concat(tagClasses));
68642     }
68643     function renderRoute(container, drawRoute, p2) {
68644       let route = container.selectAll(".preset-icon-route").data(drawRoute ? [0] : []);
68645       route.exit().remove();
68646       let routeEnter = route.enter();
68647       const d2 = 60;
68648       const w3 = d2;
68649       const h3 = d2;
68650       const y12 = Math.round(d2 * 0.8);
68651       const y22 = Math.round(d2 * 0.68);
68652       const l2 = Math.round(d2 * 0.6);
68653       const r2 = 2;
68654       const x12 = (w3 - l2) / 2;
68655       const x22 = x12 + l2 / 3;
68656       const x3 = x22 + l2 / 3;
68657       const x4 = x3 + l2 / 3;
68658       routeEnter = routeEnter.append("svg").attr("class", "preset-icon-route").attr("width", w3).attr("height", h3).attr("viewBox", "0 0 ".concat(w3, " ").concat(h3));
68659       ["casing", "stroke"].forEach((klass) => {
68660         routeEnter.append("path").attr("d", "M".concat(x12, " ").concat(y12, " L").concat(x22, " ").concat(y22)).attr("class", "segment0 line ".concat(klass));
68661         routeEnter.append("path").attr("d", "M".concat(x22, " ").concat(y22, " L").concat(x3, " ").concat(y12)).attr("class", "segment1 line ".concat(klass));
68662         routeEnter.append("path").attr("d", "M".concat(x3, " ").concat(y12, " L").concat(x4, " ").concat(y22)).attr("class", "segment2 line ".concat(klass));
68663       });
68664       [[x12, y12], [x22, y22], [x3, y12], [x4, y22]].forEach((point) => {
68665         routeEnter.append("circle").attr("class", "vertex").attr("cx", point[0]).attr("cy", point[1]).attr("r", r2);
68666       });
68667       route = routeEnter.merge(route);
68668       if (drawRoute) {
68669         let routeType = p2.tags.type === "waterway" ? "waterway" : p2.tags.route;
68670         const segmentPresetIDs = routeSegments[routeType];
68671         for (let i3 in segmentPresetIDs) {
68672           const segmentPreset = _mainPresetIndex.item(segmentPresetIDs[i3]);
68673           const segmentTagClasses = svgTagClasses().getClassesString(segmentPreset.tags, "");
68674           route.selectAll("path.stroke.segment".concat(i3)).attr("class", "segment".concat(i3, " line stroke ").concat(segmentTagClasses));
68675           route.selectAll("path.casing.segment".concat(i3)).attr("class", "segment".concat(i3, " line casing ").concat(segmentTagClasses));
68676         }
68677       }
68678     }
68679     function renderSvgIcon(container, picon, geom, isFramed, category, tagClasses) {
68680       const isMaki = picon && /^maki-/.test(picon);
68681       const isTemaki = picon && /^temaki-/.test(picon);
68682       const isFa = picon && /^fa[srb]-/.test(picon);
68683       const isR\u00F6ntgen = picon && /^roentgen-/.test(picon);
68684       const isiDIcon = picon && !(isMaki || isTemaki || isFa || isR\u00F6ntgen);
68685       let icon2 = container.selectAll(".preset-icon").data(picon ? [0] : []);
68686       icon2.exit().remove();
68687       icon2 = icon2.enter().append("div").attr("class", "preset-icon").call(svgIcon("")).merge(icon2);
68688       icon2.attr("class", "preset-icon " + (geom ? geom + "-geom" : "")).classed("category", category).classed("framed", isFramed).classed("preset-icon-iD", isiDIcon);
68689       icon2.selectAll("svg").attr("class", "icon " + picon + " " + (!isiDIcon && geom !== "line" ? "" : tagClasses));
68690       icon2.selectAll("use").attr("href", "#" + picon);
68691     }
68692     function renderImageIcon(container, imageURL) {
68693       let imageIcon = container.selectAll("img.image-icon").data(imageURL ? [0] : []);
68694       imageIcon.exit().remove();
68695       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);
68696       imageIcon.attr("src", imageURL);
68697     }
68698     const routeSegments = {
68699       bicycle: ["highway/cycleway", "highway/cycleway", "highway/cycleway"],
68700       bus: ["highway/unclassified", "highway/secondary", "highway/primary"],
68701       climbing: ["climbing/route", "climbing/route", "climbing/route"],
68702       trolleybus: ["highway/unclassified", "highway/secondary", "highway/primary"],
68703       detour: ["highway/tertiary", "highway/residential", "highway/unclassified"],
68704       ferry: ["route/ferry", "route/ferry", "route/ferry"],
68705       foot: ["highway/footway", "highway/footway", "highway/footway"],
68706       hiking: ["highway/path", "highway/path", "highway/path"],
68707       horse: ["highway/bridleway", "highway/bridleway", "highway/bridleway"],
68708       light_rail: ["railway/light_rail", "railway/light_rail", "railway/light_rail"],
68709       monorail: ["railway/monorail", "railway/monorail", "railway/monorail"],
68710       mtb: ["highway/path", "highway/track", "highway/bridleway"],
68711       pipeline: ["man_made/pipeline", "man_made/pipeline", "man_made/pipeline"],
68712       piste: ["piste/downhill", "piste/hike", "piste/nordic"],
68713       power: ["power/line", "power/line", "power/line"],
68714       road: ["highway/secondary", "highway/primary", "highway/trunk"],
68715       subway: ["railway/subway", "railway/subway", "railway/subway"],
68716       train: ["railway/rail", "railway/rail", "railway/rail"],
68717       tram: ["railway/tram", "railway/tram", "railway/tram"],
68718       railway: ["railway/rail", "railway/rail", "railway/rail"],
68719       waterway: ["waterway/stream", "waterway/stream", "waterway/stream"]
68720     };
68721     function render() {
68722       let p2 = _preset.apply(this, arguments);
68723       let geom = _geometry ? _geometry.apply(this, arguments) : null;
68724       if (geom === "relation" && p2.tags && (p2.tags.type === "route" && p2.tags.route && routeSegments[p2.tags.route] || p2.tags.type === "waterway")) {
68725         geom = "route";
68726       }
68727       const showThirdPartyIcons = corePreferences("preferences.privacy.thirdpartyicons") || "true";
68728       const isFallback = p2.isFallback && p2.isFallback();
68729       const imageURL = showThirdPartyIcons === "true" && p2.imageURL;
68730       const picon = getIcon(p2, geom);
68731       const isCategory = !p2.setTags;
68732       const drawPoint = false;
68733       const drawVertex = picon !== null && geom === "vertex";
68734       const drawLine = picon && geom === "line" && !isFallback && !isCategory;
68735       const drawArea = picon && geom === "area" && !isFallback && !isCategory;
68736       const drawRoute = picon && geom === "route";
68737       const isFramed = drawVertex || drawArea || drawLine || drawRoute || isCategory;
68738       let tags = !isCategory ? p2.setTags({}, geom) : {};
68739       for (let k3 in tags) {
68740         if (tags[k3] === "*") {
68741           tags[k3] = "yes";
68742         }
68743       }
68744       let tagClasses = svgTagClasses().getClassesString(tags, "");
68745       let selection2 = select_default2(this);
68746       let container = selection2.selectAll(".preset-icon-container").data([0]);
68747       container = container.enter().append("div").attr("class", "preset-icon-container").merge(container);
68748       container.classed("showing-img", !!imageURL).classed("fallback", isFallback);
68749       renderCategoryBorder(container, isCategory && p2);
68750       renderPointBorder(container, drawPoint);
68751       renderCircleFill(container, drawVertex);
68752       renderSquareFill(container, drawArea, tagClasses);
68753       renderLine(container, drawLine, tagClasses);
68754       renderRoute(container, drawRoute, p2);
68755       renderSvgIcon(container, picon, geom, isFramed, isCategory, tagClasses);
68756       renderImageIcon(container, imageURL);
68757     }
68758     presetIcon.preset = function(val) {
68759       if (!arguments.length) return _preset;
68760       _preset = utilFunctor(val);
68761       return presetIcon;
68762     };
68763     presetIcon.geometry = function(val) {
68764       if (!arguments.length) return _geometry;
68765       _geometry = utilFunctor(val);
68766       return presetIcon;
68767     };
68768     return presetIcon;
68769   }
68770
68771   // modules/ui/sections/feature_type.js
68772   function uiSectionFeatureType(context) {
68773     var dispatch12 = dispatch_default("choose");
68774     var _entityIDs = [];
68775     var _presets = [];
68776     var _tagReference;
68777     var section = uiSection("feature-type", context).label(() => _t.append("inspector.feature_type")).disclosureContent(renderDisclosureContent);
68778     function renderDisclosureContent(selection2) {
68779       selection2.classed("preset-list-item", true);
68780       selection2.classed("mixed-types", _presets.length > 1);
68781       var presetButtonWrap = selection2.selectAll(".preset-list-button-wrap").data([0]).enter().append("div").attr("class", "preset-list-button-wrap");
68782       var presetButton = presetButtonWrap.append("button").attr("class", "preset-list-button preset-reset").call(
68783         uiTooltip().title(() => _t.append("inspector.back_tooltip")).placement("bottom")
68784       );
68785       presetButton.append("div").attr("class", "preset-icon-container");
68786       presetButton.append("div").attr("class", "label").append("div").attr("class", "label-inner");
68787       presetButtonWrap.append("div").attr("class", "accessory-buttons");
68788       var tagReferenceBodyWrap = selection2.selectAll(".tag-reference-body-wrap").data([0]);
68789       tagReferenceBodyWrap = tagReferenceBodyWrap.enter().append("div").attr("class", "tag-reference-body-wrap").merge(tagReferenceBodyWrap);
68790       if (_tagReference) {
68791         selection2.selectAll(".preset-list-button-wrap .accessory-buttons").style("display", _presets.length === 1 ? null : "none").call(_tagReference.button);
68792         tagReferenceBodyWrap.style("display", _presets.length === 1 ? null : "none").call(_tagReference.body);
68793       }
68794       selection2.selectAll(".preset-reset").on("click", function() {
68795         dispatch12.call("choose", this, _presets);
68796       }).on("pointerdown pointerup mousedown mouseup", function(d3_event) {
68797         d3_event.preventDefault();
68798         d3_event.stopPropagation();
68799       });
68800       var geometries = entityGeometries();
68801       selection2.select(".preset-list-item button").call(
68802         uiPresetIcon().geometry(_presets.length === 1 ? geometries.length === 1 && geometries[0] : null).preset(_presets.length === 1 ? _presets[0] : _mainPresetIndex.item("point"))
68803       );
68804       var names = _presets.length === 1 ? [
68805         _presets[0].nameLabel(),
68806         _presets[0].subtitleLabel()
68807       ].filter(Boolean) : [_t.append("inspector.multiple_types")];
68808       var label = selection2.select(".label-inner");
68809       var nameparts = label.selectAll(".namepart").data(names, (d2) => d2.stringId);
68810       nameparts.exit().remove();
68811       nameparts.enter().append("div").attr("class", "namepart").text("").each(function(d2) {
68812         d2(select_default2(this));
68813       });
68814     }
68815     section.entityIDs = function(val) {
68816       if (!arguments.length) return _entityIDs;
68817       _entityIDs = val;
68818       return section;
68819     };
68820     section.presets = function(val) {
68821       if (!arguments.length) return _presets;
68822       if (!utilArrayIdentical(val, _presets)) {
68823         _presets = val;
68824         if (_presets.length === 1) {
68825           _tagReference = uiTagReference(_presets[0].reference(), context).showing(false);
68826         }
68827       }
68828       return section;
68829     };
68830     function entityGeometries() {
68831       var counts = {};
68832       for (var i3 in _entityIDs) {
68833         var geometry = context.graph().geometry(_entityIDs[i3]);
68834         if (!counts[geometry]) counts[geometry] = 0;
68835         counts[geometry] += 1;
68836       }
68837       return Object.keys(counts).sort(function(geom1, geom2) {
68838         return counts[geom2] - counts[geom1];
68839       });
68840     }
68841     return utilRebind(section, dispatch12, "on");
68842   }
68843
68844   // modules/ui/form_fields.js
68845   function uiFormFields(context) {
68846     var moreCombo = uiCombobox(context, "more-fields").minItems(1);
68847     var _fieldsArr = [];
68848     var _lastPlaceholder = "";
68849     var _state = "";
68850     var _klass = "";
68851     function formFields(selection2) {
68852       var allowedFields = _fieldsArr.filter(function(field) {
68853         return field.isAllowed();
68854       });
68855       var shown = allowedFields.filter(function(field) {
68856         return field.isShown();
68857       });
68858       var notShown = allowedFields.filter(function(field) {
68859         return !field.isShown();
68860       }).sort(function(a2, b3) {
68861         return a2.universal === b3.universal ? 0 : a2.universal ? 1 : -1;
68862       });
68863       var container = selection2.selectAll(".form-fields-container").data([0]);
68864       container = container.enter().append("div").attr("class", "form-fields-container " + (_klass || "")).merge(container);
68865       var fields = container.selectAll(".wrap-form-field").data(shown, function(d2) {
68866         return d2.id + (d2.entityIDs ? d2.entityIDs.join() : "");
68867       });
68868       fields.exit().remove();
68869       var enter = fields.enter().append("div").attr("class", function(d2) {
68870         return "wrap-form-field wrap-form-field-" + d2.safeid;
68871       });
68872       fields = fields.merge(enter);
68873       fields.order().each(function(d2) {
68874         select_default2(this).call(d2.render);
68875       });
68876       var titles = [];
68877       var moreFields = notShown.map(function(field) {
68878         var title = field.title();
68879         titles.push(title);
68880         var terms = field.terms();
68881         if (field.key) terms.push(field.key);
68882         if (field.keys) terms = terms.concat(field.keys);
68883         return {
68884           display: field.label(),
68885           value: title,
68886           title,
68887           field,
68888           terms
68889         };
68890       });
68891       var placeholder = titles.slice(0, 3).join(", ") + (titles.length > 3 ? "\u2026" : "");
68892       var more = selection2.selectAll(".more-fields").data(_state === "hover" || moreFields.length === 0 ? [] : [0]);
68893       more.exit().remove();
68894       var moreEnter = more.enter().append("div").attr("class", "more-fields").append("label");
68895       moreEnter.append("span").call(_t.append("inspector.add_fields"));
68896       more = moreEnter.merge(more);
68897       var input = more.selectAll(".value").data([0]);
68898       input.exit().remove();
68899       input = input.enter().append("input").attr("class", "value").attr("type", "text").attr("placeholder", placeholder).call(utilNoAuto).merge(input);
68900       input.call(utilGetSetValue, "").call(
68901         moreCombo.data(moreFields).on("accept", function(d2) {
68902           if (!d2) return;
68903           var field = d2.field;
68904           field.show();
68905           selection2.call(formFields);
68906           field.focus();
68907         })
68908       );
68909       if (_lastPlaceholder !== placeholder) {
68910         input.attr("placeholder", placeholder);
68911         _lastPlaceholder = placeholder;
68912       }
68913     }
68914     formFields.fieldsArr = function(val) {
68915       if (!arguments.length) return _fieldsArr;
68916       _fieldsArr = val || [];
68917       return formFields;
68918     };
68919     formFields.state = function(val) {
68920       if (!arguments.length) return _state;
68921       _state = val;
68922       return formFields;
68923     };
68924     formFields.klass = function(val) {
68925       if (!arguments.length) return _klass;
68926       _klass = val;
68927       return formFields;
68928     };
68929     return formFields;
68930   }
68931
68932   // modules/ui/sections/preset_fields.js
68933   function uiSectionPresetFields(context) {
68934     var section = uiSection("preset-fields", context).label(() => _t.append("inspector.fields")).disclosureContent(renderDisclosureContent);
68935     var dispatch12 = dispatch_default("change", "revert");
68936     var formFields = uiFormFields(context);
68937     var _state;
68938     var _fieldsArr;
68939     var _presets = [];
68940     var _tags;
68941     var _entityIDs;
68942     function renderDisclosureContent(selection2) {
68943       if (!_fieldsArr) {
68944         var graph = context.graph();
68945         var geometries = Object.keys(_entityIDs.reduce(function(geoms, entityID) {
68946           geoms[graph.entity(entityID).geometry(graph)] = true;
68947           return geoms;
68948         }, {}));
68949         const loc = _entityIDs.reduce(function(extent, entityID) {
68950           var entity = context.graph().entity(entityID);
68951           return extent.extend(entity.extent(context.graph()));
68952         }, geoExtent()).center();
68953         var presetsManager = _mainPresetIndex;
68954         var allFields = [];
68955         var allMoreFields = [];
68956         var sharedTotalFields;
68957         _presets.forEach(function(preset) {
68958           var fields = preset.fields(loc);
68959           var moreFields = preset.moreFields(loc);
68960           allFields = utilArrayUnion(allFields, fields);
68961           allMoreFields = utilArrayUnion(allMoreFields, moreFields);
68962           if (!sharedTotalFields) {
68963             sharedTotalFields = utilArrayUnion(fields, moreFields);
68964           } else {
68965             sharedTotalFields = sharedTotalFields.filter(function(field) {
68966               return fields.indexOf(field) !== -1 || moreFields.indexOf(field) !== -1;
68967             });
68968           }
68969         });
68970         var sharedFields = allFields.filter(function(field) {
68971           return sharedTotalFields.indexOf(field) !== -1;
68972         });
68973         var sharedMoreFields = allMoreFields.filter(function(field) {
68974           return sharedTotalFields.indexOf(field) !== -1;
68975         });
68976         _fieldsArr = [];
68977         sharedFields.forEach(function(field) {
68978           if (field.matchAllGeometry(geometries)) {
68979             _fieldsArr.push(
68980               uiField(context, field, _entityIDs)
68981             );
68982           }
68983         });
68984         var singularEntity = _entityIDs.length === 1 && graph.hasEntity(_entityIDs[0]);
68985         if (singularEntity && singularEntity.type === "node" && singularEntity.isHighwayIntersection(graph) && presetsManager.field("restrictions")) {
68986           _fieldsArr.push(
68987             uiField(context, presetsManager.field("restrictions"), _entityIDs)
68988           );
68989         }
68990         var additionalFields = utilArrayUnion(sharedMoreFields, presetsManager.universal());
68991         additionalFields.sort(function(field1, field2) {
68992           return field1.title().localeCompare(field2.title(), _mainLocalizer.localeCode());
68993         });
68994         additionalFields.forEach(function(field) {
68995           if (sharedFields.indexOf(field) === -1 && field.matchAllGeometry(geometries)) {
68996             _fieldsArr.push(
68997               uiField(context, field, _entityIDs, { show: false })
68998             );
68999           }
69000         });
69001         _fieldsArr.forEach(function(field) {
69002           field.on("change", function(t2, onInput) {
69003             dispatch12.call("change", field, _entityIDs, t2, onInput);
69004           }).on("revert", function(keys2) {
69005             dispatch12.call("revert", field, keys2);
69006           });
69007         });
69008       }
69009       _fieldsArr.forEach(function(field) {
69010         field.state(_state).tags(_tags);
69011       });
69012       selection2.call(
69013         formFields.fieldsArr(_fieldsArr).state(_state).klass("grouped-items-area")
69014       );
69015     }
69016     section.presets = function(val) {
69017       if (!arguments.length) return _presets;
69018       if (!_presets || !val || !utilArrayIdentical(_presets, val)) {
69019         _presets = val;
69020         _fieldsArr = null;
69021       }
69022       return section;
69023     };
69024     section.state = function(val) {
69025       if (!arguments.length) return _state;
69026       _state = val;
69027       return section;
69028     };
69029     section.tags = function(val) {
69030       if (!arguments.length) return _tags;
69031       _tags = val;
69032       return section;
69033     };
69034     section.entityIDs = function(val) {
69035       if (!arguments.length) return _entityIDs;
69036       if (!val || !_entityIDs || !utilArrayIdentical(_entityIDs, val)) {
69037         _entityIDs = val;
69038         _fieldsArr = null;
69039       }
69040       return section;
69041     };
69042     return utilRebind(section, dispatch12, "on");
69043   }
69044
69045   // modules/ui/sections/raw_member_editor.js
69046   function uiSectionRawMemberEditor(context) {
69047     var section = uiSection("raw-member-editor", context).shouldDisplay(function() {
69048       if (!_entityIDs || _entityIDs.length !== 1) return false;
69049       var entity = context.hasEntity(_entityIDs[0]);
69050       return entity && entity.type === "relation";
69051     }).label(function() {
69052       var entity = context.hasEntity(_entityIDs[0]);
69053       if (!entity) return "";
69054       var gt2 = entity.members.length > _maxMembers ? ">" : "";
69055       var count = gt2 + entity.members.slice(0, _maxMembers).length;
69056       return _t.append("inspector.title_count", { title: _t("inspector.members"), count });
69057     }).disclosureContent(renderDisclosureContent);
69058     var taginfo = services.taginfo;
69059     var _entityIDs;
69060     var _maxMembers = 1e3;
69061     function downloadMember(d3_event, d2) {
69062       d3_event.preventDefault();
69063       select_default2(this).classed("loading", true);
69064       context.loadEntity(d2.id, function() {
69065         section.reRender();
69066       });
69067     }
69068     function zoomToMember(d3_event, d2) {
69069       d3_event.preventDefault();
69070       var entity = context.entity(d2.id);
69071       context.map().zoomToEase(entity);
69072       utilHighlightEntities([d2.id], true, context);
69073     }
69074     function selectMember(d3_event, d2) {
69075       d3_event.preventDefault();
69076       utilHighlightEntities([d2.id], false, context);
69077       var entity = context.entity(d2.id);
69078       var mapExtent = context.map().extent();
69079       if (!entity.intersects(mapExtent, context.graph())) {
69080         context.map().zoomToEase(entity);
69081       }
69082       context.enter(modeSelect(context, [d2.id]));
69083     }
69084     function changeRole(d3_event, d2) {
69085       var oldRole = d2.role;
69086       var newRole = context.cleanRelationRole(select_default2(this).property("value"));
69087       if (oldRole !== newRole) {
69088         var member = { id: d2.id, type: d2.type, role: newRole };
69089         context.perform(
69090           actionChangeMember(d2.relation.id, member, d2.index),
69091           _t("operations.change_role.annotation", {
69092             n: 1
69093           })
69094         );
69095         context.validator().validate();
69096       }
69097     }
69098     function deleteMember(d3_event, d2) {
69099       utilHighlightEntities([d2.id], false, context);
69100       context.perform(
69101         actionDeleteMember(d2.relation.id, d2.index),
69102         _t("operations.delete_member.annotation", {
69103           n: 1
69104         })
69105       );
69106       if (!context.hasEntity(d2.relation.id)) {
69107         context.enter(modeBrowse(context));
69108       } else {
69109         context.validator().validate();
69110       }
69111     }
69112     function renderDisclosureContent(selection2) {
69113       var entityID = _entityIDs[0];
69114       var memberships = [];
69115       var entity = context.entity(entityID);
69116       entity.members.slice(0, _maxMembers).forEach(function(member, index) {
69117         memberships.push({
69118           index,
69119           id: member.id,
69120           type: member.type,
69121           role: member.role,
69122           relation: entity,
69123           member: context.hasEntity(member.id),
69124           domId: utilUniqueDomId(entityID + "-member-" + index)
69125         });
69126       });
69127       var list = selection2.selectAll(".member-list").data([0]);
69128       list = list.enter().append("ul").attr("class", "member-list").merge(list);
69129       var items = list.selectAll("li").data(memberships, function(d2) {
69130         return osmEntity.key(d2.relation) + "," + d2.index + "," + (d2.member ? osmEntity.key(d2.member) : "incomplete");
69131       });
69132       items.exit().each(unbind).remove();
69133       var itemsEnter = items.enter().append("li").attr("class", "member-row form-field").classed("member-incomplete", function(d2) {
69134         return !d2.member;
69135       });
69136       itemsEnter.each(function(d2) {
69137         var item = select_default2(this);
69138         var label = item.append("label").attr("class", "field-label").attr("for", d2.domId);
69139         if (d2.member) {
69140           item.on("mouseover", function() {
69141             utilHighlightEntities([d2.id], true, context);
69142           }).on("mouseout", function() {
69143             utilHighlightEntities([d2.id], false, context);
69144           });
69145           var labelLink = label.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectMember);
69146           labelLink.append("span").attr("class", "member-entity-type").text(function(d4) {
69147             var matched = _mainPresetIndex.match(d4.member, context.graph());
69148             return matched && matched.name() || utilDisplayType(d4.member.id);
69149           });
69150           labelLink.append("span").attr("class", "member-entity-name").classed("has-colour", (d4) => d4.member.type === "relation" && d4.member.tags.colour && isColourValid(d4.member.tags.colour)).style("border-color", (d4) => d4.member.type === "relation" && d4.member.tags.colour).text(function(d4) {
69151             return utilDisplayName(d4.member);
69152           });
69153           label.append("button").attr("title", _t("icons.remove")).attr("class", "remove member-delete").call(svgIcon("#iD-operation-delete"));
69154           label.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToMember);
69155         } else {
69156           var labelText = label.append("span").attr("class", "label-text");
69157           labelText.append("span").attr("class", "member-entity-type").call(_t.append("inspector." + d2.type, { id: d2.id }));
69158           labelText.append("span").attr("class", "member-entity-name").call(_t.append("inspector.incomplete", { id: d2.id }));
69159           label.append("button").attr("class", "member-download").attr("title", _t("icons.download")).call(svgIcon("#iD-icon-load")).on("click", downloadMember);
69160         }
69161       });
69162       var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
69163       wrapEnter.append("input").attr("class", "member-role").attr("id", function(d2) {
69164         return d2.domId;
69165       }).property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
69166       if (taginfo) {
69167         wrapEnter.each(bindTypeahead);
69168       }
69169       items = items.merge(itemsEnter).order();
69170       items.select("input.member-role").property("value", function(d2) {
69171         return d2.role;
69172       }).on("blur", changeRole).on("change", changeRole);
69173       items.select("button.member-delete").on("click", deleteMember);
69174       var dragOrigin, targetIndex;
69175       items.call(
69176         drag_default().on("start", function(d3_event) {
69177           dragOrigin = {
69178             x: d3_event.x,
69179             y: d3_event.y
69180           };
69181           targetIndex = null;
69182         }).on("drag", function(d3_event) {
69183           var x3 = d3_event.x - dragOrigin.x, y3 = d3_event.y - dragOrigin.y;
69184           if (!select_default2(this).classed("dragging") && // don't display drag until dragging beyond a distance threshold
69185           Math.sqrt(Math.pow(x3, 2) + Math.pow(y3, 2)) <= 5) return;
69186           var index = items.nodes().indexOf(this);
69187           select_default2(this).classed("dragging", true);
69188           targetIndex = null;
69189           selection2.selectAll("li.member-row").style("transform", function(d2, index2) {
69190             var node = select_default2(this).node();
69191             if (index === index2) {
69192               return "translate(" + x3 + "px, " + y3 + "px)";
69193             } else if (index2 > index && d3_event.y > node.offsetTop) {
69194               if (targetIndex === null || index2 > targetIndex) {
69195                 targetIndex = index2;
69196               }
69197               return "translateY(-100%)";
69198             } else if (index2 < index && d3_event.y < node.offsetTop + node.offsetHeight) {
69199               if (targetIndex === null || index2 < targetIndex) {
69200                 targetIndex = index2;
69201               }
69202               return "translateY(100%)";
69203             }
69204             return null;
69205           });
69206         }).on("end", function(d3_event, d2) {
69207           if (!select_default2(this).classed("dragging")) return;
69208           var index = items.nodes().indexOf(this);
69209           select_default2(this).classed("dragging", false);
69210           selection2.selectAll("li.member-row").style("transform", null);
69211           if (targetIndex !== null) {
69212             context.perform(
69213               actionMoveMember(d2.relation.id, index, targetIndex),
69214               _t("operations.reorder_members.annotation")
69215             );
69216             context.validator().validate();
69217           }
69218         })
69219       );
69220       function bindTypeahead(d2) {
69221         var row = select_default2(this);
69222         var role = row.selectAll("input.member-role");
69223         var origValue = role.property("value");
69224         function sort(value, data) {
69225           var sameletter = [];
69226           var other = [];
69227           for (var i3 = 0; i3 < data.length; i3++) {
69228             if (data[i3].value.substring(0, value.length) === value) {
69229               sameletter.push(data[i3]);
69230             } else {
69231               other.push(data[i3]);
69232             }
69233           }
69234           return sameletter.concat(other);
69235         }
69236         role.call(
69237           uiCombobox(context, "member-role").fetcher(function(role2, callback) {
69238             var geometry;
69239             if (d2.member) {
69240               geometry = context.graph().geometry(d2.member.id);
69241             } else if (d2.type === "relation") {
69242               geometry = "relation";
69243             } else if (d2.type === "way") {
69244               geometry = "line";
69245             } else {
69246               geometry = "point";
69247             }
69248             var rtype = entity.tags.type;
69249             taginfo.roles({
69250               debounce: true,
69251               rtype: rtype || "",
69252               geometry,
69253               query: role2
69254             }, function(err, data) {
69255               if (!err) callback(sort(role2, data));
69256             });
69257           }).on("cancel", function() {
69258             role.property("value", origValue);
69259           })
69260         );
69261       }
69262       function unbind() {
69263         var row = select_default2(this);
69264         row.selectAll("input.member-role").call(uiCombobox.off, context);
69265       }
69266     }
69267     section.entityIDs = function(val) {
69268       if (!arguments.length) return _entityIDs;
69269       _entityIDs = val;
69270       return section;
69271     };
69272     return section;
69273   }
69274
69275   // modules/actions/delete_members.js
69276   function actionDeleteMembers(relationId, memberIndexes) {
69277     return function(graph) {
69278       memberIndexes.sort((a2, b3) => b3 - a2);
69279       for (var i3 in memberIndexes) {
69280         graph = actionDeleteMember(relationId, memberIndexes[i3])(graph);
69281       }
69282       return graph;
69283     };
69284   }
69285
69286   // modules/ui/sections/raw_membership_editor.js
69287   function uiSectionRawMembershipEditor(context) {
69288     var section = uiSection("raw-membership-editor", context).shouldDisplay(function() {
69289       return _entityIDs && _entityIDs.length;
69290     }).label(function() {
69291       var parents = getSharedParentRelations();
69292       var gt2 = parents.length > _maxMemberships ? ">" : "";
69293       var count = gt2 + parents.slice(0, _maxMemberships).length;
69294       return _t.append("inspector.title_count", { title: _t("inspector.relations"), count });
69295     }).disclosureContent(renderDisclosureContent);
69296     var taginfo = services.taginfo;
69297     var nearbyCombo = uiCombobox(context, "parent-relation").minItems(1).fetcher(fetchNearbyRelations).itemsMouseEnter(function(d3_event, d2) {
69298       if (d2.relation) utilHighlightEntities([d2.relation.id], true, context);
69299     }).itemsMouseLeave(function(d3_event, d2) {
69300       if (d2.relation) utilHighlightEntities([d2.relation.id], false, context);
69301     });
69302     var _inChange = false;
69303     var _entityIDs = [];
69304     var _showBlank;
69305     var _maxMemberships = 1e3;
69306     const recentlyAdded = /* @__PURE__ */ new Set();
69307     function getSharedParentRelations() {
69308       var parents = [];
69309       for (var i3 = 0; i3 < _entityIDs.length; i3++) {
69310         var entity = context.graph().hasEntity(_entityIDs[i3]);
69311         if (!entity) continue;
69312         if (i3 === 0) {
69313           parents = context.graph().parentRelations(entity);
69314         } else {
69315           parents = utilArrayIntersection(parents, context.graph().parentRelations(entity));
69316         }
69317         if (!parents.length) break;
69318       }
69319       return parents;
69320     }
69321     function getMemberships() {
69322       var memberships = [];
69323       var relations = getSharedParentRelations().slice(0, _maxMemberships);
69324       var isMultiselect = _entityIDs.length > 1;
69325       var i3, relation, membership, index, member, indexedMember;
69326       for (i3 = 0; i3 < relations.length; i3++) {
69327         relation = relations[i3];
69328         membership = {
69329           relation,
69330           members: [],
69331           hash: osmEntity.key(relation)
69332         };
69333         for (index = 0; index < relation.members.length; index++) {
69334           member = relation.members[index];
69335           if (_entityIDs.indexOf(member.id) !== -1) {
69336             indexedMember = Object.assign({}, member, { index });
69337             membership.members.push(indexedMember);
69338             membership.hash += "," + index.toString();
69339             if (!isMultiselect) {
69340               memberships.push(membership);
69341               membership = {
69342                 relation,
69343                 members: [],
69344                 hash: osmEntity.key(relation)
69345               };
69346             }
69347           }
69348         }
69349         if (membership.members.length) memberships.push(membership);
69350       }
69351       memberships.forEach(function(membership2) {
69352         membership2.domId = utilUniqueDomId("membership-" + membership2.relation.id);
69353         var roles = [];
69354         membership2.members.forEach(function(member2) {
69355           if (roles.indexOf(member2.role) === -1) roles.push(member2.role);
69356         });
69357         membership2.role = roles.length === 1 ? roles[0] : roles;
69358       });
69359       const existingRelations = memberships.filter((membership2) => !recentlyAdded.has(membership2.relation.id)).map((membership2) => __spreadProps(__spreadValues({}, membership2), {
69360         // We only sort relations that were not added just now.
69361         // Sorting uses the same label as shown in the UI.
69362         // If the label is not unique, the relation ID ensures
69363         // that the sort order is still stable.
69364         _sortKey: [
69365           baseDisplayValue(membership2.relation),
69366           membership2.relation.id
69367         ].join("-")
69368       })).sort((a2, b3) => {
69369         return a2._sortKey.localeCompare(
69370           b3._sortKey,
69371           _mainLocalizer.localeCodes(),
69372           { numeric: true }
69373         );
69374       });
69375       const newlyAddedRelations = memberships.filter((membership2) => recentlyAdded.has(membership2.relation.id));
69376       return [
69377         // the sorted relations come first
69378         ...existingRelations,
69379         // then the ones that were just added from this panel
69380         ...newlyAddedRelations
69381       ];
69382     }
69383     function selectRelation(d3_event, d2) {
69384       d3_event.preventDefault();
69385       utilHighlightEntities([d2.relation.id], false, context);
69386       context.enter(modeSelect(context, [d2.relation.id]));
69387     }
69388     function zoomToRelation(d3_event, d2) {
69389       d3_event.preventDefault();
69390       var entity = context.entity(d2.relation.id);
69391       context.map().zoomToEase(entity);
69392       utilHighlightEntities([d2.relation.id], true, context);
69393     }
69394     function changeRole(d3_event, d2) {
69395       if (d2 === 0) return;
69396       if (_inChange) return;
69397       var newRole = context.cleanRelationRole(select_default2(this).property("value"));
69398       if (!newRole.trim() && typeof d2.role !== "string") return;
69399       var membersToUpdate = d2.members.filter(function(member) {
69400         return member.role !== newRole;
69401       });
69402       if (membersToUpdate.length) {
69403         _inChange = true;
69404         context.perform(
69405           function actionChangeMemberRoles(graph) {
69406             membersToUpdate.forEach(function(member) {
69407               var newMember = Object.assign({}, member, { role: newRole });
69408               delete newMember.index;
69409               graph = actionChangeMember(d2.relation.id, newMember, member.index)(graph);
69410             });
69411             return graph;
69412           },
69413           _t("operations.change_role.annotation", {
69414             n: membersToUpdate.length
69415           })
69416         );
69417         context.validator().validate();
69418       }
69419       _inChange = false;
69420     }
69421     function addMembership(d2, role) {
69422       _showBlank = false;
69423       function actionAddMembers(relationId, ids, role2) {
69424         return function(graph) {
69425           for (var i3 in ids) {
69426             var member = { id: ids[i3], type: graph.entity(ids[i3]).type, role: role2 };
69427             graph = actionAddMember(relationId, member)(graph);
69428           }
69429           return graph;
69430         };
69431       }
69432       if (d2.relation) {
69433         recentlyAdded.add(d2.relation.id);
69434         context.perform(
69435           actionAddMembers(d2.relation.id, _entityIDs, role),
69436           _t("operations.add_member.annotation", {
69437             n: _entityIDs.length
69438           })
69439         );
69440         context.validator().validate();
69441       } else {
69442         var relation = osmRelation();
69443         context.perform(
69444           actionAddEntity(relation),
69445           actionAddMembers(relation.id, _entityIDs, role),
69446           _t("operations.add.annotation.relation")
69447         );
69448         context.enter(modeSelect(context, [relation.id]).newFeature(true));
69449       }
69450     }
69451     function downloadMembers(d3_event, d2) {
69452       d3_event.preventDefault();
69453       const button = select_default2(this);
69454       button.classed("loading", true);
69455       context.loadEntity(d2.relation.id, function() {
69456         section.reRender();
69457       });
69458     }
69459     function deleteMembership(d3_event, d2) {
69460       this.blur();
69461       if (d2 === 0) return;
69462       utilHighlightEntities([d2.relation.id], false, context);
69463       var indexes = d2.members.map(function(member) {
69464         return member.index;
69465       });
69466       context.perform(
69467         actionDeleteMembers(d2.relation.id, indexes),
69468         _t("operations.delete_member.annotation", {
69469           n: _entityIDs.length
69470         })
69471       );
69472       context.validator().validate();
69473     }
69474     function fetchNearbyRelations(q3, callback) {
69475       var newRelation = {
69476         relation: null,
69477         value: _t("inspector.new_relation"),
69478         display: _t.append("inspector.new_relation")
69479       };
69480       var entityID = _entityIDs[0];
69481       var result = [];
69482       var graph = context.graph();
69483       function baseDisplayLabel(entity) {
69484         var matched = _mainPresetIndex.match(entity, graph);
69485         var presetName = matched && matched.name() || _t("inspector.relation");
69486         var entityName = utilDisplayName(entity) || "";
69487         return (selection2) => {
69488           selection2.append("b").text(presetName + " ");
69489           selection2.append("span").classed("has-colour", entity.tags.colour && isColourValid(entity.tags.colour)).style("border-color", entity.tags.colour).text(entityName);
69490         };
69491       }
69492       const idMatchResult = q3 && idMatch(q3);
69493       var explicitRelation = context.hasEntity("r".concat((idMatchResult == null ? void 0 : idMatchResult.id) || q3));
69494       if (explicitRelation && explicitRelation.type === "relation" && explicitRelation.id !== entityID) {
69495         result.push({
69496           relation: explicitRelation,
69497           value: baseDisplayValue(explicitRelation) + " " + explicitRelation.id,
69498           display: baseDisplayLabel(explicitRelation)
69499         });
69500       } else {
69501         context.history().intersects(context.map().extent()).forEach(function(entity) {
69502           if (entity.type !== "relation" || entity.id === entityID) return;
69503           var value = baseDisplayValue(entity);
69504           if (q3 && (value + " " + entity.id).toLowerCase().indexOf(q3.toLowerCase()) === -1) return;
69505           result.push({
69506             relation: entity,
69507             value,
69508             display: baseDisplayLabel(entity)
69509           });
69510         });
69511         result.sort(function(a2, b3) {
69512           return osmRelation.creationOrder(a2.relation, b3.relation);
69513         });
69514         Object.values(utilArrayGroupBy(result, "value")).filter((v3) => v3.length > 1).flat().forEach((obj) => obj.value += " " + obj.relation.id);
69515       }
69516       result.forEach(function(obj) {
69517         obj.title = obj.value;
69518       });
69519       result.unshift(newRelation);
69520       callback(result);
69521     }
69522     function baseDisplayValue(entity) {
69523       const graph = context.graph();
69524       var matched = _mainPresetIndex.match(entity, graph);
69525       var presetName = matched && matched.name() || _t("inspector.relation");
69526       var entityName = utilDisplayName(entity) || "";
69527       return presetName + " " + entityName;
69528     }
69529     function renderDisclosureContent(selection2) {
69530       var memberships = getMemberships();
69531       var list = selection2.selectAll(".member-list").data([0]);
69532       list = list.enter().append("ul").attr("class", "member-list").merge(list);
69533       var items = list.selectAll("li.member-row-normal").data(memberships, function(d2) {
69534         return d2.hash;
69535       });
69536       items.exit().each(unbind).remove();
69537       var itemsEnter = items.enter().append("li").attr("class", "member-row member-row-normal form-field");
69538       itemsEnter.on("mouseover", function(d3_event, d2) {
69539         utilHighlightEntities([d2.relation.id], true, context);
69540       }).on("mouseout", function(d3_event, d2) {
69541         utilHighlightEntities([d2.relation.id], false, context);
69542       });
69543       var labelEnter = itemsEnter.append("label").attr("class", "field-label").attr("for", function(d2) {
69544         return d2.domId;
69545       });
69546       var labelLink = labelEnter.append("span").attr("class", "label-text").append("a").attr("href", "#").on("click", selectRelation);
69547       labelLink.append("span").attr("class", "member-entity-type").text(function(d2) {
69548         var matched = _mainPresetIndex.match(d2.relation, context.graph());
69549         return matched && matched.name() || _t.html("inspector.relation");
69550       });
69551       labelLink.append("span").attr("class", "member-entity-name").classed("has-colour", (d2) => d2.relation.tags.colour && isColourValid(d2.relation.tags.colour)).style("border-color", (d2) => d2.relation.tags.colour).text(function(d2) {
69552         const matched = _mainPresetIndex.match(d2.relation, context.graph());
69553         return utilDisplayName(d2.relation, matched.suggestion);
69554       });
69555       labelEnter.append("button").attr("class", "members-download").attr("title", _t("icons.download")).call(svgIcon("#iD-icon-load")).on("click", downloadMembers);
69556       labelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", deleteMembership);
69557       labelEnter.append("button").attr("class", "member-zoom").attr("title", _t("icons.zoom_to")).call(svgIcon("#iD-icon-framed-dot", "monochrome")).on("click", zoomToRelation);
69558       items = items.merge(itemsEnter);
69559       items.selectAll("button.members-download").classed("hide", (d2) => {
69560         const graph = context.graph();
69561         return d2.relation.members.every((m3) => graph.hasEntity(m3.id));
69562       });
69563       const dupeLabels = new WeakSet(Object.values(
69564         utilArrayGroupBy(items.selectAll(".label-text").nodes(), "textContent")
69565       ).filter((v3) => v3.length > 1).flat());
69566       items.select(".label-text").each(function() {
69567         const label = select_default2(this);
69568         const entityName = label.select(".member-entity-name");
69569         if (dupeLabels.has(this)) {
69570           label.attr("title", (d2) => "".concat(entityName.text(), " ").concat(d2.relation.id));
69571         } else {
69572           label.attr("title", () => entityName.text());
69573         }
69574       });
69575       var wrapEnter = itemsEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
69576       wrapEnter.append("input").attr("class", "member-role").attr("id", function(d2) {
69577         return d2.domId;
69578       }).property("type", "text").property("value", function(d2) {
69579         return typeof d2.role === "string" ? d2.role : "";
69580       }).attr("title", function(d2) {
69581         return Array.isArray(d2.role) ? d2.role.filter(Boolean).join("\n") : d2.role;
69582       }).attr("placeholder", function(d2) {
69583         return Array.isArray(d2.role) ? _t("inspector.multiple_roles") : _t("inspector.role");
69584       }).classed("mixed", function(d2) {
69585         return Array.isArray(d2.role);
69586       }).call(utilNoAuto).on("blur", changeRole).on("change", changeRole);
69587       if (taginfo) {
69588         wrapEnter.each(bindTypeahead);
69589       }
69590       var newMembership = list.selectAll(".member-row-new").data(_showBlank ? [0] : []);
69591       newMembership.exit().remove();
69592       var newMembershipEnter = newMembership.enter().append("li").attr("class", "member-row member-row-new form-field");
69593       var newLabelEnter = newMembershipEnter.append("label").attr("class", "field-label");
69594       newLabelEnter.append("input").attr("placeholder", _t("inspector.choose_relation")).attr("type", "text").attr("class", "member-entity-input").call(utilNoAuto);
69595       newLabelEnter.append("button").attr("class", "remove member-delete").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete")).on("click", function() {
69596         list.selectAll(".member-row-new").remove();
69597       });
69598       var newWrapEnter = newMembershipEnter.append("div").attr("class", "form-field-input-wrap form-field-input-member");
69599       newWrapEnter.append("input").attr("class", "member-role").property("type", "text").attr("placeholder", _t("inspector.role")).call(utilNoAuto);
69600       newMembership = newMembership.merge(newMembershipEnter);
69601       newMembership.selectAll(".member-entity-input").on("blur", cancelEntity).call(
69602         nearbyCombo.on("accept", function(d2) {
69603           this.blur();
69604           acceptEntity.call(this, d2);
69605         }).on("cancel", cancelEntity)
69606       );
69607       var addRow = selection2.selectAll(".add-row").data([0]);
69608       var addRowEnter = addRow.enter().append("div").attr("class", "add-row");
69609       var addRelationButton = addRowEnter.append("button").attr("class", "add-relation").attr("aria-label", _t("inspector.add_to_relation"));
69610       addRelationButton.call(svgIcon("#iD-icon-plus", "light"));
69611       addRelationButton.call(uiTooltip().title(() => _t.append("inspector.add_to_relation")).placement(_mainLocalizer.textDirection() === "ltr" ? "right" : "left"));
69612       addRowEnter.append("div").attr("class", "space-value");
69613       addRowEnter.append("div").attr("class", "space-buttons");
69614       addRow = addRow.merge(addRowEnter);
69615       addRow.select(".add-relation").on("click", function() {
69616         _showBlank = true;
69617         section.reRender();
69618         list.selectAll(".member-entity-input").node().focus();
69619       });
69620       function acceptEntity(d2) {
69621         if (!d2) {
69622           cancelEntity();
69623           return;
69624         }
69625         if (d2.relation) utilHighlightEntities([d2.relation.id], false, context);
69626         var role = context.cleanRelationRole(list.selectAll(".member-row-new .member-role").property("value"));
69627         addMembership(d2, role);
69628       }
69629       function cancelEntity() {
69630         var input = newMembership.selectAll(".member-entity-input");
69631         input.property("value", "");
69632         context.surface().selectAll(".highlighted").classed("highlighted", false);
69633       }
69634       function bindTypeahead(d2) {
69635         var row = select_default2(this);
69636         var role = row.selectAll("input.member-role");
69637         var origValue = role.property("value");
69638         function sort(value, data) {
69639           var sameletter = [];
69640           var other = [];
69641           for (var i3 = 0; i3 < data.length; i3++) {
69642             if (data[i3].value.substring(0, value.length) === value) {
69643               sameletter.push(data[i3]);
69644             } else {
69645               other.push(data[i3]);
69646             }
69647           }
69648           return sameletter.concat(other);
69649         }
69650         role.call(
69651           uiCombobox(context, "member-role").fetcher(function(role2, callback) {
69652             var rtype = d2.relation.tags.type;
69653             taginfo.roles({
69654               debounce: true,
69655               rtype: rtype || "",
69656               geometry: context.graph().geometry(_entityIDs[0]),
69657               query: role2
69658             }, function(err, data) {
69659               if (!err) callback(sort(role2, data));
69660             });
69661           }).on("cancel", function() {
69662             role.property("value", origValue);
69663           })
69664         );
69665       }
69666       function unbind() {
69667         var row = select_default2(this);
69668         row.selectAll("input.member-role").call(uiCombobox.off, context);
69669       }
69670     }
69671     section.entityIDs = function(val) {
69672       if (!arguments.length) return _entityIDs;
69673       const didChange = _entityIDs.join(",") !== val.join(",");
69674       _entityIDs = val;
69675       _showBlank = false;
69676       if (didChange) {
69677         recentlyAdded.clear();
69678       }
69679       return section;
69680     };
69681     return section;
69682   }
69683
69684   // modules/ui/sections/selection_list.js
69685   function uiSectionSelectionList(context) {
69686     var _selectedIDs = [];
69687     var section = uiSection("selected-features", context).shouldDisplay(function() {
69688       return _selectedIDs.length > 1;
69689     }).label(function() {
69690       return _t.append("inspector.title_count", { title: _t("inspector.features"), count: _selectedIDs.length });
69691     }).disclosureContent(renderDisclosureContent);
69692     context.history().on("change.selectionList", function(difference2) {
69693       if (difference2) {
69694         section.reRender();
69695       }
69696     });
69697     section.entityIDs = function(val) {
69698       if (!arguments.length) return _selectedIDs;
69699       _selectedIDs = val;
69700       return section;
69701     };
69702     function selectEntity(d3_event, entity) {
69703       context.enter(modeSelect(context, [entity.id]));
69704     }
69705     function deselectEntity(d3_event, entity) {
69706       var selectedIDs = _selectedIDs.slice();
69707       var index = selectedIDs.indexOf(entity.id);
69708       if (index > -1) {
69709         selectedIDs.splice(index, 1);
69710         context.enter(modeSelect(context, selectedIDs));
69711       }
69712     }
69713     function renderDisclosureContent(selection2) {
69714       var list = selection2.selectAll(".feature-list").data([0]);
69715       list = list.enter().append("ul").attr("class", "feature-list").merge(list);
69716       var entities = _selectedIDs.map(function(id2) {
69717         return context.hasEntity(id2);
69718       }).filter(Boolean);
69719       var items = list.selectAll(".feature-list-item").data(entities, osmEntity.key);
69720       items.exit().remove();
69721       var enter = items.enter().append("li").attr("class", "feature-list-item").each(function(d2) {
69722         select_default2(this).on("mouseover", function() {
69723           utilHighlightEntities([d2.id], true, context);
69724         }).on("mouseout", function() {
69725           utilHighlightEntities([d2.id], false, context);
69726         });
69727       });
69728       var label = enter.append("button").attr("class", "label").on("click", selectEntity);
69729       label.append("span").attr("class", "entity-geom-icon").call(svgIcon("", "pre-text"));
69730       label.append("span").attr("class", "entity-type");
69731       label.append("span").attr("class", "entity-name");
69732       enter.append("button").attr("class", "close").attr("title", _t("icons.deselect")).on("click", deselectEntity).call(svgIcon("#iD-icon-close"));
69733       items = items.merge(enter);
69734       items.selectAll(".entity-geom-icon use").attr("href", function() {
69735         var entity = this.parentNode.parentNode.__data__;
69736         return "#iD-icon-" + entity.geometry(context.graph());
69737       });
69738       items.selectAll(".entity-type").text(function(entity) {
69739         return _mainPresetIndex.match(entity, context.graph()).name();
69740       });
69741       items.selectAll(".entity-name").text(function(d2) {
69742         var entity = context.entity(d2.id);
69743         return utilDisplayName(entity);
69744       });
69745     }
69746     return section;
69747   }
69748
69749   // modules/ui/entity_editor.js
69750   function uiEntityEditor(context) {
69751     var dispatch12 = dispatch_default("choose");
69752     var _state = "select";
69753     var _coalesceChanges = false;
69754     var _modified = false;
69755     var _base;
69756     var _entityIDs;
69757     var _activePresets = [];
69758     var _newFeature;
69759     var _sections;
69760     function entityEditor(selection2) {
69761       var combinedTags = utilCombinedTags(_entityIDs, context.graph());
69762       var header = selection2.selectAll(".header").data([0]);
69763       var headerEnter = header.enter().append("div").attr("class", "header fillL");
69764       var direction = _mainLocalizer.textDirection() === "rtl" ? "forward" : "backward";
69765       headerEnter.append("button").attr("class", "preset-reset preset-choose").attr("title", _t("inspector.back_tooltip")).call(svgIcon("#iD-icon-".concat(direction)));
69766       headerEnter.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
69767         context.enter(modeBrowse(context));
69768       }).call(svgIcon(_modified ? "#iD-icon-apply" : "#iD-icon-close"));
69769       headerEnter.append("h2");
69770       header = header.merge(headerEnter);
69771       header.selectAll("h2").text("").call(_entityIDs.length === 1 ? _t.append("inspector.edit") : _t.append("inspector.edit_features"));
69772       header.selectAll(".preset-reset").on("click", function() {
69773         dispatch12.call("choose", this, _activePresets);
69774       });
69775       var body = selection2.selectAll(".inspector-body").data([0]);
69776       var bodyEnter = body.enter().append("div").attr("class", "entity-editor inspector-body sep-top");
69777       body = body.merge(bodyEnter);
69778       if (!_sections) {
69779         _sections = [
69780           uiSectionSelectionList(context),
69781           uiSectionFeatureType(context).on("choose", function(presets) {
69782             dispatch12.call("choose", this, presets);
69783           }),
69784           uiSectionEntityIssues(context),
69785           uiSectionPresetFields(context).on("change", changeTags).on("revert", revertTags),
69786           uiSectionRawTagEditor("raw-tag-editor", context).on("change", changeTags),
69787           uiSectionRawMemberEditor(context),
69788           uiSectionRawMembershipEditor(context)
69789         ];
69790       }
69791       _sections.forEach(function(section) {
69792         if (section.entityIDs) {
69793           section.entityIDs(_entityIDs);
69794         }
69795         if (section.presets) {
69796           section.presets(_activePresets);
69797         }
69798         if (section.tags) {
69799           section.tags(combinedTags);
69800         }
69801         if (section.state) {
69802           section.state(_state);
69803         }
69804         body.call(section.render);
69805       });
69806       context.history().on("change.entity-editor", historyChanged);
69807       function historyChanged(difference2) {
69808         if (selection2.selectAll(".entity-editor").empty()) return;
69809         if (_state === "hide") return;
69810         var significant = !difference2 || difference2.didChange.properties || difference2.didChange.addition || difference2.didChange.deletion;
69811         if (!significant) return;
69812         _entityIDs = _entityIDs.filter(context.hasEntity);
69813         if (!_entityIDs.length) return;
69814         var priorActivePreset = _activePresets.length === 1 && _activePresets[0];
69815         loadActivePresets();
69816         var graph = context.graph();
69817         entityEditor.modified(_base !== graph);
69818         entityEditor(selection2);
69819         if (priorActivePreset && _activePresets.length === 1 && priorActivePreset !== _activePresets[0]) {
69820           context.container().selectAll(".entity-editor button.preset-reset .label").classed("flash-bg", true).on("animationend", function() {
69821             select_default2(this).classed("flash-bg", false);
69822           });
69823         }
69824       }
69825     }
69826     function changeTags(entityIDs, changed, onInput) {
69827       var actions = [];
69828       for (var i3 in entityIDs) {
69829         var entityID = entityIDs[i3];
69830         var entity = context.entity(entityID);
69831         var tags = Object.assign({}, entity.tags);
69832         if (typeof changed === "function") {
69833           tags = changed(tags);
69834         } else {
69835           for (var k3 in changed) {
69836             if (!k3) continue;
69837             var v3 = changed[k3];
69838             if (typeof v3 === "object") {
69839               tags[k3] = tags[v3.oldKey];
69840             } else if (v3 !== void 0 || tags.hasOwnProperty(k3)) {
69841               tags[k3] = v3;
69842             }
69843           }
69844         }
69845         if (!onInput) {
69846           tags = utilCleanTags(tags);
69847         }
69848         if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
69849           actions.push(actionChangeTags(entityID, tags));
69850         }
69851       }
69852       if (actions.length) {
69853         var combinedAction = function(graph) {
69854           actions.forEach(function(action) {
69855             graph = action(graph);
69856           });
69857           return graph;
69858         };
69859         var annotation = _t("operations.change_tags.annotation");
69860         if (_coalesceChanges) {
69861           context.replace(combinedAction, annotation);
69862         } else {
69863           context.perform(combinedAction, annotation);
69864         }
69865         _coalesceChanges = !!onInput;
69866       }
69867       if (!onInput) {
69868         context.validator().validate();
69869       }
69870     }
69871     function revertTags(keys2) {
69872       var actions = [];
69873       for (var i3 in _entityIDs) {
69874         var entityID = _entityIDs[i3];
69875         var original = context.graph().base().entities[entityID];
69876         var changed = {};
69877         for (var j3 in keys2) {
69878           var key = keys2[j3];
69879           changed[key] = original ? original.tags[key] : void 0;
69880         }
69881         var entity = context.entity(entityID);
69882         var tags = Object.assign({}, entity.tags);
69883         for (var k3 in changed) {
69884           if (!k3) continue;
69885           var v3 = changed[k3];
69886           if (v3 !== void 0 || tags.hasOwnProperty(k3)) {
69887             tags[k3] = v3;
69888           }
69889         }
69890         tags = utilCleanTags(tags);
69891         if (!(0, import_fast_deep_equal10.default)(entity.tags, tags)) {
69892           actions.push(actionChangeTags(entityID, tags));
69893         }
69894       }
69895       if (actions.length) {
69896         var combinedAction = function(graph) {
69897           actions.forEach(function(action) {
69898             graph = action(graph);
69899           });
69900           return graph;
69901         };
69902         var annotation = _t("operations.change_tags.annotation");
69903         if (_coalesceChanges) {
69904           context.replace(combinedAction, annotation);
69905         } else {
69906           context.perform(combinedAction, annotation);
69907         }
69908       }
69909       context.validator().validate();
69910     }
69911     entityEditor.modified = function(val) {
69912       if (!arguments.length) return _modified;
69913       _modified = val;
69914       return entityEditor;
69915     };
69916     entityEditor.state = function(val) {
69917       if (!arguments.length) return _state;
69918       _state = val;
69919       return entityEditor;
69920     };
69921     entityEditor.entityIDs = function(val) {
69922       if (!arguments.length) return _entityIDs;
69923       _base = context.graph();
69924       _coalesceChanges = false;
69925       if (val && _entityIDs && utilArrayIdentical(_entityIDs, val)) return entityEditor;
69926       _entityIDs = val;
69927       loadActivePresets(true);
69928       return entityEditor.modified(false);
69929     };
69930     entityEditor.newFeature = function(val) {
69931       if (!arguments.length) return _newFeature;
69932       _newFeature = val;
69933       return entityEditor;
69934     };
69935     function loadActivePresets(isForNewSelection) {
69936       var graph = context.graph();
69937       var counts = {};
69938       for (var i3 in _entityIDs) {
69939         var entity = graph.hasEntity(_entityIDs[i3]);
69940         if (!entity) return;
69941         var match = _mainPresetIndex.match(entity, graph);
69942         if (!counts[match.id]) counts[match.id] = 0;
69943         counts[match.id] += 1;
69944       }
69945       var matches = Object.keys(counts).sort(function(p1, p2) {
69946         return counts[p2] - counts[p1];
69947       }).map(function(pID) {
69948         return _mainPresetIndex.item(pID);
69949       });
69950       if (!isForNewSelection) {
69951         var weakPreset = _activePresets.length === 1 && !_activePresets[0].isFallback() && Object.keys(_activePresets[0].addTags || {}).length === 0;
69952         if (weakPreset && matches.length === 1 && matches[0].isFallback()) return;
69953       }
69954       entityEditor.presets(matches);
69955     }
69956     entityEditor.presets = function(val) {
69957       if (!arguments.length) return _activePresets;
69958       if (!utilArrayIdentical(val, _activePresets)) {
69959         _activePresets = val;
69960       }
69961       return entityEditor;
69962     };
69963     return utilRebind(entityEditor, dispatch12, "on");
69964   }
69965
69966   // modules/ui/preset_list.js
69967   function uiPresetList(context) {
69968     var dispatch12 = dispatch_default("cancel", "choose");
69969     var _entityIDs;
69970     var _currLoc;
69971     var _currentPresets;
69972     var _autofocus = false;
69973     function presetList(selection2) {
69974       if (!_entityIDs) return;
69975       var presets = _mainPresetIndex.matchAllGeometry(entityGeometries());
69976       selection2.html("");
69977       var messagewrap = selection2.append("div").attr("class", "header fillL");
69978       var message = messagewrap.append("h2").call(_t.append("inspector.choose"));
69979       messagewrap.append("button").attr("class", "preset-choose").attr("title", _entityIDs.length === 1 ? _t("inspector.edit") : _t("inspector.edit_features")).on("click", function() {
69980         dispatch12.call("cancel", this);
69981       }).call(svgIcon("#iD-icon-close"));
69982       function initialKeydown(d3_event) {
69983         if (search.property("value").length === 0 && (d3_event.keyCode === utilKeybinding.keyCodes["\u232B"] || d3_event.keyCode === utilKeybinding.keyCodes["\u2326"])) {
69984           d3_event.preventDefault();
69985           d3_event.stopPropagation();
69986           operationDelete(context, _entityIDs)();
69987         } else if (search.property("value").length === 0 && (d3_event.ctrlKey || d3_event.metaKey) && d3_event.keyCode === utilKeybinding.keyCodes.z) {
69988           d3_event.preventDefault();
69989           d3_event.stopPropagation();
69990           context.undo();
69991         } else if (!d3_event.ctrlKey && !d3_event.metaKey) {
69992           select_default2(this).on("keydown", keydown);
69993           keydown.call(this, d3_event);
69994         }
69995       }
69996       function keydown(d3_event) {
69997         if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"] && // if insertion point is at the end of the string
69998         search.node().selectionStart === search.property("value").length) {
69999           d3_event.preventDefault();
70000           d3_event.stopPropagation();
70001           var buttons = list.selectAll(".preset-list-button");
70002           if (!buttons.empty()) buttons.nodes()[0].focus();
70003         }
70004       }
70005       function keypress(d3_event) {
70006         var value = search.property("value");
70007         if (d3_event.keyCode === 13 && // ↩ Return
70008         value.length) {
70009           list.selectAll(".preset-list-item:first-child").each(function(d2) {
70010             d2.choose.call(this);
70011           });
70012         }
70013       }
70014       function inputevent() {
70015         var value = search.property("value");
70016         list.classed("filtered", value.length);
70017         var results, messageText;
70018         if (value.length) {
70019           results = presets.search(value, entityGeometries()[0], _currLoc);
70020           messageText = _t.html("inspector.results", {
70021             n: results.collection.length,
70022             search: value
70023           });
70024         } else {
70025           var entityPresets2 = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
70026           results = _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets2);
70027           messageText = _t.html("inspector.choose");
70028         }
70029         list.call(drawList, results);
70030         message.html(messageText);
70031       }
70032       var searchWrap = selection2.append("div").attr("class", "search-header");
70033       searchWrap.call(svgIcon("#iD-icon-search", "pre-text"));
70034       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));
70035       if (_autofocus) {
70036         search.node().focus();
70037         setTimeout(function() {
70038           search.node().focus();
70039         }, 0);
70040       }
70041       var listWrap = selection2.append("div").attr("class", "inspector-body");
70042       var entityPresets = _entityIDs.map((entityID) => _mainPresetIndex.match(context.graph().entity(entityID), context.graph()));
70043       var list = listWrap.append("div").attr("class", "preset-list").call(drawList, _mainPresetIndex.defaults(entityGeometries()[0], 36, !context.inIntro(), _currLoc, entityPresets));
70044       context.features().on("change.preset-list", updateForFeatureHiddenState);
70045     }
70046     function drawList(list, presets) {
70047       presets = presets.matchAllGeometry(entityGeometries());
70048       var collection = presets.collection.reduce(function(collection2, preset) {
70049         if (!preset) return collection2;
70050         if (preset.members) {
70051           if (preset.members.collection.filter(function(preset2) {
70052             return preset2.addable();
70053           }).length > 1) {
70054             collection2.push(CategoryItem(preset));
70055           }
70056         } else if (preset.addable()) {
70057           collection2.push(PresetItem(preset));
70058         }
70059         return collection2;
70060       }, []);
70061       var items = list.selectChildren(".preset-list-item").data(collection, function(d2) {
70062         return d2.preset.id;
70063       });
70064       items.order();
70065       items.exit().remove();
70066       items.enter().append("div").attr("class", function(item) {
70067         return "preset-list-item preset-" + item.preset.id.replace("/", "-");
70068       }).classed("current", function(item) {
70069         return _currentPresets.indexOf(item.preset) !== -1;
70070       }).each(function(item) {
70071         select_default2(this).call(item);
70072       }).style("opacity", 0).transition().style("opacity", 1);
70073       updateForFeatureHiddenState();
70074     }
70075     function itemKeydown(d3_event) {
70076       var item = select_default2(this.closest(".preset-list-item"));
70077       var parentItem = select_default2(item.node().parentNode.closest(".preset-list-item"));
70078       if (d3_event.keyCode === utilKeybinding.keyCodes["\u2193"]) {
70079         d3_event.preventDefault();
70080         d3_event.stopPropagation();
70081         var nextItem = select_default2(item.node().nextElementSibling);
70082         if (nextItem.empty()) {
70083           if (!parentItem.empty()) {
70084             nextItem = select_default2(parentItem.node().nextElementSibling);
70085           }
70086         } else if (select_default2(this).classed("expanded")) {
70087           nextItem = item.select(".subgrid .preset-list-item:first-child");
70088         }
70089         if (!nextItem.empty()) {
70090           nextItem.select(".preset-list-button").node().focus();
70091         }
70092       } else if (d3_event.keyCode === utilKeybinding.keyCodes["\u2191"]) {
70093         d3_event.preventDefault();
70094         d3_event.stopPropagation();
70095         var previousItem = select_default2(item.node().previousElementSibling);
70096         if (previousItem.empty()) {
70097           if (!parentItem.empty()) {
70098             previousItem = parentItem;
70099           }
70100         } else if (previousItem.select(".preset-list-button").classed("expanded")) {
70101           previousItem = previousItem.select(".subgrid .preset-list-item:last-child");
70102         }
70103         if (!previousItem.empty()) {
70104           previousItem.select(".preset-list-button").node().focus();
70105         } else {
70106           var search = select_default2(this.closest(".preset-list-pane")).select(".preset-search-input");
70107           search.node().focus();
70108         }
70109       } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
70110         d3_event.preventDefault();
70111         d3_event.stopPropagation();
70112         if (!parentItem.empty()) {
70113           parentItem.select(".preset-list-button").node().focus();
70114         }
70115       } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
70116         d3_event.preventDefault();
70117         d3_event.stopPropagation();
70118         item.datum().choose.call(select_default2(this).node());
70119       }
70120     }
70121     function CategoryItem(preset) {
70122       var box, sublist, shown = false;
70123       function item(selection2) {
70124         var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap category");
70125         function click() {
70126           var isExpanded = select_default2(this).classed("expanded");
70127           var iconName = isExpanded ? _mainLocalizer.textDirection() === "rtl" ? "#iD-icon-backward" : "#iD-icon-forward" : "#iD-icon-down";
70128           select_default2(this).classed("expanded", !isExpanded).attr("title", !isExpanded ? _t("icons.collapse") : _t("icons.expand"));
70129           select_default2(this).selectAll("div.label-inner svg.icon use").attr("href", iconName);
70130           item.choose();
70131         }
70132         var geometries = entityGeometries();
70133         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) {
70134           if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2190" : "\u2192"]) {
70135             d3_event.preventDefault();
70136             d3_event.stopPropagation();
70137             if (!select_default2(this).classed("expanded")) {
70138               click.call(this, d3_event);
70139             }
70140           } else if (d3_event.keyCode === utilKeybinding.keyCodes[_mainLocalizer.textDirection() === "rtl" ? "\u2192" : "\u2190"]) {
70141             d3_event.preventDefault();
70142             d3_event.stopPropagation();
70143             if (select_default2(this).classed("expanded")) {
70144               click.call(this, d3_event);
70145             }
70146           } else {
70147             itemKeydown.call(this, d3_event);
70148           }
70149         });
70150         var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
70151         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");
70152         box = selection2.append("div").attr("class", "subgrid").style("max-height", "0px").style("opacity", 0);
70153         box.append("div").attr("class", "arrow");
70154         sublist = box.append("div").attr("class", "preset-list fillL3");
70155       }
70156       item.choose = function() {
70157         if (!box || !sublist) return;
70158         if (shown) {
70159           shown = false;
70160           box.transition().duration(200).style("opacity", "0").style("max-height", "0px").style("padding-bottom", "0px");
70161         } else {
70162           shown = true;
70163           var members = preset.members.matchAllGeometry(entityGeometries());
70164           sublist.call(drawList, members);
70165           box.transition().duration(200).style("opacity", "1").style("max-height", 200 + members.collection.length * 190 + "px").style("padding-bottom", "10px");
70166         }
70167       };
70168       item.preset = preset;
70169       return item;
70170     }
70171     function PresetItem(preset) {
70172       function item(selection2) {
70173         var wrap2 = selection2.append("div").attr("class", "preset-list-button-wrap");
70174         var geometries = entityGeometries();
70175         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);
70176         var label = button.append("div").attr("class", "label").append("div").attr("class", "label-inner");
70177         var nameparts = [
70178           preset.nameLabel(),
70179           preset.subtitleLabel()
70180         ].filter(Boolean);
70181         label.selectAll(".namepart").data(nameparts, (d2) => d2.stringId).enter().append("div").attr("class", "namepart").text("").each(function(d2) {
70182           d2(select_default2(this));
70183         });
70184         wrap2.call(item.reference.button);
70185         selection2.call(item.reference.body);
70186       }
70187       item.choose = function() {
70188         if (select_default2(this).classed("disabled")) return;
70189         if (!context.inIntro()) {
70190           _mainPresetIndex.setMostRecent(preset, entityGeometries()[0]);
70191         }
70192         context.perform(
70193           function(graph) {
70194             for (var i3 in _entityIDs) {
70195               var entityID = _entityIDs[i3];
70196               var oldPreset = _mainPresetIndex.match(graph.entity(entityID), graph);
70197               graph = actionChangePreset(entityID, oldPreset, preset)(graph);
70198             }
70199             return graph;
70200           },
70201           _t("operations.change_tags.annotation")
70202         );
70203         context.validator().validate();
70204         dispatch12.call("choose", this, preset);
70205       };
70206       item.help = function(d3_event) {
70207         d3_event.stopPropagation();
70208         item.reference.toggle();
70209       };
70210       item.preset = preset;
70211       item.reference = uiTagReference(preset.reference(), context);
70212       return item;
70213     }
70214     function updateForFeatureHiddenState() {
70215       if (!_entityIDs.every(context.hasEntity)) return;
70216       var geometries = entityGeometries();
70217       var button = context.container().selectAll(".preset-list .preset-list-button");
70218       button.call(uiTooltip().destroyAny);
70219       button.each(function(item, index) {
70220         var hiddenPresetFeaturesId;
70221         for (var i3 in geometries) {
70222           hiddenPresetFeaturesId = context.features().isHiddenPreset(item.preset, geometries[i3]);
70223           if (hiddenPresetFeaturesId) break;
70224         }
70225         var isHiddenPreset = !context.inIntro() && !!hiddenPresetFeaturesId && (_currentPresets.length !== 1 || item.preset !== _currentPresets[0]);
70226         select_default2(this).classed("disabled", isHiddenPreset);
70227         if (isHiddenPreset) {
70228           var isAutoHidden = context.features().autoHidden(hiddenPresetFeaturesId);
70229           select_default2(this).call(
70230             uiTooltip().title(() => _t.append("inspector.hidden_preset." + (isAutoHidden ? "zoom" : "manual"), {
70231               features: _t("feature." + hiddenPresetFeaturesId + ".description")
70232             })).placement(index < 2 ? "bottom" : "top")
70233           );
70234         }
70235       });
70236     }
70237     presetList.autofocus = function(val) {
70238       if (!arguments.length) return _autofocus;
70239       _autofocus = val;
70240       return presetList;
70241     };
70242     presetList.entityIDs = function(val) {
70243       if (!arguments.length) return _entityIDs;
70244       _entityIDs = val;
70245       _currLoc = null;
70246       if (_entityIDs && _entityIDs.length) {
70247         const extent = _entityIDs.reduce(function(extent2, entityID) {
70248           var entity = context.graph().entity(entityID);
70249           return extent2.extend(entity.extent(context.graph()));
70250         }, geoExtent());
70251         _currLoc = extent.center();
70252         var presets = _entityIDs.map(function(entityID) {
70253           return _mainPresetIndex.match(context.entity(entityID), context.graph());
70254         });
70255         presetList.presets(presets);
70256       }
70257       return presetList;
70258     };
70259     presetList.presets = function(val) {
70260       if (!arguments.length) return _currentPresets;
70261       _currentPresets = val;
70262       return presetList;
70263     };
70264     function entityGeometries() {
70265       var counts = {};
70266       for (var i3 in _entityIDs) {
70267         var entityID = _entityIDs[i3];
70268         var entity = context.entity(entityID);
70269         var geometry = entity.geometry(context.graph());
70270         if (geometry === "vertex" && entity.isOnAddressLine(context.graph())) {
70271           geometry = "point";
70272         }
70273         if (!counts[geometry]) counts[geometry] = 0;
70274         counts[geometry] += 1;
70275       }
70276       return Object.keys(counts).sort(function(geom1, geom2) {
70277         return counts[geom2] - counts[geom1];
70278       });
70279     }
70280     return utilRebind(presetList, dispatch12, "on");
70281   }
70282
70283   // modules/ui/inspector.js
70284   function uiInspector(context) {
70285     var presetList = uiPresetList(context);
70286     var entityEditor = uiEntityEditor(context);
70287     var wrap2 = select_default2(null), presetPane = select_default2(null), editorPane = select_default2(null);
70288     var _state = "select";
70289     var _entityIDs;
70290     var _newFeature = false;
70291     function inspector(selection2) {
70292       presetList.entityIDs(_entityIDs).autofocus(_newFeature).on("choose", inspector.setPreset).on("cancel", function() {
70293         inspector.setPreset();
70294       });
70295       entityEditor.state(_state).entityIDs(_entityIDs).on("choose", inspector.showList);
70296       wrap2 = selection2.selectAll(".panewrap").data([0]);
70297       var enter = wrap2.enter().append("div").attr("class", "panewrap");
70298       enter.append("div").attr("class", "preset-list-pane pane");
70299       enter.append("div").attr("class", "entity-editor-pane pane");
70300       wrap2 = wrap2.merge(enter);
70301       presetPane = wrap2.selectAll(".preset-list-pane");
70302       editorPane = wrap2.selectAll(".entity-editor-pane");
70303       function shouldDefaultToPresetList() {
70304         if (_state !== "select") return false;
70305         if (_entityIDs.length !== 1) return false;
70306         var entityID = _entityIDs[0];
70307         var entity = context.hasEntity(entityID);
70308         if (!entity) return false;
70309         if (entity.hasNonGeometryTags()) return false;
70310         if (_newFeature) return true;
70311         if (entity.geometry(context.graph()) !== "vertex") return false;
70312         if (context.graph().parentRelations(entity).length) return false;
70313         if (context.validator().getEntityIssues(entityID).length) return false;
70314         if (entity.type === "node" && entity.isHighwayIntersection(context.graph())) return false;
70315         return true;
70316       }
70317       if (shouldDefaultToPresetList()) {
70318         wrap2.style("right", "-100%");
70319         editorPane.classed("hide", true);
70320         presetPane.classed("hide", false).call(presetList);
70321       } else {
70322         wrap2.style("right", "0%");
70323         presetPane.classed("hide", true);
70324         editorPane.classed("hide", false).call(entityEditor);
70325       }
70326       var footer = selection2.selectAll(".footer").data([0]);
70327       footer = footer.enter().append("div").attr("class", "footer").merge(footer);
70328       footer.call(
70329         uiViewOnOSM(context).what(context.hasEntity(_entityIDs.length === 1 && _entityIDs[0]))
70330       );
70331     }
70332     inspector.showList = function(presets) {
70333       presetPane.classed("hide", false);
70334       wrap2.transition().styleTween("right", function() {
70335         return value_default("0%", "-100%");
70336       }).on("end", function() {
70337         editorPane.classed("hide", true);
70338       });
70339       if (presets) {
70340         presetList.presets(presets);
70341       }
70342       presetPane.call(presetList.autofocus(true));
70343     };
70344     inspector.setPreset = function(preset) {
70345       if (preset && preset.id === "type/multipolygon") {
70346         presetPane.call(presetList.autofocus(true));
70347       } else {
70348         editorPane.classed("hide", false);
70349         wrap2.transition().styleTween("right", function() {
70350           return value_default("-100%", "0%");
70351         }).on("end", function() {
70352           presetPane.classed("hide", true);
70353         });
70354         if (preset) {
70355           entityEditor.presets([preset]);
70356         }
70357         editorPane.call(entityEditor);
70358       }
70359     };
70360     inspector.state = function(val) {
70361       if (!arguments.length) return _state;
70362       _state = val;
70363       entityEditor.state(_state);
70364       context.container().selectAll(".field-help-body").remove();
70365       return inspector;
70366     };
70367     inspector.entityIDs = function(val) {
70368       if (!arguments.length) return _entityIDs;
70369       _entityIDs = val;
70370       return inspector;
70371     };
70372     inspector.newFeature = function(val) {
70373       if (!arguments.length) return _newFeature;
70374       _newFeature = val;
70375       return inspector;
70376     };
70377     return inspector;
70378   }
70379
70380   // modules/ui/sidebar.js
70381   function uiSidebar(context) {
70382     var inspector = uiInspector(context);
70383     var dataEditor = uiDataEditor(context);
70384     var noteEditor = uiNoteEditor(context);
70385     var keepRightEditor = uiKeepRightEditor(context);
70386     var osmoseEditor = uiOsmoseEditor(context);
70387     var _current;
70388     var _wasData = false;
70389     var _wasNote = false;
70390     var _wasQaItem = false;
70391     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
70392     function sidebar(selection2) {
70393       var container = context.container();
70394       var minWidth = 240;
70395       var sidebarWidth;
70396       var containerWidth;
70397       var dragOffset;
70398       selection2.style("min-width", minWidth + "px").style("max-width", "400px").style("width", "33.3333%");
70399       var resizer = selection2.append("div").attr("class", "sidebar-resizer").on(_pointerPrefix + "down.sidebar-resizer", pointerdown);
70400       var downPointerId, lastClientX, containerLocGetter;
70401       function pointerdown(d3_event) {
70402         if (downPointerId) return;
70403         if ("button" in d3_event && d3_event.button !== 0) return;
70404         downPointerId = d3_event.pointerId || "mouse";
70405         lastClientX = d3_event.clientX;
70406         containerLocGetter = utilFastMouse(container.node());
70407         dragOffset = utilFastMouse(resizer.node())(d3_event)[0] - 1;
70408         sidebarWidth = selection2.node().getBoundingClientRect().width;
70409         containerWidth = container.node().getBoundingClientRect().width;
70410         var widthPct = sidebarWidth / containerWidth * 100;
70411         selection2.style("width", widthPct + "%").style("max-width", "85%");
70412         resizer.classed("dragging", true);
70413         select_default2(window).on("touchmove.sidebar-resizer", function(d3_event2) {
70414           d3_event2.preventDefault();
70415         }, { passive: false }).on(_pointerPrefix + "move.sidebar-resizer", pointermove).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", pointerup);
70416       }
70417       function pointermove(d3_event) {
70418         if (downPointerId !== (d3_event.pointerId || "mouse")) return;
70419         d3_event.preventDefault();
70420         var dx = d3_event.clientX - lastClientX;
70421         lastClientX = d3_event.clientX;
70422         var isRTL = _mainLocalizer.textDirection() === "rtl";
70423         var scaleX = isRTL ? 0 : 1;
70424         var xMarginProperty = isRTL ? "margin-right" : "margin-left";
70425         var x3 = containerLocGetter(d3_event)[0] - dragOffset;
70426         sidebarWidth = isRTL ? containerWidth - x3 : x3;
70427         var isCollapsed = selection2.classed("collapsed");
70428         var shouldCollapse = sidebarWidth < minWidth;
70429         selection2.classed("collapsed", shouldCollapse);
70430         if (shouldCollapse) {
70431           if (!isCollapsed) {
70432             selection2.style(xMarginProperty, "-400px").style("width", "400px");
70433             context.ui().onResize([(sidebarWidth - dx) * scaleX, 0]);
70434           }
70435         } else {
70436           var widthPct = sidebarWidth / containerWidth * 100;
70437           selection2.style(xMarginProperty, null).style("width", widthPct + "%");
70438           if (isCollapsed) {
70439             context.ui().onResize([-sidebarWidth * scaleX, 0]);
70440           } else {
70441             context.ui().onResize([-dx * scaleX, 0]);
70442           }
70443         }
70444       }
70445       function pointerup(d3_event) {
70446         if (downPointerId !== (d3_event.pointerId || "mouse")) return;
70447         downPointerId = null;
70448         resizer.classed("dragging", false);
70449         select_default2(window).on("touchmove.sidebar-resizer", null).on(_pointerPrefix + "move.sidebar-resizer", null).on(_pointerPrefix + "up.sidebar-resizer pointercancel.sidebar-resizer", null);
70450       }
70451       var featureListWrap = selection2.append("div").attr("class", "feature-list-pane").call(uiFeatureList(context));
70452       var inspectorWrap = selection2.append("div").attr("class", "inspector-hidden inspector-wrap");
70453       var hoverModeSelect = function(targets) {
70454         context.container().selectAll(".feature-list-item button").classed("hover", false);
70455         if (context.selectedIDs().length > 1 && targets && targets.length) {
70456           var elements = context.container().selectAll(".feature-list-item button").filter(function(node) {
70457             return targets.indexOf(node) !== -1;
70458           });
70459           if (!elements.empty()) {
70460             elements.classed("hover", true);
70461           }
70462         }
70463       };
70464       sidebar.hoverModeSelect = throttle_default(hoverModeSelect, 200);
70465       function hover(targets) {
70466         var datum2 = targets && targets.length && targets[0];
70467         if (datum2 && datum2.__featurehash__) {
70468           _wasData = true;
70469           sidebar.show(dataEditor.datum(datum2));
70470           selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
70471         } else if (datum2 instanceof osmNote) {
70472           if (context.mode().id === "drag-note") return;
70473           _wasNote = true;
70474           var osm = services.osm;
70475           if (osm) {
70476             datum2 = osm.getNote(datum2.id);
70477           }
70478           sidebar.show(noteEditor.note(datum2));
70479           selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
70480         } else if (datum2 instanceof QAItem) {
70481           _wasQaItem = true;
70482           var errService = services[datum2.service];
70483           if (errService) {
70484             datum2 = errService.getError(datum2.id);
70485           }
70486           var errEditor;
70487           if (datum2.service === "keepRight") {
70488             errEditor = keepRightEditor;
70489           } else {
70490             errEditor = osmoseEditor;
70491           }
70492           context.container().selectAll(".qaItem." + datum2.service).classed("hover", function(d2) {
70493             return d2.id === datum2.id;
70494           });
70495           sidebar.show(errEditor.error(datum2));
70496           selection2.selectAll(".sidebar-component").classed("inspector-hover", true);
70497         } else if (!_current && datum2 instanceof osmEntity) {
70498           featureListWrap.classed("inspector-hidden", true);
70499           inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", true);
70500           if (!inspector.entityIDs() || !utilArrayIdentical(inspector.entityIDs(), [datum2.id]) || inspector.state() !== "hover") {
70501             inspector.state("hover").entityIDs([datum2.id]).newFeature(false);
70502             inspectorWrap.call(inspector);
70503           }
70504         } else if (!_current) {
70505           featureListWrap.classed("inspector-hidden", false);
70506           inspectorWrap.classed("inspector-hidden", true);
70507           inspector.state("hide");
70508         } else if (_wasData || _wasNote || _wasQaItem) {
70509           _wasNote = false;
70510           _wasData = false;
70511           _wasQaItem = false;
70512           context.container().selectAll(".note").classed("hover", false);
70513           context.container().selectAll(".qaItem").classed("hover", false);
70514           sidebar.hide();
70515         }
70516       }
70517       sidebar.hover = throttle_default(hover, 200);
70518       sidebar.intersects = function(extent) {
70519         var rect = selection2.node().getBoundingClientRect();
70520         return extent.intersects([
70521           context.projection.invert([0, rect.height]),
70522           context.projection.invert([rect.width, 0])
70523         ]);
70524       };
70525       sidebar.select = function(ids, newFeature) {
70526         sidebar.hide();
70527         if (ids && ids.length) {
70528           var entity = ids.length === 1 && context.entity(ids[0]);
70529           if (entity && newFeature && selection2.classed("collapsed")) {
70530             var extent = entity.extent(context.graph());
70531             sidebar.expand(sidebar.intersects(extent));
70532           }
70533           featureListWrap.classed("inspector-hidden", true);
70534           inspectorWrap.classed("inspector-hidden", false).classed("inspector-hover", false);
70535           inspector.state("select").entityIDs(ids).newFeature(newFeature);
70536           inspectorWrap.call(inspector);
70537         } else {
70538           inspector.state("hide");
70539         }
70540       };
70541       sidebar.showPresetList = function() {
70542         inspector.showList();
70543       };
70544       sidebar.show = function(component, element) {
70545         featureListWrap.classed("inspector-hidden", true);
70546         inspectorWrap.classed("inspector-hidden", true);
70547         if (_current) _current.remove();
70548         _current = selection2.append("div").attr("class", "sidebar-component").call(component, element);
70549       };
70550       sidebar.hide = function() {
70551         featureListWrap.classed("inspector-hidden", false);
70552         inspectorWrap.classed("inspector-hidden", true);
70553         if (_current) _current.remove();
70554         _current = null;
70555       };
70556       sidebar.expand = function(moveMap) {
70557         if (selection2.classed("collapsed")) {
70558           sidebar.toggle(moveMap);
70559         }
70560       };
70561       sidebar.collapse = function(moveMap) {
70562         if (!selection2.classed("collapsed")) {
70563           sidebar.toggle(moveMap);
70564         }
70565       };
70566       sidebar.toggle = function(moveMap) {
70567         if (context.inIntro()) return;
70568         var isCollapsed = selection2.classed("collapsed");
70569         var isCollapsing = !isCollapsed;
70570         var isRTL = _mainLocalizer.textDirection() === "rtl";
70571         var scaleX = isRTL ? 0 : 1;
70572         var xMarginProperty = isRTL ? "margin-right" : "margin-left";
70573         sidebarWidth = selection2.node().getBoundingClientRect().width;
70574         selection2.style("width", sidebarWidth + "px");
70575         var startMargin, endMargin, lastMargin;
70576         if (isCollapsing) {
70577           startMargin = lastMargin = 0;
70578           endMargin = -sidebarWidth;
70579         } else {
70580           startMargin = lastMargin = -sidebarWidth;
70581           endMargin = 0;
70582         }
70583         if (!isCollapsing) {
70584           selection2.classed("collapsed", isCollapsing);
70585         }
70586         selection2.transition().style(xMarginProperty, endMargin + "px").tween("panner", function() {
70587           var i3 = number_default(startMargin, endMargin);
70588           return function(t2) {
70589             var dx = lastMargin - Math.round(i3(t2));
70590             lastMargin = lastMargin - dx;
70591             context.ui().onResize(moveMap ? void 0 : [dx * scaleX, 0]);
70592           };
70593         }).on("end", function() {
70594           if (isCollapsing) {
70595             selection2.classed("collapsed", isCollapsing);
70596           }
70597           if (!isCollapsing) {
70598             var containerWidth2 = container.node().getBoundingClientRect().width;
70599             var widthPct = sidebarWidth / containerWidth2 * 100;
70600             selection2.style(xMarginProperty, null).style("width", widthPct + "%");
70601           }
70602         });
70603       };
70604       resizer.on("dblclick", function(d3_event) {
70605         d3_event.preventDefault();
70606         if (d3_event.sourceEvent) {
70607           d3_event.sourceEvent.preventDefault();
70608         }
70609         sidebar.toggle();
70610       });
70611       context.map().on("crossEditableZoom.sidebar", function(within) {
70612         if (!within && !selection2.select(".inspector-hover").empty()) {
70613           hover([]);
70614         }
70615       });
70616     }
70617     sidebar.showPresetList = function() {
70618     };
70619     sidebar.hover = function() {
70620     };
70621     sidebar.hover.cancel = function() {
70622     };
70623     sidebar.intersects = function() {
70624     };
70625     sidebar.select = function() {
70626     };
70627     sidebar.show = function() {
70628     };
70629     sidebar.hide = function() {
70630     };
70631     sidebar.expand = function() {
70632     };
70633     sidebar.collapse = function() {
70634     };
70635     sidebar.toggle = function() {
70636     };
70637     return sidebar;
70638   }
70639
70640   // modules/ui/source_switch.js
70641   function uiSourceSwitch(context) {
70642     var keys2;
70643     function click(d3_event) {
70644       d3_event.preventDefault();
70645       var osm = context.connection();
70646       if (!osm) return;
70647       if (context.inIntro()) return;
70648       if (context.history().hasChanges() && !window.confirm(_t("source_switch.lose_changes"))) return;
70649       var isLive = select_default2(this).classed("live");
70650       isLive = !isLive;
70651       context.enter(modeBrowse(context));
70652       context.history().clearSaved();
70653       context.flush();
70654       select_default2(this).html(isLive ? _t.html("source_switch.live") : _t.html("source_switch.dev")).classed("live", isLive).classed("chip", isLive);
70655       osm.switch(isLive ? keys2[0] : keys2[1]);
70656     }
70657     var sourceSwitch = function(selection2) {
70658       selection2.append("a").attr("href", "#").call(_t.append("source_switch.live")).attr("class", "live chip").on("click", click);
70659     };
70660     sourceSwitch.keys = function(_3) {
70661       if (!arguments.length) return keys2;
70662       keys2 = _3;
70663       return sourceSwitch;
70664     };
70665     return sourceSwitch;
70666   }
70667
70668   // modules/ui/spinner.js
70669   function uiSpinner(context) {
70670     var osm = context.connection();
70671     return function(selection2) {
70672       var img = selection2.append("img").attr("src", context.imagePath("loader-black.gif")).style("opacity", 0);
70673       if (osm) {
70674         osm.on("loading.spinner", function() {
70675           img.transition().style("opacity", 1);
70676         }).on("loaded.spinner", function() {
70677           img.transition().style("opacity", 0);
70678         });
70679       }
70680     };
70681   }
70682
70683   // modules/ui/sections/privacy.js
70684   function uiSectionPrivacy(context) {
70685     let section = uiSection("preferences-third-party", context).label(() => _t.append("preferences.privacy.title")).disclosureContent(renderDisclosureContent);
70686     function renderDisclosureContent(selection2) {
70687       selection2.selectAll(".privacy-options-list").data([0]).enter().append("ul").attr("class", "layer-list privacy-options-list");
70688       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(
70689         uiTooltip().title(() => _t.append("preferences.privacy.third_party_icons.tooltip")).placement("bottom")
70690       );
70691       thirdPartyIconsEnter.append("input").attr("type", "checkbox").on("change", (d3_event, d2) => {
70692         d3_event.preventDefault();
70693         corePreferences("preferences.privacy.thirdpartyicons", d2 === "true" ? "false" : "true");
70694       });
70695       thirdPartyIconsEnter.append("span").call(_t.append("preferences.privacy.third_party_icons.description"));
70696       selection2.selectAll(".privacy-third-party-icons-item").classed("active", (d2) => d2 === "true").select("input").property("checked", (d2) => d2 === "true");
70697       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"));
70698     }
70699     corePreferences.onChange("preferences.privacy.thirdpartyicons", section.reRender);
70700     return section;
70701   }
70702
70703   // modules/ui/splash.js
70704   function uiSplash(context) {
70705     return (selection2) => {
70706       if (context.history().hasRestorableChanges()) return;
70707       let updateMessage = "";
70708       const sawPrivacyVersion = corePreferences("sawPrivacyVersion");
70709       let showSplash = !corePreferences("sawSplash");
70710       if (sawPrivacyVersion && sawPrivacyVersion !== context.privacyVersion) {
70711         updateMessage = _t("splash.privacy_update");
70712         showSplash = true;
70713       }
70714       if (!showSplash) return;
70715       corePreferences("sawSplash", true);
70716       corePreferences("sawPrivacyVersion", context.privacyVersion);
70717       _mainFileFetcher.get("intro_graph");
70718       let modalSelection = uiModal(selection2);
70719       modalSelection.select(".modal").attr("class", "modal-splash modal");
70720       let introModal = modalSelection.select(".content").append("div").attr("class", "fillL");
70721       introModal.append("div").attr("class", "modal-section").append("h3").call(_t.append("splash.welcome"));
70722       let modalSection = introModal.append("div").attr("class", "modal-section");
70723       modalSection.append("p").html(_t.html("splash.text", {
70724         version: context.version,
70725         website: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/develop/CHANGELOG.md#whats-new">' + _t.html("splash.changelog") + "</a>" },
70726         github: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/issues">github.com</a>' }
70727       }));
70728       modalSection.append("p").html(_t.html("splash.privacy", {
70729         updateMessage,
70730         privacyLink: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/release/PRIVACY.md">' + _t("splash.privacy_policy") + "</a>" }
70731       }));
70732       uiSectionPrivacy(context).label(() => _t.append("splash.privacy_settings")).render(modalSection);
70733       let buttonWrap = introModal.append("div").attr("class", "modal-actions");
70734       let walkthrough = buttonWrap.append("button").attr("class", "walkthrough").on("click", () => {
70735         context.container().call(uiIntro(context));
70736         modalSelection.close();
70737       });
70738       walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
70739       walkthrough.append("div").call(_t.append("splash.walkthrough"));
70740       let startEditing = buttonWrap.append("button").attr("class", "start-editing").on("click", modalSelection.close);
70741       startEditing.append("svg").attr("class", "logo logo-features").append("use").attr("xlink:href", "#iD-logo-features");
70742       startEditing.append("div").call(_t.append("splash.start"));
70743       modalSelection.select("button.close").attr("class", "hide");
70744     };
70745   }
70746
70747   // modules/ui/status.js
70748   function uiStatus(context) {
70749     var osm = context.connection();
70750     return function(selection2) {
70751       if (!osm) return;
70752       function update(err, apiStatus) {
70753         selection2.html("");
70754         if (err) {
70755           if (apiStatus === "connectionSwitched") {
70756             return;
70757           } else if (apiStatus === "rateLimited") {
70758             if (!osm.authenticated()) {
70759               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) {
70760                 d3_event.preventDefault();
70761                 osm.authenticate();
70762               });
70763             } else {
70764               selection2.call(_t.append("osm_api_status.message.rateLimited"));
70765             }
70766           } else {
70767             var throttledRetry = throttle_default(function() {
70768               context.loadTiles(context.projection);
70769               osm.reloadApiStatus();
70770             }, 2e3);
70771             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) {
70772               d3_event.preventDefault();
70773               throttledRetry();
70774             });
70775           }
70776         } else if (apiStatus === "readonly") {
70777           selection2.call(_t.append("osm_api_status.message.readonly"));
70778         } else if (apiStatus === "offline") {
70779           selection2.call(_t.append("osm_api_status.message.offline"));
70780         }
70781         selection2.attr("class", "api-status " + (err ? "error" : apiStatus));
70782       }
70783       osm.on("apiStatusChange.uiStatus", update);
70784       context.history().on("storage_error", () => {
70785         selection2.selectAll("span.local-storage-full").remove();
70786         selection2.append("span").attr("class", "local-storage-full").call(_t.append("osm_api_status.message.local_storage_full"));
70787         selection2.classed("error", true);
70788       });
70789       window.setInterval(function() {
70790         osm.reloadApiStatus();
70791       }, 9e4);
70792       osm.reloadApiStatus();
70793     };
70794   }
70795
70796   // modules/ui/tools/modes.js
70797   function uiToolDrawModes(context) {
70798     var tool = {
70799       id: "old_modes",
70800       label: _t.append("toolbar.add_feature")
70801     };
70802     var modes = [
70803       modeAddPoint(context, {
70804         title: _t.append("modes.add_point.title"),
70805         button: "point",
70806         description: _t.append("modes.add_point.description"),
70807         preset: _mainPresetIndex.item("point"),
70808         key: "1"
70809       }),
70810       modeAddLine(context, {
70811         title: _t.append("modes.add_line.title"),
70812         button: "line",
70813         description: _t.append("modes.add_line.description"),
70814         preset: _mainPresetIndex.item("line"),
70815         key: "2"
70816       }),
70817       modeAddArea(context, {
70818         title: _t.append("modes.add_area.title"),
70819         button: "area",
70820         description: _t.append("modes.add_area.description"),
70821         preset: _mainPresetIndex.item("area"),
70822         key: "3"
70823       })
70824     ];
70825     function enabled(_mode) {
70826       return osmEditable();
70827     }
70828     function osmEditable() {
70829       return context.editable();
70830     }
70831     modes.forEach(function(mode) {
70832       context.keybinding().on(mode.key, function() {
70833         if (!enabled(mode)) return;
70834         if (mode.id === context.mode().id) {
70835           context.enter(modeBrowse(context));
70836         } else {
70837           context.enter(mode);
70838         }
70839       });
70840     });
70841     tool.render = function(selection2) {
70842       var wrap2 = selection2.append("div").attr("class", "joined").style("display", "flex");
70843       var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
70844       context.map().on("move.modes", debouncedUpdate).on("drawn.modes", debouncedUpdate);
70845       context.on("enter.modes", update);
70846       update();
70847       function update() {
70848         var buttons = wrap2.selectAll("button.add-button").data(modes, function(d2) {
70849           return d2.id;
70850         });
70851         buttons.exit().remove();
70852         var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
70853           return d2.id + " add-button bar-button";
70854         }).on("click.mode-buttons", function(d3_event, d2) {
70855           if (!enabled(d2)) return;
70856           var currMode = context.mode().id;
70857           if (/^draw/.test(currMode)) return;
70858           if (d2.id === currMode) {
70859             context.enter(modeBrowse(context));
70860           } else {
70861             context.enter(d2);
70862           }
70863         }).call(
70864           uiTooltip().placement("bottom").title(function(d2) {
70865             return d2.description;
70866           }).keys(function(d2) {
70867             return [d2.key];
70868           }).scrollContainer(context.container().select(".top-toolbar"))
70869         );
70870         buttonsEnter.each(function(d2) {
70871           select_default2(this).call(svgIcon("#iD-icon-" + d2.button));
70872         });
70873         buttonsEnter.append("span").attr("class", "label").text("").each(function(mode) {
70874           mode.title(select_default2(this));
70875         });
70876         if (buttons.enter().size() || buttons.exit().size()) {
70877           context.ui().checkOverflow(".top-toolbar", true);
70878         }
70879         buttons = buttons.merge(buttonsEnter).attr("aria-disabled", function(d2) {
70880           return !enabled(d2);
70881         }).classed("disabled", function(d2) {
70882           return !enabled(d2);
70883         }).attr("aria-pressed", function(d2) {
70884           return context.mode() && context.mode().button === d2.button;
70885         }).classed("active", function(d2) {
70886           return context.mode() && context.mode().button === d2.button;
70887         });
70888       }
70889     };
70890     return tool;
70891   }
70892
70893   // modules/ui/tools/notes.js
70894   function uiToolNotes(context) {
70895     var tool = {
70896       id: "notes",
70897       label: _t.append("modes.add_note.label")
70898     };
70899     var mode = modeAddNote(context);
70900     function enabled() {
70901       return notesEnabled() && notesEditable();
70902     }
70903     function notesEnabled() {
70904       var noteLayer = context.layers().layer("notes");
70905       return noteLayer && noteLayer.enabled();
70906     }
70907     function notesEditable() {
70908       var mode2 = context.mode();
70909       return context.map().notesEditable() && mode2 && mode2.id !== "save";
70910     }
70911     context.keybinding().on(mode.key, function() {
70912       if (!enabled()) return;
70913       if (mode.id === context.mode().id) {
70914         context.enter(modeBrowse(context));
70915       } else {
70916         context.enter(mode);
70917       }
70918     });
70919     tool.render = function(selection2) {
70920       var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
70921       context.map().on("move.notes", debouncedUpdate).on("drawn.notes", debouncedUpdate);
70922       context.on("enter.notes", update);
70923       update();
70924       function update() {
70925         var showNotes = notesEnabled();
70926         var data = showNotes ? [mode] : [];
70927         var buttons = selection2.selectAll("button.add-button").data(data, function(d2) {
70928           return d2.id;
70929         });
70930         buttons.exit().remove();
70931         var buttonsEnter = buttons.enter().append("button").attr("class", function(d2) {
70932           return d2.id + " add-button bar-button";
70933         }).on("click.notes", function(d3_event, d2) {
70934           if (!enabled()) return;
70935           var currMode = context.mode().id;
70936           if (/^draw/.test(currMode)) return;
70937           if (d2.id === currMode) {
70938             context.enter(modeBrowse(context));
70939           } else {
70940             context.enter(d2);
70941           }
70942         }).call(
70943           uiTooltip().placement("bottom").title(function(d2) {
70944             return d2.description;
70945           }).keys(function(d2) {
70946             return [d2.key];
70947           }).scrollContainer(context.container().select(".top-toolbar"))
70948         );
70949         buttonsEnter.each(function(d2) {
70950           select_default2(this).call(svgIcon(d2.icon || "#iD-icon-" + d2.button));
70951         });
70952         if (buttons.enter().size() || buttons.exit().size()) {
70953           context.ui().checkOverflow(".top-toolbar", true);
70954         }
70955         buttons = buttons.merge(buttonsEnter).classed("disabled", function() {
70956           return !enabled();
70957         }).attr("aria-disabled", function() {
70958           return !enabled();
70959         }).classed("active", function(d2) {
70960           return context.mode() && context.mode().button === d2.button;
70961         }).attr("aria-pressed", function(d2) {
70962           return context.mode() && context.mode().button === d2.button;
70963         });
70964       }
70965     };
70966     tool.uninstall = function() {
70967       context.on("enter.editor.notes", null).on("exit.editor.notes", null).on("enter.notes", null);
70968       context.map().on("move.notes", null).on("drawn.notes", null);
70969     };
70970     return tool;
70971   }
70972
70973   // modules/ui/tools/save.js
70974   function uiToolSave(context) {
70975     var tool = {
70976       id: "save",
70977       label: _t.append("save.title")
70978     };
70979     var button = null;
70980     var tooltipBehavior = null;
70981     var history = context.history();
70982     var key = uiCmd("\u2318S");
70983     var _numChanges = 0;
70984     function isSaving() {
70985       var mode = context.mode();
70986       return mode && mode.id === "save";
70987     }
70988     function isDisabled() {
70989       return _numChanges === 0 || isSaving();
70990     }
70991     function save(d3_event) {
70992       d3_event.preventDefault();
70993       if (!context.inIntro() && !isSaving() && history.hasChanges()) {
70994         context.enter(modeSave(context));
70995       }
70996     }
70997     function bgColor(numChanges) {
70998       var step;
70999       if (numChanges === 0) {
71000         return null;
71001       } else if (numChanges <= 50) {
71002         step = numChanges / 50;
71003         return rgb_default("#fff0", "#ff08")(step);
71004       } else {
71005         step = Math.min((numChanges - 50) / 50, 1);
71006         return rgb_default("#ff08", "#f008")(step);
71007       }
71008     }
71009     function updateCount() {
71010       var val = history.difference().summary().length;
71011       if (val === _numChanges) return;
71012       _numChanges = val;
71013       if (tooltipBehavior) {
71014         tooltipBehavior.title(() => _t.append(_numChanges > 0 ? "save.help" : "save.no_changes")).keys([key]);
71015       }
71016       if (button) {
71017         button.classed("disabled", isDisabled()).style("--accent-color", bgColor(_numChanges));
71018         button.select("span.count").text(_numChanges);
71019       }
71020     }
71021     tool.render = function(selection2) {
71022       tooltipBehavior = uiTooltip().placement("bottom").title(() => _t.append("save.no_changes")).keys([key]).scrollContainer(context.container().select(".top-toolbar"));
71023       var lastPointerUpType;
71024       button = selection2.append("button").attr("class", "save disabled bar-button").on("pointerup", function(d3_event) {
71025         lastPointerUpType = d3_event.pointerType;
71026       }).on("click", function(d3_event) {
71027         save(d3_event);
71028         if (_numChanges === 0 && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
71029           context.ui().flash.duration(2e3).iconName("#iD-icon-save").iconClass("disabled").label(_t.append("save.no_changes"))();
71030         }
71031         lastPointerUpType = null;
71032       }).call(tooltipBehavior);
71033       button.call(svgIcon("#iD-icon-save"));
71034       button.append("span").attr("class", "count").attr("aria-hidden", "true").text("0");
71035       updateCount();
71036       context.keybinding().on(key, save, true);
71037       context.history().on("change.save", updateCount);
71038       context.on("enter.save", function() {
71039         if (button) {
71040           button.classed("disabled", isDisabled());
71041           if (isSaving()) {
71042             button.call(tooltipBehavior.hide);
71043           }
71044         }
71045       });
71046     };
71047     tool.uninstall = function() {
71048       context.keybinding().off(key, true);
71049       context.history().on("change.save", null);
71050       context.on("enter.save", null);
71051       button = null;
71052       tooltipBehavior = null;
71053     };
71054     return tool;
71055   }
71056
71057   // modules/ui/tools/sidebar_toggle.js
71058   function uiToolSidebarToggle(context) {
71059     var tool = {
71060       id: "sidebar_toggle",
71061       label: _t.append("toolbar.inspect")
71062     };
71063     tool.render = function(selection2) {
71064       selection2.append("button").attr("class", "bar-button").attr("aria-label", _t("sidebar.tooltip")).on("click", function() {
71065         context.ui().sidebar.toggle();
71066       }).call(
71067         uiTooltip().placement("bottom").title(() => _t.append("sidebar.tooltip")).keys([_t("sidebar.key")]).scrollContainer(context.container().select(".top-toolbar"))
71068       ).call(svgIcon("#iD-icon-sidebar-" + (_mainLocalizer.textDirection() === "rtl" ? "right" : "left")));
71069     };
71070     return tool;
71071   }
71072
71073   // modules/ui/tools/undo_redo.js
71074   function uiToolUndoRedo(context) {
71075     var tool = {
71076       id: "undo_redo",
71077       label: _t.append("toolbar.undo_redo")
71078     };
71079     var commands = [{
71080       id: "undo",
71081       cmd: uiCmd("\u2318Z"),
71082       action: function() {
71083         context.undo();
71084       },
71085       annotation: function() {
71086         return context.history().undoAnnotation();
71087       },
71088       icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")
71089     }, {
71090       id: "redo",
71091       cmd: uiCmd("\u2318\u21E7Z"),
71092       action: function() {
71093         context.redo();
71094       },
71095       annotation: function() {
71096         return context.history().redoAnnotation();
71097       },
71098       icon: "iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "undo" : "redo")
71099     }];
71100     function editable() {
71101       return context.mode() && context.mode().id !== "save" && context.map().editableDataEnabled(
71102         true
71103         /* ignore min zoom */
71104       );
71105     }
71106     tool.render = function(selection2) {
71107       var tooltipBehavior = uiTooltip().placement("bottom").title(function(d2) {
71108         return d2.annotation() ? _t.append(d2.id + ".tooltip", { action: d2.annotation() }) : _t.append(d2.id + ".nothing");
71109       }).keys(function(d2) {
71110         return [d2.cmd];
71111       }).scrollContainer(context.container().select(".top-toolbar"));
71112       var lastPointerUpType;
71113       var buttons = selection2.selectAll("button").data(commands).enter().append("button").attr("class", function(d2) {
71114         return "disabled " + d2.id + "-button bar-button";
71115       }).on("pointerup", function(d3_event) {
71116         lastPointerUpType = d3_event.pointerType;
71117       }).on("click", function(d3_event, d2) {
71118         d3_event.preventDefault();
71119         var annotation = d2.annotation();
71120         if (editable() && annotation) {
71121           d2.action();
71122         }
71123         if (editable() && (lastPointerUpType === "touch" || lastPointerUpType === "pen")) {
71124           var label = annotation ? _t.append(d2.id + ".tooltip", { action: annotation }) : _t.append(d2.id + ".nothing");
71125           context.ui().flash.duration(2e3).iconName("#" + d2.icon).iconClass(annotation ? "" : "disabled").label(label)();
71126         }
71127         lastPointerUpType = null;
71128       }).call(tooltipBehavior);
71129       buttons.each(function(d2) {
71130         select_default2(this).call(svgIcon("#" + d2.icon));
71131       });
71132       context.keybinding().on(commands[0].cmd, function(d3_event) {
71133         d3_event.preventDefault();
71134         if (editable()) commands[0].action();
71135       }).on(commands[1].cmd, function(d3_event) {
71136         d3_event.preventDefault();
71137         if (editable()) commands[1].action();
71138       });
71139       var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
71140       context.map().on("move.undo_redo", debouncedUpdate).on("drawn.undo_redo", debouncedUpdate);
71141       context.history().on("change.undo_redo", function(difference2) {
71142         if (difference2) update();
71143       });
71144       context.on("enter.undo_redo", update);
71145       function update() {
71146         buttons.classed("disabled", function(d2) {
71147           return !editable() || !d2.annotation();
71148         }).each(function() {
71149           var selection3 = select_default2(this);
71150           if (!selection3.select(".tooltip.in").empty()) {
71151             selection3.call(tooltipBehavior.updateContent);
71152           }
71153         });
71154       }
71155     };
71156     tool.uninstall = function() {
71157       context.keybinding().off(commands[0].cmd).off(commands[1].cmd);
71158       context.map().on("move.undo_redo", null).on("drawn.undo_redo", null);
71159       context.history().on("change.undo_redo", null);
71160       context.on("enter.undo_redo", null);
71161     };
71162     return tool;
71163   }
71164
71165   // modules/ui/top_toolbar.js
71166   function uiTopToolbar(context) {
71167     var sidebarToggle = uiToolSidebarToggle(context), modes = uiToolDrawModes(context), notes = uiToolNotes(context), undoRedo = uiToolUndoRedo(context), save = uiToolSave(context);
71168     function notesEnabled() {
71169       var noteLayer = context.layers().layer("notes");
71170       return noteLayer && noteLayer.enabled();
71171     }
71172     function topToolbar(bar) {
71173       bar.on("wheel.topToolbar", function(d3_event) {
71174         if (!d3_event.deltaX) {
71175           bar.node().scrollLeft += d3_event.deltaY;
71176         }
71177       });
71178       var debouncedUpdate = debounce_default(update, 500, { leading: true, trailing: true });
71179       context.layers().on("change.topToolbar", debouncedUpdate);
71180       update();
71181       function update() {
71182         var tools = [
71183           sidebarToggle,
71184           "spacer",
71185           modes
71186         ];
71187         tools.push("spacer");
71188         if (notesEnabled()) {
71189           tools = tools.concat([notes, "spacer"]);
71190         }
71191         tools = tools.concat([undoRedo, save]);
71192         var toolbarItems = bar.selectAll(".toolbar-item").data(tools, function(d2) {
71193           return d2.id || d2;
71194         });
71195         toolbarItems.exit().each(function(d2) {
71196           if (d2.uninstall) {
71197             d2.uninstall();
71198           }
71199         }).remove();
71200         var itemsEnter = toolbarItems.enter().append("div").attr("class", function(d2) {
71201           var classes = "toolbar-item " + (d2.id || d2).replace("_", "-");
71202           if (d2.klass) classes += " " + d2.klass;
71203           return classes;
71204         });
71205         var actionableItems = itemsEnter.filter(function(d2) {
71206           return d2 !== "spacer";
71207         });
71208         actionableItems.append("div").attr("class", "item-content").each(function(d2) {
71209           select_default2(this).call(d2.render, bar);
71210         });
71211         actionableItems.append("div").attr("class", "item-label").each(function(d2) {
71212           d2.label(select_default2(this));
71213         });
71214       }
71215     }
71216     return topToolbar;
71217   }
71218
71219   // modules/ui/version.js
71220   var sawVersion = null;
71221   var isNewVersion = false;
71222   var isNewUser = false;
71223   function uiVersion(context) {
71224     var currVersion = context.version;
71225     var matchedVersion = currVersion.match(/\d+\.\d+\.\d+.*/);
71226     if (sawVersion === null && matchedVersion !== null) {
71227       if (corePreferences("sawVersion")) {
71228         isNewUser = false;
71229         isNewVersion = corePreferences("sawVersion") !== currVersion && currVersion.indexOf("-") === -1;
71230       } else {
71231         isNewUser = true;
71232         isNewVersion = true;
71233       }
71234       corePreferences("sawVersion", currVersion);
71235       sawVersion = currVersion;
71236     }
71237     return function(selection2) {
71238       selection2.append("a").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD").text(currVersion);
71239       if (isNewVersion && !isNewUser) {
71240         selection2.append("a").attr("class", "badge").attr("target", "_blank").attr("href", "https://github.com/openstreetmap/iD/releases/tag/v".concat(currVersion)).call(svgIcon("#maki-gift")).call(
71241           uiTooltip().title(() => _t.append("version.whats_new", { version: currVersion })).placement("top").scrollContainer(context.container().select(".main-footer-wrap"))
71242         );
71243       }
71244     };
71245   }
71246
71247   // modules/ui/zoom.js
71248   function uiZoom(context) {
71249     var zooms = [{
71250       id: "zoom-in",
71251       icon: "iD-icon-plus",
71252       title: _t.append("zoom.in"),
71253       action: zoomIn,
71254       disabled: function() {
71255         return !context.map().canZoomIn();
71256       },
71257       disabledTitle: _t.append("zoom.disabled.in"),
71258       key: "+"
71259     }, {
71260       id: "zoom-out",
71261       icon: "iD-icon-minus",
71262       title: _t.append("zoom.out"),
71263       action: zoomOut,
71264       disabled: function() {
71265         return !context.map().canZoomOut();
71266       },
71267       disabledTitle: _t.append("zoom.disabled.out"),
71268       key: "-"
71269     }];
71270     function zoomIn(d3_event) {
71271       if (d3_event.shiftKey) return;
71272       d3_event.preventDefault();
71273       context.map().zoomIn();
71274     }
71275     function zoomOut(d3_event) {
71276       if (d3_event.shiftKey) return;
71277       d3_event.preventDefault();
71278       context.map().zoomOut();
71279     }
71280     function zoomInFurther(d3_event) {
71281       if (d3_event.shiftKey) return;
71282       d3_event.preventDefault();
71283       context.map().zoomInFurther();
71284     }
71285     function zoomOutFurther(d3_event) {
71286       if (d3_event.shiftKey) return;
71287       d3_event.preventDefault();
71288       context.map().zoomOutFurther();
71289     }
71290     return function(selection2) {
71291       var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function(d2) {
71292         if (d2.disabled()) {
71293           return d2.disabledTitle;
71294         }
71295         return d2.title;
71296       }).keys(function(d2) {
71297         return [d2.key];
71298       });
71299       var lastPointerUpType;
71300       var buttons = selection2.selectAll("button").data(zooms).enter().append("button").attr("class", function(d2) {
71301         return d2.id;
71302       }).on("pointerup.editor", function(d3_event) {
71303         lastPointerUpType = d3_event.pointerType;
71304       }).on("click.editor", function(d3_event, d2) {
71305         if (!d2.disabled()) {
71306           d2.action(d3_event);
71307         } else if (lastPointerUpType === "touch" || lastPointerUpType === "pen") {
71308           context.ui().flash.duration(2e3).iconName("#" + d2.icon).iconClass("disabled").label(d2.disabledTitle)();
71309         }
71310         lastPointerUpType = null;
71311       }).call(tooltipBehavior);
71312       buttons.each(function(d2) {
71313         select_default2(this).call(svgIcon("#" + d2.icon, "light"));
71314       });
71315       utilKeybinding.plusKeys.forEach(function(key) {
71316         context.keybinding().on([key], zoomIn);
71317         context.keybinding().on([uiCmd("\u2325" + key)], zoomInFurther);
71318       });
71319       utilKeybinding.minusKeys.forEach(function(key) {
71320         context.keybinding().on([key], zoomOut);
71321         context.keybinding().on([uiCmd("\u2325" + key)], zoomOutFurther);
71322       });
71323       function updateButtonStates() {
71324         buttons.classed("disabled", function(d2) {
71325           return d2.disabled();
71326         }).each(function() {
71327           var selection3 = select_default2(this);
71328           if (!selection3.select(".tooltip.in").empty()) {
71329             selection3.call(tooltipBehavior.updateContent);
71330           }
71331         });
71332       }
71333       updateButtonStates();
71334       context.map().on("move.uiZoom", updateButtonStates);
71335     };
71336   }
71337
71338   // modules/ui/zoom_to_selection.js
71339   function uiZoomToSelection(context) {
71340     function isDisabled() {
71341       var mode = context.mode();
71342       return !mode || !mode.zoomToSelected;
71343     }
71344     var _lastPointerUpType;
71345     function pointerup(d3_event) {
71346       _lastPointerUpType = d3_event.pointerType;
71347     }
71348     function click(d3_event) {
71349       d3_event.preventDefault();
71350       if (isDisabled()) {
71351         if (_lastPointerUpType === "touch" || _lastPointerUpType === "pen") {
71352           context.ui().flash.duration(2e3).iconName("#iD-icon-framed-dot").iconClass("disabled").label(_t.append("inspector.zoom_to.no_selection"))();
71353         }
71354       } else {
71355         var mode = context.mode();
71356         if (mode && mode.zoomToSelected) {
71357           mode.zoomToSelected();
71358         }
71359       }
71360       _lastPointerUpType = null;
71361     }
71362     return function(selection2) {
71363       var tooltipBehavior = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(function() {
71364         if (isDisabled()) {
71365           return _t.append("inspector.zoom_to.no_selection");
71366         }
71367         return _t.append("inspector.zoom_to.title");
71368       }).keys([_t("inspector.zoom_to.key")]);
71369       var button = selection2.append("button").on("pointerup", pointerup).on("click", click).call(svgIcon("#iD-icon-framed-dot", "light")).call(tooltipBehavior);
71370       function setEnabledState() {
71371         button.classed("disabled", isDisabled());
71372         if (!button.select(".tooltip.in").empty()) {
71373           button.call(tooltipBehavior.updateContent);
71374         }
71375       }
71376       context.on("enter.uiZoomToSelection", setEnabledState);
71377       setEnabledState();
71378     };
71379   }
71380
71381   // modules/ui/pane.js
71382   function uiPane(id2, context) {
71383     var _key;
71384     var _label = "";
71385     var _description = "";
71386     var _iconName = "";
71387     var _sections;
71388     var _paneSelection = select_default2(null);
71389     var _paneTooltip;
71390     var pane = {
71391       id: id2
71392     };
71393     pane.label = function(val) {
71394       if (!arguments.length) return _label;
71395       _label = val;
71396       return pane;
71397     };
71398     pane.key = function(val) {
71399       if (!arguments.length) return _key;
71400       _key = val;
71401       return pane;
71402     };
71403     pane.description = function(val) {
71404       if (!arguments.length) return _description;
71405       _description = val;
71406       return pane;
71407     };
71408     pane.iconName = function(val) {
71409       if (!arguments.length) return _iconName;
71410       _iconName = val;
71411       return pane;
71412     };
71413     pane.sections = function(val) {
71414       if (!arguments.length) return _sections;
71415       _sections = val;
71416       return pane;
71417     };
71418     pane.selection = function() {
71419       return _paneSelection;
71420     };
71421     function hidePane() {
71422       context.ui().togglePanes();
71423     }
71424     pane.togglePane = function(d3_event) {
71425       if (d3_event) d3_event.preventDefault();
71426       _paneTooltip.hide();
71427       context.ui().togglePanes(!_paneSelection.classed("shown") ? _paneSelection : void 0);
71428     };
71429     pane.renderToggleButton = function(selection2) {
71430       if (!_paneTooltip) {
71431         _paneTooltip = uiTooltip().placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left").title(() => _description).keys([_key]);
71432       }
71433       selection2.append("button").on("click", pane.togglePane).call(svgIcon("#" + _iconName, "light")).call(_paneTooltip);
71434     };
71435     pane.renderContent = function(selection2) {
71436       if (_sections) {
71437         _sections.forEach(function(section) {
71438           selection2.call(section.render);
71439         });
71440       }
71441     };
71442     pane.renderPane = function(selection2) {
71443       _paneSelection = selection2.append("div").attr("class", "fillL map-pane hide " + id2 + "-pane").attr("pane", id2);
71444       var heading = _paneSelection.append("div").attr("class", "pane-heading");
71445       heading.append("h2").text("").call(_label);
71446       heading.append("button").attr("title", _t("icons.close")).on("click", hidePane).call(svgIcon("#iD-icon-close"));
71447       _paneSelection.append("div").attr("class", "pane-content").call(pane.renderContent);
71448       if (_key) {
71449         context.keybinding().on(_key, pane.togglePane);
71450       }
71451     };
71452     return pane;
71453   }
71454
71455   // modules/ui/sections/background_display_options.js
71456   function uiSectionBackgroundDisplayOptions(context) {
71457     var section = uiSection("background-display-options", context).label(() => _t.append("background.display_options")).disclosureContent(renderDisclosureContent);
71458     var _storedOpacity = corePreferences("background-opacity");
71459     var _minVal = 0;
71460     var _maxVal = 3;
71461     var _sliders = ["brightness", "contrast", "saturation", "sharpness"];
71462     var _options = {
71463       brightness: _storedOpacity !== null ? +_storedOpacity : 1,
71464       contrast: 1,
71465       saturation: 1,
71466       sharpness: 1
71467     };
71468     function updateValue(d2, val) {
71469       val = clamp_default(val, _minVal, _maxVal);
71470       _options[d2] = val;
71471       context.background()[d2](val);
71472       if (d2 === "brightness") {
71473         corePreferences("background-opacity", val);
71474       }
71475       section.reRender();
71476     }
71477     function renderDisclosureContent(selection2) {
71478       var container = selection2.selectAll(".display-options-container").data([0]);
71479       var containerEnter = container.enter().append("div").attr("class", "display-options-container controls-list");
71480       var slidersEnter = containerEnter.selectAll(".display-control").data(_sliders).enter().append("label").attr("class", function(d2) {
71481         return "display-control display-control-" + d2;
71482       });
71483       slidersEnter.html(function(d2) {
71484         return _t.html("background." + d2);
71485       }).append("span").attr("class", function(d2) {
71486         return "display-option-value display-option-value-" + d2;
71487       });
71488       var sildersControlEnter = slidersEnter.append("div").attr("class", "control-wrap");
71489       sildersControlEnter.append("input").attr("class", function(d2) {
71490         return "display-option-input display-option-input-" + d2;
71491       }).attr("type", "range").attr("min", _minVal).attr("max", _maxVal).attr("step", "0.01").on("input", function(d3_event, d2) {
71492         var val = select_default2(this).property("value");
71493         if (!val && d3_event && d3_event.target) {
71494           val = d3_event.target.value;
71495         }
71496         updateValue(d2, val);
71497       });
71498       sildersControlEnter.append("button").attr("title", function(d2) {
71499         return "".concat(_t("background.reset"), " ").concat(_t("background." + d2));
71500       }).attr("class", function(d2) {
71501         return "display-option-reset display-option-reset-" + d2;
71502       }).on("click", function(d3_event, d2) {
71503         if (d3_event.button !== 0) return;
71504         updateValue(d2, 1);
71505       }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
71506       containerEnter.append("a").attr("class", "display-option-resetlink").attr("role", "button").attr("href", "#").call(_t.append("background.reset_all")).on("click", function(d3_event) {
71507         d3_event.preventDefault();
71508         for (var i3 = 0; i3 < _sliders.length; i3++) {
71509           updateValue(_sliders[i3], 1);
71510         }
71511       });
71512       container = containerEnter.merge(container);
71513       container.selectAll(".display-option-input").property("value", function(d2) {
71514         return _options[d2];
71515       });
71516       container.selectAll(".display-option-value").text(function(d2) {
71517         return Math.floor(_options[d2] * 100) + "%";
71518       });
71519       container.selectAll(".display-option-reset").classed("disabled", function(d2) {
71520         return _options[d2] === 1;
71521       });
71522       if (containerEnter.size() && _options.brightness !== 1) {
71523         context.background().brightness(_options.brightness);
71524       }
71525     }
71526     return section;
71527   }
71528
71529   // modules/ui/settings/custom_background.js
71530   function uiSettingsCustomBackground() {
71531     var dispatch12 = dispatch_default("change");
71532     function render(selection2) {
71533       var _origSettings = {
71534         template: corePreferences("background-custom-template")
71535       };
71536       var _currSettings = {
71537         template: corePreferences("background-custom-template")
71538       };
71539       var example = "https://tile.openstreetmap.org/{zoom}/{x}/{y}.png";
71540       var modal = uiConfirm(selection2).okButton();
71541       modal.classed("settings-modal settings-custom-background", true);
71542       modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_background.header"));
71543       var textSection = modal.select(".modal-section.message-text");
71544       var instructions = "".concat(_t.html("settings.custom_background.instructions.info"), "\n") + "\n" + "#### ".concat(_t.html("settings.custom_background.instructions.wms.tokens_label"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.wms.tokens.proj"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.wms.tokens.wkid"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.wms.tokens.dimensions"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.wms.tokens.bbox"), "\n") + "\n" + "#### ".concat(_t.html("settings.custom_background.instructions.tms.tokens_label"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.tms.tokens.xyz"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.tms.tokens.flipped_y"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.tms.tokens.switch"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.tms.tokens.quadtile"), "\n") + "* ".concat(_t.html("settings.custom_background.instructions.tms.tokens.scale_factor"), "\n") + "\n" + "#### ".concat(_t.html("settings.custom_background.instructions.example"), "\n") + "`".concat(example, "`");
71545       textSection.append("div").attr("class", "instructions-template").html(k(instructions));
71546       textSection.append("textarea").attr("class", "field-template").attr("placeholder", _t("settings.custom_background.template.placeholder")).call(utilNoAuto).property("value", _currSettings.template);
71547       var buttonSection = modal.select(".modal-section.buttons");
71548       buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
71549       buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
71550       buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
71551       function isSaveDisabled() {
71552         return null;
71553       }
71554       function clickCancel() {
71555         textSection.select(".field-template").property("value", _origSettings.template);
71556         corePreferences("background-custom-template", _origSettings.template);
71557         this.blur();
71558         modal.close();
71559       }
71560       function clickSave() {
71561         _currSettings.template = textSection.select(".field-template").property("value");
71562         corePreferences("background-custom-template", _currSettings.template);
71563         this.blur();
71564         modal.close();
71565         dispatch12.call("change", this, _currSettings);
71566       }
71567     }
71568     return utilRebind(render, dispatch12, "on");
71569   }
71570
71571   // modules/ui/sections/background_list.js
71572   function uiSectionBackgroundList(context) {
71573     var _backgroundList = select_default2(null);
71574     var _customSource = context.background().findSource("custom");
71575     var _settingsCustomBackground = uiSettingsCustomBackground(context).on("change", customChanged);
71576     var section = uiSection("background-list", context).label(() => _t.append("background.backgrounds")).disclosureContent(renderDisclosureContent);
71577     function previousBackgroundID() {
71578       return corePreferences("background-last-used-toggle");
71579     }
71580     function renderDisclosureContent(selection2) {
71581       var container = selection2.selectAll(".layer-background-list").data([0]);
71582       _backgroundList = container.enter().append("ul").attr("class", "layer-list layer-background-list").attr("dir", "auto").merge(container);
71583       var bgExtrasListEnter = selection2.selectAll(".bg-extras-list").data([0]).enter().append("ul").attr("class", "layer-list bg-extras-list");
71584       var minimapLabelEnter = bgExtrasListEnter.append("li").attr("class", "minimap-toggle-item").append("label").call(
71585         uiTooltip().title(() => _t.append("background.minimap.tooltip")).keys([_t("background.minimap.key")]).placement("top")
71586       );
71587       minimapLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
71588         d3_event.preventDefault();
71589         uiMapInMap.toggle();
71590       });
71591       minimapLabelEnter.append("span").call(_t.append("background.minimap.description"));
71592       var panelLabelEnter = bgExtrasListEnter.append("li").attr("class", "background-panel-toggle-item").append("label").call(
71593         uiTooltip().title(() => _t.append("background.panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.background.key"))]).placement("top")
71594       );
71595       panelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
71596         d3_event.preventDefault();
71597         context.ui().info.toggle("background");
71598       });
71599       panelLabelEnter.append("span").call(_t.append("background.panel.description"));
71600       var locPanelLabelEnter = bgExtrasListEnter.append("li").attr("class", "location-panel-toggle-item").append("label").call(
71601         uiTooltip().title(() => _t.append("background.location_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.location.key"))]).placement("top")
71602       );
71603       locPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
71604         d3_event.preventDefault();
71605         context.ui().info.toggle("location");
71606       });
71607       locPanelLabelEnter.append("span").call(_t.append("background.location_panel.description"));
71608       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"));
71609       _backgroundList.call(drawListItems, "radio", function(d3_event, d2) {
71610         chooseBackground(d2);
71611       }, function(d2) {
71612         return !d2.isHidden() && !d2.overlay;
71613       });
71614     }
71615     function setTooltips(selection2) {
71616       selection2.each(function(d2, i3, nodes) {
71617         var item = select_default2(this).select("label");
71618         var span = item.select("span");
71619         var placement = i3 < nodes.length / 2 ? "bottom" : "top";
71620         var hasDescription = d2.hasDescription();
71621         var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
71622         item.call(uiTooltip().destroyAny);
71623         if (d2.id === previousBackgroundID()) {
71624           item.call(
71625             uiTooltip().placement(placement).title(() => _t.append("background.switch")).keys([uiCmd("\u2318" + _t("background.key"))])
71626           );
71627         } else if (hasDescription || isOverflowing) {
71628           item.call(
71629             uiTooltip().placement(placement).title(() => hasDescription ? d2.description() : d2.label())
71630           );
71631         }
71632       });
71633     }
71634     function drawListItems(layerList, type2, change, filter2) {
71635       var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2).sort(function(a2, b3) {
71636         return a2.best() && !b3.best() ? -1 : b3.best() && !a2.best() ? 1 : descending(a2.area(), b3.area()) || ascending2(a2.name(), b3.name()) || 0;
71637       });
71638       var layerLinks = layerList.selectAll("li").data(sources, function(d2, i3) {
71639         return d2.id + "---" + i3;
71640       });
71641       layerLinks.exit().remove();
71642       var enter = layerLinks.enter().append("li").classed("layer-custom", function(d2) {
71643         return d2.id === "custom";
71644       }).classed("best", function(d2) {
71645         return d2.best();
71646       });
71647       var label = enter.append("label");
71648       label.append("input").attr("type", type2).attr("name", "background-layer").attr("value", function(d2) {
71649         return d2.id;
71650       }).on("change", change);
71651       label.append("span").each(function(d2) {
71652         d2.label()(select_default2(this));
71653       });
71654       enter.filter(function(d2) {
71655         return d2.id === "custom";
71656       }).append("button").attr("class", "layer-browse").call(
71657         uiTooltip().title(() => _t.append("settings.custom_background.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
71658       ).on("click", function(d3_event) {
71659         d3_event.preventDefault();
71660         editCustom();
71661       }).call(svgIcon("#iD-icon-more"));
71662       enter.filter(function(d2) {
71663         return d2.best();
71664       }).append("div").attr("class", "best").call(
71665         uiTooltip().title(() => _t.append("background.best_imagery")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
71666       ).append("span").text("\u2605");
71667       layerList.call(updateLayerSelections);
71668     }
71669     function updateLayerSelections(selection2) {
71670       function active(d2) {
71671         return context.background().showsLayer(d2);
71672       }
71673       selection2.selectAll("li").classed("active", active).classed("switch", function(d2) {
71674         return d2.id === previousBackgroundID();
71675       }).call(setTooltips).selectAll("input").property("checked", active);
71676     }
71677     function chooseBackground(d2) {
71678       if (d2.id === "custom" && !d2.template()) {
71679         return editCustom();
71680       }
71681       var previousBackground = context.background().baseLayerSource();
71682       corePreferences("background-last-used-toggle", previousBackground.id);
71683       corePreferences("background-last-used", d2.id);
71684       context.background().baseLayerSource(d2);
71685     }
71686     function customChanged(d2) {
71687       if (d2 && d2.template) {
71688         _customSource.template(d2.template);
71689         chooseBackground(_customSource);
71690       } else {
71691         _customSource.template("");
71692         chooseBackground(context.background().findSource("none"));
71693       }
71694     }
71695     function editCustom() {
71696       context.container().call(_settingsCustomBackground);
71697     }
71698     context.background().on("change.background_list", function() {
71699       _backgroundList.call(updateLayerSelections);
71700     });
71701     context.map().on(
71702       "move.background_list",
71703       debounce_default(function() {
71704         window.requestIdleCallback(section.reRender);
71705       }, 1e3)
71706     );
71707     return section;
71708   }
71709
71710   // modules/ui/sections/background_offset.js
71711   function uiSectionBackgroundOffset(context) {
71712     var section = uiSection("background-offset", context).label(() => _t.append("background.fix_misalignment")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
71713     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
71714     var _directions = [
71715       ["top", [0, -0.5]],
71716       ["left", [-0.5, 0]],
71717       ["right", [0.5, 0]],
71718       ["bottom", [0, 0.5]]
71719     ];
71720     function updateValue() {
71721       var meters = geoOffsetToMeters(context.background().offset());
71722       var x3 = +meters[0].toFixed(2);
71723       var y3 = +meters[1].toFixed(2);
71724       context.container().selectAll(".nudge-inner-rect").select("input").classed("error", false).property("value", x3 + ", " + y3);
71725       context.container().selectAll(".nudge-reset").classed("disabled", function() {
71726         return x3 === 0 && y3 === 0;
71727       });
71728     }
71729     function resetOffset() {
71730       context.background().offset([0, 0]);
71731       updateValue();
71732     }
71733     function nudge(d2) {
71734       context.background().nudge(d2, context.map().zoom());
71735       updateValue();
71736     }
71737     function inputOffset() {
71738       var input = select_default2(this);
71739       var d2 = input.node().value;
71740       if (d2 === "") return resetOffset();
71741       d2 = d2.replace(/;/g, ",").split(",").map(function(n3) {
71742         return !isNaN(n3) && n3;
71743       });
71744       if (d2.length !== 2 || !d2[0] || !d2[1]) {
71745         input.classed("error", true);
71746         return;
71747       }
71748       context.background().offset(geoMetersToOffset(d2));
71749       updateValue();
71750     }
71751     function dragOffset(d3_event) {
71752       if (d3_event.button !== 0) return;
71753       var origin = [d3_event.clientX, d3_event.clientY];
71754       var pointerId = d3_event.pointerId || "mouse";
71755       context.container().append("div").attr("class", "nudge-surface");
71756       select_default2(window).on(_pointerPrefix + "move.drag-bg-offset", pointermove).on(_pointerPrefix + "up.drag-bg-offset", pointerup);
71757       if (_pointerPrefix === "pointer") {
71758         select_default2(window).on("pointercancel.drag-bg-offset", pointerup);
71759       }
71760       function pointermove(d3_event2) {
71761         if (pointerId !== (d3_event2.pointerId || "mouse")) return;
71762         var latest = [d3_event2.clientX, d3_event2.clientY];
71763         var d2 = [
71764           -(origin[0] - latest[0]) / 4,
71765           -(origin[1] - latest[1]) / 4
71766         ];
71767         origin = latest;
71768         nudge(d2);
71769       }
71770       function pointerup(d3_event2) {
71771         if (pointerId !== (d3_event2.pointerId || "mouse")) return;
71772         if (d3_event2.button !== 0) return;
71773         context.container().selectAll(".nudge-surface").remove();
71774         select_default2(window).on(".drag-bg-offset", null);
71775       }
71776     }
71777     function renderDisclosureContent(selection2) {
71778       var container = selection2.selectAll(".nudge-container").data([0]);
71779       var containerEnter = container.enter().append("div").attr("class", "nudge-container");
71780       containerEnter.append("div").attr("class", "nudge-instructions").call(_t.append("background.offset"));
71781       var nudgeWrapEnter = containerEnter.append("div").attr("class", "nudge-controls-wrap");
71782       var nudgeEnter = nudgeWrapEnter.append("div").attr("class", "nudge-outer-rect").on(_pointerPrefix + "down", dragOffset);
71783       nudgeEnter.append("div").attr("class", "nudge-inner-rect").append("input").attr("type", "text").attr("aria-label", _t("background.offset_label")).on("change", inputOffset);
71784       nudgeWrapEnter.append("div").selectAll("button").data(_directions).enter().append("button").attr("title", function(d2) {
71785         return _t("background.nudge.".concat(d2[0]));
71786       }).attr("class", function(d2) {
71787         return d2[0] + " nudge";
71788       }).on("click", function(d3_event, d2) {
71789         nudge(d2[1]);
71790       });
71791       nudgeWrapEnter.append("button").attr("title", _t("background.reset")).attr("class", "nudge-reset disabled").on("click", function(d3_event) {
71792         d3_event.preventDefault();
71793         resetOffset();
71794       }).call(svgIcon("#iD-icon-" + (_mainLocalizer.textDirection() === "rtl" ? "redo" : "undo")));
71795       updateValue();
71796     }
71797     context.background().on("change.backgroundOffset-update", updateValue);
71798     return section;
71799   }
71800
71801   // modules/ui/sections/overlay_list.js
71802   function uiSectionOverlayList(context) {
71803     var section = uiSection("overlay-list", context).label(() => _t.append("background.overlays")).disclosureContent(renderDisclosureContent);
71804     var _overlayList = select_default2(null);
71805     function setTooltips(selection2) {
71806       selection2.each(function(d2, i3, nodes) {
71807         var item = select_default2(this).select("label");
71808         var span = item.select("span");
71809         var placement = i3 < nodes.length / 2 ? "bottom" : "top";
71810         var description = d2.description();
71811         var isOverflowing = span.property("clientWidth") !== span.property("scrollWidth");
71812         item.call(uiTooltip().destroyAny);
71813         if (description || isOverflowing) {
71814           item.call(
71815             uiTooltip().placement(placement).title(() => description || d2.name())
71816           );
71817         }
71818       });
71819     }
71820     function updateLayerSelections(selection2) {
71821       function active(d2) {
71822         return context.background().showsLayer(d2);
71823       }
71824       selection2.selectAll("li").classed("active", active).call(setTooltips).selectAll("input").property("checked", active);
71825     }
71826     function chooseOverlay(d3_event, d2) {
71827       d3_event.preventDefault();
71828       context.background().toggleOverlayLayer(d2);
71829       _overlayList.call(updateLayerSelections);
71830       document.activeElement.blur();
71831     }
71832     function drawListItems(layerList, type2, change, filter2) {
71833       var sources = context.background().sources(context.map().extent(), context.map().zoom(), true).filter(filter2);
71834       var layerLinks = layerList.selectAll("li").data(sources, function(d2) {
71835         return d2.name();
71836       });
71837       layerLinks.exit().remove();
71838       var enter = layerLinks.enter().append("li");
71839       var label = enter.append("label");
71840       label.append("input").attr("type", type2).attr("name", "layers").on("change", change);
71841       label.append("span").each(function(d2) {
71842         d2.label()(select_default2(this));
71843       });
71844       layerList.selectAll("li").sort(sortSources);
71845       layerList.call(updateLayerSelections);
71846       function sortSources(a2, b3) {
71847         return a2.best() && !b3.best() ? -1 : b3.best() && !a2.best() ? 1 : descending(a2.area(), b3.area()) || ascending2(a2.name(), b3.name()) || 0;
71848       }
71849     }
71850     function renderDisclosureContent(selection2) {
71851       var container = selection2.selectAll(".layer-overlay-list").data([0]);
71852       _overlayList = container.enter().append("ul").attr("class", "layer-list layer-overlay-list").attr("dir", "auto").merge(container);
71853       _overlayList.call(drawListItems, "checkbox", chooseOverlay, function(d2) {
71854         return !d2.isHidden() && d2.overlay;
71855       });
71856     }
71857     context.map().on(
71858       "move.overlay_list",
71859       debounce_default(function() {
71860         window.requestIdleCallback(section.reRender);
71861       }, 1e3)
71862     );
71863     return section;
71864   }
71865
71866   // modules/ui/panes/background.js
71867   function uiPaneBackground(context) {
71868     var backgroundPane = uiPane("background", context).key(_t("background.key")).label(_t.append("background.title")).description(_t.append("background.description")).iconName("iD-icon-layers").sections([
71869       uiSectionBackgroundList(context),
71870       uiSectionOverlayList(context),
71871       uiSectionBackgroundDisplayOptions(context),
71872       uiSectionBackgroundOffset(context)
71873     ]);
71874     return backgroundPane;
71875   }
71876
71877   // modules/ui/panes/help.js
71878   function uiPaneHelp(context) {
71879     var docKeys = [
71880       ["help", [
71881         "welcome",
71882         "open_data_h",
71883         "open_data",
71884         "before_start_h",
71885         "before_start",
71886         "open_source_h",
71887         "open_source",
71888         "open_source_attribution",
71889         "open_source_help"
71890       ]],
71891       ["overview", [
71892         "navigation_h",
71893         "navigation_drag",
71894         "navigation_zoom",
71895         "features_h",
71896         "features",
71897         "nodes_ways"
71898       ]],
71899       ["editing", [
71900         "select_h",
71901         "select_left_click",
71902         "select_right_click",
71903         "select_space",
71904         "multiselect_h",
71905         "multiselect",
71906         "multiselect_shift_click",
71907         "multiselect_lasso",
71908         "undo_redo_h",
71909         "undo_redo",
71910         "save_h",
71911         "save",
71912         "save_validation",
71913         "upload_h",
71914         "upload",
71915         "backups_h",
71916         "backups",
71917         "keyboard_h",
71918         "keyboard"
71919       ]],
71920       ["feature_editor", [
71921         "intro",
71922         "definitions",
71923         "type_h",
71924         "type",
71925         "type_picker",
71926         "fields_h",
71927         "fields_all_fields",
71928         "fields_example",
71929         "fields_add_field",
71930         "tags_h",
71931         "tags_all_tags",
71932         "tags_resources"
71933       ]],
71934       ["points", [
71935         "intro",
71936         "add_point_h",
71937         "add_point",
71938         "add_point_finish",
71939         "move_point_h",
71940         "move_point",
71941         "delete_point_h",
71942         "delete_point",
71943         "delete_point_command"
71944       ]],
71945       ["lines", [
71946         "intro",
71947         "add_line_h",
71948         "add_line",
71949         "add_line_draw",
71950         "add_line_continue",
71951         "add_line_finish",
71952         "modify_line_h",
71953         "modify_line_dragnode",
71954         "modify_line_addnode",
71955         "connect_line_h",
71956         "connect_line",
71957         "connect_line_display",
71958         "connect_line_drag",
71959         "connect_line_tag",
71960         "disconnect_line_h",
71961         "disconnect_line_command",
71962         "move_line_h",
71963         "move_line_command",
71964         "move_line_connected",
71965         "delete_line_h",
71966         "delete_line",
71967         "delete_line_command"
71968       ]],
71969       ["areas", [
71970         "intro",
71971         "point_or_area_h",
71972         "point_or_area",
71973         "add_area_h",
71974         "add_area_command",
71975         "add_area_draw",
71976         "add_area_continue",
71977         "add_area_finish",
71978         "square_area_h",
71979         "square_area_command",
71980         "modify_area_h",
71981         "modify_area_dragnode",
71982         "modify_area_addnode",
71983         "delete_area_h",
71984         "delete_area",
71985         "delete_area_command"
71986       ]],
71987       ["relations", [
71988         "intro",
71989         "edit_relation_h",
71990         "edit_relation",
71991         "edit_relation_add",
71992         "edit_relation_delete",
71993         "maintain_relation_h",
71994         "maintain_relation",
71995         "relation_types_h",
71996         "multipolygon_h",
71997         "multipolygon",
71998         "multipolygon_create",
71999         "multipolygon_merge",
72000         "turn_restriction_h",
72001         "turn_restriction",
72002         "turn_restriction_field",
72003         "turn_restriction_editing",
72004         "route_h",
72005         "route",
72006         "route_add",
72007         "boundary_h",
72008         "boundary",
72009         "boundary_add"
72010       ]],
72011       ["operations", [
72012         "intro",
72013         "intro_2",
72014         "straighten",
72015         "orthogonalize",
72016         "circularize",
72017         "move",
72018         "rotate",
72019         "reflect",
72020         "continue",
72021         "reverse",
72022         "disconnect",
72023         "split",
72024         "extract",
72025         "merge",
72026         "delete",
72027         "downgrade",
72028         "copy_paste"
72029       ]],
72030       ["notes", [
72031         "intro",
72032         "add_note_h",
72033         "add_note",
72034         "place_note",
72035         "move_note",
72036         "update_note_h",
72037         "update_note",
72038         "save_note_h",
72039         "save_note"
72040       ]],
72041       ["imagery", [
72042         "intro",
72043         "sources_h",
72044         "choosing",
72045         "sources",
72046         "offsets_h",
72047         "offset",
72048         "offset_change"
72049       ]],
72050       ["streetlevel", [
72051         "intro",
72052         "using_h",
72053         "using",
72054         "photos",
72055         "viewer"
72056       ]],
72057       ["gps", [
72058         "intro",
72059         "survey",
72060         "using_h",
72061         "using",
72062         "tracing",
72063         "upload"
72064       ]],
72065       ["qa", [
72066         "intro",
72067         "tools_h",
72068         "tools",
72069         "issues_h",
72070         "issues"
72071       ]]
72072     ];
72073     var headings = {
72074       "help.help.open_data_h": 3,
72075       "help.help.before_start_h": 3,
72076       "help.help.open_source_h": 3,
72077       "help.overview.navigation_h": 3,
72078       "help.overview.features_h": 3,
72079       "help.editing.select_h": 3,
72080       "help.editing.multiselect_h": 3,
72081       "help.editing.undo_redo_h": 3,
72082       "help.editing.save_h": 3,
72083       "help.editing.upload_h": 3,
72084       "help.editing.backups_h": 3,
72085       "help.editing.keyboard_h": 3,
72086       "help.feature_editor.type_h": 3,
72087       "help.feature_editor.fields_h": 3,
72088       "help.feature_editor.tags_h": 3,
72089       "help.points.add_point_h": 3,
72090       "help.points.move_point_h": 3,
72091       "help.points.delete_point_h": 3,
72092       "help.lines.add_line_h": 3,
72093       "help.lines.modify_line_h": 3,
72094       "help.lines.connect_line_h": 3,
72095       "help.lines.disconnect_line_h": 3,
72096       "help.lines.move_line_h": 3,
72097       "help.lines.delete_line_h": 3,
72098       "help.areas.point_or_area_h": 3,
72099       "help.areas.add_area_h": 3,
72100       "help.areas.square_area_h": 3,
72101       "help.areas.modify_area_h": 3,
72102       "help.areas.delete_area_h": 3,
72103       "help.relations.edit_relation_h": 3,
72104       "help.relations.maintain_relation_h": 3,
72105       "help.relations.relation_types_h": 2,
72106       "help.relations.multipolygon_h": 3,
72107       "help.relations.turn_restriction_h": 3,
72108       "help.relations.route_h": 3,
72109       "help.relations.boundary_h": 3,
72110       "help.notes.add_note_h": 3,
72111       "help.notes.update_note_h": 3,
72112       "help.notes.save_note_h": 3,
72113       "help.imagery.sources_h": 3,
72114       "help.imagery.offsets_h": 3,
72115       "help.streetlevel.using_h": 3,
72116       "help.gps.using_h": 3,
72117       "help.qa.tools_h": 3,
72118       "help.qa.issues_h": 3
72119     };
72120     var docs = docKeys.map(function(key) {
72121       var helpkey = "help." + key[0];
72122       var helpPaneReplacements = { version: context.version };
72123       var text = key[1].reduce(function(all, part) {
72124         var subkey = helpkey + "." + part;
72125         var depth = headings[subkey];
72126         var hhh = depth ? Array(depth + 1).join("#") + " " : "";
72127         return all + hhh + helpHtml(subkey, helpPaneReplacements) + "\n\n";
72128       }, "");
72129       return {
72130         title: _t.html(helpkey + ".title"),
72131         content: k(text.trim()).replace(/<code>/g, "<kbd>").replace(/<\/code>/g, "</kbd>")
72132       };
72133     });
72134     var helpPane = uiPane("help", context).key(_t("help.key")).label(_t.append("help.title")).description(_t.append("help.title")).iconName("iD-icon-help");
72135     helpPane.renderContent = function(content) {
72136       function clickHelp(d2, i3) {
72137         var rtl = _mainLocalizer.textDirection() === "rtl";
72138         content.property("scrollTop", 0);
72139         helpPane.selection().select(".pane-heading h2").html(d2.title);
72140         body.html(d2.content);
72141         body.selectAll("a").attr("target", "_blank");
72142         menuItems.classed("selected", function(m3) {
72143           return m3.title === d2.title;
72144         });
72145         nav.html("");
72146         if (rtl) {
72147           nav.call(drawNext).call(drawPrevious);
72148         } else {
72149           nav.call(drawPrevious).call(drawNext);
72150         }
72151         function drawNext(selection2) {
72152           if (i3 < docs.length - 1) {
72153             var nextLink = selection2.append("a").attr("href", "#").attr("class", "next").on("click", function(d3_event) {
72154               d3_event.preventDefault();
72155               clickHelp(docs[i3 + 1], i3 + 1);
72156             });
72157             nextLink.append("span").html(docs[i3 + 1].title).call(svgIcon(rtl ? "#iD-icon-backward" : "#iD-icon-forward", "inline"));
72158           }
72159         }
72160         function drawPrevious(selection2) {
72161           if (i3 > 0) {
72162             var prevLink = selection2.append("a").attr("href", "#").attr("class", "previous").on("click", function(d3_event) {
72163               d3_event.preventDefault();
72164               clickHelp(docs[i3 - 1], i3 - 1);
72165             });
72166             prevLink.call(svgIcon(rtl ? "#iD-icon-forward" : "#iD-icon-backward", "inline")).append("span").html(docs[i3 - 1].title);
72167           }
72168         }
72169       }
72170       function clickWalkthrough(d3_event) {
72171         d3_event.preventDefault();
72172         if (context.inIntro()) return;
72173         context.container().call(uiIntro(context));
72174         context.ui().togglePanes();
72175       }
72176       function clickShortcuts(d3_event) {
72177         d3_event.preventDefault();
72178         context.container().call(context.ui().shortcuts, true);
72179       }
72180       var toc = content.append("ul").attr("class", "toc");
72181       var menuItems = toc.selectAll("li").data(docs).enter().append("li").append("a").attr("role", "button").attr("href", "#").html(function(d2) {
72182         return d2.title;
72183       }).on("click", function(d3_event, d2) {
72184         d3_event.preventDefault();
72185         clickHelp(d2, docs.indexOf(d2));
72186       });
72187       var shortcuts = toc.append("li").attr("class", "shortcuts").call(
72188         uiTooltip().title(() => _t.append("shortcuts.tooltip")).keys(["?"]).placement("top")
72189       ).append("a").attr("href", "#").on("click", clickShortcuts);
72190       shortcuts.append("div").call(_t.append("shortcuts.title"));
72191       var walkthrough = toc.append("li").attr("class", "walkthrough").append("a").attr("href", "#").on("click", clickWalkthrough);
72192       walkthrough.append("svg").attr("class", "logo logo-walkthrough").append("use").attr("xlink:href", "#iD-logo-walkthrough");
72193       walkthrough.append("div").call(_t.append("splash.walkthrough"));
72194       var helpContent = content.append("div").attr("class", "left-content");
72195       var body = helpContent.append("div").attr("class", "body");
72196       var nav = helpContent.append("div").attr("class", "nav");
72197       clickHelp(docs[0], 0);
72198     };
72199     return helpPane;
72200   }
72201
72202   // modules/ui/sections/validation_issues.js
72203   function uiSectionValidationIssues(id2, severity, context) {
72204     var _issues = [];
72205     var section = uiSection(id2, context).label(function() {
72206       if (!_issues) return "";
72207       var issueCountText = _issues.length > 1e3 ? "1000+" : String(_issues.length);
72208       return _t.append("inspector.title_count", { title: _t("issues." + severity + "s.list_title"), count: issueCountText });
72209     }).disclosureContent(renderDisclosureContent).shouldDisplay(function() {
72210       return _issues && _issues.length;
72211     });
72212     function getOptions() {
72213       return {
72214         what: corePreferences("validate-what") || "edited",
72215         where: corePreferences("validate-where") || "all"
72216       };
72217     }
72218     function reloadIssues() {
72219       _issues = context.validator().getIssuesBySeverity(getOptions())[severity];
72220     }
72221     function renderDisclosureContent(selection2) {
72222       var center = context.map().center();
72223       var graph = context.graph();
72224       var issues = _issues.map(function withDistance(issue) {
72225         var extent = issue.extent(graph);
72226         var dist = extent ? geoSphericalDistance(center, extent.center()) : 0;
72227         return Object.assign(issue, { dist });
72228       }).sort(function byDistance(a2, b3) {
72229         return a2.dist - b3.dist;
72230       });
72231       issues = issues.slice(0, 1e3);
72232       selection2.call(drawIssuesList, issues);
72233     }
72234     function drawIssuesList(selection2, issues) {
72235       var list = selection2.selectAll(".issues-list").data([0]);
72236       list = list.enter().append("ul").attr("class", "layer-list issues-list " + severity + "s-list").merge(list);
72237       var items = list.selectAll("li").data(issues, function(d2) {
72238         return d2.key;
72239       });
72240       items.exit().remove();
72241       var itemsEnter = items.enter().append("li").attr("class", function(d2) {
72242         return "issue severity-" + d2.severity;
72243       });
72244       var labelsEnter = itemsEnter.append("button").attr("class", "issue-label").on("click", function(d3_event, d2) {
72245         context.validator().focusIssue(d2);
72246       }).on("mouseover", function(d3_event, d2) {
72247         utilHighlightEntities(d2.entityIds, true, context);
72248       }).on("mouseout", function(d3_event, d2) {
72249         utilHighlightEntities(d2.entityIds, false, context);
72250       });
72251       var textEnter = labelsEnter.append("span").attr("class", "issue-text");
72252       textEnter.append("span").attr("class", "issue-icon").each(function(d2) {
72253         select_default2(this).call(svgIcon(validationIssue.ICONS[d2.severity]));
72254       });
72255       textEnter.append("span").attr("class", "issue-message");
72256       items = items.merge(itemsEnter).order();
72257       items.selectAll(".issue-message").text("").each(function(d2) {
72258         return d2.message(context)(select_default2(this));
72259       });
72260     }
72261     context.validator().on("validated.uiSectionValidationIssues" + id2, function() {
72262       window.requestIdleCallback(function() {
72263         reloadIssues();
72264         section.reRender();
72265       });
72266     });
72267     context.map().on(
72268       "move.uiSectionValidationIssues" + id2,
72269       debounce_default(function() {
72270         window.requestIdleCallback(function() {
72271           if (getOptions().where === "visible") {
72272             reloadIssues();
72273           }
72274           section.reRender();
72275         });
72276       }, 1e3)
72277     );
72278     return section;
72279   }
72280
72281   // modules/ui/sections/validation_options.js
72282   function uiSectionValidationOptions(context) {
72283     var section = uiSection("issues-options", context).content(renderContent);
72284     function renderContent(selection2) {
72285       var container = selection2.selectAll(".issues-options-container").data([0]);
72286       container = container.enter().append("div").attr("class", "issues-options-container").merge(container);
72287       var data = [
72288         { key: "what", values: ["edited", "all"] },
72289         { key: "where", values: ["visible", "all"] }
72290       ];
72291       var options = container.selectAll(".issues-option").data(data, function(d2) {
72292         return d2.key;
72293       });
72294       var optionsEnter = options.enter().append("div").attr("class", function(d2) {
72295         return "issues-option issues-option-" + d2.key;
72296       });
72297       optionsEnter.append("div").attr("class", "issues-option-title").html(function(d2) {
72298         return _t.html("issues.options." + d2.key + ".title");
72299       });
72300       var valuesEnter = optionsEnter.selectAll("label").data(function(d2) {
72301         return d2.values.map(function(val) {
72302           return { value: val, key: d2.key };
72303         });
72304       }).enter().append("label");
72305       valuesEnter.append("input").attr("type", "radio").attr("name", function(d2) {
72306         return "issues-option-" + d2.key;
72307       }).attr("value", function(d2) {
72308         return d2.value;
72309       }).property("checked", function(d2) {
72310         return getOptions()[d2.key] === d2.value;
72311       }).on("change", function(d3_event, d2) {
72312         updateOptionValue(d3_event, d2.key, d2.value);
72313       });
72314       valuesEnter.append("span").html(function(d2) {
72315         return _t.html("issues.options." + d2.key + "." + d2.value);
72316       });
72317     }
72318     function getOptions() {
72319       return {
72320         what: corePreferences("validate-what") || "edited",
72321         // 'all', 'edited'
72322         where: corePreferences("validate-where") || "all"
72323         // 'all', 'visible'
72324       };
72325     }
72326     function updateOptionValue(d3_event, d2, val) {
72327       if (!val && d3_event && d3_event.target) {
72328         val = d3_event.target.value;
72329       }
72330       corePreferences("validate-" + d2, val);
72331       context.validator().validate();
72332     }
72333     return section;
72334   }
72335
72336   // modules/ui/sections/validation_rules.js
72337   function uiSectionValidationRules(context) {
72338     var MINSQUARE = 0;
72339     var MAXSQUARE = 20;
72340     var DEFAULTSQUARE = 5;
72341     var section = uiSection("issues-rules", context).disclosureContent(renderDisclosureContent).label(() => _t.append("issues.rules.title"));
72342     var _ruleKeys = context.validator().getRuleKeys().filter(function(key) {
72343       return key !== "maprules";
72344     }).sort(function(key1, key2) {
72345       return _t("issues." + key1 + ".title") < _t("issues." + key2 + ".title") ? -1 : 1;
72346     });
72347     function renderDisclosureContent(selection2) {
72348       var container = selection2.selectAll(".issues-rulelist-container").data([0]);
72349       var containerEnter = container.enter().append("div").attr("class", "issues-rulelist-container");
72350       containerEnter.append("ul").attr("class", "layer-list issue-rules-list");
72351       var ruleLinks = containerEnter.append("div").attr("class", "issue-rules-links section-footer");
72352       ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
72353         d3_event.preventDefault();
72354         context.validator().disableRules(_ruleKeys);
72355       });
72356       ruleLinks.append("a").attr("class", "issue-rules-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
72357         d3_event.preventDefault();
72358         context.validator().disableRules([]);
72359       });
72360       container = container.merge(containerEnter);
72361       container.selectAll(".issue-rules-list").call(drawListItems, _ruleKeys, "checkbox", "rule", toggleRule, isRuleEnabled);
72362     }
72363     function drawListItems(selection2, data, type2, name, change, active) {
72364       var items = selection2.selectAll("li").data(data);
72365       items.exit().remove();
72366       var enter = items.enter().append("li");
72367       if (name === "rule") {
72368         enter.call(
72369           uiTooltip().title(function(d2) {
72370             return _t.append("issues." + d2 + ".tip");
72371           }).placement("top")
72372         );
72373       }
72374       var label = enter.append("label");
72375       label.append("input").attr("type", type2).attr("name", name).on("change", change);
72376       label.append("span").html(function(d2) {
72377         var params = {};
72378         if (d2 === "unsquare_way") {
72379           params.val = { html: '<span class="square-degrees"></span>' };
72380         }
72381         return _t.html("issues." + d2 + ".title", params);
72382       });
72383       items = items.merge(enter);
72384       items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
72385       var degStr = corePreferences("validate-square-degrees");
72386       if (degStr === null) {
72387         degStr = DEFAULTSQUARE.toString();
72388       }
72389       var span = items.selectAll(".square-degrees");
72390       var input = span.selectAll(".square-degrees-input").data([0]);
72391       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) {
72392         d3_event.preventDefault();
72393         d3_event.stopPropagation();
72394         this.select();
72395       }).on("keyup", function(d3_event) {
72396         if (d3_event.keyCode === 13) {
72397           this.blur();
72398           this.select();
72399         }
72400       }).on("blur", changeSquare).merge(input).property("value", degStr);
72401     }
72402     function changeSquare() {
72403       var input = select_default2(this);
72404       var degStr = utilGetSetValue(input).trim();
72405       var degNum = Number(degStr);
72406       if (!isFinite(degNum)) {
72407         degNum = DEFAULTSQUARE;
72408       } else if (degNum > MAXSQUARE) {
72409         degNum = MAXSQUARE;
72410       } else if (degNum < MINSQUARE) {
72411         degNum = MINSQUARE;
72412       }
72413       degNum = Math.round(degNum * 10) / 10;
72414       degStr = degNum.toString();
72415       input.property("value", degStr);
72416       corePreferences("validate-square-degrees", degStr);
72417       context.validator().revalidateUnsquare();
72418     }
72419     function isRuleEnabled(d2) {
72420       return context.validator().isRuleEnabled(d2);
72421     }
72422     function toggleRule(d3_event, d2) {
72423       context.validator().toggleRule(d2);
72424     }
72425     context.validator().on("validated.uiSectionValidationRules", function() {
72426       window.requestIdleCallback(section.reRender);
72427     });
72428     return section;
72429   }
72430
72431   // modules/ui/sections/validation_status.js
72432   function uiSectionValidationStatus(context) {
72433     var section = uiSection("issues-status", context).content(renderContent).shouldDisplay(function() {
72434       var issues = context.validator().getIssues(getOptions());
72435       return issues.length === 0;
72436     });
72437     function getOptions() {
72438       return {
72439         what: corePreferences("validate-what") || "edited",
72440         where: corePreferences("validate-where") || "all"
72441       };
72442     }
72443     function renderContent(selection2) {
72444       var box = selection2.selectAll(".box").data([0]);
72445       var boxEnter = box.enter().append("div").attr("class", "box");
72446       boxEnter.append("div").call(svgIcon("#iD-icon-apply", "pre-text"));
72447       var noIssuesMessage = boxEnter.append("span");
72448       noIssuesMessage.append("strong").attr("class", "message");
72449       noIssuesMessage.append("br");
72450       noIssuesMessage.append("span").attr("class", "details");
72451       renderIgnoredIssuesReset(selection2);
72452       setNoIssuesText(selection2);
72453     }
72454     function renderIgnoredIssuesReset(selection2) {
72455       var ignoredIssues = context.validator().getIssues({ what: "all", where: "all", includeDisabledRules: true, includeIgnored: "only" });
72456       var resetIgnored = selection2.selectAll(".reset-ignored").data(ignoredIssues.length ? [0] : []);
72457       resetIgnored.exit().remove();
72458       var resetIgnoredEnter = resetIgnored.enter().append("div").attr("class", "reset-ignored section-footer");
72459       resetIgnoredEnter.append("a").attr("href", "#");
72460       resetIgnored = resetIgnored.merge(resetIgnoredEnter);
72461       resetIgnored.select("a").html(_t.html("inspector.title_count", { title: { html: _t.html("issues.reset_ignored") }, count: ignoredIssues.length }));
72462       resetIgnored.on("click", function(d3_event) {
72463         d3_event.preventDefault();
72464         context.validator().resetIgnoredIssues();
72465       });
72466     }
72467     function setNoIssuesText(selection2) {
72468       var opts = getOptions();
72469       function checkForHiddenIssues(cases) {
72470         for (var type2 in cases) {
72471           var hiddenOpts = cases[type2];
72472           var hiddenIssues = context.validator().getIssues(hiddenOpts);
72473           if (hiddenIssues.length) {
72474             selection2.select(".box .details").html("").call(_t.append(
72475               "issues.no_issues.hidden_issues." + type2,
72476               { count: hiddenIssues.length.toString() }
72477             ));
72478             return;
72479           }
72480         }
72481         selection2.select(".box .details").html("").call(_t.append("issues.no_issues.hidden_issues.none"));
72482       }
72483       var messageType;
72484       if (opts.what === "edited" && opts.where === "visible") {
72485         messageType = "edits_in_view";
72486         checkForHiddenIssues({
72487           elsewhere: { what: "edited", where: "all" },
72488           everything_else: { what: "all", where: "visible" },
72489           disabled_rules: { what: "edited", where: "visible", includeDisabledRules: "only" },
72490           everything_else_elsewhere: { what: "all", where: "all" },
72491           disabled_rules_elsewhere: { what: "edited", where: "all", includeDisabledRules: "only" },
72492           ignored_issues: { what: "edited", where: "visible", includeIgnored: "only" },
72493           ignored_issues_elsewhere: { what: "edited", where: "all", includeIgnored: "only" }
72494         });
72495       } else if (opts.what === "edited" && opts.where === "all") {
72496         messageType = "edits";
72497         checkForHiddenIssues({
72498           everything_else: { what: "all", where: "all" },
72499           disabled_rules: { what: "edited", where: "all", includeDisabledRules: "only" },
72500           ignored_issues: { what: "edited", where: "all", includeIgnored: "only" }
72501         });
72502       } else if (opts.what === "all" && opts.where === "visible") {
72503         messageType = "everything_in_view";
72504         checkForHiddenIssues({
72505           elsewhere: { what: "all", where: "all" },
72506           disabled_rules: { what: "all", where: "visible", includeDisabledRules: "only" },
72507           disabled_rules_elsewhere: { what: "all", where: "all", includeDisabledRules: "only" },
72508           ignored_issues: { what: "all", where: "visible", includeIgnored: "only" },
72509           ignored_issues_elsewhere: { what: "all", where: "all", includeIgnored: "only" }
72510         });
72511       } else if (opts.what === "all" && opts.where === "all") {
72512         messageType = "everything";
72513         checkForHiddenIssues({
72514           disabled_rules: { what: "all", where: "all", includeDisabledRules: "only" },
72515           ignored_issues: { what: "all", where: "all", includeIgnored: "only" }
72516         });
72517       }
72518       if (opts.what === "edited" && context.history().difference().summary().length === 0) {
72519         messageType = "no_edits";
72520       }
72521       selection2.select(".box .message").html("").call(_t.append("issues.no_issues.message." + messageType));
72522     }
72523     context.validator().on("validated.uiSectionValidationStatus", function() {
72524       window.requestIdleCallback(section.reRender);
72525     });
72526     context.map().on(
72527       "move.uiSectionValidationStatus",
72528       debounce_default(function() {
72529         window.requestIdleCallback(section.reRender);
72530       }, 1e3)
72531     );
72532     return section;
72533   }
72534
72535   // modules/ui/panes/issues.js
72536   function uiPaneIssues(context) {
72537     var issuesPane = uiPane("issues", context).key(_t("issues.key")).label(_t.append("issues.title")).description(_t.append("issues.title")).iconName("iD-icon-alert").sections([
72538       uiSectionValidationOptions(context),
72539       uiSectionValidationStatus(context),
72540       uiSectionValidationIssues("issues-errors", "error", context),
72541       uiSectionValidationIssues("issues-warnings", "warning", context),
72542       uiSectionValidationIssues("issues-suggestions", "suggestion", context),
72543       uiSectionValidationRules(context)
72544     ]);
72545     return issuesPane;
72546   }
72547
72548   // modules/ui/settings/custom_data.js
72549   function uiSettingsCustomData(context) {
72550     var dispatch12 = dispatch_default("change");
72551     function render(selection2) {
72552       var dataLayer = context.layers().layer("data");
72553       var _origSettings = {
72554         fileList: dataLayer && dataLayer.fileList() || null,
72555         url: corePreferences("settings-custom-data-url")
72556       };
72557       var _currSettings = {
72558         fileList: dataLayer && dataLayer.fileList() || null
72559         // url: prefs('settings-custom-data-url')
72560       };
72561       var modal = uiConfirm(selection2).okButton();
72562       modal.classed("settings-modal settings-custom-data", true);
72563       modal.select(".modal-section.header").append("h3").call(_t.append("settings.custom_data.header"));
72564       var textSection = modal.select(".modal-section.message-text");
72565       textSection.append("pre").attr("class", "instructions-file").call(_t.append("settings.custom_data.file.instructions"));
72566       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) {
72567         var files = d3_event.target.files;
72568         if (files && files.length) {
72569           _currSettings.url = "";
72570           textSection.select(".field-url").property("value", "");
72571           _currSettings.fileList = files;
72572         } else {
72573           _currSettings.fileList = null;
72574         }
72575       });
72576       textSection.append("h4").call(_t.append("settings.custom_data.or"));
72577       textSection.append("pre").attr("class", "instructions-url").call(_t.append("settings.custom_data.url.instructions"));
72578       textSection.append("textarea").attr("class", "field-url").attr("placeholder", _t("settings.custom_data.url.placeholder")).call(utilNoAuto).property("value", _currSettings.url);
72579       var buttonSection = modal.select(".modal-section.buttons");
72580       buttonSection.insert("button", ".ok-button").attr("class", "button cancel-button secondary-action").call(_t.append("confirm.cancel"));
72581       buttonSection.select(".cancel-button").on("click.cancel", clickCancel);
72582       buttonSection.select(".ok-button").attr("disabled", isSaveDisabled).on("click.save", clickSave);
72583       function isSaveDisabled() {
72584         return null;
72585       }
72586       function clickCancel() {
72587         textSection.select(".field-url").property("value", _origSettings.url);
72588         corePreferences("settings-custom-data-url", _origSettings.url);
72589         this.blur();
72590         modal.close();
72591       }
72592       function clickSave() {
72593         _currSettings.url = textSection.select(".field-url").property("value").trim();
72594         if (_currSettings.url) {
72595           _currSettings.fileList = null;
72596         }
72597         if (_currSettings.fileList) {
72598           _currSettings.url = "";
72599         }
72600         corePreferences("settings-custom-data-url", _currSettings.url);
72601         this.blur();
72602         modal.close();
72603         dispatch12.call("change", this, _currSettings);
72604       }
72605     }
72606     return utilRebind(render, dispatch12, "on");
72607   }
72608
72609   // modules/ui/sections/data_layers.js
72610   function uiSectionDataLayers(context) {
72611     var settingsCustomData = uiSettingsCustomData(context).on("change", customChanged);
72612     var layers = context.layers();
72613     var section = uiSection("data-layers", context).label(() => _t.append("map_data.data_layers")).disclosureContent(renderDisclosureContent);
72614     function renderDisclosureContent(selection2) {
72615       var container = selection2.selectAll(".data-layer-container").data([0]);
72616       container.enter().append("div").attr("class", "data-layer-container").merge(container).call(drawOsmItems).call(drawQAItems).call(drawCustomDataItems).call(drawVectorItems).call(drawPanelItems);
72617     }
72618     function showsLayer(which) {
72619       var layer = layers.layer(which);
72620       if (layer) {
72621         return layer.enabled();
72622       }
72623       return false;
72624     }
72625     function setLayer(which, enabled) {
72626       var mode = context.mode();
72627       if (mode && /^draw/.test(mode.id)) return;
72628       var layer = layers.layer(which);
72629       if (layer) {
72630         layer.enabled(enabled);
72631         if (!enabled && (which === "osm" || which === "notes")) {
72632           context.enter(modeBrowse(context));
72633         }
72634       }
72635     }
72636     function toggleLayer(which) {
72637       setLayer(which, !showsLayer(which));
72638     }
72639     function drawOsmItems(selection2) {
72640       var osmKeys = ["osm", "notes"];
72641       var osmLayers = layers.all().filter(function(obj) {
72642         return osmKeys.indexOf(obj.id) !== -1;
72643       });
72644       var ul = selection2.selectAll(".layer-list-osm").data([0]);
72645       ul = ul.enter().append("ul").attr("class", "layer-list layer-list-osm").merge(ul);
72646       var li = ul.selectAll(".list-item").data(osmLayers);
72647       li.exit().remove();
72648       var liEnter = li.enter().append("li").attr("class", function(d2) {
72649         return "list-item list-item-" + d2.id;
72650       });
72651       var labelEnter = liEnter.append("label").each(function(d2) {
72652         if (d2.id === "osm") {
72653           select_default2(this).call(
72654             uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).keys([uiCmd("\u2325" + _t("area_fill.wireframe.key"))]).placement("bottom")
72655           );
72656         } else {
72657           select_default2(this).call(
72658             uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).placement("bottom")
72659           );
72660         }
72661       });
72662       labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
72663         toggleLayer(d2.id);
72664       });
72665       labelEnter.append("span").html(function(d2) {
72666         return _t.html("map_data.layers." + d2.id + ".title");
72667       });
72668       li.merge(liEnter).classed("active", function(d2) {
72669         return d2.layer.enabled();
72670       }).selectAll("input").property("checked", function(d2) {
72671         return d2.layer.enabled();
72672       });
72673     }
72674     function drawQAItems(selection2) {
72675       var qaKeys = ["osmose"];
72676       var qaLayers = layers.all().filter(function(obj) {
72677         return qaKeys.indexOf(obj.id) !== -1;
72678       });
72679       var ul = selection2.selectAll(".layer-list-qa").data([0]);
72680       ul = ul.enter().append("ul").attr("class", "layer-list layer-list-qa").merge(ul);
72681       var li = ul.selectAll(".list-item").data(qaLayers);
72682       li.exit().remove();
72683       var liEnter = li.enter().append("li").attr("class", function(d2) {
72684         return "list-item list-item-" + d2.id;
72685       });
72686       var labelEnter = liEnter.append("label").each(function(d2) {
72687         select_default2(this).call(
72688           uiTooltip().title(() => _t.append("map_data.layers." + d2.id + ".tooltip")).placement("bottom")
72689         );
72690       });
72691       labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
72692         toggleLayer(d2.id);
72693       });
72694       labelEnter.append("span").each(function(d2) {
72695         _t.append("map_data.layers." + d2.id + ".title")(select_default2(this));
72696       });
72697       li.merge(liEnter).classed("active", function(d2) {
72698         return d2.layer.enabled();
72699       }).selectAll("input").property("checked", function(d2) {
72700         return d2.layer.enabled();
72701       });
72702     }
72703     function drawVectorItems(selection2) {
72704       var dataLayer = layers.layer("data");
72705       var vtData = [
72706         {
72707           name: "Detroit Neighborhoods/Parks",
72708           src: "neighborhoods-parks",
72709           tooltip: "Neighborhood boundaries and parks as compiled by City of Detroit in concert with community groups.",
72710           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"
72711         },
72712         {
72713           name: "Detroit Composite POIs",
72714           src: "composite-poi",
72715           tooltip: "Fire Inspections, Business Licenses, and other public location data collated from the City of Detroit.",
72716           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"
72717         },
72718         {
72719           name: "Detroit All-The-Places POIs",
72720           src: "alltheplaces-poi",
72721           tooltip: "Public domain business location data created by web scrapers.",
72722           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"
72723         }
72724       ];
72725       var detroit = geoExtent([-83.5, 42.1], [-82.8, 42.5]);
72726       var showVectorItems = context.map().zoom() > 9 && detroit.contains(context.map().center());
72727       var container = selection2.selectAll(".vectortile-container").data(showVectorItems ? [0] : []);
72728       container.exit().remove();
72729       var containerEnter = container.enter().append("div").attr("class", "vectortile-container");
72730       containerEnter.append("h4").attr("class", "vectortile-header").text("Detroit Vector Tiles (Beta)");
72731       containerEnter.append("ul").attr("class", "layer-list layer-list-vectortile");
72732       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");
72733       container = container.merge(containerEnter);
72734       var ul = container.selectAll(".layer-list-vectortile");
72735       var li = ul.selectAll(".list-item").data(vtData);
72736       li.exit().remove();
72737       var liEnter = li.enter().append("li").attr("class", function(d2) {
72738         return "list-item list-item-" + d2.src;
72739       });
72740       var labelEnter = liEnter.append("label").each(function(d2) {
72741         select_default2(this).call(
72742           uiTooltip().title(d2.tooltip).placement("top")
72743         );
72744       });
72745       labelEnter.append("input").attr("type", "radio").attr("name", "vectortile").on("change", selectVTLayer);
72746       labelEnter.append("span").text(function(d2) {
72747         return d2.name;
72748       });
72749       li.merge(liEnter).classed("active", isVTLayerSelected).selectAll("input").property("checked", isVTLayerSelected);
72750       function isVTLayerSelected(d2) {
72751         return dataLayer && dataLayer.template() === d2.template;
72752       }
72753       function selectVTLayer(d3_event, d2) {
72754         corePreferences("settings-custom-data-url", d2.template);
72755         if (dataLayer) {
72756           dataLayer.template(d2.template, d2.src);
72757           dataLayer.enabled(true);
72758         }
72759       }
72760     }
72761     function drawCustomDataItems(selection2) {
72762       var dataLayer = layers.layer("data");
72763       var hasData = dataLayer && dataLayer.hasData();
72764       var showsData = hasData && dataLayer.enabled();
72765       var ul = selection2.selectAll(".layer-list-data").data(dataLayer ? [0] : []);
72766       ul.exit().remove();
72767       var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-data");
72768       var liEnter = ulEnter.append("li").attr("class", "list-item-data");
72769       var labelEnter = liEnter.append("label").call(
72770         uiTooltip().title(() => _t.append("map_data.layers.custom.tooltip")).placement("top")
72771       );
72772       labelEnter.append("input").attr("type", "checkbox").on("change", function() {
72773         toggleLayer("data");
72774       });
72775       labelEnter.append("span").call(_t.append("map_data.layers.custom.title"));
72776       liEnter.append("button").attr("class", "open-data-options").call(
72777         uiTooltip().title(() => _t.append("settings.custom_data.tooltip")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
72778       ).on("click", function(d3_event) {
72779         d3_event.preventDefault();
72780         editCustom();
72781       }).call(svgIcon("#iD-icon-more"));
72782       liEnter.append("button").attr("class", "zoom-to-data").call(
72783         uiTooltip().title(() => _t.append("map_data.layers.custom.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
72784       ).on("click", function(d3_event) {
72785         if (select_default2(this).classed("disabled")) return;
72786         d3_event.preventDefault();
72787         d3_event.stopPropagation();
72788         dataLayer.fitZoom();
72789       }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
72790       ul = ul.merge(ulEnter);
72791       ul.selectAll(".list-item-data").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
72792       ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
72793     }
72794     function editCustom() {
72795       context.container().call(settingsCustomData);
72796     }
72797     function customChanged(d2) {
72798       var dataLayer = layers.layer("data");
72799       if (d2 && d2.url) {
72800         dataLayer.url(d2.url);
72801       } else if (d2 && d2.fileList) {
72802         dataLayer.fileList(d2.fileList);
72803       }
72804     }
72805     function drawPanelItems(selection2) {
72806       var panelsListEnter = selection2.selectAll(".md-extras-list").data([0]).enter().append("ul").attr("class", "layer-list md-extras-list");
72807       var historyPanelLabelEnter = panelsListEnter.append("li").attr("class", "history-panel-toggle-item").append("label").call(
72808         uiTooltip().title(() => _t.append("map_data.history_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.history.key"))]).placement("top")
72809       );
72810       historyPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72811         d3_event.preventDefault();
72812         context.ui().info.toggle("history");
72813       });
72814       historyPanelLabelEnter.append("span").call(_t.append("map_data.history_panel.title"));
72815       var measurementPanelLabelEnter = panelsListEnter.append("li").attr("class", "measurement-panel-toggle-item").append("label").call(
72816         uiTooltip().title(() => _t.append("map_data.measurement_panel.tooltip")).keys([uiCmd("\u2318\u21E7" + _t("info_panels.measurement.key"))]).placement("top")
72817       );
72818       measurementPanelLabelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event) {
72819         d3_event.preventDefault();
72820         context.ui().info.toggle("measurement");
72821       });
72822       measurementPanelLabelEnter.append("span").call(_t.append("map_data.measurement_panel.title"));
72823     }
72824     context.layers().on("change.uiSectionDataLayers", section.reRender);
72825     context.map().on(
72826       "move.uiSectionDataLayers",
72827       debounce_default(function() {
72828         window.requestIdleCallback(section.reRender);
72829       }, 1e3)
72830     );
72831     return section;
72832   }
72833
72834   // modules/ui/sections/map_features.js
72835   function uiSectionMapFeatures(context) {
72836     var _features = context.features().keys();
72837     var section = uiSection("map-features", context).label(() => _t.append("map_data.map_features")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
72838     function renderDisclosureContent(selection2) {
72839       var container = selection2.selectAll(".layer-feature-list-container").data([0]);
72840       var containerEnter = container.enter().append("div").attr("class", "layer-feature-list-container");
72841       containerEnter.append("ul").attr("class", "layer-list layer-feature-list");
72842       var footer = containerEnter.append("div").attr("class", "feature-list-links section-footer");
72843       footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.disable_all")).on("click", function(d3_event) {
72844         d3_event.preventDefault();
72845         context.features().disableAll();
72846       });
72847       footer.append("a").attr("class", "feature-list-link").attr("role", "button").attr("href", "#").call(_t.append("issues.enable_all")).on("click", function(d3_event) {
72848         d3_event.preventDefault();
72849         context.features().enableAll();
72850       });
72851       container = container.merge(containerEnter);
72852       container.selectAll(".layer-feature-list").call(drawListItems, _features, "checkbox", "feature", clickFeature, showsFeature);
72853     }
72854     function drawListItems(selection2, data, type2, name, change, active) {
72855       var items = selection2.selectAll("li").data(data);
72856       items.exit().remove();
72857       var enter = items.enter().append("li").call(
72858         uiTooltip().title(function(d2) {
72859           var tip = _t.append(name + "." + d2 + ".tooltip");
72860           if (autoHiddenFeature(d2)) {
72861             var msg = showsLayer("osm") ? _t.append("map_data.autohidden") : _t.append("map_data.osmhidden");
72862             return (selection3) => {
72863               selection3.call(tip);
72864               selection3.append("div").call(msg);
72865             };
72866           }
72867           return tip;
72868         }).placement("top")
72869       );
72870       var label = enter.append("label");
72871       label.append("input").attr("type", type2).attr("name", name).on("change", change);
72872       label.append("span").html(function(d2) {
72873         return _t.html(name + "." + d2 + ".description");
72874       });
72875       items = items.merge(enter);
72876       items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", autoHiddenFeature);
72877     }
72878     function autoHiddenFeature(d2) {
72879       return context.features().autoHidden(d2);
72880     }
72881     function showsFeature(d2) {
72882       return context.features().enabled(d2);
72883     }
72884     function clickFeature(d3_event, d2) {
72885       context.features().toggle(d2);
72886     }
72887     function showsLayer(id2) {
72888       var layer = context.layers().layer(id2);
72889       return layer && layer.enabled();
72890     }
72891     context.features().on("change.map_features", section.reRender);
72892     return section;
72893   }
72894
72895   // modules/ui/sections/map_style_options.js
72896   function uiSectionMapStyleOptions(context) {
72897     var section = uiSection("fill-area", context).label(() => _t.append("map_data.style_options")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
72898     function renderDisclosureContent(selection2) {
72899       var container = selection2.selectAll(".layer-fill-list").data([0]);
72900       container.enter().append("ul").attr("class", "layer-list layer-fill-list").merge(container).call(drawListItems, context.map().areaFillOptions, "radio", "area_fill", setFill, isActiveFill);
72901       var container2 = selection2.selectAll(".layer-visual-diff-list").data([0]);
72902       container2.enter().append("ul").attr("class", "layer-list layer-visual-diff-list").merge(container2).call(drawListItems, ["highlight_edits"], "checkbox", "visual_diff", toggleHighlightEdited, function() {
72903         return context.surface().classed("highlight-edited");
72904       });
72905     }
72906     function drawListItems(selection2, data, type2, name, change, active) {
72907       var items = selection2.selectAll("li").data(data);
72908       items.exit().remove();
72909       var enter = items.enter().append("li").call(
72910         uiTooltip().title(function(d2) {
72911           return _t.append(name + "." + d2 + ".tooltip");
72912         }).keys(function(d2) {
72913           var key = d2 === "wireframe" ? _t("area_fill.wireframe.key") : null;
72914           if (d2 === "highlight_edits") key = _t("map_data.highlight_edits.key");
72915           return key ? [key] : null;
72916         }).placement("top")
72917       );
72918       var label = enter.append("label");
72919       label.append("input").attr("type", type2).attr("name", name).on("change", change);
72920       label.append("span").html(function(d2) {
72921         return _t.html(name + "." + d2 + ".description");
72922       });
72923       items = items.merge(enter);
72924       items.classed("active", active).selectAll("input").property("checked", active).property("indeterminate", false);
72925     }
72926     function isActiveFill(d2) {
72927       return context.map().activeAreaFill() === d2;
72928     }
72929     function toggleHighlightEdited(d3_event) {
72930       d3_event.preventDefault();
72931       context.map().toggleHighlightEdited();
72932     }
72933     function setFill(d3_event, d2) {
72934       context.map().activeAreaFill(d2);
72935     }
72936     context.map().on("changeHighlighting.ui_style, changeAreaFill.ui_style", section.reRender);
72937     return section;
72938   }
72939
72940   // modules/ui/settings/local_photos.js
72941   function uiSettingsLocalPhotos(context) {
72942     var dispatch12 = dispatch_default("change");
72943     var photoLayer = context.layers().layer("local-photos");
72944     var modal;
72945     function render(selection2) {
72946       modal = uiConfirm(selection2).okButton();
72947       modal.classed("settings-modal settings-local-photos", true);
72948       modal.select(".modal-section.header").append("h3").call(_t.append("local_photos.header"));
72949       modal.select(".modal-section.message-text").append("div").classed("local-photos", true);
72950       var instructionsSection = modal.select(".modal-section.message-text .local-photos").append("div").classed("instructions", true);
72951       instructionsSection.append("p").classed("instructions-local-photos", true).call(_t.append("local_photos.file.instructions"));
72952       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) {
72953         var files = d3_event.target.files;
72954         if (files && files.length) {
72955           photoList.select("ul").append("li").classed("placeholder", true).append("div");
72956           dispatch12.call("change", this, files);
72957         }
72958         d3_event.target.value = null;
72959       });
72960       instructionsSection.append("label").attr("for", "local-photo-files").classed("button", true).call(_t.append("local_photos.file.label"));
72961       const photoList = modal.select(".modal-section.message-text .local-photos").append("div").append("div").classed("list-local-photos", true);
72962       photoList.append("ul");
72963       updatePhotoList(photoList.select("ul"));
72964       context.layers().on("change", () => updatePhotoList(photoList.select("ul")));
72965     }
72966     function updatePhotoList(container) {
72967       var _a5;
72968       function locationUnavailable(d2) {
72969         return !(isArray_default(d2.loc) && isNumber_default(d2.loc[0]) && isNumber_default(d2.loc[1]));
72970       }
72971       container.selectAll("li.placeholder").remove();
72972       let selection2 = container.selectAll("li").data((_a5 = photoLayer.getPhotos()) != null ? _a5 : [], (d2) => d2.id);
72973       selection2.exit().remove();
72974       const selectionEnter = selection2.enter().append("li");
72975       selectionEnter.append("span").classed("filename", true);
72976       selectionEnter.append("button").classed("form-field-button zoom-to-data", true).attr("title", _t("local_photos.zoom_single")).call(svgIcon("#iD-icon-framed-dot"));
72977       selectionEnter.append("button").classed("form-field-button no-geolocation", true).call(svgIcon("#iD-icon-alert")).call(
72978         uiTooltip().title(() => _t.append("local_photos.no_geolocation.tooltip")).placement("left")
72979       );
72980       selectionEnter.append("button").classed("form-field-button remove", true).attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
72981       selection2 = selection2.merge(selectionEnter);
72982       selection2.classed("invalid", locationUnavailable);
72983       selection2.select("span.filename").text((d2) => d2.name).attr("title", (d2) => d2.name);
72984       selection2.select("span.filename").on("click", (d3_event, d2) => {
72985         photoLayer.openPhoto(d3_event, d2, false);
72986       });
72987       selection2.select("button.zoom-to-data").on("click", (d3_event, d2) => {
72988         photoLayer.openPhoto(d3_event, d2, true);
72989       });
72990       selection2.select("button.remove").on("click", (d3_event, d2) => {
72991         photoLayer.removePhoto(d2.id);
72992         updatePhotoList(container);
72993       });
72994     }
72995     return utilRebind(render, dispatch12, "on");
72996   }
72997
72998   // modules/ui/sections/photo_overlays.js
72999   function uiSectionPhotoOverlays(context) {
73000     let _savedLayers = [];
73001     let _layersHidden = false;
73002     const _streetLayerIDs = ["streetside", "mapillary", "mapillary-map-features", "mapillary-signs", "kartaview", "mapilio", "vegbilder", "panoramax"];
73003     var settingsLocalPhotos = uiSettingsLocalPhotos(context).on("change", localPhotosChanged);
73004     var layers = context.layers();
73005     var section = uiSection("photo-overlays", context).label(() => _t.append("photo_overlays.title")).disclosureContent(renderDisclosureContent).expandedByDefault(false);
73006     const photoDates = {};
73007     const now3 = +/* @__PURE__ */ new Date();
73008     function renderDisclosureContent(selection2) {
73009       var container = selection2.selectAll(".photo-overlay-container").data([0]);
73010       container.enter().append("div").attr("class", "photo-overlay-container").merge(container).call(drawPhotoItems).call(drawPhotoTypeItems).call(drawDateSlider).call(drawUsernameFilter).call(drawLocalPhotos);
73011     }
73012     function drawPhotoItems(selection2) {
73013       var photoKeys = context.photos().overlayLayerIDs();
73014       var photoLayers = layers.all().filter(function(obj) {
73015         return photoKeys.indexOf(obj.id) !== -1;
73016       });
73017       var data = photoLayers.filter(function(obj) {
73018         if (!obj.layer.supported()) return false;
73019         if (layerEnabled(obj)) return true;
73020         if (typeof obj.layer.validHere === "function") {
73021           return obj.layer.validHere(context.map().extent(), context.map().zoom());
73022         }
73023         return true;
73024       });
73025       function layerSupported(d2) {
73026         return d2.layer && d2.layer.supported();
73027       }
73028       function layerEnabled(d2) {
73029         return layerSupported(d2) && (d2.layer.enabled() || _savedLayers.includes(d2.id));
73030       }
73031       function layerRendered(d2) {
73032         var _a5, _b3, _c2;
73033         return (_c2 = (_b3 = (_a5 = d2.layer).rendered) == null ? void 0 : _b3.call(_a5, context.map().zoom())) != null ? _c2 : true;
73034       }
73035       var ul = selection2.selectAll(".layer-list-photos").data([0]);
73036       ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photos").merge(ul);
73037       var li = ul.selectAll(".list-item-photos").data(data, (d2) => d2.id);
73038       li.exit().remove();
73039       var liEnter = li.enter().append("li").attr("class", function(d2) {
73040         var classes = "list-item-photos list-item-" + d2.id;
73041         if (d2.id === "mapillary-signs" || d2.id === "mapillary-map-features") {
73042           classes += " indented";
73043         }
73044         return classes;
73045       });
73046       var labelEnter = liEnter.append("label").each(function(d2) {
73047         var titleID;
73048         if (d2.id === "mapillary-signs") titleID = "mapillary.signs.tooltip";
73049         else if (d2.id === "mapillary") titleID = "mapillary_images.tooltip";
73050         else if (d2.id === "kartaview") titleID = "kartaview_images.tooltip";
73051         else titleID = d2.id.replace(/-/g, "_") + ".tooltip";
73052         select_default2(this).call(
73053           uiTooltip().title(() => {
73054             if (!layerRendered(d2)) {
73055               return _t.append("street_side.minzoom_tooltip");
73056             } else {
73057               return _t.append(titleID);
73058             }
73059           }).placement("top")
73060         );
73061       });
73062       labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73063         toggleLayer(d2.id);
73064       });
73065       labelEnter.append("span").html(function(d2) {
73066         var id2 = d2.id;
73067         if (id2 === "mapillary-signs") id2 = "photo_overlays.traffic_signs";
73068         return _t.html(id2.replace(/-/g, "_") + ".title");
73069       });
73070       li.merge(liEnter).classed("active", layerEnabled).selectAll("input").property("disabled", (d2) => !layerRendered(d2)).property("checked", layerEnabled);
73071     }
73072     function drawPhotoTypeItems(selection2) {
73073       var data = context.photos().allPhotoTypes();
73074       function typeEnabled(d2) {
73075         return context.photos().showsPhotoType(d2);
73076       }
73077       var ul = selection2.selectAll(".layer-list-photo-types").data([0]);
73078       ul.exit().remove();
73079       ul = ul.enter().append("ul").attr("class", "layer-list layer-list-photo-types").merge(ul);
73080       var li = ul.selectAll(".list-item-photo-types").data(context.photos().shouldFilterByPhotoType() ? data : []);
73081       li.exit().remove();
73082       var liEnter = li.enter().append("li").attr("class", function(d2) {
73083         return "list-item-photo-types list-item-" + d2;
73084       });
73085       var labelEnter = liEnter.append("label").each(function(d2) {
73086         select_default2(this).call(
73087           uiTooltip().title(() => _t.append("photo_overlays.photo_type." + d2 + ".tooltip")).placement("top")
73088         );
73089       });
73090       labelEnter.append("input").attr("type", "checkbox").on("change", function(d3_event, d2) {
73091         context.photos().togglePhotoType(d2, true);
73092       });
73093       labelEnter.append("span").html(function(d2) {
73094         return _t.html("photo_overlays.photo_type." + d2 + ".title");
73095       });
73096       li.merge(liEnter).classed("active", typeEnabled).selectAll("input").property("checked", typeEnabled);
73097     }
73098     function drawDateSlider(selection2) {
73099       var ul = selection2.selectAll(".layer-list-date-slider").data([0]);
73100       ul.exit().remove();
73101       ul = ul.enter().append("ul").attr("class", "layer-list layer-list-date-slider").merge(ul);
73102       var li = ul.selectAll(".list-item-date-slider").data(context.photos().shouldFilterDateBySlider() ? ["date-slider"] : []);
73103       li.exit().remove();
73104       var liEnter = li.enter().append("li").attr("class", "list-item-date-slider");
73105       var labelEnter = liEnter.append("label").each(function() {
73106         select_default2(this).call(
73107           uiTooltip().title(() => _t.append("photo_overlays.age_slider_filter.tooltip")).placement("top")
73108         );
73109       });
73110       labelEnter.append("span").attr("class", "dateSliderSpan").call(_t.append("photo_overlays.age_slider_filter.title"));
73111       let sliderWrap = labelEnter.append("div").attr("class", "slider-wrap");
73112       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() {
73113         let value = select_default2(this).property("value");
73114         setYearFilter(value, true, "from");
73115       });
73116       selection2.select("input.from-date").each(function() {
73117         this.value = dateSliderValue("from");
73118       });
73119       sliderWrap.append("div").attr("class", "date-slider-label");
73120       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() {
73121         let value = select_default2(this).property("value");
73122         setYearFilter(1 - value, true, "to");
73123       });
73124       selection2.select("input.to-date").each(function() {
73125         this.value = 1 - dateSliderValue("to");
73126       });
73127       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", {
73128         date: new Date(now3 - Math.pow(dateSliderValue("from"), 1.45) * 10 * 365.25 * 86400 * 1e3).toLocaleDateString(_mainLocalizer.localeCode())
73129       }));
73130       sliderWrap.append("datalist").attr("class", "date-slider-values").attr("id", "photo-overlay-date-range");
73131       sliderWrap.append("datalist").attr("class", "date-slider-values").attr("id", "photo-overlay-date-range-inverted");
73132       const dateTicks = /* @__PURE__ */ new Set();
73133       for (const dates of Object.values(photoDates)) {
73134         dates.forEach((date) => {
73135           dateTicks.add(Math.round(1e3 * Math.pow((now3 - date) / (10 * 365.25 * 86400 * 1e3), 1 / 1.45)) / 1e3);
73136         });
73137       }
73138       const ticks2 = selection2.select("datalist#photo-overlay-date-range").selectAll("option").data([...dateTicks].concat([1, 0]));
73139       ticks2.exit().remove();
73140       ticks2.enter().append("option").merge(ticks2).attr("value", (d2) => d2);
73141       const ticksInverted = selection2.select("datalist#photo-overlay-date-range-inverted").selectAll("option").data([...dateTicks].concat([1, 0]));
73142       ticksInverted.exit().remove();
73143       ticksInverted.enter().append("option").merge(ticksInverted).attr("value", (d2) => 1 - d2);
73144       li.merge(liEnter).classed("active", filterEnabled);
73145       function filterEnabled() {
73146         return !!context.photos().fromDate();
73147       }
73148     }
73149     function dateSliderValue(which) {
73150       const val = which === "from" ? context.photos().fromDate() : context.photos().toDate();
73151       if (val) {
73152         const date = +new Date(val);
73153         return Math.pow((now3 - date) / (10 * 365.25 * 86400 * 1e3), 1 / 1.45);
73154       } else return which === "from" ? 1 : 0;
73155     }
73156     function setYearFilter(value, updateUrl, which) {
73157       value = +value + (which === "from" ? 1e-3 : -1e-3);
73158       if (value < 1 && value > 0) {
73159         const date = new Date(now3 - Math.pow(value, 1.45) * 10 * 365.25 * 86400 * 1e3).toISOString().substring(0, 10);
73160         context.photos().setDateFilter("".concat(which, "Date"), date, updateUrl);
73161       } else {
73162         context.photos().setDateFilter("".concat(which, "Date"), null, updateUrl);
73163       }
73164     }
73165     ;
73166     function drawUsernameFilter(selection2) {
73167       function filterEnabled() {
73168         return context.photos().usernames();
73169       }
73170       var ul = selection2.selectAll(".layer-list-username-filter").data([0]);
73171       ul.exit().remove();
73172       ul = ul.enter().append("ul").attr("class", "layer-list layer-list-username-filter").merge(ul);
73173       var li = ul.selectAll(".list-item-username-filter").data(context.photos().shouldFilterByUsername() ? ["username-filter"] : []);
73174       li.exit().remove();
73175       var liEnter = li.enter().append("li").attr("class", "list-item-username-filter");
73176       var labelEnter = liEnter.append("label").each(function() {
73177         select_default2(this).call(
73178           uiTooltip().title(() => _t.append("photo_overlays.username_filter.tooltip")).placement("top")
73179         );
73180       });
73181       labelEnter.append("span").call(_t.append("photo_overlays.username_filter.title"));
73182       labelEnter.append("input").attr("type", "text").attr("class", "list-item-input").call(utilNoAuto).property("value", usernameValue).on("change", function() {
73183         var value = select_default2(this).property("value");
73184         context.photos().setUsernameFilter(value, true);
73185         select_default2(this).property("value", usernameValue);
73186       });
73187       li.merge(liEnter).classed("active", filterEnabled);
73188       function usernameValue() {
73189         var usernames = context.photos().usernames();
73190         if (usernames) return usernames.join("; ");
73191         return usernames;
73192       }
73193     }
73194     function toggleLayer(which) {
73195       setLayer(which, !showsLayer(which));
73196     }
73197     function showsLayer(which) {
73198       var layer = layers.layer(which);
73199       if (layer) {
73200         return layer.enabled();
73201       }
73202       return false;
73203     }
73204     function setLayer(which, enabled) {
73205       var layer = layers.layer(which);
73206       if (layer) {
73207         layer.enabled(enabled);
73208       }
73209     }
73210     function drawLocalPhotos(selection2) {
73211       var photoLayer = layers.layer("local-photos");
73212       var hasData = photoLayer && photoLayer.hasData();
73213       var showsData = hasData && photoLayer.enabled();
73214       var ul = selection2.selectAll(".layer-list-local-photos").data(photoLayer ? [0] : []);
73215       ul.exit().remove();
73216       var ulEnter = ul.enter().append("ul").attr("class", "layer-list layer-list-local-photos");
73217       var localPhotosEnter = ulEnter.append("li").attr("class", "list-item-local-photos");
73218       var localPhotosLabelEnter = localPhotosEnter.append("label").call(uiTooltip().title(() => _t.append("local_photos.tooltip")));
73219       localPhotosLabelEnter.append("input").attr("type", "checkbox").on("change", function() {
73220         toggleLayer("local-photos");
73221       });
73222       localPhotosLabelEnter.call(_t.append("local_photos.header"));
73223       localPhotosEnter.append("button").attr("class", "open-data-options").call(
73224         uiTooltip().title(() => _t.append("local_photos.tooltip_edit")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
73225       ).on("click", function(d3_event) {
73226         d3_event.preventDefault();
73227         editLocalPhotos();
73228       }).call(svgIcon("#iD-icon-more"));
73229       localPhotosEnter.append("button").attr("class", "zoom-to-data").call(
73230         uiTooltip().title(() => _t.append("local_photos.zoom")).placement(_mainLocalizer.textDirection() === "rtl" ? "right" : "left")
73231       ).on("click", function(d3_event) {
73232         if (select_default2(this).classed("disabled")) return;
73233         d3_event.preventDefault();
73234         d3_event.stopPropagation();
73235         photoLayer.fitZoom();
73236       }).call(svgIcon("#iD-icon-framed-dot", "monochrome"));
73237       ul = ul.merge(ulEnter);
73238       ul.selectAll(".list-item-local-photos").classed("active", showsData).selectAll("label").classed("deemphasize", !hasData).selectAll("input").property("disabled", !hasData).property("checked", showsData);
73239       ul.selectAll("button.zoom-to-data").classed("disabled", !hasData);
73240     }
73241     function editLocalPhotos() {
73242       context.container().call(settingsLocalPhotos);
73243     }
73244     function localPhotosChanged(d2) {
73245       var localPhotosLayer = layers.layer("local-photos");
73246       localPhotosLayer.fileList(d2);
73247     }
73248     function toggleStreetSide() {
73249       let layerContainer = select_default2(".photo-overlay-container");
73250       if (!_layersHidden) {
73251         layers.all().forEach((d2) => {
73252           if (_streetLayerIDs.includes(d2.id)) {
73253             if (showsLayer(d2.id)) _savedLayers.push(d2.id);
73254             setLayer(d2.id, false);
73255           }
73256         });
73257         layerContainer.classed("disabled-panel", true);
73258       } else {
73259         _savedLayers.forEach((d2) => {
73260           setLayer(d2, true);
73261         });
73262         _savedLayers = [];
73263         layerContainer.classed("disabled-panel", false);
73264       }
73265       _layersHidden = !_layersHidden;
73266     }
73267     ;
73268     context.layers().on("change.uiSectionPhotoOverlays", section.reRender);
73269     context.photos().on("change.uiSectionPhotoOverlays", section.reRender);
73270     context.layers().on("photoDatesChanged.uiSectionPhotoOverlays", function(service, dates) {
73271       photoDates[service] = dates.map((date) => +new Date(date));
73272       section.reRender();
73273     });
73274     context.keybinding().on("\u21E7P", toggleStreetSide);
73275     context.map().on(
73276       "move.photo_overlays",
73277       debounce_default(function() {
73278         window.requestIdleCallback(section.reRender);
73279       }, 1e3)
73280     );
73281     return section;
73282   }
73283
73284   // modules/ui/panes/map_data.js
73285   function uiPaneMapData(context) {
73286     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([
73287       uiSectionDataLayers(context),
73288       uiSectionPhotoOverlays(context),
73289       uiSectionMapStyleOptions(context),
73290       uiSectionMapFeatures(context)
73291     ]);
73292     return mapDataPane;
73293   }
73294
73295   // modules/ui/panes/preferences.js
73296   function uiPanePreferences(context) {
73297     let preferencesPane = uiPane("preferences", context).key(_t("preferences.key")).label(_t.append("preferences.title")).description(_t.append("preferences.description")).iconName("fas-user-cog").sections([
73298       uiSectionPrivacy(context)
73299     ]);
73300     return preferencesPane;
73301   }
73302
73303   // modules/ui/init.js
73304   function uiInit(context) {
73305     var _initCounter = 0;
73306     var _needWidth = {};
73307     var _lastPointerType;
73308     var overMap;
73309     function render(container) {
73310       container.on("click.ui", function(d3_event) {
73311         if (d3_event.button !== 0) return;
73312         if (!d3_event.composedPath) return;
73313         var isOkayTarget = d3_event.composedPath().some(function(node) {
73314           return node.nodeType === 1 && // clicking <input> focuses it and/or changes a value
73315           (node.nodeName === "INPUT" || // clicking <label> affects its <input> by default
73316           node.nodeName === "LABEL" || // clicking <a> opens a hyperlink by default
73317           node.nodeName === "A");
73318         });
73319         if (isOkayTarget) return;
73320         d3_event.preventDefault();
73321       });
73322       var detected = utilDetect();
73323       if ("GestureEvent" in window && // Listening for gesture events on iOS 13.4+ breaks double-tapping,
73324       // but we only need to do this on desktop Safari anyway. – #7694
73325       !detected.isMobileWebKit) {
73326         container.on("gesturestart.ui gesturechange.ui gestureend.ui", function(d3_event) {
73327           d3_event.preventDefault();
73328         });
73329       }
73330       if ("PointerEvent" in window) {
73331         select_default2(window).on("pointerdown.ui pointerup.ui", function(d3_event) {
73332           var pointerType = d3_event.pointerType || "mouse";
73333           if (_lastPointerType !== pointerType) {
73334             _lastPointerType = pointerType;
73335             container.attr("pointer", pointerType);
73336           }
73337         }, true);
73338       } else {
73339         _lastPointerType = "mouse";
73340         container.attr("pointer", "mouse");
73341       }
73342       container.attr("lang", _mainLocalizer.localeCode()).attr("dir", _mainLocalizer.textDirection());
73343       container.call(uiFullScreen(context));
73344       var map2 = context.map();
73345       map2.redrawEnable(false);
73346       map2.on("hitMinZoom.ui", function() {
73347         ui.flash.iconName("#iD-icon-no").label(_t.append("cannot_zoom"))();
73348       });
73349       container.append("svg").attr("id", "ideditor-defs").call(ui.svgDefs);
73350       container.append("div").attr("class", "sidebar").call(ui.sidebar);
73351       var content = container.append("div").attr("class", "main-content active");
73352       content.append("div").attr("class", "top-toolbar-wrap").append("div").attr("class", "top-toolbar fillD").call(uiTopToolbar(context));
73353       content.append("div").attr("class", "main-map").attr("dir", "ltr").call(map2);
73354       overMap = content.append("div").attr("class", "over-map");
73355       overMap.append("div").attr("class", "select-trap").text("t");
73356       overMap.call(uiMapInMap(context)).call(uiNotice(context));
73357       overMap.append("div").attr("class", "spinner").call(uiSpinner(context));
73358       var controlsWrap = overMap.append("div").attr("class", "map-controls-wrap");
73359       var controls = controlsWrap.append("div").attr("class", "map-controls");
73360       controls.append("div").attr("class", "map-control zoombuttons").call(uiZoom(context));
73361       controls.append("div").attr("class", "map-control zoom-to-selection-control").call(uiZoomToSelection(context));
73362       controls.append("div").attr("class", "map-control geolocate-control").call(uiGeolocate(context));
73363       controlsWrap.on("wheel.mapControls", function(d3_event) {
73364         if (!d3_event.deltaX) {
73365           controlsWrap.node().scrollTop += d3_event.deltaY;
73366         }
73367       });
73368       var panes = overMap.append("div").attr("class", "map-panes");
73369       var uiPanes = [
73370         uiPaneBackground(context),
73371         uiPaneMapData(context),
73372         uiPaneIssues(context),
73373         uiPanePreferences(context),
73374         uiPaneHelp(context)
73375       ];
73376       uiPanes.forEach(function(pane) {
73377         controls.append("div").attr("class", "map-control map-pane-control " + pane.id + "-control").call(pane.renderToggleButton);
73378         panes.call(pane.renderPane);
73379       });
73380       ui.info = uiInfo(context);
73381       overMap.call(ui.info);
73382       overMap.append("div").attr("class", "photoviewer").classed("al", true).classed("hide", true).call(ui.photoviewer);
73383       overMap.append("div").attr("class", "attribution-wrap").attr("dir", "ltr").call(uiAttribution(context));
73384       var about = content.append("div").attr("class", "map-footer");
73385       about.append("div").attr("class", "api-status").call(uiStatus(context));
73386       var footer = about.append("div").attr("class", "map-footer-bar fillD");
73387       footer.append("div").attr("class", "flash-wrap footer-hide");
73388       var footerWrap = footer.append("div").attr("class", "main-footer-wrap footer-show");
73389       footerWrap.append("div").attr("class", "scale-block").call(uiScale(context));
73390       var aboutList = footerWrap.append("div").attr("class", "info-block").append("ul").attr("class", "map-footer-list");
73391       aboutList.append("li").attr("class", "user-list").call(uiContributors(context));
73392       var apiConnections = context.connection().apiConnections();
73393       if (apiConnections && apiConnections.length > 1) {
73394         aboutList.append("li").attr("class", "source-switch").call(
73395           uiSourceSwitch(context).keys(apiConnections)
73396         );
73397       }
73398       aboutList.append("li").attr("class", "issues-info").call(uiIssuesInfo(context));
73399       aboutList.append("li").attr("class", "feature-warning").call(uiFeatureInfo(context));
73400       var issueLinks = aboutList.append("li");
73401       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"));
73402       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"));
73403       aboutList.append("li").attr("class", "version").call(uiVersion(context));
73404       if (!context.embed()) {
73405         aboutList.call(uiAccount(context));
73406       }
73407       ui.onResize();
73408       map2.redrawEnable(true);
73409       ui.hash = behaviorHash(context);
73410       ui.hash();
73411       if (!ui.hash.hadLocation) {
73412         map2.centerZoom([0, 0], 2);
73413       }
73414       window.onbeforeunload = function() {
73415         return context.save();
73416       };
73417       window.onunload = function() {
73418         context.history().unlock();
73419       };
73420       select_default2(window).on("resize.editor", function() {
73421         ui.onResize();
73422       });
73423       var panPixels = 80;
73424       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) {
73425         if (d3_event) {
73426           d3_event.stopImmediatePropagation();
73427           d3_event.preventDefault();
73428         }
73429         var previousBackground = context.background().findSource(corePreferences("background-last-used-toggle"));
73430         if (previousBackground) {
73431           var currentBackground = context.background().baseLayerSource();
73432           corePreferences("background-last-used-toggle", currentBackground.id);
73433           corePreferences("background-last-used", previousBackground.id);
73434           context.background().baseLayerSource(previousBackground);
73435         }
73436       }).on(_t("area_fill.wireframe.key"), function toggleWireframe(d3_event) {
73437         d3_event.preventDefault();
73438         d3_event.stopPropagation();
73439         context.map().toggleWireframe();
73440       }).on(uiCmd("\u2325" + _t("area_fill.wireframe.key")), function toggleOsmData(d3_event) {
73441         d3_event.preventDefault();
73442         d3_event.stopPropagation();
73443         var mode = context.mode();
73444         if (mode && /^draw/.test(mode.id)) return;
73445         var layer = context.layers().layer("osm");
73446         if (layer) {
73447           layer.enabled(!layer.enabled());
73448           if (!layer.enabled()) {
73449             context.enter(modeBrowse(context));
73450           }
73451         }
73452       }).on(_t("map_data.highlight_edits.key"), function toggleHighlightEdited(d3_event) {
73453         d3_event.preventDefault();
73454         context.map().toggleHighlightEdited();
73455       });
73456       context.on("enter.editor", function(entered) {
73457         container.classed("mode-" + entered.id, true);
73458       }).on("exit.editor", function(exited) {
73459         container.classed("mode-" + exited.id, false);
73460       });
73461       context.enter(modeBrowse(context));
73462       if (!_initCounter++) {
73463         if (!ui.hash.startWalkthrough) {
73464           context.container().call(uiSplash(context)).call(uiRestore(context));
73465         }
73466         context.container().call(ui.shortcuts);
73467       }
73468       var osm = context.connection();
73469       var auth = uiLoading(context).message(_t.html("loading_auth")).blocking(true);
73470       if (osm && auth) {
73471         osm.on("authLoading.ui", function() {
73472           context.container().call(auth);
73473         }).on("authDone.ui", function() {
73474           auth.close();
73475         });
73476       }
73477       _initCounter++;
73478       if (ui.hash.startWalkthrough) {
73479         ui.hash.startWalkthrough = false;
73480         context.container().call(uiIntro(context));
73481       }
73482       function pan(d2) {
73483         return function(d3_event) {
73484           if (d3_event.shiftKey) return;
73485           if (context.container().select(".combobox").size()) return;
73486           d3_event.preventDefault();
73487           context.map().pan(d2, 100);
73488         };
73489       }
73490     }
73491     let ui = {};
73492     let _loadPromise;
73493     ui.ensureLoaded = () => {
73494       if (_loadPromise) return _loadPromise;
73495       return _loadPromise = Promise.all([
73496         // must have strings and presets before loading the UI
73497         _mainLocalizer.ensureLoaded(),
73498         _mainPresetIndex.ensureLoaded()
73499       ]).then(() => {
73500         if (!context.container().empty()) render(context.container());
73501       }).catch((err) => console.error(err));
73502     };
73503     ui.restart = function() {
73504       context.keybinding().clear();
73505       _loadPromise = null;
73506       context.container().selectAll("*").remove();
73507       ui.ensureLoaded();
73508     };
73509     ui.lastPointerType = function() {
73510       return _lastPointerType;
73511     };
73512     ui.svgDefs = svgDefs(context);
73513     ui.flash = uiFlash(context);
73514     ui.sidebar = uiSidebar(context);
73515     ui.photoviewer = uiPhotoviewer(context);
73516     ui.shortcuts = uiShortcuts(context);
73517     ui.onResize = function(withPan) {
73518       var map2 = context.map();
73519       var mapDimensions = utilGetDimensions(context.container().select(".main-content"), true);
73520       utilGetDimensions(context.container().select(".sidebar"), true);
73521       if (withPan !== void 0) {
73522         map2.redrawEnable(false);
73523         map2.pan(withPan);
73524         map2.redrawEnable(true);
73525       }
73526       map2.dimensions(mapDimensions);
73527       ui.photoviewer.onMapResize();
73528       ui.checkOverflow(".top-toolbar");
73529       ui.checkOverflow(".map-footer-bar");
73530       var resizeWindowEvent = document.createEvent("Event");
73531       resizeWindowEvent.initEvent("resizeWindow", true, true);
73532       document.dispatchEvent(resizeWindowEvent);
73533     };
73534     ui.checkOverflow = function(selector, reset) {
73535       if (reset) {
73536         delete _needWidth[selector];
73537       }
73538       var selection2 = context.container().select(selector);
73539       if (selection2.empty()) return;
73540       var scrollWidth = selection2.property("scrollWidth");
73541       var clientWidth = selection2.property("clientWidth");
73542       var needed = _needWidth[selector] || scrollWidth;
73543       if (scrollWidth > clientWidth) {
73544         selection2.classed("narrow", true);
73545         if (!_needWidth[selector]) {
73546           _needWidth[selector] = scrollWidth;
73547         }
73548       } else if (scrollWidth >= needed) {
73549         selection2.classed("narrow", false);
73550       }
73551     };
73552     ui.togglePanes = function(showPane) {
73553       var hidePanes = context.container().selectAll(".map-pane.shown");
73554       var side = _mainLocalizer.textDirection() === "ltr" ? "right" : "left";
73555       hidePanes.classed("shown", false).classed("hide", true);
73556       context.container().selectAll(".map-pane-control button").classed("active", false);
73557       if (showPane) {
73558         hidePanes.classed("shown", false).classed("hide", true).style(side, "-500px");
73559         context.container().selectAll("." + showPane.attr("pane") + "-control button").classed("active", true);
73560         showPane.classed("shown", true).classed("hide", false);
73561         if (hidePanes.empty()) {
73562           showPane.style(side, "-500px").transition().duration(200).style(side, "0px");
73563         } else {
73564           showPane.style(side, "0px");
73565         }
73566       } else {
73567         hidePanes.classed("shown", true).classed("hide", false).style(side, "0px").transition().duration(200).style(side, "-500px").on("end", function() {
73568           select_default2(this).classed("shown", false).classed("hide", true);
73569         });
73570       }
73571     };
73572     var _editMenu = uiEditMenu(context);
73573     ui.editMenu = function() {
73574       return _editMenu;
73575     };
73576     ui.showEditMenu = function(anchorPoint, triggerType, operations) {
73577       ui.closeEditMenu();
73578       if (!operations && context.mode().operations) operations = context.mode().operations();
73579       if (!operations || !operations.length) return;
73580       if (!context.map().editableDataEnabled()) return;
73581       var surfaceNode = context.surface().node();
73582       if (surfaceNode.focus) {
73583         surfaceNode.focus();
73584       }
73585       operations.forEach(function(operation2) {
73586         if (operation2.point) operation2.point(anchorPoint);
73587       });
73588       _editMenu.anchorLoc(anchorPoint).triggerType(triggerType).operations(operations);
73589       overMap.call(_editMenu);
73590     };
73591     ui.closeEditMenu = function() {
73592       if (overMap !== void 0) {
73593         overMap.select(".edit-menu").remove();
73594       }
73595     };
73596     var _saveLoading = select_default2(null);
73597     context.uploader().on("saveStarted.ui", function() {
73598       _saveLoading = uiLoading(context).message(_t.html("save.uploading")).blocking(true);
73599       context.container().call(_saveLoading);
73600     }).on("saveEnded.ui", function() {
73601       _saveLoading.close();
73602       _saveLoading = select_default2(null);
73603     });
73604     k.use({
73605       mangle: false,
73606       headerIds: false
73607     });
73608     return ui;
73609   }
73610
73611   // modules/ui/commit_warnings.js
73612   function uiCommitWarnings(context) {
73613     function commitWarnings(selection2) {
73614       var issuesBySeverity = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeDisabledRules: true });
73615       for (var severity in issuesBySeverity) {
73616         if (severity === "suggestion") continue;
73617         var issues = issuesBySeverity[severity];
73618         if (severity !== "error") {
73619           issues = issues.filter(function(issue) {
73620             return issue.type !== "help_request";
73621           });
73622         }
73623         var section = severity + "-section";
73624         var issueItem = severity + "-item";
73625         var container = selection2.selectAll("." + section).data(issues.length ? [0] : []);
73626         container.exit().remove();
73627         var containerEnter = container.enter().append("div").attr("class", "modal-section " + section + " fillL2");
73628         containerEnter.append("h3").call(_t.append("commit.".concat(severity, "s")));
73629         containerEnter.append("ul").attr("class", "changeset-list");
73630         container = containerEnter.merge(container);
73631         var items = container.select("ul").selectAll("li").data(issues, function(d2) {
73632           return d2.key;
73633         });
73634         items.exit().remove();
73635         var itemsEnter = items.enter().append("li").attr("class", issueItem);
73636         var buttons = itemsEnter.append("button").on("mouseover", function(d3_event, d2) {
73637           if (d2.entityIds) {
73638             context.surface().selectAll(
73639               utilEntityOrMemberSelector(
73640                 d2.entityIds,
73641                 context.graph()
73642               )
73643             ).classed("hover", true);
73644           }
73645         }).on("mouseout", function() {
73646           context.surface().selectAll(".hover").classed("hover", false);
73647         }).on("click", function(d3_event, d2) {
73648           context.validator().focusIssue(d2);
73649         });
73650         buttons.call(svgIcon("#iD-icon-alert", "pre-text"));
73651         buttons.append("strong").attr("class", "issue-message");
73652         buttons.filter(function(d2) {
73653           return d2.tooltip;
73654         }).call(
73655           uiTooltip().title(function(d2) {
73656             return d2.tooltip;
73657           }).placement("top")
73658         );
73659         items = itemsEnter.merge(items);
73660         items.selectAll(".issue-message").text("").each(function(d2) {
73661           return d2.message(context)(select_default2(this));
73662         });
73663       }
73664     }
73665     return commitWarnings;
73666   }
73667
73668   // modules/ui/lasso.js
73669   function uiLasso(context) {
73670     var group, polygon2;
73671     lasso.coordinates = [];
73672     function lasso(selection2) {
73673       context.container().classed("lasso", true);
73674       group = selection2.append("g").attr("class", "lasso hide");
73675       polygon2 = group.append("path").attr("class", "lasso-path");
73676       group.call(uiToggle(true));
73677     }
73678     function draw() {
73679       if (polygon2) {
73680         polygon2.data([lasso.coordinates]).attr("d", function(d2) {
73681           return "M" + d2.join(" L") + " Z";
73682         });
73683       }
73684     }
73685     lasso.extent = function() {
73686       return lasso.coordinates.reduce(function(extent, point) {
73687         return extent.extend(geoExtent(point));
73688       }, geoExtent());
73689     };
73690     lasso.p = function(_3) {
73691       if (!arguments.length) return lasso;
73692       lasso.coordinates.push(_3);
73693       draw();
73694       return lasso;
73695     };
73696     lasso.close = function() {
73697       if (group) {
73698         group.call(uiToggle(false, function() {
73699           select_default2(this).remove();
73700         }));
73701       }
73702       context.container().classed("lasso", false);
73703     };
73704     return lasso;
73705   }
73706
73707   // node_modules/osm-community-index/lib/simplify.js
73708   var import_diacritics3 = __toESM(require_diacritics(), 1);
73709   function simplify2(str) {
73710     if (typeof str !== "string") return "";
73711     return import_diacritics3.default.remove(
73712       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()
73713     );
73714   }
73715
73716   // node_modules/osm-community-index/lib/resolve_strings.js
73717   function resolveStrings(item, defaults, localizerFn) {
73718     let itemStrings = Object.assign({}, item.strings);
73719     let defaultStrings = Object.assign({}, defaults[item.type]);
73720     const anyToken = new RegExp(/(\{\w+\})/, "gi");
73721     if (localizerFn) {
73722       if (itemStrings.community) {
73723         const communityID = simplify2(itemStrings.community);
73724         itemStrings.community = localizerFn("_communities.".concat(communityID));
73725       }
73726       ["name", "description", "extendedDescription"].forEach((prop) => {
73727         if (defaultStrings[prop]) defaultStrings[prop] = localizerFn("_defaults.".concat(item.type, ".").concat(prop));
73728         if (itemStrings[prop]) itemStrings[prop] = localizerFn("".concat(item.id, ".").concat(prop));
73729       });
73730     }
73731     let replacements = {
73732       account: item.account,
73733       community: itemStrings.community,
73734       signupUrl: itemStrings.signupUrl,
73735       url: itemStrings.url
73736     };
73737     if (!replacements.signupUrl) {
73738       replacements.signupUrl = resolve(itemStrings.signupUrl || defaultStrings.signupUrl);
73739     }
73740     if (!replacements.url) {
73741       replacements.url = resolve(itemStrings.url || defaultStrings.url);
73742     }
73743     let resolved = {
73744       name: resolve(itemStrings.name || defaultStrings.name),
73745       url: resolve(itemStrings.url || defaultStrings.url),
73746       signupUrl: resolve(itemStrings.signupUrl || defaultStrings.signupUrl),
73747       description: resolve(itemStrings.description || defaultStrings.description),
73748       extendedDescription: resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription)
73749     };
73750     resolved.nameHTML = linkify(resolved.url, resolved.name);
73751     resolved.urlHTML = linkify(resolved.url);
73752     resolved.signupUrlHTML = linkify(resolved.signupUrl);
73753     resolved.descriptionHTML = resolve(itemStrings.description || defaultStrings.description, true);
73754     resolved.extendedDescriptionHTML = resolve(itemStrings.extendedDescription || defaultStrings.extendedDescription, true);
73755     return resolved;
73756     function resolve(s2, addLinks) {
73757       if (!s2) return void 0;
73758       let result = s2;
73759       for (let key in replacements) {
73760         const token = "{".concat(key, "}");
73761         const regex = new RegExp(token, "g");
73762         if (regex.test(result)) {
73763           let replacement = replacements[key];
73764           if (!replacement) {
73765             throw new Error("Cannot resolve token: ".concat(token));
73766           } else {
73767             if (addLinks && (key === "signupUrl" || key === "url")) {
73768               replacement = linkify(replacement);
73769             }
73770             result = result.replace(regex, replacement);
73771           }
73772         }
73773       }
73774       const leftovers = result.match(anyToken);
73775       if (leftovers) {
73776         throw new Error("Cannot resolve tokens: ".concat(leftovers));
73777       }
73778       if (addLinks && item.type === "reddit") {
73779         result = result.replace(/(\/r\/\w+\/*)/i, (match) => linkify(resolved.url, match));
73780       }
73781       return result;
73782     }
73783     function linkify(url, text) {
73784       if (!url) return void 0;
73785       text = text || url;
73786       return '<a target="_blank" href="'.concat(url, '">').concat(text, "</a>");
73787     }
73788   }
73789
73790   // modules/ui/success.js
73791   var _oci = null;
73792   function uiSuccess(context) {
73793     const MAXEVENTS = 2;
73794     const dispatch12 = dispatch_default("cancel");
73795     let _changeset2;
73796     let _location;
73797     ensureOSMCommunityIndex();
73798     function ensureOSMCommunityIndex() {
73799       const data = _mainFileFetcher;
73800       return Promise.all([
73801         data.get("oci_features"),
73802         data.get("oci_resources"),
73803         data.get("oci_defaults")
73804       ]).then((vals) => {
73805         if (_oci) return _oci;
73806         if (vals[0] && Array.isArray(vals[0].features)) {
73807           _sharedLocationManager.mergeCustomGeoJSON(vals[0]);
73808         }
73809         let ociResources = Object.values(vals[1].resources);
73810         if (ociResources.length) {
73811           return _sharedLocationManager.mergeLocationSets(ociResources).then(() => {
73812             _oci = {
73813               resources: ociResources,
73814               defaults: vals[2].defaults
73815             };
73816             return _oci;
73817           });
73818         } else {
73819           _oci = {
73820             resources: [],
73821             // no resources?
73822             defaults: vals[2].defaults
73823           };
73824           return _oci;
73825         }
73826       });
73827     }
73828     function parseEventDate(when) {
73829       if (!when) return;
73830       let raw = when.trim();
73831       if (!raw) return;
73832       if (!/Z$/.test(raw)) {
73833         raw += "Z";
73834       }
73835       const parsed = new Date(raw);
73836       return new Date(parsed.toUTCString().slice(0, 25));
73837     }
73838     function success(selection2) {
73839       let header = selection2.append("div").attr("class", "header fillL");
73840       header.append("h2").call(_t.append("success.just_edited"));
73841       header.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", () => dispatch12.call("cancel")).call(svgIcon("#iD-icon-close"));
73842       let body = selection2.append("div").attr("class", "body save-success fillL");
73843       let summary = body.append("div").attr("class", "save-summary");
73844       summary.append("h3").call(_t.append("success.thank_you" + (_location ? "_location" : ""), { where: _location }));
73845       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"));
73846       let osm = context.connection();
73847       if (!osm) return;
73848       let changesetURL = osm.changesetURL(_changeset2.id);
73849       let table = summary.append("table").attr("class", "summary-table");
73850       let row = table.append("tr").attr("class", "summary-row");
73851       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");
73852       let summaryDetail = row.append("td").attr("class", "cell-detail summary-detail");
73853       summaryDetail.append("a").attr("class", "cell-detail summary-view-on-osm").attr("target", "_blank").attr("href", changesetURL).call(_t.append("success.view_on_osm"));
73854       summaryDetail.append("div").html(_t.html("success.changeset_id", {
73855         changeset_id: { html: '<a href="'.concat(changesetURL, '" target="_blank">').concat(_changeset2.id, "</a>") }
73856       }));
73857       if (showDonationMessage !== false) {
73858         const donationUrl = "https://supporting.openstreetmap.org/";
73859         let supporting = body.append("div").attr("class", "save-supporting");
73860         supporting.append("h3").call(_t.append("success.supporting.title"));
73861         supporting.append("p").call(_t.append("success.supporting.details"));
73862         table = supporting.append("table").attr("class", "supporting-table");
73863         row = table.append("tr").attr("class", "supporting-row");
73864         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");
73865         let supportingDetail = row.append("td").attr("class", "cell-detail supporting-detail");
73866         supportingDetail.append("a").attr("class", "cell-detail support-the-map").attr("target", "_blank").attr("href", donationUrl).call(_t.append("success.supporting.donation.title"));
73867         supportingDetail.append("div").call(_t.append("success.supporting.donation.details"));
73868       }
73869       ensureOSMCommunityIndex().then((oci) => {
73870         const loc = context.map().center();
73871         const validHere = _sharedLocationManager.locationSetsAt(loc);
73872         let communities = [];
73873         oci.resources.forEach((resource) => {
73874           let area = validHere[resource.locationSetID];
73875           if (!area) return;
73876           const localizer = (stringID) => _t.html("community.".concat(stringID));
73877           resource.resolved = resolveStrings(resource, oci.defaults, localizer);
73878           communities.push({
73879             area,
73880             order: resource.order || 0,
73881             resource
73882           });
73883         });
73884         communities.sort((a2, b3) => a2.area - b3.area || b3.order - a2.order);
73885         body.call(showCommunityLinks, communities.map((c2) => c2.resource));
73886       });
73887     }
73888     function showCommunityLinks(selection2, resources) {
73889       let communityLinks = selection2.append("div").attr("class", "save-communityLinks");
73890       communityLinks.append("h3").call(_t.append("success.like_osm"));
73891       let table = communityLinks.append("table").attr("class", "community-table");
73892       let row = table.selectAll(".community-row").data(resources);
73893       let rowEnter = row.enter().append("tr").attr("class", "community-row");
73894       rowEnter.append("td").attr("class", "cell-icon community-icon").append("a").attr("target", "_blank").attr("href", (d2) => d2.resolved.url).append("svg").attr("class", "logo-small").append("use").attr("xlink:href", (d2) => "#community-".concat(d2.type));
73895       let communityDetail = rowEnter.append("td").attr("class", "cell-detail community-detail");
73896       communityDetail.each(showCommunityDetails);
73897       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"));
73898     }
73899     function showCommunityDetails(d2) {
73900       let selection2 = select_default2(this);
73901       let communityID = d2.id;
73902       selection2.append("div").attr("class", "community-name").html(d2.resolved.nameHTML);
73903       selection2.append("div").attr("class", "community-description").html(d2.resolved.descriptionHTML);
73904       if (d2.resolved.extendedDescriptionHTML || d2.languageCodes && d2.languageCodes.length) {
73905         selection2.append("div").call(
73906           uiDisclosure(context, "community-more-".concat(d2.id), false).expanded(false).updatePreference(false).label(() => _t.append("success.more")).content(showMore)
73907         );
73908       }
73909       let nextEvents = (d2.events || []).map((event) => {
73910         event.date = parseEventDate(event.when);
73911         return event;
73912       }).filter((event) => {
73913         const t2 = event.date.getTime();
73914         const now3 = (/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0);
73915         return !isNaN(t2) && t2 >= now3;
73916       }).sort((a2, b3) => {
73917         return a2.date < b3.date ? -1 : a2.date > b3.date ? 1 : 0;
73918       }).slice(0, MAXEVENTS);
73919       if (nextEvents.length) {
73920         selection2.append("div").call(
73921           uiDisclosure(context, "community-events-".concat(d2.id), false).expanded(false).updatePreference(false).label(_t.html("success.events")).content(showNextEvents)
73922         ).select(".hide-toggle").append("span").attr("class", "badge-text").text(nextEvents.length);
73923       }
73924       function showMore(selection3) {
73925         let more = selection3.selectAll(".community-more").data([0]);
73926         let moreEnter = more.enter().append("div").attr("class", "community-more");
73927         if (d2.resolved.extendedDescriptionHTML) {
73928           moreEnter.append("div").attr("class", "community-extended-description").html(d2.resolved.extendedDescriptionHTML);
73929         }
73930         if (d2.languageCodes && d2.languageCodes.length) {
73931           const languageList = d2.languageCodes.map((code) => _mainLocalizer.languageName(code)).join(", ");
73932           moreEnter.append("div").attr("class", "community-languages").call(_t.append("success.languages", { languages: languageList }));
73933         }
73934       }
73935       function showNextEvents(selection3) {
73936         let events = selection3.append("div").attr("class", "community-events");
73937         let item = events.selectAll(".community-event").data(nextEvents);
73938         let itemEnter = item.enter().append("div").attr("class", "community-event");
73939         itemEnter.append("div").attr("class", "community-event-name").append("a").attr("target", "_blank").attr("href", (d4) => d4.url).text((d4) => {
73940           let name = d4.name;
73941           if (d4.i18n && d4.id) {
73942             name = _t("community.".concat(communityID, ".events.").concat(d4.id, ".name"), { default: name });
73943           }
73944           return name;
73945         });
73946         itemEnter.append("div").attr("class", "community-event-when").text((d4) => {
73947           let options = { weekday: "short", day: "numeric", month: "short", year: "numeric" };
73948           if (d4.date.getHours() || d4.date.getMinutes()) {
73949             options.hour = "numeric";
73950             options.minute = "numeric";
73951           }
73952           return d4.date.toLocaleString(_mainLocalizer.localeCode(), options);
73953         });
73954         itemEnter.append("div").attr("class", "community-event-where").text((d4) => {
73955           let where = d4.where;
73956           if (d4.i18n && d4.id) {
73957             where = _t("community.".concat(communityID, ".events.").concat(d4.id, ".where"), { default: where });
73958           }
73959           return where;
73960         });
73961         itemEnter.append("div").attr("class", "community-event-description").text((d4) => {
73962           let description = d4.description;
73963           if (d4.i18n && d4.id) {
73964             description = _t("community.".concat(communityID, ".events.").concat(d4.id, ".description"), { default: description });
73965           }
73966           return description;
73967         });
73968       }
73969     }
73970     success.changeset = function(val) {
73971       if (!arguments.length) return _changeset2;
73972       _changeset2 = val;
73973       return success;
73974     };
73975     success.location = function(val) {
73976       if (!arguments.length) return _location;
73977       _location = val;
73978       return success;
73979     };
73980     return utilRebind(success, dispatch12, "on");
73981   }
73982
73983   // modules/ui/fields/input.js
73984   var likelyRawNumberFormat = /^-?(0\.\d*|\d*\.\d{0,2}(\d{4,})?|\d{4,}\.\d{3})$/;
73985   var yoHoursURLFormat = "https://projets.pavie.info/yohours/?oh={value}";
73986   function uiFieldText(field, context) {
73987     var dispatch12 = dispatch_default("change");
73988     var input = select_default2(null);
73989     var outlinkButton = select_default2(null);
73990     var wrap2 = select_default2(null);
73991     var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
73992     var _entityIDs = [];
73993     var _tags;
73994     var _phoneFormats = {};
73995     const isDirectionField = field.key.split(":").some((keyPart) => keyPart === "direction");
73996     const formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
73997     const parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
73998     const countDecimalPlaces = _mainLocalizer.decimalPlaceCounter(_mainLocalizer.languageCode());
73999     if (field.type === "tel") {
74000       _mainFileFetcher.get("phone_formats").then(function(d2) {
74001         _phoneFormats = d2;
74002         updatePhonePlaceholder();
74003       }).catch(function() {
74004       });
74005     }
74006     function calcLocked() {
74007       var isLocked = (field.id === "brand" || field.id === "network" || field.id === "operator" || field.id === "flag") && _entityIDs.length && _entityIDs.some(function(entityID) {
74008         var entity = context.graph().hasEntity(entityID);
74009         if (!entity) return false;
74010         if (entity.tags.wikidata) return true;
74011         var preset = _mainPresetIndex.match(entity, context.graph());
74012         var isSuggestion = preset && preset.suggestion;
74013         var which = field.id;
74014         return isSuggestion && !!entity.tags[which] && !!entity.tags[which + ":wikidata"];
74015       });
74016       field.locked(isLocked);
74017     }
74018     function i3(selection2) {
74019       calcLocked();
74020       var isLocked = field.locked();
74021       wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
74022       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
74023       input = wrap2.selectAll("input").data([0]);
74024       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);
74025       input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
74026       wrap2.call(_lengthIndicator);
74027       if (field.type === "tel") {
74028         updatePhonePlaceholder();
74029       } else if (field.type === "number" || field.type === "integer") {
74030         var rtl = _mainLocalizer.textDirection() === "rtl";
74031         input.attr("type", "text");
74032         var inc = field.increment;
74033         var buttons = wrap2.selectAll(".increment, .decrement").data(rtl ? [inc, -inc] : [-inc, inc]);
74034         buttons.enter().append("button").attr("class", function(d2) {
74035           var which = d2 > 0 ? "increment" : "decrement";
74036           return "form-field-button " + which;
74037         }).attr("title", function(d2) {
74038           var which = d2 > 0 ? "increment" : "decrement";
74039           return _t("inspector.".concat(which));
74040         }).merge(buttons).on("click", function(d3_event, d2) {
74041           d3_event.preventDefault();
74042           var isMixed = Array.isArray(_tags[field.key]);
74043           if (isMixed) return;
74044           var raw_vals = input.node().value || "0";
74045           var vals = raw_vals.split(";");
74046           vals = vals.map(function(v3) {
74047             v3 = v3.trim();
74048             const isRawNumber = likelyRawNumberFormat.test(v3);
74049             var num = isRawNumber ? parseFloat(v3) : parseLocaleFloat(v3);
74050             if (isDirectionField) {
74051               const compassDir = cardinal[v3.toLowerCase()];
74052               if (compassDir !== void 0) {
74053                 num = compassDir;
74054               }
74055             }
74056             if (!isFinite(num)) return v3;
74057             num = parseFloat(num);
74058             if (!isFinite(num)) return v3;
74059             num += d2;
74060             if (isDirectionField) {
74061               num = (num % 360 + 360) % 360;
74062             }
74063             return formatFloat(clamped(num), isRawNumber ? v3.includes(".") ? v3.split(".")[1].length : 0 : countDecimalPlaces(v3));
74064           });
74065           input.node().value = vals.join(";");
74066           change()();
74067         });
74068       } else if (field.type === "identifier" && field.urlFormat && field.pattern) {
74069         input.attr("type", "text");
74070         outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
74071         outlinkButton = outlinkButton.enter().append("button").call(svgIcon("#iD-icon-out-link")).attr("class", "form-field-button foreign-id-permalink").attr("title", function() {
74072           var domainResults = /^https?:\/\/(.{1,}?)\//.exec(field.urlFormat);
74073           if (domainResults.length >= 2 && domainResults[1]) {
74074             var domain = domainResults[1];
74075             return _t("icons.view_on", { domain });
74076           }
74077           return "";
74078         }).merge(outlinkButton);
74079         outlinkButton.on("click", function(d3_event) {
74080           d3_event.preventDefault();
74081           var value = validIdentifierValueForLink();
74082           if (value) {
74083             var url = field.urlFormat.replace(/{value}/, encodeURIComponent(value));
74084             window.open(url, "_blank");
74085           }
74086         }).classed("disabled", () => !validIdentifierValueForLink()).merge(outlinkButton);
74087       } else if (field.type === "schedule") {
74088         input.attr("type", "text");
74089         outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
74090         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) {
74091           d3_event.preventDefault();
74092           var value = validIdentifierValueForLink();
74093           var url = yoHoursURLFormat.replace(/{value}/, encodeURIComponent(value || ""));
74094           window.open(url, "_blank");
74095         }).merge(outlinkButton);
74096       } else if (field.type === "url") {
74097         input.attr("type", "text");
74098         outlinkButton = wrap2.selectAll(".foreign-id-permalink").data([0]);
74099         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) {
74100           d3_event.preventDefault();
74101           const value = validIdentifierValueForLink();
74102           if (value) window.open(value, "_blank");
74103         }).merge(outlinkButton);
74104       } else if (field.type === "colour") {
74105         input.attr("type", "text");
74106         updateColourPreview();
74107       } else if (field.type === "date") {
74108         input.attr("type", "text");
74109         updateDateField();
74110       }
74111     }
74112     function updateColourPreview() {
74113       wrap2.selectAll(".colour-preview").remove();
74114       const colour = utilGetSetValue(input);
74115       if (!isColourValid(colour) && colour !== "") {
74116         wrap2.selectAll("input.colour-selector").remove();
74117         wrap2.selectAll(".form-field-button").remove();
74118         return;
74119       }
74120       var colourSelector = wrap2.selectAll(".colour-selector").data([0]);
74121       colourSelector.enter().append("input").attr("type", "color").attr("class", "colour-selector").on("input", debounce_default(function(d3_event) {
74122         d3_event.preventDefault();
74123         var colour2 = this.value;
74124         if (!isColourValid(colour2)) return;
74125         utilGetSetValue(input, this.value);
74126         change()();
74127         updateColourPreview();
74128       }, 100));
74129       wrap2.selectAll("input.colour-selector").attr("value", colour);
74130       var chooserButton = wrap2.selectAll(".colour-preview").data([colour]);
74131       chooserButton = chooserButton.enter().append("div").attr("class", "form-field-button colour-preview").append("div").style("background-color", (d2) => d2).attr("class", "colour-box");
74132       if (colour === "") {
74133         chooserButton = chooserButton.call(svgIcon("#iD-icon-edit"));
74134       }
74135       chooserButton.on("click", () => wrap2.select(".colour-selector").node().showPicker());
74136     }
74137     function updateDateField() {
74138       function isDateValid(date2) {
74139         return date2.match(/^[0-9]{4}(-[0-9]{2}(-[0-9]{2})?)?$/);
74140       }
74141       const date = utilGetSetValue(input);
74142       const now3 = /* @__PURE__ */ new Date();
74143       const today = new Date(now3.getTime() - now3.getTimezoneOffset() * 6e4).toISOString().split("T")[0];
74144       if ((field.key === "check_date" || field.key === "survey:date") && date !== today) {
74145         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", () => {
74146           utilGetSetValue(input, today);
74147           change()();
74148           updateDateField();
74149         });
74150       } else {
74151         wrap2.selectAll(".date-set-today").remove();
74152       }
74153       if (!isDateValid(date) && date !== "") {
74154         wrap2.selectAll("input.date-selector").remove();
74155         wrap2.selectAll(".date-calendar").remove();
74156         return;
74157       }
74158       if (utilDetect().browser !== "Safari") {
74159         var dateSelector = wrap2.selectAll(".date-selector").data([0]);
74160         dateSelector.enter().append("input").attr("type", "date").attr("class", "date-selector").on("input", debounce_default(function(d3_event) {
74161           d3_event.preventDefault();
74162           var date2 = this.value;
74163           if (!isDateValid(date2)) return;
74164           utilGetSetValue(input, this.value);
74165           change()();
74166           updateDateField();
74167         }, 100));
74168         wrap2.selectAll("input.date-selector").attr("value", date);
74169         var calendarButton = wrap2.selectAll(".date-calendar").data([date]);
74170         calendarButton = calendarButton.enter().append("button").attr("class", "form-field-button date-calendar").call(svgIcon("#fas-calendar-days"));
74171         calendarButton.on("click", () => wrap2.select(".date-selector").node().showPicker());
74172       }
74173     }
74174     function updatePhonePlaceholder() {
74175       if (input.empty() || !Object.keys(_phoneFormats).length) return;
74176       var extent = combinedEntityExtent();
74177       var countryCode = extent && iso1A2Code(extent.center());
74178       var format2 = countryCode && _phoneFormats[countryCode.toLowerCase()];
74179       if (format2) input.attr("placeholder", format2);
74180     }
74181     function validIdentifierValueForLink() {
74182       var _a5;
74183       const value = utilGetSetValue(input).trim();
74184       if (field.type === "url" && value) {
74185         try {
74186           return new URL(value).href;
74187         } catch (e3) {
74188           return null;
74189         }
74190       }
74191       if (field.type === "identifier" && field.pattern) {
74192         return value && ((_a5 = value.match(new RegExp(field.pattern))) == null ? void 0 : _a5[0]);
74193       }
74194       if (field.type === "schedule") {
74195         return value;
74196       }
74197       return null;
74198     }
74199     function clamped(num) {
74200       if (field.minValue !== void 0) {
74201         num = Math.max(num, field.minValue);
74202       }
74203       if (field.maxValue !== void 0) {
74204         num = Math.min(num, field.maxValue);
74205       }
74206       return num;
74207     }
74208     function getVals(tags) {
74209       if (field.keys) {
74210         const multiSelection = context.selectedIDs();
74211         tags = multiSelection.length > 1 ? context.selectedIDs().map((id2) => context.graph().entity(id2)).map((entity) => entity.tags) : [tags];
74212         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]));
74213       } else {
74214         return new Set([].concat(tags[field.key]));
74215       }
74216     }
74217     function change(onInput) {
74218       return function() {
74219         var t2 = {};
74220         var val = utilGetSetValue(input);
74221         if (!onInput) val = context.cleanTagValue(val);
74222         if (!val && getVals(_tags).size > 1) return;
74223         let displayVal = val;
74224         if ((field.type === "number" || field.type === "integer") && val) {
74225           const numbers2 = val.split(";").map((v3) => {
74226             if (likelyRawNumberFormat.test(v3)) {
74227               return {
74228                 v: v3,
74229                 num: parseFloat(v3),
74230                 fractionDigits: v3.includes(".") ? v3.split(".")[1].length : 0
74231               };
74232             } else {
74233               return {
74234                 v: v3,
74235                 num: parseLocaleFloat(v3),
74236                 fractionDigits: countDecimalPlaces(v3)
74237               };
74238             }
74239           });
74240           val = numbers2.map(({ num, v: v3, fractionDigits }) => {
74241             if (!isFinite(num)) return v3;
74242             return clamped(num).toFixed(fractionDigits);
74243           }).join(";");
74244           displayVal = numbers2.map(({ num, v: v3, fractionDigits }) => {
74245             if (!isFinite(num)) return v3;
74246             return formatFloat(clamped(num), fractionDigits);
74247           }).join(";");
74248         }
74249         if (!onInput) utilGetSetValue(input, displayVal);
74250         t2[field.key] = val || void 0;
74251         if (field.keys) {
74252           dispatch12.call("change", this, (tags) => {
74253             if (field.keys.some((key) => tags[key])) {
74254               field.keys.filter((key) => tags[key]).forEach((key) => {
74255                 tags[key] = val || void 0;
74256               });
74257             } else {
74258               tags[field.key] = val || void 0;
74259             }
74260             return tags;
74261           }, onInput);
74262         } else {
74263           dispatch12.call("change", this, t2, onInput);
74264         }
74265       };
74266     }
74267     i3.entityIDs = function(val) {
74268       if (!arguments.length) return _entityIDs;
74269       _entityIDs = val;
74270       return i3;
74271     };
74272     i3.tags = function(tags) {
74273       var _a5;
74274       _tags = tags;
74275       const vals = getVals(tags);
74276       const isMixed = vals.size > 1;
74277       var val = vals.size === 1 ? (_a5 = [...vals][0]) != null ? _a5 : "" : "";
74278       var shouldUpdate;
74279       if ((field.type === "number" || field.type === "integer") && val) {
74280         var numbers2 = val.split(";");
74281         var oriNumbers = utilGetSetValue(input).split(";");
74282         if (numbers2.length !== oriNumbers.length) shouldUpdate = true;
74283         numbers2 = numbers2.map(function(v3) {
74284           v3 = v3.trim();
74285           var num = Number(v3);
74286           if (!isFinite(num) || v3 === "") return v3;
74287           const fractionDigits = v3.includes(".") ? v3.split(".")[1].length : 0;
74288           return formatFloat(num, fractionDigits);
74289         });
74290         val = numbers2.join(";");
74291         shouldUpdate = (inputValue, setValue) => {
74292           const inputNums = inputValue.split(";").map((val2) => {
74293             const parsedNum = likelyRawNumberFormat.test(val2) ? parseFloat(val2) : parseLocaleFloat(val2);
74294             if (!isFinite(parsedNum)) return val2;
74295             return parsedNum;
74296           });
74297           const setNums = setValue.split(";").map((val2) => {
74298             const parsedNum = parseLocaleFloat(val2);
74299             if (!isFinite(parsedNum)) return val2;
74300             return parsedNum;
74301           });
74302           return !isEqual_default(inputNums, setNums);
74303         };
74304       }
74305       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);
74306       if (field.type === "number" || field.type === "integer") {
74307         const buttons = wrap2.selectAll(".increment, .decrement");
74308         if (isMixed) {
74309           buttons.attr("disabled", "disabled").classed("disabled", true);
74310         } else {
74311           var raw_vals = tags[field.key] || "0";
74312           const canIncDec = raw_vals.split(";").some(
74313             (val2) => isFinite(Number(val2)) || isDirectionField && val2.trim().toLowerCase() in cardinal
74314           );
74315           buttons.attr("disabled", canIncDec ? null : "disabled").classed("disabled", !canIncDec);
74316         }
74317       }
74318       if (field.type === "tel") updatePhonePlaceholder();
74319       if (field.type === "colour") updateColourPreview();
74320       if (field.type === "date") updateDateField();
74321       if (outlinkButton && !outlinkButton.empty()) {
74322         var disabled = !validIdentifierValueForLink() && field.type !== "schedule";
74323         outlinkButton.classed("disabled", disabled);
74324       }
74325       if (!isMixed) {
74326         _lengthIndicator.update(tags[field.key]);
74327       }
74328     };
74329     i3.focus = function() {
74330       var node = input.node();
74331       if (node) node.focus();
74332     };
74333     function combinedEntityExtent() {
74334       return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
74335     }
74336     return utilRebind(i3, dispatch12, "on");
74337   }
74338
74339   // modules/ui/fields/access.js
74340   function uiFieldAccess(field, context) {
74341     var dispatch12 = dispatch_default("change");
74342     var items = select_default2(null);
74343     var _tags;
74344     function access(selection2) {
74345       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
74346       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
74347       var list = wrap2.selectAll("ul").data([0]);
74348       list = list.enter().append("ul").attr("class", "rows").merge(list);
74349       items = list.selectAll("li").data(field.keys);
74350       var enter = items.enter().append("li").attr("class", function(d2) {
74351         return "labeled-input preset-access-" + d2;
74352       });
74353       enter.append("div").attr("class", "label preset-label-access").attr("for", function(d2) {
74354         return "preset-input-access-" + d2;
74355       }).html(function(d2) {
74356         return field.t.html("types." + d2);
74357       });
74358       enter.append("div").attr("class", "preset-input-access-wrap").append("input").attr("type", "text").attr("class", function(d2) {
74359         return "preset-input-access preset-input-access-" + d2;
74360       }).call(utilNoAuto).each(function(d2) {
74361         select_default2(this).call(
74362           uiCombobox(context, "access-" + d2).data(access.options(d2))
74363         );
74364       });
74365       items = items.merge(enter);
74366       wrap2.selectAll(".preset-input-access").on("change", change).on("blur", change);
74367     }
74368     function change(d3_event, d2) {
74369       var tag = {};
74370       var value = context.cleanTagValue(utilGetSetValue(select_default2(this)));
74371       if (!value && typeof _tags[d2] !== "string") return;
74372       tag[d2] = value || void 0;
74373       dispatch12.call("change", this, tag);
74374     }
74375     access.options = function(type2) {
74376       var options = [
74377         "yes",
74378         "no",
74379         "designated",
74380         "permissive",
74381         "destination",
74382         "customers",
74383         "private",
74384         "permit",
74385         "unknown"
74386       ];
74387       if (type2 === "access") {
74388         options = options.filter((v3) => v3 !== "yes" && v3 !== "designated");
74389       }
74390       if (type2 === "bicycle") {
74391         options.splice(options.length - 4, 0, "dismount");
74392       }
74393       var stringsField = field.resolveReference("stringsCrossReference");
74394       return options.map(function(option) {
74395         return {
74396           title: stringsField.t("options." + option + ".description"),
74397           value: option
74398         };
74399       });
74400     };
74401     const placeholdersByTag = {
74402       highway: {
74403         footway: {
74404           foot: "designated",
74405           motor_vehicle: "no"
74406         },
74407         steps: {
74408           foot: "yes",
74409           motor_vehicle: "no",
74410           bicycle: "no",
74411           horse: "no"
74412         },
74413         ladder: {
74414           foot: "yes",
74415           motor_vehicle: "no",
74416           bicycle: "no",
74417           horse: "no"
74418         },
74419         pedestrian: {
74420           foot: "yes",
74421           motor_vehicle: "no"
74422         },
74423         cycleway: {
74424           motor_vehicle: "no",
74425           bicycle: "designated"
74426         },
74427         bridleway: {
74428           motor_vehicle: "no",
74429           horse: "designated"
74430         },
74431         path: {
74432           foot: "yes",
74433           motor_vehicle: "no",
74434           bicycle: "yes",
74435           horse: "yes"
74436         },
74437         motorway: {
74438           foot: "no",
74439           motor_vehicle: "yes",
74440           bicycle: "no",
74441           horse: "no"
74442         },
74443         trunk: {
74444           motor_vehicle: "yes"
74445         },
74446         primary: {
74447           foot: "yes",
74448           motor_vehicle: "yes",
74449           bicycle: "yes",
74450           horse: "yes"
74451         },
74452         secondary: {
74453           foot: "yes",
74454           motor_vehicle: "yes",
74455           bicycle: "yes",
74456           horse: "yes"
74457         },
74458         tertiary: {
74459           foot: "yes",
74460           motor_vehicle: "yes",
74461           bicycle: "yes",
74462           horse: "yes"
74463         },
74464         residential: {
74465           foot: "yes",
74466           motor_vehicle: "yes",
74467           bicycle: "yes",
74468           horse: "yes"
74469         },
74470         unclassified: {
74471           foot: "yes",
74472           motor_vehicle: "yes",
74473           bicycle: "yes",
74474           horse: "yes"
74475         },
74476         service: {
74477           foot: "yes",
74478           motor_vehicle: "yes",
74479           bicycle: "yes",
74480           horse: "yes"
74481         },
74482         motorway_link: {
74483           foot: "no",
74484           motor_vehicle: "yes",
74485           bicycle: "no",
74486           horse: "no"
74487         },
74488         trunk_link: {
74489           motor_vehicle: "yes"
74490         },
74491         primary_link: {
74492           foot: "yes",
74493           motor_vehicle: "yes",
74494           bicycle: "yes",
74495           horse: "yes"
74496         },
74497         secondary_link: {
74498           foot: "yes",
74499           motor_vehicle: "yes",
74500           bicycle: "yes",
74501           horse: "yes"
74502         },
74503         tertiary_link: {
74504           foot: "yes",
74505           motor_vehicle: "yes",
74506           bicycle: "yes",
74507           horse: "yes"
74508         },
74509         construction: {
74510           access: "no"
74511         },
74512         busway: {
74513           access: "no",
74514           bus: "designated",
74515           emergency: "yes"
74516         }
74517       },
74518       barrier: {
74519         bollard: {
74520           access: "no",
74521           bicycle: "yes",
74522           foot: "yes"
74523         },
74524         bus_trap: {
74525           motor_vehicle: "no",
74526           psv: "yes",
74527           foot: "yes",
74528           bicycle: "yes"
74529         },
74530         city_wall: {
74531           access: "no"
74532         },
74533         coupure: {
74534           access: "yes"
74535         },
74536         cycle_barrier: {
74537           motor_vehicle: "no"
74538         },
74539         ditch: {
74540           access: "no"
74541         },
74542         entrance: {
74543           access: "yes"
74544         },
74545         fence: {
74546           access: "no"
74547         },
74548         hedge: {
74549           access: "no"
74550         },
74551         jersey_barrier: {
74552           access: "no"
74553         },
74554         motorcycle_barrier: {
74555           motor_vehicle: "no"
74556         },
74557         rail_guard: {
74558           access: "no"
74559         }
74560       }
74561     };
74562     access.tags = function(tags) {
74563       _tags = tags;
74564       utilGetSetValue(items.selectAll(".preset-input-access"), function(d2) {
74565         return typeof tags[d2] === "string" ? tags[d2] : "";
74566       }).classed("mixed", function(accessField) {
74567         return tags[accessField] && Array.isArray(tags[accessField]) || new Set(getAllPlaceholders(tags, accessField)).size > 1;
74568       }).attr("title", function(accessField) {
74569         return tags[accessField] && Array.isArray(tags[accessField]) && tags[accessField].filter(Boolean).join("\n");
74570       }).attr("placeholder", function(accessField) {
74571         let placeholders = getAllPlaceholders(tags, accessField);
74572         if (new Set(placeholders).size === 1) {
74573           return placeholders[0];
74574         } else {
74575           return _t("inspector.multiple_values");
74576         }
74577       });
74578       function getAllPlaceholders(tags2, accessField) {
74579         let allTags = tags2[Symbol.for("allTags")];
74580         if (allTags && allTags.length > 1) {
74581           const placeholders = [];
74582           allTags.forEach((tags3) => {
74583             placeholders.push(getPlaceholder(tags3, accessField));
74584           });
74585           return placeholders;
74586         } else {
74587           return [getPlaceholder(tags2, accessField)];
74588         }
74589       }
74590       function getPlaceholder(tags2, accessField) {
74591         if (tags2[accessField]) {
74592           return tags2[accessField];
74593         }
74594         if (tags2.motorroad === "yes" && (accessField === "foot" || accessField === "bicycle" || accessField === "horse")) {
74595           return "no";
74596         }
74597         if (tags2.vehicle && (accessField === "bicycle" || accessField === "motor_vehicle")) {
74598           return tags2.vehicle;
74599         }
74600         if (tags2.access) {
74601           return tags2.access;
74602         }
74603         for (const key in placeholdersByTag) {
74604           if (tags2[key]) {
74605             if (placeholdersByTag[key][tags2[key]] && placeholdersByTag[key][tags2[key]][accessField]) {
74606               return placeholdersByTag[key][tags2[key]][accessField];
74607             }
74608           }
74609         }
74610         if (accessField === "access" && !tags2.barrier) {
74611           return "yes";
74612         }
74613         return field.placeholder();
74614       }
74615     };
74616     access.focus = function() {
74617       items.selectAll(".preset-input-access").node().focus();
74618     };
74619     return utilRebind(access, dispatch12, "on");
74620   }
74621
74622   // modules/ui/fields/address.js
74623   function uiFieldAddress(field, context) {
74624     var dispatch12 = dispatch_default("change");
74625     var _selection = select_default2(null);
74626     var _wrap = select_default2(null);
74627     var addrField = _mainPresetIndex.field("address");
74628     var _entityIDs = [];
74629     var _tags;
74630     var _countryCode;
74631     var _addressFormats = [{
74632       format: [
74633         ["housenumber", "street"],
74634         ["city", "postcode"]
74635       ]
74636     }];
74637     _mainFileFetcher.get("address_formats").then(function(d2) {
74638       _addressFormats = d2;
74639       if (!_selection.empty()) {
74640         _selection.call(address);
74641       }
74642     }).catch(function() {
74643     });
74644     function getNear(isAddressable, type2, searchRadius, resultProp) {
74645       var extent = combinedEntityExtent();
74646       var l2 = extent.center();
74647       var box = extent.padByMeters(searchRadius);
74648       var features = context.history().intersects(box).filter(isAddressable).map((d2) => {
74649         let dist = geoSphericalDistance(d2.extent(context.graph()).center(), l2);
74650         if (d2.geometry(context.graph()) === "line") {
74651           var loc = context.projection([
74652             (extent[0][0] + extent[1][0]) / 2,
74653             (extent[0][1] + extent[1][1]) / 2
74654           ]);
74655           var choice = geoChooseEdge(context.graph().childNodes(d2), loc, context.projection);
74656           dist = geoSphericalDistance(choice.loc, l2);
74657         }
74658         const value = resultProp && d2.tags[resultProp] ? d2.tags[resultProp] : d2.tags.name;
74659         let title = value;
74660         if (type2 === "street") {
74661           title = "".concat(addrField.t("placeholders.street"), ": ").concat(title);
74662         } else if (type2 === "place") {
74663           title = "".concat(addrField.t("placeholders.place"), ": ").concat(title);
74664         }
74665         return {
74666           title,
74667           value,
74668           dist,
74669           type: type2,
74670           klass: "address-".concat(type2)
74671         };
74672       }).sort(function(a2, b3) {
74673         return a2.dist - b3.dist;
74674       });
74675       return utilArrayUniqBy(features, "value");
74676     }
74677     function getEnclosing(isAddressable, type2, resultProp) {
74678       var extent = combinedEntityExtent();
74679       var features = context.history().intersects(extent).filter(isAddressable).map((d2) => {
74680         if (d2.geometry(context.graph()) !== "area") {
74681           return false;
74682         }
74683         const geom = d2.asGeoJSON(context.graph()).coordinates[0];
74684         if (!geoPolygonContainsPolygon(geom, extent.polygon())) {
74685           return false;
74686         }
74687         const value = resultProp && d2.tags[resultProp] ? d2.tags[resultProp] : d2.tags.name;
74688         return {
74689           title: value,
74690           value,
74691           dist: 0,
74692           geom,
74693           type: type2,
74694           klass: "address-".concat(type2)
74695         };
74696       }).filter(Boolean);
74697       return utilArrayUniqBy(features, "value");
74698     }
74699     function getNearStreets() {
74700       function isAddressable(d2) {
74701         return d2.tags.highway && d2.tags.name && d2.type === "way";
74702       }
74703       return getNear(isAddressable, "street", 200);
74704     }
74705     function getNearPlaces() {
74706       function isAddressable(d2) {
74707         if (d2.tags.name) {
74708           if (d2.tags.place) return true;
74709           if (d2.tags.boundary === "administrative" && d2.tags.admin_level > 8) return true;
74710         }
74711         return false;
74712       }
74713       return getNear(isAddressable, "place", 200);
74714     }
74715     function getNearCities() {
74716       function isAddressable(d2) {
74717         if (d2.tags.name) {
74718           if (d2.tags.boundary === "administrative" && d2.tags.admin_level === "8") return true;
74719           if (d2.tags.border_type === "city") return true;
74720           if (d2.tags.place === "city" || d2.tags.place === "town" || d2.tags.place === "village" || d2.tags.place === "hamlet") return true;
74721         }
74722         if (d2.tags["".concat(field.key, ":city")]) return true;
74723         return false;
74724       }
74725       return getNear(isAddressable, "city", 200, "".concat(field.key, ":city"));
74726     }
74727     function getNearPostcodes() {
74728       const postcodes = [].concat(getNearValues("postcode")).concat(getNear((d2) => d2.tags.postal_code, "postcode", 200, "postal_code"));
74729       return utilArrayUniqBy(postcodes, (item) => item.value);
74730     }
74731     function getNearValues(key) {
74732       const tagKey = "".concat(field.key, ":").concat(key);
74733       function hasTag(d2) {
74734         return _entityIDs.indexOf(d2.id) === -1 && d2.tags[tagKey];
74735       }
74736       return getNear(hasTag, key, 200, tagKey);
74737     }
74738     function getEnclosingValues(key) {
74739       const tagKey = "".concat(field.key, ":").concat(key);
74740       function hasTag(d2) {
74741         return _entityIDs.indexOf(d2.id) === -1 && d2.tags[tagKey];
74742       }
74743       const enclosingAddresses = getEnclosing(hasTag, key, tagKey);
74744       function isBuilding(d2) {
74745         return _entityIDs.indexOf(d2.id) === -1 && d2.tags.building && d2.tags.building !== "no";
74746       }
74747       const enclosingBuildings = getEnclosing(isBuilding, "building", "building").map((d2) => d2.geom);
74748       function isInNearbyBuilding(d2) {
74749         return hasTag(d2) && d2.type === "node" && enclosingBuildings.some(
74750           (geom) => geoPointInPolygon(d2.loc, geom) || geom.indexOf(d2.loc) !== -1
74751         );
74752       }
74753       const nearPointAddresses = getNear(isInNearbyBuilding, key, 100, tagKey);
74754       return utilArrayUniqBy([
74755         ...enclosingAddresses,
74756         ...nearPointAddresses
74757       ], "value").sort((a2, b3) => a2.value > b3.value ? 1 : -1);
74758     }
74759     function updateForCountryCode() {
74760       if (!_countryCode) return;
74761       var addressFormat;
74762       for (var i3 = 0; i3 < _addressFormats.length; i3++) {
74763         var format2 = _addressFormats[i3];
74764         if (!format2.countryCodes) {
74765           addressFormat = format2;
74766         } else if (format2.countryCodes.indexOf(_countryCode) !== -1) {
74767           addressFormat = format2;
74768           break;
74769         }
74770       }
74771       const maybeDropdowns = /* @__PURE__ */ new Set([
74772         "housenumber",
74773         "housename"
74774       ]);
74775       const dropdowns = /* @__PURE__ */ new Set([
74776         "block_number",
74777         "city",
74778         "country",
74779         "county",
74780         "district",
74781         "floor",
74782         "hamlet",
74783         "neighbourhood",
74784         "place",
74785         "postcode",
74786         "province",
74787         "quarter",
74788         "state",
74789         "street",
74790         "street+place",
74791         "subdistrict",
74792         "suburb",
74793         "town",
74794         ...maybeDropdowns
74795       ]);
74796       var widths = addressFormat.widths || {
74797         housenumber: 1 / 5,
74798         unit: 1 / 5,
74799         street: 1 / 2,
74800         place: 1 / 2,
74801         city: 2 / 3,
74802         state: 1 / 4,
74803         postcode: 1 / 3
74804       };
74805       function row(r2) {
74806         var total = r2.reduce(function(sum, key) {
74807           return sum + (widths[key] || 0.5);
74808         }, 0);
74809         return r2.map(function(key) {
74810           return {
74811             id: key,
74812             width: (widths[key] || 0.5) / total
74813           };
74814         });
74815       }
74816       var rows = _wrap.selectAll(".addr-row").data(addressFormat.format, function(d2) {
74817         return d2.toString();
74818       });
74819       rows.exit().remove();
74820       rows.enter().append("div").attr("class", "addr-row").selectAll("input").data(row).enter().append("input").property("type", "text").attr("id", (d2) => d2.id === "housenumber" ? field.domId : null).attr("class", function(d2) {
74821         return "addr-" + d2.id;
74822       }).call(utilNoAuto).each(addDropdown).call(updatePlaceholder).style("width", function(d2) {
74823         return d2.width * 100 + "%";
74824       });
74825       function addDropdown(d2) {
74826         if (!dropdowns.has(d2.id)) {
74827           return false;
74828         }
74829         var nearValues;
74830         switch (d2.id) {
74831           case "street":
74832             nearValues = getNearStreets;
74833             break;
74834           case "place":
74835             nearValues = getNearPlaces;
74836             break;
74837           case "street+place":
74838             nearValues = () => [].concat(getNearStreets()).concat(getNearPlaces());
74839             d2.isAutoStreetPlace = true;
74840             d2.id = _tags["".concat(field.key, ":place")] ? "place" : "street";
74841             break;
74842           case "city":
74843             nearValues = getNearCities;
74844             break;
74845           case "postcode":
74846             nearValues = getNearPostcodes;
74847             break;
74848           case "housenumber":
74849           case "housename":
74850             nearValues = getEnclosingValues;
74851             break;
74852           default:
74853             nearValues = getNearValues;
74854         }
74855         if (maybeDropdowns.has(d2.id)) {
74856           const candidates = nearValues(d2.id);
74857           if (candidates.length === 0) return false;
74858         }
74859         select_default2(this).call(
74860           uiCombobox(context, "address-".concat(d2.isAutoStreetPlace ? "street-place" : d2.id)).minItems(1).caseSensitive(true).fetcher(function(typedValue, callback) {
74861             typedValue = typedValue.toLowerCase();
74862             callback(nearValues(d2.id).filter((v3) => v3.value.toLowerCase().indexOf(typedValue) !== -1));
74863           }).on("accept", function(selected) {
74864             if (d2.isAutoStreetPlace) {
74865               d2.id = selected ? selected.type : "street";
74866               utilTriggerEvent(select_default2(this), "change");
74867             }
74868           })
74869         );
74870       }
74871       _wrap.selectAll("input").on("input", change(true)).on("blur", change()).on("change", change());
74872       if (_tags) updateTags(_tags);
74873     }
74874     function address(selection2) {
74875       _selection = selection2;
74876       _wrap = selection2.selectAll(".form-field-input-wrap").data([0]);
74877       _wrap = _wrap.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(_wrap);
74878       var extent = combinedEntityExtent();
74879       if (extent) {
74880         var countryCode;
74881         if (context.inIntro()) {
74882           countryCode = _t("intro.graph.countrycode");
74883         } else {
74884           var center = extent.center();
74885           countryCode = iso1A2Code(center);
74886         }
74887         if (countryCode) {
74888           _countryCode = countryCode.toLowerCase();
74889           updateForCountryCode();
74890         }
74891       }
74892     }
74893     function change(onInput) {
74894       return function() {
74895         var tags = {};
74896         _wrap.selectAll("input").each(function(subfield) {
74897           var key = field.key + ":" + subfield.id;
74898           var value = this.value;
74899           if (!onInput) value = context.cleanTagValue(value);
74900           if (Array.isArray(_tags[key]) && !value) return;
74901           if (subfield.isAutoStreetPlace) {
74902             if (subfield.id === "street") {
74903               tags["".concat(field.key, ":place")] = void 0;
74904             } else if (subfield.id === "place") {
74905               tags["".concat(field.key, ":street")] = void 0;
74906             }
74907           }
74908           tags[key] = value || void 0;
74909         });
74910         Object.keys(tags).filter((k3) => tags[k3]).forEach((k3) => _tags[k3] = tags[k3]);
74911         dispatch12.call("change", this, tags, onInput);
74912       };
74913     }
74914     function updatePlaceholder(inputSelection) {
74915       return inputSelection.attr("placeholder", function(subfield) {
74916         if (_tags && Array.isArray(_tags[field.key + ":" + subfield.id])) {
74917           return _t("inspector.multiple_values");
74918         }
74919         if (subfield.isAutoStreetPlace) {
74920           return "".concat(getLocalPlaceholder("street"), " / ").concat(getLocalPlaceholder("place"));
74921         }
74922         return getLocalPlaceholder(subfield.id);
74923       });
74924     }
74925     function getLocalPlaceholder(key) {
74926       if (_countryCode) {
74927         var localkey = key + "!" + _countryCode;
74928         var tkey = addrField.hasTextForStringId("placeholders." + localkey) ? localkey : key;
74929         return addrField.t("placeholders." + tkey);
74930       }
74931     }
74932     function updateTags(tags) {
74933       utilGetSetValue(_wrap.selectAll("input"), (subfield) => {
74934         var val;
74935         if (subfield.isAutoStreetPlace) {
74936           const streetKey = "".concat(field.key, ":street");
74937           const placeKey = "".concat(field.key, ":place");
74938           if (tags[streetKey] !== void 0 || tags[placeKey] === void 0) {
74939             val = tags[streetKey];
74940             subfield.id = "street";
74941           } else {
74942             val = tags[placeKey];
74943             subfield.id = "place";
74944           }
74945         } else {
74946           val = tags["".concat(field.key, ":").concat(subfield.id)];
74947         }
74948         return typeof val === "string" ? val : "";
74949       }).attr("title", function(subfield) {
74950         var val = tags[field.key + ":" + subfield.id];
74951         return val && Array.isArray(val) ? val.filter(Boolean).join("\n") : void 0;
74952       }).classed("mixed", function(subfield) {
74953         return Array.isArray(tags[field.key + ":" + subfield.id]);
74954       }).call(updatePlaceholder);
74955     }
74956     function combinedEntityExtent() {
74957       return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
74958     }
74959     address.entityIDs = function(val) {
74960       if (!arguments.length) return _entityIDs;
74961       _entityIDs = val;
74962       return address;
74963     };
74964     address.tags = function(tags) {
74965       _tags = tags;
74966       updateTags(tags);
74967     };
74968     address.focus = function() {
74969       var node = _wrap.selectAll("input").node();
74970       if (node) node.focus();
74971     };
74972     return utilRebind(address, dispatch12, "on");
74973   }
74974
74975   // modules/ui/fields/directional_combo.js
74976   function uiFieldDirectionalCombo(field, context) {
74977     var dispatch12 = dispatch_default("change");
74978     var items = select_default2(null);
74979     var wrap2 = select_default2(null);
74980     var _tags;
74981     var _combos = {};
74982     if (field.type === "cycleway") {
74983       field = __spreadProps(__spreadValues({}, field), {
74984         key: field.keys[0],
74985         keys: field.keys.slice(1)
74986       });
74987     }
74988     function directionalCombo(selection2) {
74989       function stripcolon(s2) {
74990         return s2.replace(":", "");
74991       }
74992       wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
74993       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
74994       var div = wrap2.selectAll("ul").data([0]);
74995       div = div.enter().append("ul").attr("class", "rows rows-table").merge(div);
74996       items = div.selectAll("li").data(field.keys);
74997       var enter = items.enter().append("li").attr("class", function(d2) {
74998         return "labeled-input preset-directionalcombo-" + stripcolon(d2);
74999       });
75000       enter.append("div").attr("class", "label preset-label-directionalcombo").attr("for", function(d2) {
75001         return "preset-input-directionalcombo-" + stripcolon(d2);
75002       }).html(function(d2) {
75003         return field.t.html("types." + d2);
75004       });
75005       enter.append("div").attr("class", "preset-input-directionalcombo-wrap form-field-input-wrap").each(function(key) {
75006         const subField = __spreadProps(__spreadValues({}, field), {
75007           type: "combo",
75008           key
75009         });
75010         const combo = uiFieldCombo(subField, context);
75011         combo.on("change", (t2) => change(key, t2[key]));
75012         _combos[key] = combo;
75013         select_default2(this).call(combo);
75014       });
75015       items = items.merge(enter);
75016       wrap2.selectAll(".preset-input-directionalcombo").on("change", change).on("blur", change);
75017     }
75018     function change(key, newValue) {
75019       const commonKey = field.key;
75020       const otherCommonKey = field.key.endsWith(":both") ? field.key.replace(/:both$/, "") : "".concat(field.key, ":both");
75021       const otherKey = key === field.keys[0] ? field.keys[1] : field.keys[0];
75022       dispatch12.call("change", this, (tags) => {
75023         const otherValue = tags[otherKey] || tags[commonKey] || tags[otherCommonKey];
75024         if (newValue === otherValue) {
75025           tags[commonKey] = newValue;
75026           delete tags[key];
75027           delete tags[otherKey];
75028           delete tags[otherCommonKey];
75029         } else {
75030           tags[key] = newValue;
75031           delete tags[commonKey];
75032           delete tags[otherCommonKey];
75033           tags[otherKey] = otherValue;
75034         }
75035         return tags;
75036       });
75037     }
75038     directionalCombo.tags = function(tags) {
75039       _tags = tags;
75040       const commonKey = field.key.replace(/:both$/, "");
75041       for (let key in _combos) {
75042         const uniqueValues = [...new Set([].concat(_tags[commonKey]).concat(_tags["".concat(commonKey, ":both")]).concat(_tags[key]).filter(Boolean))];
75043         _combos[key].tags({ [key]: uniqueValues.length > 1 ? uniqueValues : uniqueValues[0] });
75044       }
75045     };
75046     directionalCombo.focus = function() {
75047       var node = wrap2.selectAll("input").node();
75048       if (node) node.focus();
75049     };
75050     return utilRebind(directionalCombo, dispatch12, "on");
75051   }
75052
75053   // modules/ui/fields/lanes.js
75054   function uiFieldLanes(field, context) {
75055     var dispatch12 = dispatch_default("change");
75056     var LANE_WIDTH = 40;
75057     var LANE_HEIGHT = 200;
75058     var _entityIDs = [];
75059     function lanes(selection2) {
75060       var lanesData = context.entity(_entityIDs[0]).lanes();
75061       if (!context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode) {
75062         selection2.call(lanes.off);
75063         return;
75064       }
75065       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
75066       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
75067       var surface = wrap2.selectAll(".surface").data([0]);
75068       var d2 = utilGetDimensions(wrap2);
75069       var freeSpace = d2[0] - lanesData.lanes.length * LANE_WIDTH * 1.5 + LANE_WIDTH * 0.5;
75070       surface = surface.enter().append("svg").attr("width", d2[0]).attr("height", 300).attr("class", "surface").merge(surface);
75071       var lanesSelection = surface.selectAll(".lanes").data([0]);
75072       lanesSelection = lanesSelection.enter().append("g").attr("class", "lanes").merge(lanesSelection);
75073       lanesSelection.attr("transform", function() {
75074         return "translate(" + freeSpace / 2 + ", 0)";
75075       });
75076       var lane = lanesSelection.selectAll(".lane").data(lanesData.lanes);
75077       lane.exit().remove();
75078       var enter = lane.enter().append("g").attr("class", "lane");
75079       enter.append("g").append("rect").attr("y", 50).attr("width", LANE_WIDTH).attr("height", LANE_HEIGHT);
75080       enter.append("g").attr("class", "forward").append("text").attr("y", 40).attr("x", 14).text("\u25B2");
75081       enter.append("g").attr("class", "bothways").append("text").attr("y", 40).attr("x", 14).text("\u25B2\u25BC");
75082       enter.append("g").attr("class", "backward").append("text").attr("y", 40).attr("x", 14).text("\u25BC");
75083       lane = lane.merge(enter);
75084       lane.attr("transform", function(d4) {
75085         return "translate(" + LANE_WIDTH * d4.index * 1.5 + ", 0)";
75086       });
75087       lane.select(".forward").style("visibility", function(d4) {
75088         return d4.direction === "forward" ? "visible" : "hidden";
75089       });
75090       lane.select(".bothways").style("visibility", function(d4) {
75091         return d4.direction === "bothways" ? "visible" : "hidden";
75092       });
75093       lane.select(".backward").style("visibility", function(d4) {
75094         return d4.direction === "backward" ? "visible" : "hidden";
75095       });
75096     }
75097     lanes.entityIDs = function(val) {
75098       _entityIDs = val;
75099     };
75100     lanes.tags = function() {
75101     };
75102     lanes.focus = function() {
75103     };
75104     lanes.off = function() {
75105     };
75106     return utilRebind(lanes, dispatch12, "on");
75107   }
75108   uiFieldLanes.supportsMultiselection = false;
75109
75110   // modules/ui/fields/localized.js
75111   var _languagesArray = [];
75112   var LANGUAGE_SUFFIX_REGEX = /^(.*):([a-z]{2,3}(?:-[A-Z][a-z]{3})?(?:-[A-Z]{2})?)$/;
75113   function uiFieldLocalized(field, context) {
75114     var dispatch12 = dispatch_default("change", "input");
75115     var input = select_default2(null);
75116     var localizedInputs = select_default2(null);
75117     var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue());
75118     var _countryCode;
75119     var _tags;
75120     _mainFileFetcher.get("languages").then(loadLanguagesArray).catch(function() {
75121     });
75122     var _territoryLanguages = {};
75123     _mainFileFetcher.get("territory_languages").then(function(d2) {
75124       _territoryLanguages = d2;
75125     }).catch(function() {
75126     });
75127     var langCombo = uiCombobox(context, "localized-lang").fetcher(fetchLanguages).minItems(0);
75128     var _selection = select_default2(null);
75129     var _multilingual = [];
75130     var _buttonTip = uiTooltip().title(() => _t.append("translate.translate")).placement("left");
75131     var _entityIDs = [];
75132     function loadLanguagesArray(dataLanguages) {
75133       if (_languagesArray.length !== 0) return;
75134       var replacements = {
75135         sr: "sr-Cyrl",
75136         // in OSM, `sr` implies Cyrillic
75137         "sr-Cyrl": false
75138         // `sr-Cyrl` isn't used in OSM
75139       };
75140       for (var code in dataLanguages) {
75141         if (replacements[code] === false) continue;
75142         var metaCode = code;
75143         if (replacements[code]) metaCode = replacements[code];
75144         _languagesArray.push({
75145           localName: _mainLocalizer.languageName(metaCode, { localOnly: true }),
75146           nativeName: dataLanguages[metaCode].nativeName,
75147           code,
75148           label: _mainLocalizer.languageName(metaCode)
75149         });
75150       }
75151     }
75152     function calcLocked() {
75153       var isLocked = field.id === "name" && _entityIDs.length && _entityIDs.some(function(entityID) {
75154         var entity = context.graph().hasEntity(entityID);
75155         if (!entity) return false;
75156         if (entity.tags.wikidata) return true;
75157         if (entity.tags["name:etymology:wikidata"]) return true;
75158         var preset = _mainPresetIndex.match(entity, context.graph());
75159         if (preset) {
75160           var isSuggestion = preset.suggestion;
75161           var fields = preset.fields(entity.extent(context.graph()).center());
75162           var showsBrandField = fields.some(function(d2) {
75163             return d2.id === "brand";
75164           });
75165           var showsOperatorField = fields.some(function(d2) {
75166             return d2.id === "operator";
75167           });
75168           var setsName = preset.addTags.name;
75169           var setsBrandWikidata = preset.addTags["brand:wikidata"];
75170           var setsOperatorWikidata = preset.addTags["operator:wikidata"];
75171           return isSuggestion && setsName && (setsBrandWikidata && !showsBrandField || setsOperatorWikidata && !showsOperatorField);
75172         }
75173         return false;
75174       });
75175       field.locked(isLocked);
75176     }
75177     function calcMultilingual(tags) {
75178       var existingLangsOrdered = _multilingual.map(function(item2) {
75179         return item2.lang;
75180       });
75181       var existingLangs = new Set(existingLangsOrdered.filter(Boolean));
75182       for (var k3 in tags) {
75183         var m3 = k3.match(LANGUAGE_SUFFIX_REGEX);
75184         if (m3 && m3[1] === field.key && m3[2]) {
75185           var item = { lang: m3[2], value: tags[k3] };
75186           if (existingLangs.has(item.lang)) {
75187             _multilingual[existingLangsOrdered.indexOf(item.lang)].value = item.value;
75188             existingLangs.delete(item.lang);
75189           } else {
75190             _multilingual.push(item);
75191           }
75192         }
75193       }
75194       _multilingual.forEach(function(item2) {
75195         if (item2.lang && existingLangs.has(item2.lang)) {
75196           item2.value = "";
75197         }
75198       });
75199     }
75200     function localized(selection2) {
75201       _selection = selection2;
75202       calcLocked();
75203       var isLocked = field.locked();
75204       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
75205       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
75206       input = wrap2.selectAll(".localized-main").data([0]);
75207       input = input.enter().append("input").attr("type", "text").attr("dir", "auto").attr("id", field.domId).attr("class", "localized-main").call(utilNoAuto).merge(input);
75208       input.classed("disabled", !!isLocked).attr("readonly", isLocked || null).on("input", change(true)).on("blur", change()).on("change", change());
75209       wrap2.call(_lengthIndicator);
75210       var translateButton = wrap2.selectAll(".localized-add").data([0]);
75211       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);
75212       translateButton.classed("disabled", !!isLocked).call(isLocked ? _buttonTip.destroy : _buttonTip).on("click", addNew);
75213       if (_tags && !_multilingual.length) {
75214         calcMultilingual(_tags);
75215       }
75216       localizedInputs = selection2.selectAll(".localized-multilingual").data([0]);
75217       localizedInputs = localizedInputs.enter().append("div").attr("class", "localized-multilingual").merge(localizedInputs);
75218       localizedInputs.call(renderMultilingual);
75219       localizedInputs.selectAll("button, input").classed("disabled", !!isLocked).attr("readonly", isLocked || null);
75220       selection2.selectAll(".combobox-caret").classed("nope", true);
75221       function addNew(d3_event) {
75222         d3_event.preventDefault();
75223         if (field.locked()) return;
75224         var defaultLang = _mainLocalizer.languageCode().toLowerCase();
75225         var langExists = _multilingual.find(function(datum2) {
75226           return datum2.lang === defaultLang;
75227         });
75228         var isLangEn = defaultLang.indexOf("en") > -1;
75229         if (isLangEn || langExists) {
75230           defaultLang = "";
75231           langExists = _multilingual.find(function(datum2) {
75232             return datum2.lang === defaultLang;
75233           });
75234         }
75235         if (!langExists) {
75236           _multilingual.unshift({ lang: defaultLang, value: "" });
75237           localizedInputs.call(renderMultilingual);
75238         }
75239       }
75240       function change(onInput) {
75241         return function(d3_event) {
75242           if (field.locked()) {
75243             d3_event.preventDefault();
75244             return;
75245           }
75246           var val = utilGetSetValue(select_default2(this));
75247           if (!onInput) val = context.cleanTagValue(val);
75248           if (!val && Array.isArray(_tags[field.key])) return;
75249           var t2 = {};
75250           t2[field.key] = val || void 0;
75251           dispatch12.call("change", this, t2, onInput);
75252         };
75253       }
75254     }
75255     function key(lang) {
75256       return field.key + ":" + lang;
75257     }
75258     function changeLang(d3_event, d2) {
75259       var tags = {};
75260       var lang = utilGetSetValue(select_default2(this)).toLowerCase();
75261       var language = _languagesArray.find(function(d4) {
75262         return d4.label.toLowerCase() === lang || d4.localName && d4.localName.toLowerCase() === lang || d4.nativeName && d4.nativeName.toLowerCase() === lang;
75263       });
75264       if (language) lang = language.code;
75265       if (d2.lang && d2.lang !== lang) {
75266         tags[key(d2.lang)] = void 0;
75267       }
75268       var newKey = lang && context.cleanTagKey(key(lang));
75269       var value = utilGetSetValue(select_default2(this.parentNode).selectAll(".localized-value"));
75270       if (newKey && value) {
75271         tags[newKey] = value;
75272       }
75273       d2.lang = lang;
75274       dispatch12.call("change", this, tags);
75275     }
75276     function changeValue(d3_event, d2) {
75277       if (!d2.lang) return;
75278       var value = context.cleanTagValue(utilGetSetValue(select_default2(this))) || void 0;
75279       if (!value && Array.isArray(d2.value)) return;
75280       var t2 = {};
75281       t2[key(d2.lang)] = value;
75282       d2.value = value;
75283       dispatch12.call("change", this, t2);
75284     }
75285     function fetchLanguages(value, cb) {
75286       var v3 = value.toLowerCase();
75287       var langCodes = [_mainLocalizer.localeCode(), _mainLocalizer.languageCode()];
75288       if (_countryCode && _territoryLanguages[_countryCode]) {
75289         langCodes = langCodes.concat(_territoryLanguages[_countryCode]);
75290       }
75291       var langItems = [];
75292       langCodes.forEach(function(code) {
75293         var langItem = _languagesArray.find(function(item) {
75294           return item.code === code;
75295         });
75296         if (langItem) langItems.push(langItem);
75297       });
75298       langItems = utilArrayUniq(langItems.concat(_languagesArray));
75299       cb(langItems.filter(function(d2) {
75300         return d2.label.toLowerCase().indexOf(v3) >= 0 || d2.localName && d2.localName.toLowerCase().indexOf(v3) >= 0 || d2.nativeName && d2.nativeName.toLowerCase().indexOf(v3) >= 0 || d2.code.toLowerCase().indexOf(v3) >= 0;
75301       }).map(function(d2) {
75302         return { value: d2.label };
75303       }));
75304     }
75305     function renderMultilingual(selection2) {
75306       var entries = selection2.selectAll("div.entry").data(_multilingual, function(d2) {
75307         return d2.lang;
75308       });
75309       entries.exit().style("top", "0").style("max-height", "240px").transition().duration(200).style("opacity", "0").style("max-height", "0px").remove();
75310       var entriesEnter = entries.enter().append("div").attr("class", "entry").each(function(_3, index) {
75311         var wrap2 = select_default2(this);
75312         var domId = utilUniqueDomId(index);
75313         var label = wrap2.append("label").attr("class", "field-label").attr("for", domId);
75314         var text = label.append("span").attr("class", "label-text");
75315         text.append("span").attr("class", "label-textvalue").call(_t.append("translate.localized_translation_label"));
75316         text.append("span").attr("class", "label-textannotation");
75317         label.append("button").attr("class", "remove-icon-multilingual").attr("title", _t("icons.remove")).on("click", function(d3_event, d2) {
75318           if (field.locked()) return;
75319           d3_event.preventDefault();
75320           _multilingual.splice(_multilingual.indexOf(d2), 1);
75321           var langKey = d2.lang && key(d2.lang);
75322           if (langKey && langKey in _tags) {
75323             delete _tags[langKey];
75324             var t2 = {};
75325             t2[langKey] = void 0;
75326             dispatch12.call("change", this, t2);
75327             return;
75328           }
75329           renderMultilingual(selection2);
75330         }).call(svgIcon("#iD-operation-delete"));
75331         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);
75332         wrap2.append("input").attr("type", "text").attr("dir", "auto").attr("class", "localized-value").on("blur", changeValue).on("change", changeValue);
75333       });
75334       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() {
75335         select_default2(this).style("max-height", "").style("overflow", "visible");
75336       });
75337       entries = entries.merge(entriesEnter);
75338       entries.order();
75339       entries.classed("present", true);
75340       utilGetSetValue(entries.select(".localized-lang"), function(d2) {
75341         var langItem = _languagesArray.find(function(item) {
75342           return item.code === d2.lang;
75343         });
75344         if (langItem) return langItem.label;
75345         return d2.lang;
75346       });
75347       utilGetSetValue(entries.select(".localized-value"), function(d2) {
75348         return typeof d2.value === "string" ? d2.value : "";
75349       }).attr("title", function(d2) {
75350         return Array.isArray(d2.value) ? d2.value.filter(Boolean).join("\n") : null;
75351       }).attr("placeholder", function(d2) {
75352         return Array.isArray(d2.value) ? _t("inspector.multiple_values") : _t("translate.localized_translation_name");
75353       }).attr("lang", function(d2) {
75354         return d2.lang;
75355       }).classed("mixed", function(d2) {
75356         return Array.isArray(d2.value);
75357       });
75358     }
75359     localized.tags = function(tags) {
75360       _tags = tags;
75361       var isMixed = Array.isArray(tags[field.key]);
75362       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);
75363       calcMultilingual(tags);
75364       _selection.call(localized);
75365       if (!isMixed) {
75366         _lengthIndicator.update(tags[field.key]);
75367       }
75368     };
75369     localized.focus = function() {
75370       input.node().focus();
75371     };
75372     localized.entityIDs = function(val) {
75373       if (!arguments.length) return _entityIDs;
75374       _entityIDs = val;
75375       _multilingual = [];
75376       loadCountryCode();
75377       return localized;
75378     };
75379     function loadCountryCode() {
75380       var extent = combinedEntityExtent();
75381       var countryCode = extent && iso1A2Code(extent.center());
75382       _countryCode = countryCode && countryCode.toLowerCase();
75383     }
75384     function combinedEntityExtent() {
75385       return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
75386     }
75387     return utilRebind(localized, dispatch12, "on");
75388   }
75389
75390   // modules/ui/fields/roadheight.js
75391   function uiFieldRoadheight(field, context) {
75392     var dispatch12 = dispatch_default("change");
75393     var primaryUnitInput = select_default2(null);
75394     var primaryInput = select_default2(null);
75395     var secondaryInput = select_default2(null);
75396     var secondaryUnitInput = select_default2(null);
75397     var _entityIDs = [];
75398     var _tags;
75399     var _isImperial;
75400     var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
75401     var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
75402     var primaryUnits = [
75403       {
75404         value: "m",
75405         title: _t("inspector.roadheight.meter")
75406       },
75407       {
75408         value: "ft",
75409         title: _t("inspector.roadheight.foot")
75410       }
75411     ];
75412     var unitCombo = uiCombobox(context, "roadheight-unit").data(primaryUnits);
75413     function roadheight(selection2) {
75414       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
75415       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
75416       primaryInput = wrap2.selectAll("input.roadheight-number").data([0]);
75417       primaryInput = primaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-number").attr("id", field.domId).call(utilNoAuto).merge(primaryInput);
75418       primaryInput.on("change", change).on("blur", change);
75419       var loc = combinedEntityExtent().center();
75420       _isImperial = roadHeightUnit(loc) === "ft";
75421       primaryUnitInput = wrap2.selectAll("input.roadheight-unit").data([0]);
75422       primaryUnitInput = primaryUnitInput.enter().append("input").attr("type", "text").attr("class", "roadheight-unit").call(unitCombo).merge(primaryUnitInput);
75423       primaryUnitInput.on("blur", changeUnits).on("change", changeUnits);
75424       secondaryInput = wrap2.selectAll("input.roadheight-secondary-number").data([0]);
75425       secondaryInput = secondaryInput.enter().append("input").attr("type", "text").attr("class", "roadheight-secondary-number").call(utilNoAuto).merge(secondaryInput);
75426       secondaryInput.on("change", change).on("blur", change);
75427       secondaryUnitInput = wrap2.selectAll("input.roadheight-secondary-unit").data([0]);
75428       secondaryUnitInput = secondaryUnitInput.enter().append("input").attr("type", "text").call(utilNoAuto).classed("disabled", true).classed("roadheight-secondary-unit", true).attr("readonly", "readonly").merge(secondaryUnitInput);
75429       function changeUnits() {
75430         var primaryUnit = utilGetSetValue(primaryUnitInput);
75431         if (primaryUnit === "m") {
75432           _isImperial = false;
75433         } else if (primaryUnit === "ft") {
75434           _isImperial = true;
75435         }
75436         utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
75437         setUnitSuggestions();
75438         change();
75439       }
75440     }
75441     function setUnitSuggestions() {
75442       utilGetSetValue(primaryUnitInput, _isImperial ? "ft" : "m");
75443     }
75444     function change() {
75445       var tag = {};
75446       var primaryValue = utilGetSetValue(primaryInput).trim();
75447       var secondaryValue = utilGetSetValue(secondaryInput).trim();
75448       if (!primaryValue && !secondaryValue && Array.isArray(_tags[field.key])) return;
75449       if (!primaryValue && !secondaryValue) {
75450         tag[field.key] = void 0;
75451       } else {
75452         var rawPrimaryValue = likelyRawNumberFormat.test(primaryValue) ? parseFloat(primaryValue) : parseLocaleFloat(primaryValue);
75453         if (isNaN(rawPrimaryValue)) rawPrimaryValue = primaryValue;
75454         var rawSecondaryValue = likelyRawNumberFormat.test(secondaryValue) ? parseFloat(secondaryValue) : parseLocaleFloat(secondaryValue);
75455         if (isNaN(rawSecondaryValue)) rawSecondaryValue = secondaryValue;
75456         if (isNaN(rawPrimaryValue) || isNaN(rawSecondaryValue) || !_isImperial) {
75457           tag[field.key] = context.cleanTagValue(rawPrimaryValue);
75458         } else {
75459           if (rawPrimaryValue !== "") {
75460             rawPrimaryValue = rawPrimaryValue + "'";
75461           }
75462           if (rawSecondaryValue !== "") {
75463             rawSecondaryValue = rawSecondaryValue + '"';
75464           }
75465           tag[field.key] = context.cleanTagValue(rawPrimaryValue + rawSecondaryValue);
75466         }
75467       }
75468       dispatch12.call("change", this, tag);
75469     }
75470     roadheight.tags = function(tags) {
75471       _tags = tags;
75472       var primaryValue = tags[field.key];
75473       var secondaryValue;
75474       var isMixed = Array.isArray(primaryValue);
75475       if (!isMixed) {
75476         if (primaryValue && (primaryValue.indexOf("'") >= 0 || primaryValue.indexOf('"') >= 0)) {
75477           secondaryValue = primaryValue.match(/(-?[\d.]+)"/);
75478           if (secondaryValue !== null) {
75479             secondaryValue = formatFloat(parseFloat(secondaryValue[1]));
75480           }
75481           primaryValue = primaryValue.match(/(-?[\d.]+)'/);
75482           if (primaryValue !== null) {
75483             primaryValue = formatFloat(parseFloat(primaryValue[1]));
75484           }
75485           _isImperial = true;
75486         } else if (primaryValue) {
75487           var rawValue = primaryValue;
75488           primaryValue = parseFloat(rawValue);
75489           if (isNaN(primaryValue)) {
75490             primaryValue = rawValue;
75491           } else {
75492             primaryValue = formatFloat(primaryValue);
75493           }
75494           _isImperial = false;
75495         }
75496       }
75497       setUnitSuggestions();
75498       var inchesPlaceholder = formatFloat(0);
75499       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);
75500       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");
75501       secondaryUnitInput.attr("value", _isImperial ? _t("inspector.roadheight.inch") : null);
75502     };
75503     roadheight.focus = function() {
75504       primaryInput.node().focus();
75505     };
75506     roadheight.entityIDs = function(val) {
75507       _entityIDs = val;
75508     };
75509     function combinedEntityExtent() {
75510       return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
75511     }
75512     return utilRebind(roadheight, dispatch12, "on");
75513   }
75514
75515   // modules/ui/fields/roadspeed.js
75516   function uiFieldRoadspeed(field, context) {
75517     var dispatch12 = dispatch_default("change");
75518     var unitInput = select_default2(null);
75519     var input = select_default2(null);
75520     var _entityIDs = [];
75521     var _tags;
75522     var _isImperial;
75523     var formatFloat = _mainLocalizer.floatFormatter(_mainLocalizer.languageCode());
75524     var parseLocaleFloat = _mainLocalizer.floatParser(_mainLocalizer.languageCode());
75525     var speedCombo = uiCombobox(context, "roadspeed");
75526     var unitCombo = uiCombobox(context, "roadspeed-unit").data(["km/h", "mph"].map(comboValues));
75527     var metricValues = [20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120];
75528     var imperialValues = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80];
75529     function roadspeed(selection2) {
75530       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
75531       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
75532       input = wrap2.selectAll("input.roadspeed-number").data([0]);
75533       input = input.enter().append("input").attr("type", "text").attr("class", "roadspeed-number").attr("id", field.domId).call(utilNoAuto).call(speedCombo).merge(input);
75534       input.on("change", change).on("blur", change);
75535       var loc = combinedEntityExtent().center();
75536       _isImperial = roadSpeedUnit(loc) === "mph";
75537       unitInput = wrap2.selectAll("input.roadspeed-unit").data([0]);
75538       unitInput = unitInput.enter().append("input").attr("type", "text").attr("class", "roadspeed-unit").attr("aria-label", _t("inspector.speed_unit")).call(unitCombo).merge(unitInput);
75539       unitInput.on("blur", changeUnits).on("change", changeUnits);
75540       function changeUnits() {
75541         var unit2 = utilGetSetValue(unitInput);
75542         if (unit2 === "km/h") {
75543           _isImperial = false;
75544         } else if (unit2 === "mph") {
75545           _isImperial = true;
75546         }
75547         utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
75548         setUnitSuggestions();
75549         change();
75550       }
75551     }
75552     function setUnitSuggestions() {
75553       speedCombo.data((_isImperial ? imperialValues : metricValues).map(comboValues));
75554       utilGetSetValue(unitInput, _isImperial ? "mph" : "km/h");
75555     }
75556     function comboValues(d2) {
75557       return {
75558         value: formatFloat(d2),
75559         title: formatFloat(d2)
75560       };
75561     }
75562     function change() {
75563       var tag = {};
75564       var value = utilGetSetValue(input).trim();
75565       if (!value && Array.isArray(_tags[field.key])) return;
75566       if (!value) {
75567         tag[field.key] = void 0;
75568       } else {
75569         var rawValue = likelyRawNumberFormat.test(value) ? parseFloat(value) : parseLocaleFloat(value);
75570         if (isNaN(rawValue)) rawValue = value;
75571         if (isNaN(rawValue) || !_isImperial) {
75572           tag[field.key] = context.cleanTagValue(rawValue);
75573         } else {
75574           tag[field.key] = context.cleanTagValue(rawValue + " mph");
75575         }
75576       }
75577       dispatch12.call("change", this, tag);
75578     }
75579     roadspeed.tags = function(tags) {
75580       _tags = tags;
75581       var rawValue = tags[field.key];
75582       var value = rawValue;
75583       var isMixed = Array.isArray(value);
75584       if (!isMixed) {
75585         if (rawValue && rawValue.indexOf("mph") >= 0) {
75586           _isImperial = true;
75587         } else if (rawValue) {
75588           _isImperial = false;
75589         }
75590         value = parseInt(value, 10);
75591         if (isNaN(value)) {
75592           value = rawValue;
75593         } else {
75594           value = formatFloat(value);
75595         }
75596       }
75597       setUnitSuggestions();
75598       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);
75599     };
75600     roadspeed.focus = function() {
75601       input.node().focus();
75602     };
75603     roadspeed.entityIDs = function(val) {
75604       _entityIDs = val;
75605     };
75606     function combinedEntityExtent() {
75607       return _entityIDs && _entityIDs.length && utilTotalExtent(_entityIDs, context.graph());
75608     }
75609     return utilRebind(roadspeed, dispatch12, "on");
75610   }
75611
75612   // modules/ui/fields/radio.js
75613   function uiFieldRadio(field, context) {
75614     var dispatch12 = dispatch_default("change");
75615     var placeholder = select_default2(null);
75616     var wrap2 = select_default2(null);
75617     var labels = select_default2(null);
75618     var radios = select_default2(null);
75619     var strings = field.resolveReference("stringsCrossReference");
75620     var radioData = (field.options || strings.options || field.keys).slice();
75621     var typeField;
75622     var layerField;
75623     let _tags = {};
75624     var _oldType = {};
75625     var _entityIDs = [];
75626     function selectedKey() {
75627       var node = wrap2.selectAll(".form-field-input-radio label.active input");
75628       return !node.empty() && node.datum();
75629     }
75630     function radio(selection2) {
75631       selection2.classed("preset-radio", true);
75632       wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
75633       var enter = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-radio");
75634       enter.append("span").attr("class", "placeholder");
75635       wrap2 = wrap2.merge(enter);
75636       placeholder = wrap2.selectAll(".placeholder");
75637       labels = wrap2.selectAll("label").data(radioData);
75638       enter = labels.enter().append("label");
75639       enter.append("input").attr("type", "radio").attr("name", field.id).attr("value", function(d2) {
75640         return strings.t("options." + d2, { "default": d2 });
75641       }).attr("checked", false);
75642       enter.append("span").each(function(d2) {
75643         strings.t.append("options." + d2, { "default": d2 })(select_default2(this));
75644       });
75645       labels = labels.merge(enter);
75646       radios = labels.selectAll("input").on("change", changeRadio);
75647     }
75648     function structureExtras(selection2, tags) {
75649       var selected = selectedKey() || tags.layer !== void 0;
75650       var type2 = _mainPresetIndex.field(selected);
75651       var layer = _mainPresetIndex.field("layer");
75652       var showLayer = selected === "bridge" || selected === "tunnel" || tags.layer !== void 0;
75653       var extrasWrap = selection2.selectAll(".structure-extras-wrap").data(selected ? [0] : []);
75654       extrasWrap.exit().remove();
75655       extrasWrap = extrasWrap.enter().append("div").attr("class", "structure-extras-wrap").merge(extrasWrap);
75656       var list = extrasWrap.selectAll("ul").data([0]);
75657       list = list.enter().append("ul").attr("class", "rows").merge(list);
75658       if (type2) {
75659         if (!typeField || typeField.id !== selected) {
75660           typeField = uiField(context, type2, _entityIDs, { wrap: false }).on("change", changeType);
75661         }
75662         typeField.tags(tags);
75663       } else {
75664         typeField = null;
75665       }
75666       var typeItem = list.selectAll(".structure-type-item").data(typeField ? [typeField] : [], function(d2) {
75667         return d2.id;
75668       });
75669       typeItem.exit().remove();
75670       var typeEnter = typeItem.enter().insert("li", ":first-child").attr("class", "labeled-input structure-type-item");
75671       typeEnter.append("div").attr("class", "label structure-label-type").attr("for", "preset-input-" + selected).call(_t.append("inspector.radio.structure.type"));
75672       typeEnter.append("div").attr("class", "structure-input-type-wrap");
75673       typeItem = typeItem.merge(typeEnter);
75674       if (typeField) {
75675         typeItem.selectAll(".structure-input-type-wrap").call(typeField.render);
75676       }
75677       if (layer && showLayer) {
75678         if (!layerField) {
75679           layerField = uiField(context, layer, _entityIDs, { wrap: false }).on("change", changeLayer);
75680         }
75681         layerField.tags(tags);
75682         field.keys = utilArrayUnion(field.keys, ["layer"]);
75683       } else {
75684         layerField = null;
75685         field.keys = field.keys.filter(function(k3) {
75686           return k3 !== "layer";
75687         });
75688       }
75689       var layerItem = list.selectAll(".structure-layer-item").data(layerField ? [layerField] : []);
75690       layerItem.exit().remove();
75691       var layerEnter = layerItem.enter().append("li").attr("class", "labeled-input structure-layer-item");
75692       layerEnter.append("div").attr("class", "label structure-label-layer").attr("for", "preset-input-layer").call(_t.append("inspector.radio.structure.layer"));
75693       layerEnter.append("div").attr("class", "structure-input-layer-wrap");
75694       layerItem = layerItem.merge(layerEnter);
75695       if (layerField) {
75696         layerItem.selectAll(".structure-input-layer-wrap").call(layerField.render);
75697       }
75698     }
75699     function changeType(t2, onInput) {
75700       var key = selectedKey();
75701       if (!key) return;
75702       var val = t2[key];
75703       if (val !== "no") {
75704         _oldType[key] = val;
75705       }
75706       if (field.type === "structureRadio") {
75707         if (val === "no" || key !== "bridge" && key !== "tunnel" || key === "tunnel" && val === "building_passage") {
75708           t2.layer = void 0;
75709         }
75710         if (t2.layer === void 0) {
75711           if (key === "bridge" && val !== "no") {
75712             t2.layer = "1";
75713           }
75714           if (key === "tunnel" && val !== "no" && val !== "building_passage") {
75715             t2.layer = "-1";
75716           }
75717         }
75718       }
75719       dispatch12.call("change", this, t2, onInput);
75720     }
75721     function changeLayer(t2, onInput) {
75722       dispatch12.call("change", this, t2, onInput);
75723     }
75724     function changeRadio() {
75725       var t2 = {};
75726       var activeKey;
75727       if (field.key) {
75728         t2[field.key] = void 0;
75729       }
75730       radios.each(function(d2) {
75731         var active = select_default2(this).property("checked");
75732         if (active) activeKey = d2;
75733         if (field.key) {
75734           if (active) t2[field.key] = d2;
75735         } else {
75736           var val = _oldType[activeKey] || "yes";
75737           t2[d2] = active ? val : void 0;
75738         }
75739       });
75740       if (field.type === "structureRadio") {
75741         if (activeKey === "bridge") {
75742           const hasExistingLayer = !Number.isNaN(+_tags.layer) && +_tags.layer > 0;
75743           t2.layer = hasExistingLayer ? _tags.layer : "1";
75744         } else if (activeKey === "tunnel" && t2.tunnel !== "building_passage") {
75745           const hasExistingLayer = !Number.isNaN(+_tags.layer) && +_tags.layer < 0;
75746           t2.layer = hasExistingLayer ? _tags.layer : "-1";
75747         } else {
75748           t2.layer = void 0;
75749         }
75750       }
75751       dispatch12.call("change", this, t2);
75752     }
75753     radio.tags = function(tags) {
75754       _tags = tags;
75755       function isOptionChecked(d2) {
75756         if (field.key) {
75757           return tags[field.key] === d2;
75758         }
75759         return !!(typeof tags[d2] === "string" && tags[d2].toLowerCase() !== "no");
75760       }
75761       function isMixed(d2) {
75762         if (field.key) {
75763           return Array.isArray(tags[field.key]) && tags[field.key].includes(d2);
75764         }
75765         return Array.isArray(tags[d2]);
75766       }
75767       radios.property("checked", function(d2) {
75768         return isOptionChecked(d2) && (field.key || field.options.filter(isOptionChecked).length === 1);
75769       });
75770       labels.classed("active", function(d2) {
75771         if (field.key) {
75772           return Array.isArray(tags[field.key]) && tags[field.key].includes(d2) || tags[field.key] === d2;
75773         }
75774         return Array.isArray(tags[d2]) && tags[d2].some((v3) => typeof v3 === "string" && v3.toLowerCase() !== "no") || !!(typeof tags[d2] === "string" && tags[d2].toLowerCase() !== "no");
75775       }).classed("mixed", isMixed).attr("title", function(d2) {
75776         return isMixed(d2) ? _t("inspector.unshared_value_tooltip") : null;
75777       });
75778       var selection2 = radios.filter(function() {
75779         return this.checked;
75780       });
75781       if (selection2.empty()) {
75782         placeholder.text("");
75783         placeholder.call(_t.append("inspector.none"));
75784       } else {
75785         placeholder.text(selection2.attr("value"));
75786         _oldType[selection2.datum()] = tags[selection2.datum()];
75787       }
75788       if (field.type === "structureRadio") {
75789         if (!!tags.waterway && !_oldType.tunnel) {
75790           _oldType.tunnel = "culvert";
75791         }
75792         if (!!tags.waterway && !_oldType.bridge) {
75793           _oldType.bridge = "aqueduct";
75794         }
75795         wrap2.call(structureExtras, tags);
75796       }
75797     };
75798     radio.focus = function() {
75799       radios.node().focus();
75800     };
75801     radio.entityIDs = function(val) {
75802       if (!arguments.length) return _entityIDs;
75803       _entityIDs = val;
75804       _oldType = {};
75805       return radio;
75806     };
75807     radio.isAllowed = function() {
75808       return _entityIDs.length === 1;
75809     };
75810     return utilRebind(radio, dispatch12, "on");
75811   }
75812
75813   // modules/ui/fields/restrictions.js
75814   function uiFieldRestrictions(field, context) {
75815     var dispatch12 = dispatch_default("change");
75816     var breathe = behaviorBreathe(context);
75817     corePreferences("turn-restriction-via-way", null);
75818     var storedViaWay = corePreferences("turn-restriction-via-way0");
75819     var storedDistance = corePreferences("turn-restriction-distance");
75820     var _maxViaWay = storedViaWay !== null ? +storedViaWay : 0;
75821     var _maxDistance = storedDistance ? +storedDistance : 30;
75822     var _initialized3 = false;
75823     var _parent = select_default2(null);
75824     var _container = select_default2(null);
75825     var _oldTurns;
75826     var _graph;
75827     var _vertexID;
75828     var _intersection;
75829     var _fromWayID;
75830     var _lastXPos;
75831     function restrictions(selection2) {
75832       _parent = selection2;
75833       if (_vertexID && (context.graph() !== _graph || !_intersection)) {
75834         _graph = context.graph();
75835         _intersection = osmIntersection(_graph, _vertexID, _maxDistance);
75836       }
75837       var isOK = _intersection && _intersection.vertices.length && // has vertices
75838       _intersection.vertices.filter(function(vertex) {
75839         return vertex.id === _vertexID;
75840       }).length && _intersection.ways.length > 2;
75841       select_default2(selection2.node().parentNode).classed("hide", !isOK);
75842       if (!isOK || !context.container().select(".inspector-wrap.inspector-hidden").empty() || !selection2.node().parentNode || !selection2.node().parentNode.parentNode) {
75843         selection2.call(restrictions.off);
75844         return;
75845       }
75846       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
75847       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
75848       var container = wrap2.selectAll(".restriction-container").data([0]);
75849       var containerEnter = container.enter().append("div").attr("class", "restriction-container");
75850       containerEnter.append("div").attr("class", "restriction-help");
75851       _container = containerEnter.merge(container).call(renderViewer);
75852       var controls = wrap2.selectAll(".restriction-controls").data([0]);
75853       controls.enter().append("div").attr("class", "restriction-controls-container").append("div").attr("class", "restriction-controls").merge(controls).call(renderControls);
75854     }
75855     function renderControls(selection2) {
75856       var distControl = selection2.selectAll(".restriction-distance").data([0]);
75857       distControl.exit().remove();
75858       var distControlEnter = distControl.enter().append("div").attr("class", "restriction-control restriction-distance");
75859       distControlEnter.append("span").attr("class", "restriction-control-label restriction-distance-label").call(_t.append("restriction.controls.distance", { suffix: ":" }));
75860       distControlEnter.append("input").attr("class", "restriction-distance-input").attr("type", "range").attr("min", "20").attr("max", "50").attr("step", "5");
75861       distControlEnter.append("span").attr("class", "restriction-distance-text");
75862       selection2.selectAll(".restriction-distance-input").property("value", _maxDistance).on("input", function() {
75863         var val = select_default2(this).property("value");
75864         _maxDistance = +val;
75865         _intersection = null;
75866         _container.selectAll(".layer-osm .layer-turns *").remove();
75867         corePreferences("turn-restriction-distance", _maxDistance);
75868         _parent.call(restrictions);
75869       });
75870       selection2.selectAll(".restriction-distance-text").call(displayMaxDistance(_maxDistance));
75871       var viaControl = selection2.selectAll(".restriction-via-way").data([0]);
75872       viaControl.exit().remove();
75873       var viaControlEnter = viaControl.enter().append("div").attr("class", "restriction-control restriction-via-way");
75874       viaControlEnter.append("span").attr("class", "restriction-control-label restriction-via-way-label").call(_t.append("restriction.controls.via", { suffix: ":" }));
75875       viaControlEnter.append("input").attr("class", "restriction-via-way-input").attr("type", "range").attr("min", "0").attr("max", "2").attr("step", "1");
75876       viaControlEnter.append("span").attr("class", "restriction-via-way-text");
75877       selection2.selectAll(".restriction-via-way-input").property("value", _maxViaWay).on("input", function() {
75878         var val = select_default2(this).property("value");
75879         _maxViaWay = +val;
75880         _container.selectAll(".layer-osm .layer-turns *").remove();
75881         corePreferences("turn-restriction-via-way0", _maxViaWay);
75882         _parent.call(restrictions);
75883       });
75884       selection2.selectAll(".restriction-via-way-text").call(displayMaxVia(_maxViaWay));
75885     }
75886     function renderViewer(selection2) {
75887       if (!_intersection) return;
75888       var vgraph = _intersection.graph;
75889       var filter2 = utilFunctor(true);
75890       var projection2 = geoRawMercator();
75891       var sdims = utilGetDimensions(context.container().select(".sidebar"));
75892       var d2 = [sdims[0] - 50, 370];
75893       var c2 = geoVecScale(d2, 0.5);
75894       var z3 = 22;
75895       projection2.scale(geoZoomToScale(z3));
75896       var extent = geoExtent();
75897       for (var i3 = 0; i3 < _intersection.vertices.length; i3++) {
75898         extent._extend(_intersection.vertices[i3].extent());
75899       }
75900       var padTop = 35;
75901       if (_intersection.vertices.length > 1) {
75902         var hPadding = Math.min(160, Math.max(110, d2[0] * 0.4));
75903         var vPadding = 160;
75904         var tl = projection2([extent[0][0], extent[1][1]]);
75905         var br = projection2([extent[1][0], extent[0][1]]);
75906         var hFactor = (br[0] - tl[0]) / (d2[0] - hPadding);
75907         var vFactor = (br[1] - tl[1]) / (d2[1] - vPadding - padTop);
75908         var hZoomDiff = Math.log(Math.abs(hFactor)) / Math.LN2;
75909         var vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2;
75910         z3 = z3 - Math.max(hZoomDiff, vZoomDiff);
75911         projection2.scale(geoZoomToScale(z3));
75912       }
75913       var extentCenter = projection2(extent.center());
75914       extentCenter[1] = extentCenter[1] - padTop / 2;
75915       projection2.translate(geoVecSubtract(c2, extentCenter)).clipExtent([[0, 0], d2]);
75916       var drawLayers = svgLayers(projection2, context).only(["osm", "touch"]).dimensions(d2);
75917       var drawVertices = svgVertices(projection2, context);
75918       var drawLines = svgLines(projection2, context);
75919       var drawTurns = svgTurns(projection2, context);
75920       var firstTime = selection2.selectAll(".surface").empty();
75921       selection2.call(drawLayers);
75922       var surface = selection2.selectAll(".surface").classed("tr", true);
75923       if (firstTime) {
75924         _initialized3 = true;
75925         surface.call(breathe);
75926       }
75927       if (_fromWayID && !vgraph.hasEntity(_fromWayID)) {
75928         _fromWayID = null;
75929         _oldTurns = null;
75930       }
75931       surface.call(utilSetDimensions, d2).call(drawVertices, vgraph, _intersection.vertices, filter2, extent, z3).call(drawLines, vgraph, _intersection.ways, filter2).call(drawTurns, vgraph, _intersection.turns(_fromWayID, _maxViaWay));
75932       surface.on("click.restrictions", click).on("mouseover.restrictions", mouseover);
75933       surface.selectAll(".selected").classed("selected", false);
75934       surface.selectAll(".related").classed("related", false);
75935       var way;
75936       if (_fromWayID) {
75937         way = vgraph.entity(_fromWayID);
75938         surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
75939       }
75940       document.addEventListener("resizeWindow", function() {
75941         utilSetDimensions(_container, null);
75942         redraw(1);
75943       }, false);
75944       updateHints(null);
75945       function click(d3_event) {
75946         surface.call(breathe.off).call(breathe);
75947         var datum2 = d3_event.target.__data__;
75948         var entity = datum2 && datum2.properties && datum2.properties.entity;
75949         if (entity) {
75950           datum2 = entity;
75951         }
75952         if (datum2 instanceof osmWay && (datum2.__from || datum2.__via)) {
75953           _fromWayID = datum2.id;
75954           _oldTurns = null;
75955           redraw();
75956         } else if (datum2 instanceof osmTurn) {
75957           var actions, extraActions, turns, i4;
75958           var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
75959           if (datum2.restrictionID && !datum2.direct) {
75960             return;
75961           } else if (datum2.restrictionID && !datum2.only) {
75962             var seen = {};
75963             var datumOnly = JSON.parse(JSON.stringify(datum2));
75964             datumOnly.only = true;
75965             restrictionType = restrictionType.replace(/^no/, "only");
75966             turns = _intersection.turns(_fromWayID, 2);
75967             extraActions = [];
75968             _oldTurns = [];
75969             for (i4 = 0; i4 < turns.length; i4++) {
75970               var turn = turns[i4];
75971               if (seen[turn.restrictionID]) continue;
75972               if (turn.direct && turn.path[1] === datum2.path[1]) {
75973                 seen[turns[i4].restrictionID] = true;
75974                 turn.restrictionType = osmInferRestriction(vgraph, turn, projection2);
75975                 _oldTurns.push(turn);
75976                 extraActions.push(actionUnrestrictTurn(turn));
75977               }
75978             }
75979             actions = _intersection.actions.concat(extraActions, [
75980               actionRestrictTurn(datumOnly, restrictionType),
75981               _t("operations.restriction.annotation.create")
75982             ]);
75983           } else if (datum2.restrictionID) {
75984             turns = _oldTurns || [];
75985             extraActions = [];
75986             for (i4 = 0; i4 < turns.length; i4++) {
75987               if (turns[i4].key !== datum2.key) {
75988                 extraActions.push(actionRestrictTurn(turns[i4], turns[i4].restrictionType));
75989               }
75990             }
75991             _oldTurns = null;
75992             actions = _intersection.actions.concat(extraActions, [
75993               actionUnrestrictTurn(datum2),
75994               _t("operations.restriction.annotation.delete")
75995             ]);
75996           } else {
75997             actions = _intersection.actions.concat([
75998               actionRestrictTurn(datum2, restrictionType),
75999               _t("operations.restriction.annotation.create")
76000             ]);
76001           }
76002           context.perform.apply(context, actions);
76003           var s2 = surface.selectAll("." + datum2.key);
76004           datum2 = s2.empty() ? null : s2.datum();
76005           updateHints(datum2);
76006         } else {
76007           _fromWayID = null;
76008           _oldTurns = null;
76009           redraw();
76010         }
76011       }
76012       function mouseover(d3_event) {
76013         var datum2 = d3_event.target.__data__;
76014         updateHints(datum2);
76015       }
76016       _lastXPos = _lastXPos || sdims[0];
76017       function redraw(minChange) {
76018         var xPos = -1;
76019         if (minChange) {
76020           xPos = utilGetDimensions(context.container().select(".sidebar"))[0];
76021         }
76022         if (!minChange || minChange && Math.abs(xPos - _lastXPos) >= minChange) {
76023           if (context.hasEntity(_vertexID)) {
76024             _lastXPos = xPos;
76025             _container.call(renderViewer);
76026           }
76027         }
76028       }
76029       function highlightPathsFrom(wayID) {
76030         surface.selectAll(".related").classed("related", false).classed("allow", false).classed("restrict", false).classed("only", false);
76031         surface.selectAll("." + wayID).classed("related", true);
76032         if (wayID) {
76033           var turns = _intersection.turns(wayID, _maxViaWay);
76034           for (var i4 = 0; i4 < turns.length; i4++) {
76035             var turn = turns[i4];
76036             var ids = [turn.to.way];
76037             var klass = turn.no ? "restrict" : turn.only ? "only" : "allow";
76038             if (turn.only || turns.length === 1) {
76039               if (turn.via.ways) {
76040                 ids = ids.concat(turn.via.ways);
76041               }
76042             } else if (turn.to.way === wayID) {
76043               continue;
76044             }
76045             surface.selectAll(utilEntitySelector(ids)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
76046           }
76047         }
76048       }
76049       function updateHints(datum2) {
76050         var help = _container.selectAll(".restriction-help").html("");
76051         var placeholders = {};
76052         ["from", "via", "to"].forEach(function(k3) {
76053           placeholders[k3] = { html: '<span class="qualifier">' + _t("restriction.help." + k3) + "</span>" };
76054         });
76055         var entity = datum2 && datum2.properties && datum2.properties.entity;
76056         if (entity) {
76057           datum2 = entity;
76058         }
76059         if (_fromWayID) {
76060           way = vgraph.entity(_fromWayID);
76061           surface.selectAll("." + _fromWayID).classed("selected", true).classed("related", true);
76062         }
76063         if (datum2 instanceof osmWay && datum2.__from) {
76064           way = datum2;
76065           highlightPathsFrom(_fromWayID ? null : way.id);
76066           surface.selectAll("." + way.id).classed("related", true);
76067           var clickSelect = !_fromWayID || _fromWayID !== way.id;
76068           help.append("div").html(_t.html("restriction.help." + (clickSelect ? "select_from_name" : "from_name"), {
76069             from: placeholders.from,
76070             fromName: displayName(way.id, vgraph)
76071           }));
76072         } else if (datum2 instanceof osmTurn) {
76073           var restrictionType = osmInferRestriction(vgraph, datum2, projection2);
76074           var turnType = restrictionType.replace(/^(only|no)\_/, "");
76075           var indirect = datum2.direct === false ? _t.html("restriction.help.indirect") : "";
76076           var klass, turnText, nextText;
76077           if (datum2.no) {
76078             klass = "restrict";
76079             turnText = _t.html("restriction.help.turn.no_" + turnType, { indirect: { html: indirect } });
76080             nextText = _t.html("restriction.help.turn.only_" + turnType, { indirect: "" });
76081           } else if (datum2.only) {
76082             klass = "only";
76083             turnText = _t.html("restriction.help.turn.only_" + turnType, { indirect: { html: indirect } });
76084             nextText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: "" });
76085           } else {
76086             klass = "allow";
76087             turnText = _t.html("restriction.help.turn.allowed_" + turnType, { indirect: { html: indirect } });
76088             nextText = _t.html("restriction.help.turn.no_" + turnType, { indirect: "" });
76089           }
76090           help.append("div").attr("class", "qualifier " + klass).html(turnText);
76091           help.append("div").html(_t.html("restriction.help.from_name_to_name", {
76092             from: placeholders.from,
76093             fromName: displayName(datum2.from.way, vgraph),
76094             to: placeholders.to,
76095             toName: displayName(datum2.to.way, vgraph)
76096           }));
76097           if (datum2.via.ways && datum2.via.ways.length) {
76098             var names = [];
76099             for (var i4 = 0; i4 < datum2.via.ways.length; i4++) {
76100               var prev = names[names.length - 1];
76101               var curr = displayName(datum2.via.ways[i4], vgraph);
76102               if (!prev || curr !== prev) {
76103                 names.push(curr);
76104               }
76105             }
76106             help.append("div").html(_t.html("restriction.help.via_names", {
76107               via: placeholders.via,
76108               viaNames: names.join(", ")
76109             }));
76110           }
76111           if (!indirect) {
76112             help.append("div").html(_t.html("restriction.help.toggle", { turn: { html: nextText.trim() } }));
76113           }
76114           highlightPathsFrom(null);
76115           var alongIDs = datum2.path.slice();
76116           surface.selectAll(utilEntitySelector(alongIDs)).classed("related", true).classed("allow", klass === "allow").classed("restrict", klass === "restrict").classed("only", klass === "only");
76117         } else {
76118           highlightPathsFrom(null);
76119           if (_fromWayID) {
76120             help.append("div").html(_t.html("restriction.help.from_name", {
76121               from: placeholders.from,
76122               fromName: displayName(_fromWayID, vgraph)
76123             }));
76124           } else {
76125             help.append("div").html(_t.html("restriction.help.select_from", {
76126               from: placeholders.from
76127             }));
76128           }
76129         }
76130       }
76131     }
76132     function displayMaxDistance(maxDist) {
76133       return (selection2) => {
76134         var isImperial = !_mainLocalizer.usesMetric();
76135         var opts;
76136         if (isImperial) {
76137           var distToFeet = {
76138             // imprecise conversion for prettier display
76139             20: 70,
76140             25: 85,
76141             30: 100,
76142             35: 115,
76143             40: 130,
76144             45: 145,
76145             50: 160
76146           }[maxDist];
76147           opts = { distance: _t("units.feet", { quantity: distToFeet }) };
76148         } else {
76149           opts = { distance: _t("units.meters", { quantity: maxDist }) };
76150         }
76151         return selection2.html("").call(_t.append("restriction.controls.distance_up_to", opts));
76152       };
76153     }
76154     function displayMaxVia(maxVia) {
76155       return (selection2) => {
76156         selection2 = selection2.html("");
76157         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"));
76158       };
76159     }
76160     function displayName(entityID, graph) {
76161       var entity = graph.entity(entityID);
76162       var name = utilDisplayName(entity) || "";
76163       var matched = _mainPresetIndex.match(entity, graph);
76164       var type2 = matched && matched.name() || utilDisplayType(entity.id);
76165       return name || type2;
76166     }
76167     restrictions.entityIDs = function(val) {
76168       _intersection = null;
76169       _fromWayID = null;
76170       _oldTurns = null;
76171       _vertexID = val[0];
76172     };
76173     restrictions.tags = function() {
76174     };
76175     restrictions.focus = function() {
76176     };
76177     restrictions.off = function(selection2) {
76178       if (!_initialized3) return;
76179       selection2.selectAll(".surface").call(breathe.off).on("click.restrictions", null).on("mouseover.restrictions", null);
76180       select_default2(window).on("resize.restrictions", null);
76181     };
76182     return utilRebind(restrictions, dispatch12, "on");
76183   }
76184   uiFieldRestrictions.supportsMultiselection = false;
76185
76186   // modules/ui/fields/textarea.js
76187   function uiFieldTextarea(field, context) {
76188     var dispatch12 = dispatch_default("change");
76189     var input = select_default2(null);
76190     var _lengthIndicator = uiLengthIndicator(context.maxCharsForTagValue()).silent(field.usage === "changeset" && field.key === "comment");
76191     var _tags;
76192     function textarea(selection2) {
76193       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
76194       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).style("position", "relative").merge(wrap2);
76195       input = wrap2.selectAll("textarea").data([0]);
76196       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);
76197       wrap2.call(_lengthIndicator);
76198       function change(onInput) {
76199         return function() {
76200           var val = utilGetSetValue(input);
76201           if (!onInput) val = context.cleanTagValue(val);
76202           if (!val && Array.isArray(_tags[field.key])) return;
76203           var t2 = {};
76204           t2[field.key] = val || void 0;
76205           dispatch12.call("change", this, t2, onInput);
76206         };
76207       }
76208     }
76209     textarea.tags = function(tags) {
76210       _tags = tags;
76211       var isMixed = Array.isArray(tags[field.key]);
76212       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);
76213       if (!isMixed) {
76214         _lengthIndicator.update(tags[field.key]);
76215       }
76216     };
76217     textarea.focus = function() {
76218       input.node().focus();
76219     };
76220     return utilRebind(textarea, dispatch12, "on");
76221   }
76222
76223   // modules/ui/fields/wikidata.js
76224   function uiFieldWikidata(field, context) {
76225     var wikidata = services.wikidata;
76226     var dispatch12 = dispatch_default("change");
76227     var _selection = select_default2(null);
76228     var _searchInput = select_default2(null);
76229     var _qid = null;
76230     var _wikidataEntity = null;
76231     var _wikiURL = "";
76232     var _entityIDs = [];
76233     var _wikipediaKey = field.keys && field.keys.find(function(key) {
76234       return key.includes("wikipedia");
76235     });
76236     var _hintKey = field.key === "wikidata" ? "name" : field.key.split(":")[0];
76237     var combobox = uiCombobox(context, "combo-" + field.safeid).caseSensitive(true).minItems(1);
76238     function wiki(selection2) {
76239       _selection = selection2;
76240       var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
76241       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
76242       var list = wrap2.selectAll("ul").data([0]);
76243       list = list.enter().append("ul").attr("class", "rows").merge(list);
76244       var searchRow = list.selectAll("li.wikidata-search").data([0]);
76245       var searchRowEnter = searchRow.enter().append("li").attr("class", "wikidata-search");
76246       searchRowEnter.append("input").attr("type", "text").attr("dir", "auto").attr("id", field.domId).style("flex", "1").call(utilNoAuto).on("focus", function() {
76247         var node = select_default2(this).node();
76248         node.setSelectionRange(0, node.value.length);
76249       }).on("blur", function() {
76250         setLabelForEntity();
76251       }).call(combobox.fetcher(fetchWikidataItems));
76252       combobox.on("accept", function(d2) {
76253         if (d2) {
76254           _qid = d2.id;
76255           change();
76256         }
76257       }).on("cancel", function() {
76258         setLabelForEntity();
76259       });
76260       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) {
76261         d3_event.preventDefault();
76262         if (_wikiURL) window.open(_wikiURL, "_blank");
76263       });
76264       searchRow = searchRow.merge(searchRowEnter);
76265       _searchInput = searchRow.select("input");
76266       var wikidataProperties = ["description", "identifier"];
76267       var items = list.selectAll("li.labeled-input").data(wikidataProperties);
76268       var enter = items.enter().append("li").attr("class", function(d2) {
76269         return "labeled-input preset-wikidata-" + d2;
76270       });
76271       enter.append("div").attr("class", "label").html(function(d2) {
76272         return _t.html("wikidata." + d2);
76273       });
76274       enter.append("input").attr("type", "text").attr("dir", "auto").call(utilNoAuto).classed("disabled", "true").attr("readonly", "true");
76275       enter.append("button").attr("class", "form-field-button").attr("title", _t("icons.copy")).call(svgIcon("#iD-operation-copy")).on("click", function(d3_event) {
76276         d3_event.preventDefault();
76277         select_default2(this.parentNode).select("input").node().select();
76278         document.execCommand("copy");
76279       });
76280     }
76281     function fetchWikidataItems(q3, callback) {
76282       if (!q3 && _hintKey) {
76283         for (var i3 in _entityIDs) {
76284           var entity = context.hasEntity(_entityIDs[i3]);
76285           if (entity.tags[_hintKey]) {
76286             q3 = entity.tags[_hintKey];
76287             break;
76288           }
76289         }
76290       }
76291       wikidata.itemsForSearchQuery(q3, function(err, data) {
76292         if (err) {
76293           if (err !== "No query") console.error(err);
76294           return;
76295         }
76296         var result = data.map(function(item) {
76297           return {
76298             id: item.id,
76299             value: item.display.label.value + " (" + item.id + ")",
76300             display: (selection2) => selection2.append("span").attr("class", "localized-text").attr("lang", item.display.label.language).text(item.display.label.value),
76301             title: item.display.description && item.display.description.value,
76302             terms: item.aliases
76303           };
76304         });
76305         if (callback) callback(result);
76306       });
76307     }
76308     function change() {
76309       var syncTags = {};
76310       syncTags[field.key] = _qid;
76311       dispatch12.call("change", this, syncTags);
76312       var initGraph = context.graph();
76313       var initEntityIDs = _entityIDs;
76314       wikidata.entityByQID(_qid, function(err, entity) {
76315         if (err) return;
76316         if (context.graph() !== initGraph) return;
76317         if (!entity.sitelinks) return;
76318         var langs = wikidata.languagesToQuery();
76319         ["labels", "descriptions"].forEach(function(key) {
76320           if (!entity[key]) return;
76321           var valueLangs = Object.keys(entity[key]);
76322           if (valueLangs.length === 0) return;
76323           var valueLang = valueLangs[0];
76324           if (langs.indexOf(valueLang) === -1) {
76325             langs.push(valueLang);
76326           }
76327         });
76328         var newWikipediaValue;
76329         if (_wikipediaKey) {
76330           var foundPreferred;
76331           for (var i3 in langs) {
76332             var lang = langs[i3];
76333             var siteID = lang.replace("-", "_") + "wiki";
76334             if (entity.sitelinks[siteID]) {
76335               foundPreferred = true;
76336               newWikipediaValue = lang + ":" + entity.sitelinks[siteID].title;
76337               break;
76338             }
76339           }
76340           if (!foundPreferred) {
76341             var wikiSiteKeys = Object.keys(entity.sitelinks).filter(function(site) {
76342               return site.endsWith("wiki");
76343             });
76344             if (wikiSiteKeys.length === 0) {
76345               newWikipediaValue = null;
76346             } else {
76347               var wikiLang = wikiSiteKeys[0].slice(0, -4).replace("_", "-");
76348               var wikiTitle = entity.sitelinks[wikiSiteKeys[0]].title;
76349               newWikipediaValue = wikiLang + ":" + wikiTitle;
76350             }
76351           }
76352         }
76353         if (newWikipediaValue) {
76354           newWikipediaValue = context.cleanTagValue(newWikipediaValue);
76355         }
76356         if (typeof newWikipediaValue === "undefined") return;
76357         var actions = initEntityIDs.map(function(entityID) {
76358           var entity2 = context.hasEntity(entityID);
76359           if (!entity2) return null;
76360           var currTags = Object.assign({}, entity2.tags);
76361           if (newWikipediaValue === null) {
76362             if (!currTags[_wikipediaKey]) return null;
76363             delete currTags[_wikipediaKey];
76364           } else {
76365             currTags[_wikipediaKey] = newWikipediaValue;
76366           }
76367           return actionChangeTags(entityID, currTags);
76368         }).filter(Boolean);
76369         if (!actions.length) return;
76370         context.replace(
76371           function actionUpdateWikipediaTags(graph) {
76372             actions.forEach(function(action) {
76373               graph = action(graph);
76374             });
76375             return graph;
76376           },
76377           context.history().undoAnnotation()
76378         );
76379       });
76380     }
76381     function setLabelForEntity() {
76382       var label = {
76383         value: ""
76384       };
76385       if (_wikidataEntity) {
76386         label = entityPropertyForDisplay(_wikidataEntity, "labels");
76387         if (label.value.length === 0) {
76388           label.value = _wikidataEntity.id.toString();
76389         }
76390       }
76391       utilGetSetValue(_searchInput, label.value).attr("lang", label.language);
76392     }
76393     wiki.tags = function(tags) {
76394       var isMixed = Array.isArray(tags[field.key]);
76395       _searchInput.attr("title", isMixed ? tags[field.key].filter(Boolean).join("\n") : null).attr("placeholder", isMixed ? _t("inspector.multiple_values") : "").classed("mixed", isMixed);
76396       _qid = typeof tags[field.key] === "string" && tags[field.key] || "";
76397       if (!/^Q[0-9]*$/.test(_qid)) {
76398         unrecognized();
76399         return;
76400       }
76401       _wikiURL = "https://wikidata.org/wiki/" + _qid;
76402       wikidata.entityByQID(_qid, function(err, entity) {
76403         if (err) {
76404           unrecognized();
76405           return;
76406         }
76407         _wikidataEntity = entity;
76408         setLabelForEntity();
76409         var description = entityPropertyForDisplay(entity, "descriptions");
76410         _selection.select("button.wiki-link").classed("disabled", false);
76411         _selection.select(".preset-wikidata-description").style("display", function() {
76412           return description.value.length > 0 ? "flex" : "none";
76413         }).select("input").attr("value", description.value).attr("lang", description.language);
76414         _selection.select(".preset-wikidata-identifier").style("display", function() {
76415           return entity.id ? "flex" : "none";
76416         }).select("input").attr("value", entity.id);
76417       });
76418       function unrecognized() {
76419         _wikidataEntity = null;
76420         setLabelForEntity();
76421         _selection.select(".preset-wikidata-description").style("display", "none");
76422         _selection.select(".preset-wikidata-identifier").style("display", "none");
76423         _selection.select("button.wiki-link").classed("disabled", true);
76424         if (_qid && _qid !== "") {
76425           _wikiURL = "https://wikidata.org/wiki/Special:Search?search=" + _qid;
76426         } else {
76427           _wikiURL = "";
76428         }
76429       }
76430     };
76431     function entityPropertyForDisplay(wikidataEntity, propKey) {
76432       var blankResponse = { value: "" };
76433       if (!wikidataEntity[propKey]) return blankResponse;
76434       var propObj = wikidataEntity[propKey];
76435       var langKeys = Object.keys(propObj);
76436       if (langKeys.length === 0) return blankResponse;
76437       var langs = wikidata.languagesToQuery();
76438       for (var i3 in langs) {
76439         var lang = langs[i3];
76440         var valueObj = propObj[lang];
76441         if (valueObj && valueObj.value && valueObj.value.length > 0) return valueObj;
76442       }
76443       return propObj[langKeys[0]];
76444     }
76445     wiki.entityIDs = function(val) {
76446       if (!arguments.length) return _entityIDs;
76447       _entityIDs = val;
76448       return wiki;
76449     };
76450     wiki.focus = function() {
76451       _searchInput.node().focus();
76452     };
76453     return utilRebind(wiki, dispatch12, "on");
76454   }
76455
76456   // modules/ui/fields/wikipedia.js
76457   function uiFieldWikipedia(field, context) {
76458     const scheme = "https://";
76459     const domain = "wikipedia.org";
76460     const dispatch12 = dispatch_default("change");
76461     const wikipedia = services.wikipedia;
76462     const wikidata = services.wikidata;
76463     let _langInput = select_default2(null);
76464     let _titleInput = select_default2(null);
76465     let _wikiURL = "";
76466     let _entityIDs;
76467     let _tags;
76468     let _dataWikipedia = [];
76469     _mainFileFetcher.get("wmf_sitematrix").then((d2) => {
76470       _dataWikipedia = d2;
76471       if (_tags) updateForTags(_tags);
76472     }).catch(() => {
76473     });
76474     const langCombo = uiCombobox(context, "wikipedia-lang").fetcher((value, callback) => {
76475       const v3 = value.toLowerCase();
76476       callback(
76477         _dataWikipedia.filter((d2) => {
76478           return d2[0].toLowerCase().indexOf(v3) >= 0 || d2[1].toLowerCase().indexOf(v3) >= 0 || d2[2].toLowerCase().indexOf(v3) >= 0;
76479         }).map((d2) => ({ value: d2[1] }))
76480       );
76481     });
76482     const titleCombo = uiCombobox(context, "wikipedia-title").fetcher((value, callback) => {
76483       if (!value) {
76484         value = "";
76485         for (let i3 in _entityIDs) {
76486           let entity = context.hasEntity(_entityIDs[i3]);
76487           if (entity.tags.name) {
76488             value = entity.tags.name;
76489             break;
76490           }
76491         }
76492       }
76493       const searchfn = value.length > 7 ? wikipedia.search : wikipedia.suggestions;
76494       searchfn(language()[2], value, (query, data) => {
76495         callback(data.map((d2) => ({ value: d2 })));
76496       });
76497     });
76498     function wiki(selection2) {
76499       let wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
76500       wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-".concat(field.type)).merge(wrap2);
76501       let langContainer = wrap2.selectAll(".wiki-lang-container").data([0]);
76502       langContainer = langContainer.enter().append("div").attr("class", "wiki-lang-container").merge(langContainer);
76503       _langInput = langContainer.selectAll("input.wiki-lang").data([0]);
76504       _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);
76505       _langInput.on("blur", changeLang).on("change", changeLang);
76506       let titleContainer = wrap2.selectAll(".wiki-title-container").data([0]);
76507       titleContainer = titleContainer.enter().append("div").attr("class", "wiki-title-container").merge(titleContainer);
76508       _titleInput = titleContainer.selectAll("input.wiki-title").data([0]);
76509       _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);
76510       _titleInput.on("blur", function() {
76511         change(true);
76512       }).on("change", function() {
76513         change(false);
76514       });
76515       let link2 = titleContainer.selectAll(".wiki-link").data([0]);
76516       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);
76517       link2.on("click", (d3_event) => {
76518         d3_event.preventDefault();
76519         if (_wikiURL) window.open(_wikiURL, "_blank");
76520       });
76521     }
76522     function defaultLanguageInfo(skipEnglishFallback) {
76523       const langCode = _mainLocalizer.languageCode().toLowerCase();
76524       for (let i3 in _dataWikipedia) {
76525         let d2 = _dataWikipedia[i3];
76526         if (d2[2] === langCode) return d2;
76527       }
76528       return skipEnglishFallback ? ["", "", ""] : ["English", "English", "en"];
76529     }
76530     function language(skipEnglishFallback) {
76531       const value = utilGetSetValue(_langInput).toLowerCase();
76532       for (let i3 in _dataWikipedia) {
76533         let d2 = _dataWikipedia[i3];
76534         if (d2[0].toLowerCase() === value || d2[1].toLowerCase() === value || d2[2] === value) return d2;
76535       }
76536       return defaultLanguageInfo(skipEnglishFallback);
76537     }
76538     function changeLang() {
76539       utilGetSetValue(_langInput, language()[1]);
76540       change(true);
76541     }
76542     function change(skipWikidata) {
76543       let value = utilGetSetValue(_titleInput);
76544       const m3 = value.match(/https?:\/\/([-a-z]+)\.wikipedia\.org\/(?:wiki|\1-[-a-z]+)\/([^#]+)(?:#(.+))?/);
76545       const langInfo = m3 && _dataWikipedia.find((d2) => m3[1] === d2[2]);
76546       let syncTags = {};
76547       if (langInfo) {
76548         const nativeLangName = langInfo[1];
76549         value = decodeURIComponent(m3[2]).replace(/_/g, " ");
76550         if (m3[3]) {
76551           let anchor;
76552           anchor = decodeURIComponent(m3[3]);
76553           value += "#" + anchor.replace(/_/g, " ");
76554         }
76555         value = value.slice(0, 1).toUpperCase() + value.slice(1);
76556         utilGetSetValue(_langInput, nativeLangName).attr("lang", langInfo[2]);
76557         utilGetSetValue(_titleInput, value);
76558       }
76559       if (value) {
76560         syncTags.wikipedia = context.cleanTagValue(language()[2] + ":" + value);
76561       } else {
76562         syncTags.wikipedia = void 0;
76563       }
76564       dispatch12.call("change", this, syncTags);
76565       if (skipWikidata || !value || !language()[2]) return;
76566       const initGraph = context.graph();
76567       const initEntityIDs = _entityIDs;
76568       wikidata.itemsByTitle(language()[2], value, (err, data) => {
76569         if (err || !data || !Object.keys(data).length) return;
76570         if (context.graph() !== initGraph) return;
76571         const qids = Object.keys(data);
76572         const value2 = qids && qids.find((id2) => id2.match(/^Q\d+$/));
76573         let actions = initEntityIDs.map((entityID) => {
76574           let entity = context.entity(entityID).tags;
76575           let currTags = Object.assign({}, entity);
76576           if (currTags.wikidata !== value2) {
76577             currTags.wikidata = value2;
76578             return actionChangeTags(entityID, currTags);
76579           }
76580           return null;
76581         }).filter(Boolean);
76582         if (!actions.length) return;
76583         context.replace(
76584           function actionUpdateWikidataTags(graph) {
76585             actions.forEach(function(action) {
76586               graph = action(graph);
76587             });
76588             return graph;
76589           },
76590           context.history().undoAnnotation()
76591         );
76592       });
76593     }
76594     wiki.tags = (tags) => {
76595       _tags = tags;
76596       updateForTags(tags);
76597     };
76598     function updateForTags(tags) {
76599       const value = typeof tags[field.key] === "string" ? tags[field.key] : "";
76600       const m3 = value.match(/([^:]+):([^#]+)(?:#(.+))?/);
76601       const tagLang = m3 && m3[1];
76602       const tagArticleTitle = m3 && m3[2];
76603       let anchor = m3 && m3[3];
76604       const tagLangInfo = tagLang && _dataWikipedia.find((d2) => tagLang === d2[2]);
76605       if (tagLangInfo) {
76606         const nativeLangName = tagLangInfo[1];
76607         utilGetSetValue(_langInput, nativeLangName);
76608         _titleInput.attr("lang", tagLangInfo[2]);
76609         utilGetSetValue(_titleInput, tagArticleTitle + (anchor ? "#" + anchor : ""));
76610         _wikiURL = "".concat(scheme).concat(tagLang, ".").concat(domain, "/wiki/").concat(wiki.encodePath(tagArticleTitle, anchor));
76611       } else {
76612         utilGetSetValue(_titleInput, value);
76613         if (value && value !== "") {
76614           utilGetSetValue(_langInput, "");
76615           const defaultLangInfo = defaultLanguageInfo();
76616           _wikiURL = "".concat(scheme).concat(defaultLangInfo[2], ".").concat(domain, "/w/index.php?fulltext=1&search=").concat(value);
76617         } else {
76618           const shownOrDefaultLangInfo = language(
76619             true
76620             /* skipEnglishFallback */
76621           );
76622           utilGetSetValue(_langInput, shownOrDefaultLangInfo[1]);
76623           _wikiURL = "";
76624         }
76625       }
76626     }
76627     wiki.encodePath = (tagArticleTitle, anchor) => {
76628       const underscoredTitle = tagArticleTitle.replace(/ /g, "_");
76629       const uriEncodedUnderscoredTitle = encodeURIComponent(underscoredTitle);
76630       const uriEncodedAnchorFragment = wiki.encodeURIAnchorFragment(anchor);
76631       return "".concat(uriEncodedUnderscoredTitle).concat(uriEncodedAnchorFragment);
76632     };
76633     wiki.encodeURIAnchorFragment = (anchor) => {
76634       if (!anchor) return "";
76635       const underscoredAnchor = anchor.replace(/ /g, "_");
76636       return "#" + encodeURIComponent(underscoredAnchor);
76637     };
76638     wiki.entityIDs = (val) => {
76639       if (!arguments.length) return _entityIDs;
76640       _entityIDs = val;
76641       return wiki;
76642     };
76643     wiki.focus = () => {
76644       _titleInput.node().focus();
76645     };
76646     return utilRebind(wiki, dispatch12, "on");
76647   }
76648   uiFieldWikipedia.supportsMultiselection = false;
76649
76650   // modules/ui/fields/index.js
76651   var uiFields = {
76652     access: uiFieldAccess,
76653     address: uiFieldAddress,
76654     check: uiFieldCheck,
76655     colour: uiFieldText,
76656     combo: uiFieldCombo,
76657     cycleway: uiFieldDirectionalCombo,
76658     date: uiFieldText,
76659     defaultCheck: uiFieldCheck,
76660     directionalCombo: uiFieldDirectionalCombo,
76661     email: uiFieldText,
76662     identifier: uiFieldText,
76663     lanes: uiFieldLanes,
76664     localized: uiFieldLocalized,
76665     roadheight: uiFieldRoadheight,
76666     roadspeed: uiFieldRoadspeed,
76667     manyCombo: uiFieldCombo,
76668     multiCombo: uiFieldCombo,
76669     networkCombo: uiFieldCombo,
76670     number: uiFieldText,
76671     onewayCheck: uiFieldCheck,
76672     radio: uiFieldRadio,
76673     restrictions: uiFieldRestrictions,
76674     schedule: uiFieldText,
76675     semiCombo: uiFieldCombo,
76676     structureRadio: uiFieldRadio,
76677     tel: uiFieldText,
76678     text: uiFieldText,
76679     textarea: uiFieldTextarea,
76680     typeCombo: uiFieldCombo,
76681     url: uiFieldText,
76682     wikidata: uiFieldWikidata,
76683     wikipedia: uiFieldWikipedia
76684   };
76685
76686   // modules/ui/field.js
76687   function uiField(context, presetField2, entityIDs, options) {
76688     options = Object.assign({
76689       show: true,
76690       wrap: true,
76691       remove: true,
76692       revert: true,
76693       info: true
76694     }, options);
76695     var dispatch12 = dispatch_default("change", "revert");
76696     var field = Object.assign({}, presetField2);
76697     field.domId = utilUniqueDomId("form-field-" + field.safeid);
76698     var _show = options.show;
76699     var _state = "";
76700     var _tags = {};
76701     var _entityExtent;
76702     if (entityIDs && entityIDs.length) {
76703       _entityExtent = entityIDs.reduce(function(extent, entityID) {
76704         var entity = context.graph().entity(entityID);
76705         return extent.extend(entity.extent(context.graph()));
76706       }, geoExtent());
76707     }
76708     var _locked = false;
76709     var _lockedTip = uiTooltip().title(() => _t.append("inspector.lock.suggestion", { label: field.title })).placement("bottom");
76710     if (_show && !field.impl) {
76711       createField();
76712     }
76713     function createField() {
76714       field.impl = uiFields[field.type](field, context).on("change", function(t2, onInput) {
76715         dispatch12.call("change", field, t2, onInput);
76716       });
76717       if (entityIDs) {
76718         field.entityIDs = entityIDs;
76719         if (field.impl.entityIDs) {
76720           field.impl.entityIDs(entityIDs);
76721         }
76722       }
76723     }
76724     function allKeys() {
76725       let keys2 = field.keys || [field.key];
76726       if (field.type === "directionalCombo" && field.key) {
76727         const baseKey = field.key.replace(/:both$/, "");
76728         keys2 = keys2.concat(baseKey, "".concat(baseKey, ":both"));
76729       }
76730       return keys2;
76731     }
76732     function isModified() {
76733       if (!entityIDs || !entityIDs.length) return false;
76734       return entityIDs.some(function(entityID) {
76735         var original = context.graph().base().entities[entityID];
76736         var latest = context.graph().entity(entityID);
76737         return allKeys().some(function(key) {
76738           return original ? latest.tags[key] !== original.tags[key] : latest.tags[key];
76739         });
76740       });
76741     }
76742     function tagsContainFieldKey() {
76743       return allKeys().some(function(key) {
76744         if (field.type === "multiCombo") {
76745           for (var tagKey in _tags) {
76746             if (tagKey.indexOf(key) === 0) {
76747               return true;
76748             }
76749           }
76750           return false;
76751         }
76752         if (field.type === "localized") {
76753           for (let tagKey2 in _tags) {
76754             let match = tagKey2.match(LANGUAGE_SUFFIX_REGEX);
76755             if (match && match[1] === field.key && match[2]) {
76756               return true;
76757             }
76758           }
76759         }
76760         return _tags[key] !== void 0;
76761       });
76762     }
76763     function revert(d3_event, d2) {
76764       d3_event.stopPropagation();
76765       d3_event.preventDefault();
76766       if (!entityIDs || _locked) return;
76767       dispatch12.call("revert", d2, allKeys());
76768     }
76769     function remove2(d3_event, d2) {
76770       d3_event.stopPropagation();
76771       d3_event.preventDefault();
76772       if (_locked) return;
76773       var t2 = {};
76774       allKeys().forEach(function(key) {
76775         t2[key] = void 0;
76776       });
76777       dispatch12.call("change", d2, t2);
76778     }
76779     field.render = function(selection2) {
76780       var container = selection2.selectAll(".form-field").data([field]);
76781       var enter = container.enter().append("div").attr("class", function(d2) {
76782         return "form-field form-field-" + d2.safeid;
76783       }).classed("nowrap", !options.wrap);
76784       if (options.wrap) {
76785         var labelEnter = enter.append("label").attr("class", "field-label").attr("for", function(d2) {
76786           return d2.domId;
76787         });
76788         var textEnter = labelEnter.append("span").attr("class", "label-text");
76789         textEnter.append("span").attr("class", "label-textvalue").each(function(d2) {
76790           d2.label()(select_default2(this));
76791         });
76792         textEnter.append("span").attr("class", "label-textannotation");
76793         if (options.remove) {
76794           labelEnter.append("button").attr("class", "remove-icon").attr("title", _t("icons.remove")).call(svgIcon("#iD-operation-delete"));
76795         }
76796         if (options.revert) {
76797           labelEnter.append("button").attr("class", "modified-icon").attr("title", _t("icons.undo")).call(svgIcon(_mainLocalizer.textDirection() === "rtl" ? "#iD-icon-redo" : "#iD-icon-undo"));
76798         }
76799       }
76800       container = container.merge(enter);
76801       container.select(".field-label > .remove-icon").on("click", remove2);
76802       container.select(".field-label > .modified-icon").on("click", revert);
76803       container.each(function(d2) {
76804         var selection3 = select_default2(this);
76805         if (!d2.impl) {
76806           createField();
76807         }
76808         var reference, help;
76809         if (options.wrap && field.type === "restrictions") {
76810           help = uiFieldHelp(context, "restrictions");
76811         }
76812         if (options.wrap && options.info) {
76813           var referenceKey = d2.key || "";
76814           if (d2.type === "multiCombo") {
76815             referenceKey = referenceKey.replace(/:$/, ":*");
76816           }
76817           var referenceOptions = d2.reference || {
76818             key: referenceKey,
76819             value: _tags[referenceKey]
76820           };
76821           reference = uiTagReference(referenceOptions, context);
76822           if (_state === "hover") {
76823             reference.showing(false);
76824           }
76825         }
76826         selection3.call(d2.impl);
76827         if (help) {
76828           selection3.call(help.body).select(".field-label").call(help.button);
76829         }
76830         if (reference) {
76831           selection3.call(reference.body).select(".field-label").call(reference.button);
76832         }
76833         d2.impl.tags(_tags);
76834       });
76835       container.classed("locked", _locked).classed("modified", isModified()).classed("present", tagsContainFieldKey());
76836       var annotation = container.selectAll(".field-label .label-textannotation");
76837       var icon2 = annotation.selectAll(".icon").data(_locked ? [0] : []);
76838       icon2.exit().remove();
76839       icon2.enter().append("svg").attr("class", "icon").append("use").attr("xlink:href", "#fas-lock");
76840       container.call(_locked ? _lockedTip : _lockedTip.destroy);
76841     };
76842     field.state = function(val) {
76843       if (!arguments.length) return _state;
76844       _state = val;
76845       return field;
76846     };
76847     field.tags = function(val) {
76848       if (!arguments.length) return _tags;
76849       _tags = val;
76850       if (tagsContainFieldKey() && !_show) {
76851         _show = true;
76852         if (!field.impl) {
76853           createField();
76854         }
76855       }
76856       return field;
76857     };
76858     field.locked = function(val) {
76859       if (!arguments.length) return _locked;
76860       _locked = val;
76861       return field;
76862     };
76863     field.show = function() {
76864       _show = true;
76865       if (!field.impl) {
76866         createField();
76867       }
76868       if (field.default && field.key && _tags[field.key] !== field.default) {
76869         var t2 = {};
76870         t2[field.key] = field.default;
76871         dispatch12.call("change", this, t2);
76872       }
76873     };
76874     field.isShown = function() {
76875       return _show;
76876     };
76877     field.isAllowed = function() {
76878       if (entityIDs && entityIDs.length > 1 && uiFields[field.type].supportsMultiselection === false) return false;
76879       if (field.geometry && !entityIDs.every(function(entityID) {
76880         return field.matchGeometry(context.graph().geometry(entityID));
76881       })) return false;
76882       if (entityIDs && _entityExtent && field.locationSetID) {
76883         var validHere = _sharedLocationManager.locationSetsAt(_entityExtent.center());
76884         if (!validHere[field.locationSetID]) return false;
76885       }
76886       var prerequisiteTag = field.prerequisiteTag;
76887       if (entityIDs && !tagsContainFieldKey() && // ignore tagging prerequisites if a value is already present
76888       prerequisiteTag) {
76889         if (!entityIDs.every(function(entityID) {
76890           var entity = context.graph().entity(entityID);
76891           if (prerequisiteTag.key) {
76892             var value = entity.tags[prerequisiteTag.key] || "";
76893             if (prerequisiteTag.valuesNot) {
76894               return !prerequisiteTag.valuesNot.includes(value);
76895             }
76896             if (prerequisiteTag.valueNot) {
76897               return prerequisiteTag.valueNot !== value;
76898             }
76899             if (prerequisiteTag.values) {
76900               return prerequisiteTag.values.includes(value);
76901             }
76902             if (prerequisiteTag.value) {
76903               return prerequisiteTag.value === value;
76904             }
76905             if (!value) return false;
76906           } else if (prerequisiteTag.keyNot) {
76907             if (entity.tags[prerequisiteTag.keyNot]) return false;
76908           }
76909           return true;
76910         })) return false;
76911       }
76912       return true;
76913     };
76914     field.focus = function() {
76915       if (field.impl) {
76916         field.impl.focus();
76917       }
76918     };
76919     return utilRebind(field, dispatch12, "on");
76920   }
76921
76922   // modules/ui/changeset_editor.js
76923   function uiChangesetEditor(context) {
76924     var dispatch12 = dispatch_default("change");
76925     var formFields = uiFormFields(context);
76926     var commentCombo = uiCombobox(context, "comment").caseSensitive(true);
76927     var _fieldsArr;
76928     var _tags;
76929     var _changesetID;
76930     function changesetEditor(selection2) {
76931       render(selection2);
76932     }
76933     function render(selection2) {
76934       var initial = false;
76935       if (!_fieldsArr) {
76936         initial = true;
76937         var presets = _mainPresetIndex;
76938         _fieldsArr = [
76939           uiField(context, presets.field("comment"), null, { show: true, revert: false }),
76940           uiField(context, presets.field("source"), null, { show: true, revert: false }),
76941           uiField(context, presets.field("hashtags"), null, { show: false, revert: false })
76942         ];
76943         _fieldsArr.forEach(function(field) {
76944           field.on("change", function(t2, onInput) {
76945             dispatch12.call("change", field, void 0, t2, onInput);
76946           });
76947         });
76948       }
76949       _fieldsArr.forEach(function(field) {
76950         field.tags(_tags);
76951       });
76952       selection2.call(formFields.fieldsArr(_fieldsArr));
76953       if (initial) {
76954         var commentField = selection2.select(".form-field-comment textarea");
76955         const sourceField = _fieldsArr.find((field) => field.id === "source");
76956         var commentNode = commentField.node();
76957         if (commentNode) {
76958           commentNode.focus();
76959           commentNode.select();
76960         }
76961         utilTriggerEvent(commentField, "blur");
76962         var osm = context.connection();
76963         if (osm) {
76964           osm.userChangesets(function(err, changesets) {
76965             if (err) return;
76966             var comments = changesets.map(function(changeset) {
76967               var comment = changeset.tags.comment;
76968               return comment ? { title: comment, value: comment } : null;
76969             }).filter(Boolean);
76970             commentField.call(
76971               commentCombo.data(utilArrayUniqBy(comments, "title"))
76972             );
76973             const recentSources = changesets.flatMap((changeset) => {
76974               var _a5;
76975               return (_a5 = changeset.tags.source) == null ? void 0 : _a5.split(";");
76976             }).filter((value) => !sourceField.options.includes(value)).filter(Boolean).map((title) => ({ title, value: title, klass: "raw-option" }));
76977             sourceField.impl.setCustomOptions(utilArrayUniqBy(recentSources, "title"));
76978           });
76979         }
76980       }
76981       function findIncompatibleSources(str, which) {
76982         const incompatibleSources = getIncompatibleSources(str);
76983         if (!incompatibleSources) return false;
76984         return incompatibleSources.map((rule) => {
76985           const value = rule.regex.exec(str)[1];
76986           return {
76987             id: "incompatible_source.".concat(which, ".").concat(rule.id),
76988             msg: (selection3) => {
76989               selection3.call(_t.append("commit.changeset_incompatible_source.".concat(which), { value }));
76990               selection3.append("br");
76991               selection3.append("a").attr("href", _t("commit.changeset_incompatible_source.link")).call(_t.append("issues.incompatible_source.reference.".concat(rule.id)));
76992             }
76993           };
76994         });
76995       }
76996       function renderWarnings(warnings, selection3, klass) {
76997         const entries = selection3.selectAll(".".concat(klass)).data(warnings, (d2) => d2.id);
76998         entries.exit().transition().duration(200).style("opacity", 0).remove();
76999         const enter = entries.enter().append("div").classed("field-warning", true).classed(klass, true).style("opacity", 0);
77000         enter.call(svgIcon("#iD-icon-alert", "inline")).append("span");
77001         enter.transition().duration(200).style("opacity", 1);
77002         entries.merge(enter).selectAll("div > span").text("").each(function(d2) {
77003           select_default2(this).call(d2.msg);
77004         });
77005       }
77006       const commentWarnings = findIncompatibleSources(_tags.comment, "comment");
77007       const maxChars = context.maxCharsForTagValue();
77008       const strLen = utilUnicodeCharsCount(utilCleanOsmString(_tags.comment, Number.POSITIVE_INFINITY));
77009       if (strLen > maxChars || false) {
77010         commentWarnings.push({
77011           id: "message too long",
77012           msg: _t.append("commit.changeset_comment_length_warning", { maxChars })
77013         });
77014       }
77015       renderWarnings(commentWarnings, selection2.select(".form-field-comment"), "comment-warning");
77016       const sourceWarnings = findIncompatibleSources(_tags.source, "source");
77017       renderWarnings(sourceWarnings, selection2.select(".form-field-source"), "source-warning");
77018     }
77019     changesetEditor.tags = function(_3) {
77020       if (!arguments.length) return _tags;
77021       _tags = _3;
77022       return changesetEditor;
77023     };
77024     changesetEditor.changesetID = function(_3) {
77025       if (!arguments.length) return _changesetID;
77026       if (_changesetID === _3) return changesetEditor;
77027       _changesetID = _3;
77028       _fieldsArr = null;
77029       return changesetEditor;
77030     };
77031     return utilRebind(changesetEditor, dispatch12, "on");
77032   }
77033
77034   // modules/ui/sections/changes.js
77035   function uiSectionChanges(context) {
77036     var _discardTags = {};
77037     _mainFileFetcher.get("discarded").then(function(d2) {
77038       _discardTags = d2;
77039     }).catch(function() {
77040     });
77041     var section = uiSection("changes-list", context).label(function() {
77042       var history = context.history();
77043       var summary = history.difference().summary();
77044       return _t.append("inspector.title_count", { title: _t("commit.changes"), count: summary.length });
77045     }).disclosureContent(renderDisclosureContent);
77046     function renderDisclosureContent(selection2) {
77047       var history = context.history();
77048       var summary = history.difference().summary();
77049       var container = selection2.selectAll(".commit-section").data([0]);
77050       var containerEnter = container.enter().append("div").attr("class", "commit-section");
77051       containerEnter.append("ul").attr("class", "changeset-list");
77052       container = containerEnter.merge(container);
77053       var items = container.select("ul").selectAll("li").data(summary);
77054       var itemsEnter = items.enter().append("li").attr("class", "change-item");
77055       var buttons = itemsEnter.append("button").on("mouseover", mouseover).on("mouseout", mouseout).on("click", click);
77056       buttons.each(function(d2) {
77057         select_default2(this).call(svgIcon("#iD-icon-" + d2.entity.geometry(d2.graph), "pre-text " + d2.changeType));
77058       });
77059       buttons.append("span").attr("class", "change-type").html(function(d2) {
77060         return _t.html("commit." + d2.changeType) + " ";
77061       });
77062       buttons.append("strong").attr("class", "entity-type").text(function(d2) {
77063         var matched = _mainPresetIndex.match(d2.entity, d2.graph);
77064         return matched && matched.name() || utilDisplayType(d2.entity.id);
77065       });
77066       buttons.append("span").attr("class", "entity-name").text(function(d2) {
77067         var name = utilDisplayName(d2.entity) || "", string = "";
77068         if (name !== "") {
77069           string += ":";
77070         }
77071         return string += " " + name;
77072       });
77073       items = itemsEnter.merge(items);
77074       var changeset = new osmChangeset().update({ id: void 0 });
77075       var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
77076       delete changeset.id;
77077       var data = JXON.stringify(changeset.osmChangeJXON(changes));
77078       var blob = new Blob([data], { type: "text/xml;charset=utf-8;" });
77079       var fileName = "changes.osc";
77080       var linkEnter = container.selectAll(".download-changes").data([0]).enter().append("a").attr("class", "download-changes");
77081       linkEnter.attr("href", window.URL.createObjectURL(blob)).attr("download", fileName);
77082       linkEnter.call(svgIcon("#iD-icon-load", "inline")).append("span").call(_t.append("commit.download_changes"));
77083       function mouseover(d3_event, d2) {
77084         if (d2.entity) {
77085           context.surface().selectAll(
77086             utilEntityOrMemberSelector([d2.entity.id], context.graph())
77087           ).classed("hover", true);
77088         }
77089       }
77090       function mouseout() {
77091         context.surface().selectAll(".hover").classed("hover", false);
77092       }
77093       function click(d3_event, change) {
77094         if (change.changeType !== "deleted") {
77095           var entity = change.entity;
77096           context.map().zoomToEase(entity);
77097           context.surface().selectAll(utilEntityOrMemberSelector([entity.id], context.graph())).classed("hover", true);
77098         }
77099       }
77100     }
77101     return section;
77102   }
77103
77104   // modules/ui/commit.js
77105   var readOnlyTags = [
77106     /^changesets_count$/,
77107     /^created_by$/,
77108     /^ideditor:/,
77109     /^imagery_used$/,
77110     /^host$/,
77111     /^locale$/,
77112     /^warnings:/,
77113     /^resolved:/,
77114     /^closed:note$/,
77115     /^closed:keepright$/,
77116     /^closed:osmose:/
77117   ];
77118   var hashtagRegex = /([##][^\u2000-\u206F\u2E00-\u2E7F\s\\'!"#$%()*,.\/:;<=>?@\[\]^`{|}~]+)/g;
77119   function uiCommit(context) {
77120     var dispatch12 = dispatch_default("cancel");
77121     var _userDetails2;
77122     var _selection;
77123     var changesetEditor = uiChangesetEditor(context).on("change", changeTags);
77124     var rawTagEditor = uiSectionRawTagEditor("changeset-tag-editor", context).on("change", changeTags).readOnlyTags(readOnlyTags);
77125     var commitChanges = uiSectionChanges(context);
77126     var commitWarnings = uiCommitWarnings(context);
77127     function commit(selection2) {
77128       _selection = selection2;
77129       if (!context.changeset) initChangeset();
77130       selection2.call(render);
77131     }
77132     function initChangeset() {
77133       var commentDate = +corePreferences("commentDate") || 0;
77134       var currDate = Date.now();
77135       var cutoff = 2 * 86400 * 1e3;
77136       if (commentDate > currDate || currDate - commentDate > cutoff) {
77137         corePreferences("comment", null);
77138         corePreferences("hashtags", null);
77139         corePreferences("source", null);
77140       }
77141       if (context.defaultChangesetComment()) {
77142         corePreferences("comment", context.defaultChangesetComment());
77143         corePreferences("commentDate", Date.now());
77144       }
77145       if (context.defaultChangesetSource()) {
77146         corePreferences("source", context.defaultChangesetSource());
77147         corePreferences("commentDate", Date.now());
77148       }
77149       if (context.defaultChangesetHashtags()) {
77150         corePreferences("hashtags", context.defaultChangesetHashtags());
77151         corePreferences("commentDate", Date.now());
77152       }
77153       var detected = utilDetect();
77154       var tags = {
77155         comment: corePreferences("comment") || "",
77156         created_by: context.cleanTagValue("iD " + context.version),
77157         host: context.cleanTagValue(detected.host),
77158         locale: context.cleanTagValue(_mainLocalizer.localeCode())
77159       };
77160       findHashtags(tags, true);
77161       var hashtags = corePreferences("hashtags");
77162       if (hashtags) {
77163         tags.hashtags = hashtags;
77164       }
77165       var source = corePreferences("source");
77166       if (source) {
77167         tags.source = source;
77168       }
77169       var photoOverlaysUsed = context.history().photoOverlaysUsed();
77170       if (photoOverlaysUsed.length) {
77171         var sources = (tags.source || "").split(";");
77172         if (sources.indexOf("streetlevel imagery") === -1) {
77173           sources.push("streetlevel imagery");
77174         }
77175         photoOverlaysUsed.forEach(function(photoOverlay) {
77176           if (sources.indexOf(photoOverlay) === -1) {
77177             sources.push(photoOverlay);
77178           }
77179         });
77180         tags.source = context.cleanTagValue(sources.filter(Boolean).join(";"));
77181       }
77182       context.changeset = new osmChangeset({ tags });
77183     }
77184     function loadDerivedChangesetTags() {
77185       var osm = context.connection();
77186       if (!osm) return;
77187       var tags = Object.assign({}, context.changeset.tags);
77188       var imageryUsed = context.cleanTagValue(context.history().imageryUsed().join(";"));
77189       tags.imagery_used = imageryUsed || "None";
77190       var osmClosed = osm.getClosedIDs();
77191       var itemType;
77192       if (osmClosed.length) {
77193         tags["closed:note"] = context.cleanTagValue(osmClosed.join(";"));
77194       }
77195       if (services.keepRight) {
77196         var krClosed = services.keepRight.getClosedIDs();
77197         if (krClosed.length) {
77198           tags["closed:keepright"] = context.cleanTagValue(krClosed.join(";"));
77199         }
77200       }
77201       if (services.osmose) {
77202         var osmoseClosed = services.osmose.getClosedCounts();
77203         for (itemType in osmoseClosed) {
77204           tags["closed:osmose:" + itemType] = context.cleanTagValue(osmoseClosed[itemType].toString());
77205         }
77206       }
77207       for (var key in tags) {
77208         if (key.match(/(^warnings:)|(^resolved:)/)) {
77209           delete tags[key];
77210         }
77211       }
77212       function addIssueCounts(issues, prefix) {
77213         var issuesByType = utilArrayGroupBy(issues, "type");
77214         for (var issueType in issuesByType) {
77215           var issuesOfType = issuesByType[issueType];
77216           if (issuesOfType[0].subtype) {
77217             var issuesBySubtype = utilArrayGroupBy(issuesOfType, "subtype");
77218             for (var issueSubtype in issuesBySubtype) {
77219               var issuesOfSubtype = issuesBySubtype[issueSubtype];
77220               tags[prefix + ":" + issueType + ":" + issueSubtype] = context.cleanTagValue(issuesOfSubtype.length.toString());
77221             }
77222           } else {
77223             tags[prefix + ":" + issueType] = context.cleanTagValue(issuesOfType.length.toString());
77224           }
77225         }
77226       }
77227       const warnings = context.validator().getIssuesBySeverity({ what: "edited", where: "all", includeIgnored: true, includeDisabledRules: true }).warning.filter(function(issue) {
77228         return issue.type !== "help_request";
77229       });
77230       [
77231         ...getIncompatibleSources(tags.comment),
77232         ...getIncompatibleSources(tags.source)
77233       ].forEach(() => {
77234         warnings.push({ type: "incompatible_source" });
77235       });
77236       addIssueCounts(warnings, "warnings");
77237       var resolvedIssues = context.validator().getResolvedIssues();
77238       addIssueCounts(resolvedIssues, "resolved");
77239       context.changeset = context.changeset.update({ tags });
77240     }
77241     function render(selection2) {
77242       loadDerivedChangesetTags();
77243       var osm = context.connection();
77244       if (!osm) return;
77245       var header = selection2.selectAll(".header").data([0]);
77246       var headerTitle = header.enter().append("div").attr("class", "header fillL");
77247       headerTitle.append("div").append("h2").call(_t.append("commit.title"));
77248       headerTitle.append("button").attr("class", "close").attr("title", _t("icons.close")).on("click", function() {
77249         dispatch12.call("cancel", this);
77250       }).call(svgIcon("#iD-icon-close"));
77251       var body = selection2.selectAll(".body").data([0]);
77252       body = body.enter().append("div").attr("class", "body").merge(body);
77253       var changesetSection = body.selectAll(".changeset-editor").data([0]);
77254       changesetSection = changesetSection.enter().append("div").attr("class", "modal-section changeset-editor").merge(changesetSection);
77255       changesetSection.call(
77256         changesetEditor.changesetID(context.changeset.id).tags(context.changeset.tags)
77257       );
77258       body.call(commitWarnings);
77259       var saveSection = body.selectAll(".save-section").data([0]);
77260       saveSection = saveSection.enter().append("div").attr("class", "modal-section save-section fillL").merge(saveSection);
77261       var prose = saveSection.selectAll(".commit-info").data([0]);
77262       if (prose.enter().size()) {
77263         _userDetails2 = null;
77264       }
77265       prose = prose.enter().append("p").attr("class", "commit-info").call(_t.append("commit.upload_explanation")).merge(prose);
77266       osm.userDetails(function(err, user) {
77267         if (err) return;
77268         if (_userDetails2 === user) return;
77269         _userDetails2 = user;
77270         var userLink = select_default2(document.createElement("div"));
77271         if (user.image_url) {
77272           userLink.append("img").attr("src", user.image_url).attr("class", "icon pre-text user-icon");
77273         }
77274         userLink.append("a").attr("class", "user-info").text(user.display_name).attr("href", osm.userURL(user.display_name)).attr("target", "_blank");
77275         prose.html(_t.html("commit.upload_explanation_with_user", { user: { html: userLink.html() } }));
77276       });
77277       var requestReview = saveSection.selectAll(".request-review").data([0]);
77278       var requestReviewEnter = requestReview.enter().append("div").attr("class", "request-review");
77279       var requestReviewDomId = utilUniqueDomId("commit-input-request-review");
77280       var labelEnter = requestReviewEnter.append("label").attr("for", requestReviewDomId);
77281       if (!labelEnter.empty()) {
77282         labelEnter.call(uiTooltip().title(() => _t.append("commit.request_review_info")).placement("top"));
77283       }
77284       labelEnter.append("input").attr("type", "checkbox").attr("id", requestReviewDomId);
77285       labelEnter.append("span").call(_t.append("commit.request_review"));
77286       requestReview = requestReview.merge(requestReviewEnter);
77287       var requestReviewInput = requestReview.selectAll("input").property("checked", isReviewRequested(context.changeset.tags)).on("change", toggleRequestReview);
77288       var buttonSection = saveSection.selectAll(".buttons").data([0]);
77289       var buttonEnter = buttonSection.enter().append("div").attr("class", "buttons fillL");
77290       buttonEnter.append("button").attr("class", "secondary-action button cancel-button").append("span").attr("class", "label").call(_t.append("commit.cancel"));
77291       var uploadButton = buttonEnter.append("button").attr("class", "action button save-button");
77292       uploadButton.append("span").attr("class", "label").call(_t.append("commit.save"));
77293       var uploadBlockerTooltipText = getUploadBlockerMessage();
77294       buttonSection = buttonSection.merge(buttonEnter);
77295       buttonSection.selectAll(".cancel-button").on("click.cancel", function() {
77296         dispatch12.call("cancel", this);
77297       });
77298       buttonSection.selectAll(".save-button").classed("disabled", uploadBlockerTooltipText !== null).on("click.save", function() {
77299         if (!select_default2(this).classed("disabled")) {
77300           this.blur();
77301           for (var key in context.changeset.tags) {
77302             if (!key) delete context.changeset.tags[key];
77303           }
77304           context.uploader().save(context.changeset);
77305         }
77306       });
77307       uiTooltip().destroyAny(buttonSection.selectAll(".save-button"));
77308       if (uploadBlockerTooltipText) {
77309         buttonSection.selectAll(".save-button").call(uiTooltip().title(() => uploadBlockerTooltipText).placement("top"));
77310       }
77311       var tagSection = body.selectAll(".tag-section.raw-tag-editor").data([0]);
77312       tagSection = tagSection.enter().append("div").attr("class", "modal-section tag-section raw-tag-editor").merge(tagSection);
77313       tagSection.call(
77314         rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
77315       );
77316       var changesSection = body.selectAll(".commit-changes-section").data([0]);
77317       changesSection = changesSection.enter().append("div").attr("class", "modal-section commit-changes-section").merge(changesSection);
77318       changesSection.call(commitChanges.render);
77319       function toggleRequestReview() {
77320         var rr = requestReviewInput.property("checked");
77321         updateChangeset({ review_requested: rr ? "yes" : void 0 });
77322         tagSection.call(
77323           rawTagEditor.tags(Object.assign({}, context.changeset.tags)).render
77324         );
77325       }
77326     }
77327     function getUploadBlockerMessage() {
77328       var errors = context.validator().getIssuesBySeverity({ what: "edited", where: "all" }).error;
77329       if (errors.length) {
77330         return _t.append("commit.outstanding_errors_message", { count: errors.length });
77331       } else {
77332         var hasChangesetComment = context.changeset && context.changeset.tags.comment && context.changeset.tags.comment.trim().length;
77333         if (!hasChangesetComment) {
77334           return _t.append("commit.comment_needed_message");
77335         }
77336       }
77337       return null;
77338     }
77339     function changeTags(_3, changed, onInput) {
77340       if (changed.hasOwnProperty("comment")) {
77341         if (!onInput) {
77342           corePreferences("comment", changed.comment);
77343           corePreferences("commentDate", Date.now());
77344         }
77345       }
77346       if (changed.hasOwnProperty("source")) {
77347         if (changed.source === void 0) {
77348           corePreferences("source", null);
77349         } else if (!onInput) {
77350           corePreferences("source", changed.source);
77351           corePreferences("commentDate", Date.now());
77352         }
77353       }
77354       updateChangeset(changed, onInput);
77355       if (_selection) {
77356         _selection.call(render);
77357       }
77358     }
77359     function findHashtags(tags, commentOnly) {
77360       var detectedHashtags = commentHashtags();
77361       if (detectedHashtags.length) {
77362         corePreferences("hashtags", null);
77363       }
77364       if (!detectedHashtags.length || !commentOnly) {
77365         detectedHashtags = detectedHashtags.concat(hashtagHashtags());
77366       }
77367       var allLowerCase = /* @__PURE__ */ new Set();
77368       return detectedHashtags.filter(function(hashtag) {
77369         var lowerCase = hashtag.toLowerCase();
77370         if (!allLowerCase.has(lowerCase)) {
77371           allLowerCase.add(lowerCase);
77372           return true;
77373         }
77374         return false;
77375       });
77376       function commentHashtags() {
77377         var matches = (tags.comment || "").replace(/http\S*/g, "").match(hashtagRegex);
77378         return matches || [];
77379       }
77380       function hashtagHashtags() {
77381         var matches = (tags.hashtags || "").split(/[,;\s]+/).map(function(s2) {
77382           if (s2[0] !== "#") {
77383             s2 = "#" + s2;
77384           }
77385           var matched = s2.match(hashtagRegex);
77386           return matched && matched[0];
77387         }).filter(Boolean);
77388         return matches || [];
77389       }
77390     }
77391     function isReviewRequested(tags) {
77392       var rr = tags.review_requested;
77393       if (rr === void 0) return false;
77394       rr = rr.trim().toLowerCase();
77395       return !(rr === "" || rr === "no");
77396     }
77397     function updateChangeset(changed, onInput) {
77398       var tags = Object.assign({}, context.changeset.tags);
77399       Object.keys(changed).forEach(function(k3) {
77400         var v3 = changed[k3];
77401         k3 = context.cleanTagKey(k3);
77402         if (readOnlyTags.indexOf(k3) !== -1) return;
77403         if (v3 === void 0) {
77404           delete tags[k3];
77405         } else if (onInput) {
77406           tags[k3] = v3;
77407         } else {
77408           tags[k3] = context.cleanTagValue(v3);
77409         }
77410       });
77411       if (!onInput) {
77412         var commentOnly = changed.hasOwnProperty("comment") && changed.comment !== "";
77413         var arr = findHashtags(tags, commentOnly);
77414         if (arr.length) {
77415           tags.hashtags = context.cleanTagValue(arr.join(";"));
77416           corePreferences("hashtags", tags.hashtags);
77417         } else {
77418           delete tags.hashtags;
77419           corePreferences("hashtags", null);
77420         }
77421       }
77422       if (_userDetails2 && _userDetails2.changesets_count !== void 0) {
77423         var changesetsCount = parseInt(_userDetails2.changesets_count, 10) + 1;
77424         tags.changesets_count = String(changesetsCount);
77425         if (changesetsCount <= 100) {
77426           var s2;
77427           s2 = corePreferences("walkthrough_completed");
77428           if (s2) {
77429             tags["ideditor:walkthrough_completed"] = s2;
77430           }
77431           s2 = corePreferences("walkthrough_progress");
77432           if (s2) {
77433             tags["ideditor:walkthrough_progress"] = s2;
77434           }
77435           s2 = corePreferences("walkthrough_started");
77436           if (s2) {
77437             tags["ideditor:walkthrough_started"] = s2;
77438           }
77439         }
77440       } else {
77441         delete tags.changesets_count;
77442       }
77443       if (!(0, import_fast_deep_equal11.default)(context.changeset.tags, tags)) {
77444         context.changeset = context.changeset.update({ tags });
77445       }
77446     }
77447     commit.reset = function() {
77448       context.changeset = null;
77449     };
77450     return utilRebind(commit, dispatch12, "on");
77451   }
77452
77453   // modules/modes/save.js
77454   function modeSave(context) {
77455     var mode = { id: "save" };
77456     var keybinding = utilKeybinding("modeSave");
77457     var commit = uiCommit(context).on("cancel", cancel);
77458     var _conflictsUi;
77459     var _location;
77460     var _success;
77461     var uploader = context.uploader().on("saveStarted.modeSave", function() {
77462       keybindingOff();
77463     }).on("willAttemptUpload.modeSave", prepareForSuccess).on("progressChanged.modeSave", showProgress).on("resultNoChanges.modeSave", function() {
77464       cancel();
77465     }).on("resultErrors.modeSave", showErrors).on("resultConflicts.modeSave", showConflicts).on("resultSuccess.modeSave", showSuccess);
77466     function cancel() {
77467       context.enter(modeBrowse(context));
77468     }
77469     function showProgress(num, total) {
77470       var modal = context.container().select(".loading-modal .modal-section");
77471       var progress = modal.selectAll(".progress").data([0]);
77472       progress.enter().append("div").attr("class", "progress").merge(progress).text(_t("save.conflict_progress", { num, total }));
77473     }
77474     function showConflicts(changeset, conflicts, origChanges) {
77475       var selection2 = context.container().select(".sidebar").append("div").attr("class", "sidebar-component");
77476       context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
77477       _conflictsUi = uiConflicts(context).conflictList(conflicts).origChanges(origChanges).on("cancel", function() {
77478         context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
77479         selection2.remove();
77480         keybindingOn();
77481         uploader.cancelConflictResolution();
77482       }).on("save", function() {
77483         context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
77484         selection2.remove();
77485         uploader.processResolvedConflicts(changeset);
77486       });
77487       selection2.call(_conflictsUi);
77488     }
77489     function showErrors(errors) {
77490       keybindingOn();
77491       var selection2 = uiConfirm(context.container());
77492       selection2.select(".modal-section.header").append("h3").text(_t("save.error"));
77493       addErrors(selection2, errors);
77494       selection2.okButton();
77495     }
77496     function addErrors(selection2, data) {
77497       var message = selection2.select(".modal-section.message-text");
77498       var items = message.selectAll(".error-container").data(data);
77499       var enter = items.enter().append("div").attr("class", "error-container");
77500       enter.append("a").attr("class", "error-description").attr("href", "#").classed("hide-toggle", true).text(function(d2) {
77501         return d2.msg || _t("save.unknown_error_details");
77502       }).on("click", function(d3_event) {
77503         d3_event.preventDefault();
77504         var error = select_default2(this);
77505         var detail = select_default2(this.nextElementSibling);
77506         var exp2 = error.classed("expanded");
77507         detail.style("display", exp2 ? "none" : "block");
77508         error.classed("expanded", !exp2);
77509       });
77510       var details = enter.append("div").attr("class", "error-detail-container").style("display", "none");
77511       details.append("ul").attr("class", "error-detail-list").selectAll("li").data(function(d2) {
77512         return d2.details || [];
77513       }).enter().append("li").attr("class", "error-detail-item").text(function(d2) {
77514         return d2;
77515       });
77516       items.exit().remove();
77517     }
77518     function showSuccess(changeset) {
77519       commit.reset();
77520       var ui = _success.changeset(changeset).location(_location).on("cancel", function() {
77521         context.ui().sidebar.hide();
77522       });
77523       context.enter(modeBrowse(context).sidebar(ui));
77524     }
77525     function keybindingOn() {
77526       select_default2(document).call(keybinding.on("\u238B", cancel, true));
77527     }
77528     function keybindingOff() {
77529       select_default2(document).call(keybinding.unbind);
77530     }
77531     function prepareForSuccess() {
77532       _success = uiSuccess(context);
77533       _location = null;
77534       if (!services.geocoder) return;
77535       services.geocoder.reverse(context.map().center(), function(err, result) {
77536         if (err || !result || !result.address) return;
77537         var addr = result.address;
77538         var place = addr && (addr.town || addr.city || addr.county) || "";
77539         var region = addr && (addr.state || addr.country) || "";
77540         var separator = place && region ? _t("success.thank_you_where.separator") : "";
77541         _location = _t(
77542           "success.thank_you_where.format",
77543           { place, separator, region }
77544         );
77545       });
77546     }
77547     mode.selectedIDs = function() {
77548       return _conflictsUi ? _conflictsUi.shownEntityIds() : [];
77549     };
77550     mode.enter = function() {
77551       context.ui().sidebar.expand();
77552       function done() {
77553         context.ui().sidebar.show(commit);
77554       }
77555       keybindingOn();
77556       context.container().selectAll(".main-content").classed("active", false).classed("inactive", true);
77557       var osm = context.connection();
77558       if (!osm) {
77559         cancel();
77560         return;
77561       }
77562       if (osm.authenticated()) {
77563         done();
77564       } else {
77565         osm.authenticate(function(err) {
77566           if (err) {
77567             cancel();
77568           } else {
77569             done();
77570           }
77571         });
77572       }
77573     };
77574     mode.exit = function() {
77575       keybindingOff();
77576       context.container().selectAll(".main-content").classed("active", true).classed("inactive", false);
77577       context.ui().sidebar.hide();
77578     };
77579     return mode;
77580   }
77581
77582   // modules/core/context.js
77583   function coreContext() {
77584     const dispatch12 = dispatch_default("enter", "exit", "change");
77585     const context = {};
77586     let _deferred2 = /* @__PURE__ */ new Set();
77587     context.version = package_default.version;
77588     context.privacyVersion = "20201202";
77589     context.initialHashParams = window.location.hash ? utilStringQs(window.location.hash) : {};
77590     context.changeset = null;
77591     let _defaultChangesetComment = context.initialHashParams.comment;
77592     let _defaultChangesetSource = context.initialHashParams.source;
77593     let _defaultChangesetHashtags = context.initialHashParams.hashtags;
77594     context.defaultChangesetComment = function(val) {
77595       if (!arguments.length) return _defaultChangesetComment;
77596       _defaultChangesetComment = val;
77597       return context;
77598     };
77599     context.defaultChangesetSource = function(val) {
77600       if (!arguments.length) return _defaultChangesetSource;
77601       _defaultChangesetSource = val;
77602       return context;
77603     };
77604     context.defaultChangesetHashtags = function(val) {
77605       if (!arguments.length) return _defaultChangesetHashtags;
77606       _defaultChangesetHashtags = val;
77607       return context;
77608     };
77609     let _setsDocumentTitle = true;
77610     context.setsDocumentTitle = function(val) {
77611       if (!arguments.length) return _setsDocumentTitle;
77612       _setsDocumentTitle = val;
77613       return context;
77614     };
77615     let _documentTitleBase = document.title;
77616     context.documentTitleBase = function(val) {
77617       if (!arguments.length) return _documentTitleBase;
77618       _documentTitleBase = val;
77619       return context;
77620     };
77621     let _ui;
77622     context.ui = () => _ui;
77623     context.lastPointerType = () => _ui.lastPointerType();
77624     let _keybinding = utilKeybinding("context");
77625     context.keybinding = () => _keybinding;
77626     select_default2(document).call(_keybinding);
77627     let _connection = services.osm;
77628     let _history;
77629     let _validator;
77630     let _uploader;
77631     context.connection = () => _connection;
77632     context.history = () => _history;
77633     context.validator = () => _validator;
77634     context.uploader = () => _uploader;
77635     context.preauth = (options) => {
77636       if (_connection) {
77637         _connection.switch(options);
77638       }
77639       return context;
77640     };
77641     context.locale = function(locale2) {
77642       if (!arguments.length) return _mainLocalizer.localeCode();
77643       _mainLocalizer.preferredLocaleCodes(locale2);
77644       return context;
77645     };
77646     function afterLoad(cid, callback) {
77647       return (err, result) => {
77648         if (err) {
77649           if (typeof callback === "function") {
77650             callback(err);
77651           }
77652           return;
77653         } else if (_connection && _connection.getConnectionId() !== cid) {
77654           if (typeof callback === "function") {
77655             callback({ message: "Connection Switched", status: -1 });
77656           }
77657           return;
77658         } else {
77659           _history.merge(result.data, result.extent);
77660           if (typeof callback === "function") {
77661             callback(err, result);
77662           }
77663           return;
77664         }
77665       };
77666     }
77667     context.loadTiles = (projection2, callback) => {
77668       const handle = window.requestIdleCallback(() => {
77669         _deferred2.delete(handle);
77670         if (_connection && context.editableDataEnabled()) {
77671           const cid = _connection.getConnectionId();
77672           _connection.loadTiles(projection2, afterLoad(cid, callback));
77673         }
77674       });
77675       _deferred2.add(handle);
77676     };
77677     context.loadTileAtLoc = (loc, callback) => {
77678       const handle = window.requestIdleCallback(() => {
77679         _deferred2.delete(handle);
77680         if (_connection && context.editableDataEnabled()) {
77681           const cid = _connection.getConnectionId();
77682           _connection.loadTileAtLoc(loc, afterLoad(cid, callback));
77683         }
77684       });
77685       _deferred2.add(handle);
77686     };
77687     context.loadEntity = (entityID, callback) => {
77688       if (_connection) {
77689         const cid = _connection.getConnectionId();
77690         _connection.loadEntity(entityID, afterLoad(cid, callback));
77691         _connection.loadEntityRelations(entityID, afterLoad(cid, callback));
77692       }
77693     };
77694     context.loadNote = (entityID, callback) => {
77695       if (_connection) {
77696         const cid = _connection.getConnectionId();
77697         _connection.loadEntityNote(entityID, afterLoad(cid, callback));
77698       }
77699     };
77700     context.zoomToEntity = (entityID, zoomTo) => {
77701       context.zoomToEntities([entityID], zoomTo);
77702     };
77703     context.zoomToEntities = (entityIDs, zoomTo) => {
77704       let loadedEntities = [];
77705       const throttledZoomTo = throttle_default(() => _map.zoomTo(loadedEntities), 500);
77706       entityIDs.forEach((entityID) => context.loadEntity(entityID, (err, result) => {
77707         if (err) return;
77708         const entity = result.data.find((e3) => e3.id === entityID);
77709         if (!entity) return;
77710         loadedEntities.push(entity);
77711         if (zoomTo !== false) {
77712           throttledZoomTo();
77713         }
77714       }));
77715       _map.on("drawn.zoomToEntity", () => {
77716         if (!entityIDs.every((entityID) => context.hasEntity(entityID))) return;
77717         _map.on("drawn.zoomToEntity", null);
77718         context.on("enter.zoomToEntity", null);
77719         context.enter(modeSelect(context, entityIDs));
77720       });
77721       context.on("enter.zoomToEntity", () => {
77722         if (_mode.id !== "browse") {
77723           _map.on("drawn.zoomToEntity", null);
77724           context.on("enter.zoomToEntity", null);
77725         }
77726       });
77727     };
77728     context.moveToNote = (noteId, moveTo) => {
77729       context.loadNote(noteId, (err, result) => {
77730         if (err) return;
77731         const entity = result.data.find((e3) => e3.id === noteId);
77732         if (!entity) return;
77733         const note = services.osm.getNote(noteId);
77734         if (moveTo !== false) {
77735           context.map().center(note.loc);
77736         }
77737         const noteLayer = context.layers().layer("notes");
77738         noteLayer.enabled(true);
77739         context.enter(modeSelectNote(context, noteId));
77740       });
77741     };
77742     let _minEditableZoom = 16;
77743     context.minEditableZoom = function(val) {
77744       if (!arguments.length) return _minEditableZoom;
77745       _minEditableZoom = val;
77746       if (_connection) {
77747         _connection.tileZoom(val);
77748       }
77749       return context;
77750     };
77751     context.maxCharsForTagKey = () => 255;
77752     context.maxCharsForTagValue = () => 255;
77753     context.maxCharsForRelationRole = () => 255;
77754     context.cleanTagKey = (val) => utilCleanOsmString(val, context.maxCharsForTagKey());
77755     context.cleanTagValue = (val) => utilCleanOsmString(val, context.maxCharsForTagValue());
77756     context.cleanRelationRole = (val) => utilCleanOsmString(val, context.maxCharsForRelationRole());
77757     let _inIntro = false;
77758     context.inIntro = function(val) {
77759       if (!arguments.length) return _inIntro;
77760       _inIntro = val;
77761       return context;
77762     };
77763     context.save = () => {
77764       if (_inIntro || context.container().select(".modal").size()) return;
77765       let canSave;
77766       if (_mode && _mode.id === "save") {
77767         canSave = false;
77768         if (services.osm && services.osm.isChangesetInflight()) {
77769           _history.clearSaved();
77770           return;
77771         }
77772       } else {
77773         canSave = context.selectedIDs().every((id2) => {
77774           const entity = context.hasEntity(id2);
77775           return entity && !entity.isDegenerate();
77776         });
77777       }
77778       if (canSave) {
77779         _history.save();
77780       }
77781       if (_history.hasChanges()) {
77782         return _t("save.unsaved_changes");
77783       }
77784     };
77785     context.debouncedSave = debounce_default(context.save, 100);
77786     function withDebouncedSave(fn) {
77787       return function() {
77788         const result = fn.apply(_history, arguments);
77789         context.debouncedSave();
77790         return result;
77791       };
77792     }
77793     context.hasEntity = (id2) => _history.graph().hasEntity(id2);
77794     context.entity = (id2) => _history.graph().entity(id2);
77795     let _mode;
77796     context.mode = () => _mode;
77797     context.enter = (newMode) => {
77798       if (_mode) {
77799         _mode.exit();
77800         dispatch12.call("exit", this, _mode);
77801       }
77802       _mode = newMode;
77803       _mode.enter();
77804       dispatch12.call("enter", this, _mode);
77805     };
77806     context.selectedIDs = () => _mode && _mode.selectedIDs && _mode.selectedIDs() || [];
77807     context.activeID = () => _mode && _mode.activeID && _mode.activeID();
77808     let _selectedNoteID;
77809     context.selectedNoteID = function(noteID) {
77810       if (!arguments.length) return _selectedNoteID;
77811       _selectedNoteID = noteID;
77812       return context;
77813     };
77814     let _selectedErrorID;
77815     context.selectedErrorID = function(errorID) {
77816       if (!arguments.length) return _selectedErrorID;
77817       _selectedErrorID = errorID;
77818       return context;
77819     };
77820     context.install = (behavior) => context.surface().call(behavior);
77821     context.uninstall = (behavior) => context.surface().call(behavior.off);
77822     let _copyGraph;
77823     context.copyGraph = () => _copyGraph;
77824     let _copyIDs = [];
77825     context.copyIDs = function(val) {
77826       if (!arguments.length) return _copyIDs;
77827       _copyIDs = val;
77828       _copyGraph = _history.graph();
77829       return context;
77830     };
77831     let _copyLonLat;
77832     context.copyLonLat = function(val) {
77833       if (!arguments.length) return _copyLonLat;
77834       _copyLonLat = val;
77835       return context;
77836     };
77837     let _background;
77838     context.background = () => _background;
77839     let _features;
77840     context.features = () => _features;
77841     context.hasHiddenConnections = (id2) => {
77842       const graph = _history.graph();
77843       const entity = graph.entity(id2);
77844       return _features.hasHiddenConnections(entity, graph);
77845     };
77846     let _photos;
77847     context.photos = () => _photos;
77848     let _map;
77849     context.map = () => _map;
77850     context.layers = () => _map.layers();
77851     context.surface = () => _map.surface;
77852     context.editableDataEnabled = () => _map.editableDataEnabled();
77853     context.surfaceRect = () => _map.surface.node().getBoundingClientRect();
77854     context.editable = () => {
77855       const mode = context.mode();
77856       if (!mode || mode.id === "save") return false;
77857       return _map.editableDataEnabled();
77858     };
77859     let _debugFlags = {
77860       tile: false,
77861       // tile boundaries
77862       collision: false,
77863       // label collision bounding boxes
77864       imagery: false,
77865       // imagery bounding polygons
77866       target: false,
77867       // touch targets
77868       downloaded: false
77869       // downloaded data from osm
77870     };
77871     context.debugFlags = () => _debugFlags;
77872     context.getDebug = (flag) => flag && _debugFlags[flag];
77873     context.setDebug = function(flag, val) {
77874       if (arguments.length === 1) val = true;
77875       _debugFlags[flag] = val;
77876       dispatch12.call("change");
77877       return context;
77878     };
77879     let _container = select_default2(null);
77880     let _theme;
77881     context.container = function(val) {
77882       if (!arguments.length) return _container;
77883       _container = val;
77884       _container.classed("ideditor", true);
77885       _container.classed("theme-dark", _theme === "dark");
77886       _container.classed("theme-light", _theme === "light");
77887       return context;
77888     };
77889     context.containerNode = function(val) {
77890       if (!arguments.length) return context.container().node();
77891       context.container(select_default2(val));
77892       return context;
77893     };
77894     context.theme = function(val) {
77895       if (!arguments.length) return _theme;
77896       _theme = val;
77897       context.container(_container);
77898       return context;
77899     };
77900     let _embed;
77901     context.embed = function(val) {
77902       if (!arguments.length) return _embed;
77903       _embed = val;
77904       return context;
77905     };
77906     let _assetPath = "";
77907     context.assetPath = function(val) {
77908       if (!arguments.length) return _assetPath;
77909       _assetPath = val;
77910       _mainFileFetcher.assetPath(val);
77911       return context;
77912     };
77913     let _assetMap = {};
77914     context.assetMap = function(val) {
77915       if (!arguments.length) return _assetMap;
77916       _assetMap = val;
77917       _mainFileFetcher.assetMap(val);
77918       return context;
77919     };
77920     context.asset = (val) => {
77921       if (/^http(s)?:\/\//i.test(val)) return val;
77922       const filename = _assetPath + val;
77923       return _assetMap[filename] || filename;
77924     };
77925     context.imagePath = (val) => context.asset("img/".concat(val));
77926     context.reset = context.flush = () => {
77927       context.debouncedSave.cancel();
77928       Array.from(_deferred2).forEach((handle) => {
77929         window.cancelIdleCallback(handle);
77930         _deferred2.delete(handle);
77931       });
77932       Object.values(services).forEach((service) => {
77933         if (service && typeof service.reset === "function") {
77934           service.reset(context);
77935         }
77936       });
77937       context.changeset = null;
77938       _validator.reset();
77939       _features.reset();
77940       _history.reset();
77941       _uploader.reset();
77942       context.container().select(".inspector-wrap *").remove();
77943       return context;
77944     };
77945     context.projection = geoRawMercator();
77946     context.curtainProjection = geoRawMercator();
77947     context.init = () => {
77948       instantiateInternal();
77949       initializeDependents();
77950       return context;
77951       function instantiateInternal() {
77952         _history = coreHistory(context);
77953         context.graph = _history.graph;
77954         context.pauseChangeDispatch = _history.pauseChangeDispatch;
77955         context.resumeChangeDispatch = _history.resumeChangeDispatch;
77956         context.perform = withDebouncedSave(_history.perform);
77957         context.replace = withDebouncedSave(_history.replace);
77958         context.pop = withDebouncedSave(_history.pop);
77959         context.undo = withDebouncedSave(_history.undo);
77960         context.redo = withDebouncedSave(_history.redo);
77961         _validator = coreValidator(context);
77962         _uploader = coreUploader(context);
77963         _background = rendererBackground(context);
77964         _features = rendererFeatures(context);
77965         _map = rendererMap(context);
77966         _photos = rendererPhotos(context);
77967         _ui = uiInit(context);
77968       }
77969       function initializeDependents() {
77970         if (context.initialHashParams.presets) {
77971           _mainPresetIndex.addablePresetIDs(new Set(context.initialHashParams.presets.split(",")));
77972         }
77973         if (context.initialHashParams.locale) {
77974           _mainLocalizer.preferredLocaleCodes(context.initialHashParams.locale);
77975         }
77976         if (context.initialHashParams.theme) {
77977           context.theme(context.initialHashParams.theme);
77978         }
77979         _mainLocalizer.ensureLoaded();
77980         _mainPresetIndex.ensureLoaded();
77981         _background.ensureLoaded();
77982         Object.values(services).forEach((service) => {
77983           if (service && typeof service.init === "function") {
77984             service.init();
77985           }
77986         });
77987         _map.init();
77988         _validator.init();
77989         _features.init();
77990         _history.migrateHistoryData();
77991         if (services.maprules && context.initialHashParams.maprules) {
77992           json_default(context.initialHashParams.maprules).then((mapcss) => {
77993             services.maprules.init();
77994             mapcss.forEach((mapcssSelector) => services.maprules.addRule(mapcssSelector));
77995           }).catch(() => {
77996           });
77997         }
77998         if (!context.container().empty()) {
77999           _ui.ensureLoaded().then(() => {
78000             _background.init();
78001             _photos.init();
78002           });
78003         }
78004       }
78005     };
78006     return utilRebind(context, dispatch12, "on");
78007   }
78008
78009   // modules/behavior/operation.js
78010   function behaviorOperation(context) {
78011     var _operation;
78012     function keypress(d3_event) {
78013       var _a5;
78014       if (!context.map().withinEditableZoom()) return;
78015       if (((_a5 = _operation.availableForKeypress) == null ? void 0 : _a5.call(_operation)) === false) return;
78016       d3_event.preventDefault();
78017       if (!_operation.available()) {
78018         context.ui().flash.duration(4e3).iconName("#iD-operation-" + _operation.id).iconClass("operation disabled").label(_t.append("operations._unavailable", {
78019           operation: _t("operations.".concat(_operation.id, ".title")) || _operation.id
78020         }))();
78021       } else if (_operation.disabled()) {
78022         context.ui().flash.duration(4e3).iconName("#iD-operation-" + _operation.id).iconClass("operation disabled").label(_operation.tooltip())();
78023       } else {
78024         context.ui().flash.duration(2e3).iconName("#iD-operation-" + _operation.id).iconClass("operation").label(_operation.annotation() || _operation.title)();
78025         if (_operation.point) _operation.point(null);
78026         _operation(d3_event);
78027       }
78028     }
78029     function behavior() {
78030       if (_operation && _operation.available()) {
78031         behavior.on();
78032       }
78033       return behavior;
78034     }
78035     behavior.on = function() {
78036       context.keybinding().on(_operation.keys, keypress);
78037     };
78038     behavior.off = function() {
78039       context.keybinding().off(_operation.keys);
78040     };
78041     behavior.which = function(_3) {
78042       if (!arguments.length) return _operation;
78043       _operation = _3;
78044       return behavior;
78045     };
78046     return behavior;
78047   }
78048
78049   // modules/operations/circularize.js
78050   function operationCircularize(context, selectedIDs) {
78051     var _extent;
78052     var _actions = selectedIDs.map(getAction).filter(Boolean);
78053     var _amount = _actions.length === 1 ? "single" : "multiple";
78054     var _coords = utilGetAllNodes(selectedIDs, context.graph()).map(function(n3) {
78055       return n3.loc;
78056     });
78057     function getAction(entityID) {
78058       var entity = context.entity(entityID);
78059       if (entity.type !== "way" || new Set(entity.nodes).size <= 1) return null;
78060       if (!_extent) {
78061         _extent = entity.extent(context.graph());
78062       } else {
78063         _extent = _extent.extend(entity.extent(context.graph()));
78064       }
78065       return actionCircularize(entityID, context.projection);
78066     }
78067     var operation2 = function() {
78068       if (!_actions.length) return;
78069       var combinedAction = function(graph, t2) {
78070         _actions.forEach(function(action) {
78071           if (!action.disabled(graph)) {
78072             graph = action(graph, t2);
78073           }
78074         });
78075         return graph;
78076       };
78077       combinedAction.transitionable = true;
78078       context.perform(combinedAction, operation2.annotation());
78079       window.setTimeout(function() {
78080         context.validator().validate();
78081       }, 300);
78082     };
78083     operation2.available = function() {
78084       return _actions.length && selectedIDs.length === _actions.length;
78085     };
78086     operation2.disabled = function() {
78087       if (!_actions.length) return "";
78088       var actionDisableds = _actions.map(function(action) {
78089         return action.disabled(context.graph());
78090       }).filter(Boolean);
78091       if (actionDisableds.length === _actions.length) {
78092         if (new Set(actionDisableds).size > 1) {
78093           return "multiple_blockers";
78094         }
78095         return actionDisableds[0];
78096       } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
78097         return "too_large";
78098       } else if (someMissing()) {
78099         return "not_downloaded";
78100       } else if (selectedIDs.some(context.hasHiddenConnections)) {
78101         return "connected_to_hidden";
78102       }
78103       return false;
78104       function someMissing() {
78105         if (context.inIntro()) return false;
78106         var osm = context.connection();
78107         if (osm) {
78108           var missing = _coords.filter(function(loc) {
78109             return !osm.isDataLoaded(loc);
78110           });
78111           if (missing.length) {
78112             missing.forEach(function(loc) {
78113               context.loadTileAtLoc(loc);
78114             });
78115             return true;
78116           }
78117         }
78118         return false;
78119       }
78120     };
78121     operation2.tooltip = function() {
78122       var disable = operation2.disabled();
78123       return disable ? _t.append("operations.circularize." + disable + "." + _amount) : _t.append("operations.circularize.description." + _amount);
78124     };
78125     operation2.annotation = function() {
78126       return _t("operations.circularize.annotation.feature", { n: _actions.length });
78127     };
78128     operation2.id = "circularize";
78129     operation2.keys = [_t("operations.circularize.key")];
78130     operation2.title = _t.append("operations.circularize.title");
78131     operation2.behavior = behaviorOperation(context).which(operation2);
78132     return operation2;
78133   }
78134
78135   // modules/operations/rotate.js
78136   function operationRotate(context, selectedIDs) {
78137     var multi = selectedIDs.length === 1 ? "single" : "multiple";
78138     var nodes = utilGetAllNodes(selectedIDs, context.graph());
78139     var coords = nodes.map(function(n3) {
78140       return n3.loc;
78141     });
78142     var extent = utilTotalExtent(selectedIDs, context.graph());
78143     var operation2 = function() {
78144       context.enter(modeRotate(context, selectedIDs));
78145     };
78146     operation2.available = function() {
78147       return nodes.length >= 2;
78148     };
78149     operation2.disabled = function() {
78150       if (extent.percentContainedIn(context.map().extent()) < 0.8) {
78151         return "too_large";
78152       } else if (someMissing()) {
78153         return "not_downloaded";
78154       } else if (selectedIDs.some(context.hasHiddenConnections)) {
78155         return "connected_to_hidden";
78156       } else if (selectedIDs.some(incompleteRelation)) {
78157         return "incomplete_relation";
78158       }
78159       return false;
78160       function someMissing() {
78161         if (context.inIntro()) return false;
78162         var osm = context.connection();
78163         if (osm) {
78164           var missing = coords.filter(function(loc) {
78165             return !osm.isDataLoaded(loc);
78166           });
78167           if (missing.length) {
78168             missing.forEach(function(loc) {
78169               context.loadTileAtLoc(loc);
78170             });
78171             return true;
78172           }
78173         }
78174         return false;
78175       }
78176       function incompleteRelation(id2) {
78177         var entity = context.entity(id2);
78178         return entity.type === "relation" && !entity.isComplete(context.graph());
78179       }
78180     };
78181     operation2.tooltip = function() {
78182       var disable = operation2.disabled();
78183       return disable ? _t.append("operations.rotate." + disable + "." + multi) : _t.append("operations.rotate.description." + multi);
78184     };
78185     operation2.annotation = function() {
78186       return selectedIDs.length === 1 ? _t("operations.rotate.annotation." + context.graph().geometry(selectedIDs[0])) : _t("operations.rotate.annotation.feature", { n: selectedIDs.length });
78187     };
78188     operation2.id = "rotate";
78189     operation2.keys = [_t("operations.rotate.key")];
78190     operation2.title = _t.append("operations.rotate.title");
78191     operation2.behavior = behaviorOperation(context).which(operation2);
78192     operation2.mouseOnly = true;
78193     return operation2;
78194   }
78195
78196   // modules/modes/move.js
78197   function modeMove(context, entityIDs, baseGraph) {
78198     var _tolerancePx = 4;
78199     var mode = {
78200       id: "move",
78201       button: "browse"
78202     };
78203     var keybinding = utilKeybinding("move");
78204     var behaviors = [
78205       behaviorEdit(context),
78206       operationCircularize(context, entityIDs).behavior,
78207       operationDelete(context, entityIDs).behavior,
78208       operationOrthogonalize(context, entityIDs).behavior,
78209       operationReflectLong(context, entityIDs).behavior,
78210       operationReflectShort(context, entityIDs).behavior,
78211       operationRotate(context, entityIDs).behavior
78212     ];
78213     var annotation = entityIDs.length === 1 ? _t("operations.move.annotation." + context.graph().geometry(entityIDs[0])) : _t("operations.move.annotation.feature", { n: entityIDs.length });
78214     var _prevGraph;
78215     var _cache5;
78216     var _origMouseCoords;
78217     var _nudgeInterval;
78218     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
78219     function doMove(nudge) {
78220       nudge = nudge || [0, 0];
78221       let fn;
78222       if (_prevGraph !== context.graph()) {
78223         _cache5 = {};
78224         _origMouseCoords = context.map().mouseCoordinates();
78225         fn = context.perform;
78226       } else {
78227         fn = (action) => {
78228           context.pop();
78229           context.perform(action);
78230         };
78231       }
78232       const currMouseCoords = context.map().mouseCoordinates();
78233       const currMouse = context.projection(currMouseCoords);
78234       const origMouse = context.projection(_origMouseCoords);
78235       const delta = geoVecSubtract(geoVecSubtract(currMouse, origMouse), nudge);
78236       fn(actionMove(entityIDs, delta, context.projection, _cache5));
78237       _prevGraph = context.graph();
78238     }
78239     function startNudge(nudge) {
78240       if (_nudgeInterval) window.clearInterval(_nudgeInterval);
78241       _nudgeInterval = window.setInterval(function() {
78242         context.map().pan(nudge);
78243         doMove(nudge);
78244       }, 50);
78245     }
78246     function stopNudge() {
78247       if (_nudgeInterval) {
78248         window.clearInterval(_nudgeInterval);
78249         _nudgeInterval = null;
78250       }
78251     }
78252     function move() {
78253       doMove();
78254       var nudge = geoViewportEdge(context.map().mouse(), context.map().dimensions());
78255       if (nudge) {
78256         startNudge(nudge);
78257       } else {
78258         stopNudge();
78259       }
78260     }
78261     function finish(d3_event) {
78262       d3_event.stopPropagation();
78263       context.replace(actionNoop(), annotation);
78264       context.enter(modeSelect(context, entityIDs));
78265       stopNudge();
78266     }
78267     function cancel() {
78268       if (baseGraph) {
78269         while (context.graph() !== baseGraph) context.pop();
78270         context.enter(modeBrowse(context));
78271       } else {
78272         if (_prevGraph) context.pop();
78273         context.enter(modeSelect(context, entityIDs));
78274       }
78275       stopNudge();
78276     }
78277     function undone() {
78278       context.enter(modeBrowse(context));
78279     }
78280     mode.enter = function() {
78281       _origMouseCoords = context.map().mouseCoordinates();
78282       _prevGraph = null;
78283       _cache5 = {};
78284       context.features().forceVisible(entityIDs);
78285       behaviors.forEach(context.install);
78286       var downEvent;
78287       context.surface().on(_pointerPrefix + "down.modeMove", function(d3_event) {
78288         downEvent = d3_event;
78289       });
78290       select_default2(window).on(_pointerPrefix + "move.modeMove", move, true).on(_pointerPrefix + "up.modeMove", function(d3_event) {
78291         if (!downEvent) return;
78292         var mapNode = context.container().select(".main-map").node();
78293         var pointGetter = utilFastMouse(mapNode);
78294         var p1 = pointGetter(downEvent);
78295         var p2 = pointGetter(d3_event);
78296         var dist = geoVecLength(p1, p2);
78297         if (dist <= _tolerancePx) finish(d3_event);
78298         downEvent = null;
78299       }, true);
78300       context.history().on("undone.modeMove", undone);
78301       keybinding.on("\u238B", cancel).on("\u21A9", finish);
78302       select_default2(document).call(keybinding);
78303     };
78304     mode.exit = function() {
78305       stopNudge();
78306       behaviors.forEach(function(behavior) {
78307         context.uninstall(behavior);
78308       });
78309       context.surface().on(_pointerPrefix + "down.modeMove", null);
78310       select_default2(window).on(_pointerPrefix + "move.modeMove", null, true).on(_pointerPrefix + "up.modeMove", null, true);
78311       context.history().on("undone.modeMove", null);
78312       select_default2(document).call(keybinding.unbind);
78313       context.features().forceVisible([]);
78314     };
78315     mode.selectedIDs = function() {
78316       if (!arguments.length) return entityIDs;
78317       return mode;
78318     };
78319     mode.annotation = function(_annotation) {
78320       annotation = _annotation;
78321       return mode;
78322     };
78323     return mode;
78324   }
78325
78326   // modules/operations/index.js
78327   var operations_exports = {};
78328   __export(operations_exports, {
78329     operationCircularize: () => operationCircularize,
78330     operationContinue: () => operationContinue,
78331     operationCopy: () => operationCopy,
78332     operationDelete: () => operationDelete,
78333     operationDisconnect: () => operationDisconnect,
78334     operationDowngrade: () => operationDowngrade,
78335     operationExtract: () => operationExtract,
78336     operationMerge: () => operationMerge,
78337     operationMove: () => operationMove,
78338     operationOrthogonalize: () => operationOrthogonalize,
78339     operationPaste: () => operationPaste,
78340     operationReflectLong: () => operationReflectLong,
78341     operationReflectShort: () => operationReflectShort,
78342     operationReverse: () => operationReverse,
78343     operationRotate: () => operationRotate,
78344     operationSplit: () => operationSplit,
78345     operationStraighten: () => operationStraighten
78346   });
78347
78348   // modules/operations/continue.js
78349   function operationContinue(context, selectedIDs) {
78350     var _entities = selectedIDs.map(function(id2) {
78351       return context.graph().entity(id2);
78352     });
78353     var _geometries = Object.assign(
78354       { line: [], vertex: [] },
78355       utilArrayGroupBy(_entities, function(entity) {
78356         return entity.geometry(context.graph());
78357       })
78358     );
78359     var _vertex = _geometries.vertex.length && _geometries.vertex[0];
78360     function candidateWays() {
78361       return _vertex ? context.graph().parentWays(_vertex).filter(function(parent2) {
78362         const geom = parent2.geometry(context.graph());
78363         return (geom === "line" || geom === "area") && !parent2.isClosed() && parent2.affix(_vertex.id) && (_geometries.line.length === 0 || _geometries.line[0] === parent2);
78364       }) : [];
78365     }
78366     var _candidates = candidateWays();
78367     var operation2 = function() {
78368       var candidate = _candidates[0];
78369       const tagsToRemove = /* @__PURE__ */ new Set();
78370       if (_vertex.tags.fixme === "continue") tagsToRemove.add("fixme");
78371       if (_vertex.tags.noexit === "yes") tagsToRemove.add("noexit");
78372       if (tagsToRemove.size) {
78373         context.perform((graph) => {
78374           const newTags = __spreadValues({}, _vertex.tags);
78375           for (const key of tagsToRemove) {
78376             delete newTags[key];
78377           }
78378           return actionChangeTags(_vertex.id, newTags)(graph);
78379         }, operation2.annotation());
78380       }
78381       context.enter(
78382         modeDrawLine(context, candidate.id, context.graph(), "line", candidate.affix(_vertex.id), true)
78383       );
78384     };
78385     operation2.relatedEntityIds = function() {
78386       return _candidates.length ? [_candidates[0].id] : [];
78387     };
78388     operation2.available = function() {
78389       return _geometries.vertex.length === 1 && _geometries.line.length <= 1 && !context.features().hasHiddenConnections(_vertex, context.graph());
78390     };
78391     operation2.disabled = function() {
78392       if (_candidates.length === 0) {
78393         return "not_eligible";
78394       } else if (_candidates.length > 1) {
78395         return "multiple";
78396       }
78397       return false;
78398     };
78399     operation2.tooltip = function() {
78400       var disable = operation2.disabled();
78401       return disable ? _t.append("operations.continue." + disable) : _t.append("operations.continue.description");
78402     };
78403     operation2.annotation = function() {
78404       return _t("operations.continue.annotation.line");
78405     };
78406     operation2.id = "continue";
78407     operation2.keys = [_t("operations.continue.key")];
78408     operation2.title = _t.append("operations.continue.title");
78409     operation2.behavior = behaviorOperation(context).which(operation2);
78410     return operation2;
78411   }
78412
78413   // modules/operations/copy.js
78414   function operationCopy(context, selectedIDs) {
78415     function getFilteredIdsToCopy() {
78416       return selectedIDs.filter(function(selectedID) {
78417         var entity = context.graph().hasEntity(selectedID);
78418         return entity.hasInterestingTags() || entity.geometry(context.graph()) !== "vertex";
78419       });
78420     }
78421     var operation2 = function() {
78422       var graph = context.graph();
78423       var selected = groupEntities(getFilteredIdsToCopy(), graph);
78424       var canCopy = [];
78425       var skip = {};
78426       var entity;
78427       var i3;
78428       for (i3 = 0; i3 < selected.relation.length; i3++) {
78429         entity = selected.relation[i3];
78430         if (!skip[entity.id] && entity.isComplete(graph)) {
78431           canCopy.push(entity.id);
78432           skip = getDescendants(entity.id, graph, skip);
78433         }
78434       }
78435       for (i3 = 0; i3 < selected.way.length; i3++) {
78436         entity = selected.way[i3];
78437         if (!skip[entity.id]) {
78438           canCopy.push(entity.id);
78439           skip = getDescendants(entity.id, graph, skip);
78440         }
78441       }
78442       for (i3 = 0; i3 < selected.node.length; i3++) {
78443         entity = selected.node[i3];
78444         if (!skip[entity.id]) {
78445           canCopy.push(entity.id);
78446         }
78447       }
78448       context.copyIDs(canCopy);
78449       if (_point && (canCopy.length !== 1 || graph.entity(canCopy[0]).type !== "node")) {
78450         context.copyLonLat(context.projection.invert(_point));
78451       } else {
78452         context.copyLonLat(null);
78453       }
78454     };
78455     function groupEntities(ids, graph) {
78456       var entities = ids.map(function(id2) {
78457         return graph.entity(id2);
78458       });
78459       return Object.assign(
78460         { relation: [], way: [], node: [] },
78461         utilArrayGroupBy(entities, "type")
78462       );
78463     }
78464     function getDescendants(id2, graph, descendants) {
78465       var entity = graph.entity(id2);
78466       var children2;
78467       descendants = descendants || {};
78468       if (entity.type === "relation") {
78469         children2 = entity.members.map(function(m3) {
78470           return m3.id;
78471         });
78472       } else if (entity.type === "way") {
78473         children2 = entity.nodes;
78474       } else {
78475         children2 = [];
78476       }
78477       for (var i3 = 0; i3 < children2.length; i3++) {
78478         if (!descendants[children2[i3]]) {
78479           descendants[children2[i3]] = true;
78480           descendants = getDescendants(children2[i3], graph, descendants);
78481         }
78482       }
78483       return descendants;
78484     }
78485     operation2.available = function() {
78486       return getFilteredIdsToCopy().length > 0;
78487     };
78488     operation2.disabled = function() {
78489       var extent = utilTotalExtent(getFilteredIdsToCopy(), context.graph());
78490       if (extent.percentContainedIn(context.map().extent()) < 0.8) {
78491         return "too_large";
78492       }
78493       return false;
78494     };
78495     operation2.availableForKeypress = function() {
78496       var _a5;
78497       const selection2 = (_a5 = window.getSelection) == null ? void 0 : _a5.call(window);
78498       return !(selection2 == null ? void 0 : selection2.toString());
78499     };
78500     operation2.tooltip = function() {
78501       var disable = operation2.disabled();
78502       return disable ? _t.append("operations.copy." + disable, { n: selectedIDs.length }) : _t.append("operations.copy.description", { n: selectedIDs.length });
78503     };
78504     operation2.annotation = function() {
78505       return _t("operations.copy.annotation", { n: selectedIDs.length });
78506     };
78507     var _point;
78508     operation2.point = function(val) {
78509       _point = val;
78510       return operation2;
78511     };
78512     operation2.id = "copy";
78513     operation2.keys = [uiCmd("\u2318C")];
78514     operation2.title = _t.append("operations.copy.title");
78515     operation2.behavior = behaviorOperation(context).which(operation2);
78516     return operation2;
78517   }
78518
78519   // modules/operations/disconnect.js
78520   function operationDisconnect(context, selectedIDs) {
78521     var _vertexIDs = [];
78522     var _wayIDs = [];
78523     var _otherIDs = [];
78524     var _actions = [];
78525     selectedIDs.forEach(function(id2) {
78526       var entity = context.entity(id2);
78527       if (entity.type === "way") {
78528         _wayIDs.push(id2);
78529       } else if (entity.geometry(context.graph()) === "vertex") {
78530         _vertexIDs.push(id2);
78531       } else {
78532         _otherIDs.push(id2);
78533       }
78534     });
78535     var _coords, _descriptionID = "", _annotationID = "features";
78536     var _disconnectingVertexIds = [];
78537     var _disconnectingWayIds = [];
78538     if (_vertexIDs.length > 0) {
78539       _disconnectingVertexIds = _vertexIDs;
78540       _vertexIDs.forEach(function(vertexID) {
78541         var action = actionDisconnect(vertexID);
78542         if (_wayIDs.length > 0) {
78543           var waysIDsForVertex = _wayIDs.filter(function(wayID) {
78544             var way = context.entity(wayID);
78545             return way.nodes.indexOf(vertexID) !== -1;
78546           });
78547           action.limitWays(waysIDsForVertex);
78548         }
78549         _actions.push(action);
78550         _disconnectingWayIds = _disconnectingWayIds.concat(context.graph().parentWays(context.graph().entity(vertexID)).map((d2) => d2.id));
78551       });
78552       _disconnectingWayIds = utilArrayUniq(_disconnectingWayIds).filter(function(id2) {
78553         return _wayIDs.indexOf(id2) === -1;
78554       });
78555       _descriptionID += _actions.length === 1 ? "single_point." : "multiple_points.";
78556       if (_wayIDs.length === 1) {
78557         _descriptionID += "single_way." + context.graph().geometry(_wayIDs[0]);
78558       } else {
78559         _descriptionID += _wayIDs.length === 0 ? "no_ways" : "multiple_ways";
78560       }
78561     } else if (_wayIDs.length > 0) {
78562       var ways = _wayIDs.map(function(id2) {
78563         return context.entity(id2);
78564       });
78565       var nodes = utilGetAllNodes(_wayIDs, context.graph());
78566       _coords = nodes.map(function(n3) {
78567         return n3.loc;
78568       });
78569       var sharedActions = [];
78570       var sharedNodes = [];
78571       var unsharedActions = [];
78572       var unsharedNodes = [];
78573       nodes.forEach(function(node) {
78574         var action = actionDisconnect(node.id).limitWays(_wayIDs);
78575         if (action.disabled(context.graph()) !== "not_connected") {
78576           var count = 0;
78577           for (var i3 in ways) {
78578             var way = ways[i3];
78579             if (way.nodes.indexOf(node.id) !== -1) {
78580               count += 1;
78581             }
78582             if (count > 1) break;
78583           }
78584           if (count > 1) {
78585             sharedActions.push(action);
78586             sharedNodes.push(node);
78587           } else {
78588             unsharedActions.push(action);
78589             unsharedNodes.push(node);
78590           }
78591         }
78592       });
78593       _descriptionID += "no_points.";
78594       _descriptionID += _wayIDs.length === 1 ? "single_way." : "multiple_ways.";
78595       if (sharedActions.length) {
78596         _actions = sharedActions;
78597         _disconnectingVertexIds = sharedNodes.map((node) => node.id);
78598         _descriptionID += "conjoined";
78599         _annotationID = "from_each_other";
78600       } else {
78601         _actions = unsharedActions;
78602         _disconnectingVertexIds = unsharedNodes.map((node) => node.id);
78603         if (_wayIDs.length === 1) {
78604           _descriptionID += context.graph().geometry(_wayIDs[0]);
78605         } else {
78606           _descriptionID += "separate";
78607         }
78608       }
78609     }
78610     var _extent = utilTotalExtent(_disconnectingVertexIds, context.graph());
78611     var operation2 = function() {
78612       context.perform(function(graph) {
78613         return _actions.reduce(function(graph2, action) {
78614           return action(graph2);
78615         }, graph);
78616       }, operation2.annotation());
78617       context.validator().validate();
78618     };
78619     operation2.relatedEntityIds = function() {
78620       if (_vertexIDs.length) {
78621         return _disconnectingWayIds;
78622       }
78623       return _disconnectingVertexIds;
78624     };
78625     operation2.available = function() {
78626       if (_actions.length === 0) return false;
78627       if (_otherIDs.length !== 0) return false;
78628       if (_vertexIDs.length !== 0 && _wayIDs.length !== 0 && !_wayIDs.every(function(wayID) {
78629         return _vertexIDs.some(function(vertexID) {
78630           var way = context.entity(wayID);
78631           return way.nodes.indexOf(vertexID) !== -1;
78632         });
78633       })) return false;
78634       return true;
78635     };
78636     operation2.disabled = function() {
78637       var reason;
78638       for (var actionIndex in _actions) {
78639         reason = _actions[actionIndex].disabled(context.graph());
78640         if (reason) return reason;
78641       }
78642       if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
78643         return "too_large." + ((_vertexIDs.length ? _vertexIDs : _wayIDs).length === 1 ? "single" : "multiple");
78644       } else if (_coords && someMissing()) {
78645         return "not_downloaded";
78646       } else if (selectedIDs.some(context.hasHiddenConnections)) {
78647         return "connected_to_hidden";
78648       }
78649       return false;
78650       function someMissing() {
78651         if (context.inIntro()) return false;
78652         var osm = context.connection();
78653         if (osm) {
78654           var missing = _coords.filter(function(loc) {
78655             return !osm.isDataLoaded(loc);
78656           });
78657           if (missing.length) {
78658             missing.forEach(function(loc) {
78659               context.loadTileAtLoc(loc);
78660             });
78661             return true;
78662           }
78663         }
78664         return false;
78665       }
78666     };
78667     operation2.tooltip = function() {
78668       var disable = operation2.disabled();
78669       return disable ? _t.append("operations.disconnect." + disable) : _t.append("operations.disconnect.description." + _descriptionID);
78670     };
78671     operation2.annotation = function() {
78672       return _t("operations.disconnect.annotation." + _annotationID);
78673     };
78674     operation2.id = "disconnect";
78675     operation2.keys = [_t("operations.disconnect.key")];
78676     operation2.title = _t.append("operations.disconnect.title");
78677     operation2.behavior = behaviorOperation(context).which(operation2);
78678     return operation2;
78679   }
78680
78681   // modules/operations/downgrade.js
78682   function operationDowngrade(context, selectedIDs) {
78683     var _affectedFeatureCount = 0;
78684     var _downgradeType = downgradeTypeForEntityIDs(selectedIDs);
78685     var _multi = _affectedFeatureCount === 1 ? "single" : "multiple";
78686     function downgradeTypeForEntityIDs(entityIds) {
78687       var downgradeType;
78688       _affectedFeatureCount = 0;
78689       for (var i3 in entityIds) {
78690         var entityID = entityIds[i3];
78691         var type2 = downgradeTypeForEntityID(entityID);
78692         if (type2) {
78693           _affectedFeatureCount += 1;
78694           if (downgradeType && type2 !== downgradeType) {
78695             if (downgradeType !== "generic" && type2 !== "generic") {
78696               downgradeType = "building_address";
78697             } else {
78698               downgradeType = "generic";
78699             }
78700           } else {
78701             downgradeType = type2;
78702           }
78703         }
78704       }
78705       return downgradeType;
78706     }
78707     function downgradeTypeForEntityID(entityID) {
78708       var graph = context.graph();
78709       var entity = graph.entity(entityID);
78710       var preset = _mainPresetIndex.match(entity, graph);
78711       if (!preset || preset.isFallback()) return null;
78712       if (entity.type === "node" && preset.id !== "address" && Object.keys(entity.tags).some(function(key) {
78713         return key.match(/^addr:.{1,}/);
78714       })) {
78715         return "address";
78716       }
78717       var geometry = entity.geometry(graph);
78718       if (geometry === "area" && entity.tags.building && !preset.tags.building) {
78719         return "building";
78720       }
78721       if (geometry === "vertex" && Object.keys(entity.tags).length) {
78722         return "generic";
78723       }
78724       return null;
78725     }
78726     var buildingKeysToKeep = ["architect", "building", "height", "layer", "nycdoitt:bin", "source", "type", "wheelchair"];
78727     var addressKeysToKeep = ["source"];
78728     var operation2 = function() {
78729       context.perform(function(graph) {
78730         for (var i3 in selectedIDs) {
78731           var entityID = selectedIDs[i3];
78732           var type2 = downgradeTypeForEntityID(entityID);
78733           if (!type2) continue;
78734           var tags = Object.assign({}, graph.entity(entityID).tags);
78735           for (var key in tags) {
78736             if (type2 === "address" && addressKeysToKeep.indexOf(key) !== -1) continue;
78737             if (type2 === "building") {
78738               if (buildingKeysToKeep.indexOf(key) !== -1 || key.match(/^building:.{1,}/) || key.match(/^roof:.{1,}/)) continue;
78739             }
78740             if (type2 !== "generic") {
78741               if (key.match(/^addr:.{1,}/) || key.match(/^source:.{1,}/)) continue;
78742             }
78743             delete tags[key];
78744           }
78745           graph = actionChangeTags(entityID, tags)(graph);
78746         }
78747         return graph;
78748       }, operation2.annotation());
78749       context.validator().validate();
78750       context.enter(modeSelect(context, selectedIDs));
78751     };
78752     operation2.available = function() {
78753       return _downgradeType;
78754     };
78755     operation2.disabled = function() {
78756       if (selectedIDs.some(hasWikidataTag)) {
78757         return "has_wikidata_tag";
78758       }
78759       return false;
78760       function hasWikidataTag(id2) {
78761         var entity = context.entity(id2);
78762         return entity.tags.wikidata && entity.tags.wikidata.trim().length > 0;
78763       }
78764     };
78765     operation2.tooltip = function() {
78766       var disable = operation2.disabled();
78767       return disable ? _t.append("operations.downgrade." + disable + "." + _multi) : _t.append("operations.downgrade.description." + _downgradeType);
78768     };
78769     operation2.annotation = function() {
78770       var suffix;
78771       if (_downgradeType === "building_address") {
78772         suffix = "generic";
78773       } else {
78774         suffix = _downgradeType;
78775       }
78776       return _t("operations.downgrade.annotation." + suffix, { n: _affectedFeatureCount });
78777     };
78778     operation2.id = "downgrade";
78779     operation2.keys = [uiCmd("\u232B")];
78780     operation2.title = _t.append("operations.downgrade.title");
78781     operation2.behavior = behaviorOperation(context).which(operation2);
78782     return operation2;
78783   }
78784
78785   // modules/operations/extract.js
78786   function operationExtract(context, selectedIDs) {
78787     var _amount = selectedIDs.length === 1 ? "single" : "multiple";
78788     var _geometries = utilArrayUniq(selectedIDs.map(function(entityID) {
78789       return context.graph().hasEntity(entityID) && context.graph().geometry(entityID);
78790     }).filter(Boolean));
78791     var _geometryID = _geometries.length === 1 ? _geometries[0] : "feature";
78792     var _extent;
78793     var _actions = selectedIDs.map(function(entityID) {
78794       var graph = context.graph();
78795       var entity = graph.hasEntity(entityID);
78796       if (!entity || !entity.hasInterestingTags()) return null;
78797       if (entity.type === "node" && graph.parentWays(entity).length === 0) return null;
78798       if (entity.type !== "node") {
78799         var preset = _mainPresetIndex.match(entity, graph);
78800         if (preset.geometry.indexOf("point") === -1) return null;
78801       }
78802       _extent = _extent ? _extent.extend(entity.extent(graph)) : entity.extent(graph);
78803       return actionExtract(entityID, context.projection);
78804     }).filter(Boolean);
78805     var operation2 = function(d3_event) {
78806       const shiftKeyPressed = (d3_event == null ? void 0 : d3_event.shiftKey) || false;
78807       var combinedAction = function(graph) {
78808         _actions.forEach(function(action) {
78809           graph = action(graph, shiftKeyPressed);
78810         });
78811         return graph;
78812       };
78813       context.perform(combinedAction, operation2.annotation());
78814       var extractedNodeIDs = _actions.map(function(action) {
78815         return action.getExtractedNodeID();
78816       });
78817       context.enter(modeSelect(context, extractedNodeIDs));
78818     };
78819     operation2.available = function() {
78820       return _actions.length && selectedIDs.length === _actions.length;
78821     };
78822     operation2.disabled = function() {
78823       if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
78824         return "too_large";
78825       } else if (selectedIDs.some(function(entityID) {
78826         return context.graph().geometry(entityID) === "vertex" && context.hasHiddenConnections(entityID);
78827       })) {
78828         return "connected_to_hidden";
78829       }
78830       return false;
78831     };
78832     operation2.tooltip = function() {
78833       var disableReason = operation2.disabled();
78834       if (disableReason) {
78835         return _t.append("operations.extract." + disableReason + "." + _amount);
78836       } else {
78837         return _t.append("operations.extract.description." + _geometryID + "." + _amount);
78838       }
78839     };
78840     operation2.annotation = function() {
78841       return _t("operations.extract.annotation", { n: selectedIDs.length });
78842     };
78843     operation2.id = "extract";
78844     operation2.keys = [_t("operations.extract.key")];
78845     operation2.title = _t.append("operations.extract.title");
78846     operation2.behavior = behaviorOperation(context).which(operation2);
78847     return operation2;
78848   }
78849
78850   // modules/operations/merge.js
78851   function operationMerge(context, selectedIDs) {
78852     var _action = getAction();
78853     function getAction() {
78854       var join = actionJoin(selectedIDs);
78855       if (!join.disabled(context.graph())) return join;
78856       var merge3 = actionMerge(selectedIDs);
78857       if (!merge3.disabled(context.graph())) return merge3;
78858       var mergePolygon = actionMergePolygon(selectedIDs);
78859       if (!mergePolygon.disabled(context.graph())) return mergePolygon;
78860       var mergeNodes = actionMergeNodes(selectedIDs);
78861       if (!mergeNodes.disabled(context.graph())) return mergeNodes;
78862       if (join.disabled(context.graph()) !== "not_eligible") return join;
78863       if (merge3.disabled(context.graph()) !== "not_eligible") return merge3;
78864       if (mergePolygon.disabled(context.graph()) !== "not_eligible") return mergePolygon;
78865       return mergeNodes;
78866     }
78867     var operation2 = function() {
78868       if (operation2.disabled()) return;
78869       context.perform(_action, operation2.annotation());
78870       context.validator().validate();
78871       var resultIDs = selectedIDs.filter(context.hasEntity);
78872       if (resultIDs.length > 1) {
78873         var interestingIDs = resultIDs.filter(function(id2) {
78874           return context.entity(id2).hasInterestingTags();
78875         });
78876         if (interestingIDs.length) resultIDs = interestingIDs;
78877       }
78878       context.enter(modeSelect(context, resultIDs));
78879     };
78880     operation2.available = function() {
78881       return selectedIDs.length >= 2;
78882     };
78883     operation2.disabled = function() {
78884       var actionDisabled = _action.disabled(context.graph());
78885       if (actionDisabled) return actionDisabled;
78886       var osm = context.connection();
78887       if (osm && _action.resultingWayNodesLength && _action.resultingWayNodesLength(context.graph()) > osm.maxWayNodes()) {
78888         return "too_many_vertices";
78889       }
78890       return false;
78891     };
78892     operation2.tooltip = function() {
78893       var disabled = operation2.disabled();
78894       if (disabled) {
78895         if (disabled === "conflicting_relations") {
78896           return _t.append("operations.merge.conflicting_relations");
78897         }
78898         if (disabled === "restriction" || disabled === "connectivity") {
78899           return _t.append(
78900             "operations.merge.damage_relation",
78901             { relation: _mainPresetIndex.item("type/" + disabled).name() }
78902           );
78903         }
78904         return _t.append("operations.merge." + disabled);
78905       }
78906       return _t.append("operations.merge.description");
78907     };
78908     operation2.annotation = function() {
78909       return _t("operations.merge.annotation", { n: selectedIDs.length });
78910     };
78911     operation2.id = "merge";
78912     operation2.keys = [_t("operations.merge.key")];
78913     operation2.title = _t.append("operations.merge.title");
78914     operation2.behavior = behaviorOperation(context).which(operation2);
78915     return operation2;
78916   }
78917
78918   // modules/operations/paste.js
78919   function operationPaste(context) {
78920     var _pastePoint;
78921     var operation2 = function() {
78922       if (!_pastePoint) return;
78923       var oldIDs = context.copyIDs();
78924       if (!oldIDs.length) return;
78925       var projection2 = context.projection;
78926       var extent = geoExtent();
78927       var oldGraph = context.copyGraph();
78928       var newIDs = [];
78929       var action = actionCopyEntities(oldIDs, oldGraph);
78930       context.perform(action);
78931       var copies = action.copies();
78932       var originals = /* @__PURE__ */ new Set();
78933       Object.values(copies).forEach(function(entity) {
78934         originals.add(entity.id);
78935       });
78936       for (var id2 in copies) {
78937         var oldEntity = oldGraph.entity(id2);
78938         var newEntity = copies[id2];
78939         extent._extend(oldEntity.extent(oldGraph));
78940         var parents = context.graph().parentWays(newEntity);
78941         var parentCopied = parents.some(function(parent2) {
78942           return originals.has(parent2.id);
78943         });
78944         if (!parentCopied) {
78945           newIDs.push(newEntity.id);
78946         }
78947       }
78948       var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
78949       var delta = geoVecSubtract(_pastePoint, copyPoint);
78950       context.replace(actionMove(newIDs, delta, projection2), operation2.annotation());
78951       context.enter(modeSelect(context, newIDs));
78952     };
78953     operation2.point = function(val) {
78954       _pastePoint = val;
78955       return operation2;
78956     };
78957     operation2.available = function() {
78958       return context.mode().id === "browse";
78959     };
78960     operation2.disabled = function() {
78961       return !context.copyIDs().length;
78962     };
78963     operation2.tooltip = function() {
78964       var oldGraph = context.copyGraph();
78965       var ids = context.copyIDs();
78966       if (!ids.length) {
78967         return _t.append("operations.paste.nothing_copied");
78968       }
78969       return _t.append("operations.paste.description", { feature: utilDisplayLabel(oldGraph.entity(ids[0]), oldGraph), n: ids.length });
78970     };
78971     operation2.annotation = function() {
78972       var ids = context.copyIDs();
78973       return _t("operations.paste.annotation", { n: ids.length });
78974     };
78975     operation2.id = "paste";
78976     operation2.keys = [uiCmd("\u2318V")];
78977     operation2.title = _t.append("operations.paste.title");
78978     return operation2;
78979   }
78980
78981   // modules/operations/reverse.js
78982   function operationReverse(context, selectedIDs) {
78983     var operation2 = function() {
78984       context.perform(function combinedReverseAction(graph) {
78985         actions().forEach(function(action) {
78986           graph = action(graph);
78987         });
78988         return graph;
78989       }, operation2.annotation());
78990       context.validator().validate();
78991     };
78992     function actions(situation) {
78993       return selectedIDs.map(function(entityID) {
78994         var entity = context.hasEntity(entityID);
78995         if (!entity) return null;
78996         if (situation === "toolbar") {
78997           if (entity.type === "way" && (!entity.isOneWay() && !entity.isSided())) return null;
78998         }
78999         var geometry = entity.geometry(context.graph());
79000         if (entity.type !== "node" && geometry !== "line") return null;
79001         var action = actionReverse(entityID);
79002         if (action.disabled(context.graph())) return null;
79003         return action;
79004       }).filter(Boolean);
79005     }
79006     function reverseTypeID() {
79007       var acts = actions();
79008       var nodeActionCount = acts.filter(function(act) {
79009         var entity = context.hasEntity(act.entityID());
79010         return entity && entity.type === "node";
79011       }).length;
79012       if (nodeActionCount === 0) return "line";
79013       if (nodeActionCount === acts.length) return "point";
79014       return "feature";
79015     }
79016     operation2.available = function(situation) {
79017       return actions(situation).length > 0;
79018     };
79019     operation2.disabled = function() {
79020       return false;
79021     };
79022     operation2.tooltip = function() {
79023       return _t.append("operations.reverse.description." + reverseTypeID());
79024     };
79025     operation2.annotation = function() {
79026       var acts = actions();
79027       return _t("operations.reverse.annotation." + reverseTypeID(), { n: acts.length });
79028     };
79029     operation2.id = "reverse";
79030     operation2.keys = [_t("operations.reverse.key")];
79031     operation2.title = _t.append("operations.reverse.title");
79032     operation2.behavior = behaviorOperation(context).which(operation2);
79033     return operation2;
79034   }
79035
79036   // modules/operations/straighten.js
79037   function operationStraighten(context, selectedIDs) {
79038     var _wayIDs = selectedIDs.filter(function(id2) {
79039       return id2.charAt(0) === "w";
79040     });
79041     var _nodeIDs = selectedIDs.filter(function(id2) {
79042       return id2.charAt(0) === "n";
79043     });
79044     var _amount = (_wayIDs.length ? _wayIDs : _nodeIDs).length === 1 ? "single" : "multiple";
79045     var _nodes = utilGetAllNodes(selectedIDs, context.graph());
79046     var _coords = _nodes.map(function(n3) {
79047       return n3.loc;
79048     });
79049     var _extent = utilTotalExtent(selectedIDs, context.graph());
79050     var _action = chooseAction();
79051     var _geometry;
79052     function chooseAction() {
79053       if (_wayIDs.length === 0 && _nodeIDs.length > 2) {
79054         _geometry = "point";
79055         return actionStraightenNodes(_nodeIDs, context.projection);
79056       } else if (_wayIDs.length > 0 && (_nodeIDs.length === 0 || _nodeIDs.length === 2)) {
79057         var startNodeIDs = [];
79058         var endNodeIDs = [];
79059         for (var i3 = 0; i3 < selectedIDs.length; i3++) {
79060           var entity = context.entity(selectedIDs[i3]);
79061           if (entity.type === "node") {
79062             continue;
79063           } else if (entity.type !== "way" || entity.isClosed()) {
79064             return null;
79065           }
79066           startNodeIDs.push(entity.first());
79067           endNodeIDs.push(entity.last());
79068         }
79069         startNodeIDs = startNodeIDs.filter(function(n3) {
79070           return startNodeIDs.indexOf(n3) === startNodeIDs.lastIndexOf(n3);
79071         });
79072         endNodeIDs = endNodeIDs.filter(function(n3) {
79073           return endNodeIDs.indexOf(n3) === endNodeIDs.lastIndexOf(n3);
79074         });
79075         if (utilArrayDifference(startNodeIDs, endNodeIDs).length + utilArrayDifference(endNodeIDs, startNodeIDs).length !== 2) return null;
79076         var wayNodeIDs = utilGetAllNodes(_wayIDs, context.graph()).map(function(node) {
79077           return node.id;
79078         });
79079         if (wayNodeIDs.length <= 2) return null;
79080         if (_nodeIDs.length === 2 && (wayNodeIDs.indexOf(_nodeIDs[0]) === -1 || wayNodeIDs.indexOf(_nodeIDs[1]) === -1)) return null;
79081         if (_nodeIDs.length) {
79082           _extent = utilTotalExtent(_nodeIDs, context.graph());
79083         }
79084         _geometry = "line";
79085         return actionStraightenWay(selectedIDs, context.projection);
79086       }
79087       return null;
79088     }
79089     function operation2() {
79090       if (!_action) return;
79091       context.perform(_action, operation2.annotation());
79092       window.setTimeout(function() {
79093         context.validator().validate();
79094       }, 300);
79095     }
79096     operation2.available = function() {
79097       return Boolean(_action);
79098     };
79099     operation2.disabled = function() {
79100       var reason = _action.disabled(context.graph());
79101       if (reason) {
79102         return reason;
79103       } else if (_extent.percentContainedIn(context.map().extent()) < 0.8) {
79104         return "too_large";
79105       } else if (someMissing()) {
79106         return "not_downloaded";
79107       } else if (selectedIDs.some(context.hasHiddenConnections)) {
79108         return "connected_to_hidden";
79109       }
79110       return false;
79111       function someMissing() {
79112         if (context.inIntro()) return false;
79113         var osm = context.connection();
79114         if (osm) {
79115           var missing = _coords.filter(function(loc) {
79116             return !osm.isDataLoaded(loc);
79117           });
79118           if (missing.length) {
79119             missing.forEach(function(loc) {
79120               context.loadTileAtLoc(loc);
79121             });
79122             return true;
79123           }
79124         }
79125         return false;
79126       }
79127     };
79128     operation2.tooltip = function() {
79129       var disable = operation2.disabled();
79130       return disable ? _t.append("operations.straighten." + disable + "." + _amount) : _t.append("operations.straighten.description." + _geometry + (_wayIDs.length === 1 ? "" : "s"));
79131     };
79132     operation2.annotation = function() {
79133       return _t("operations.straighten.annotation." + _geometry, { n: _wayIDs.length ? _wayIDs.length : _nodeIDs.length });
79134     };
79135     operation2.id = "straighten";
79136     operation2.keys = [_t("operations.straighten.key")];
79137     operation2.title = _t.append("operations.straighten.title");
79138     operation2.behavior = behaviorOperation(context).which(operation2);
79139     return operation2;
79140   }
79141
79142   // modules/behavior/paste.js
79143   function behaviorPaste(context) {
79144     function doPaste(d3_event) {
79145       if (!context.map().withinEditableZoom()) return;
79146       const isOsmLayerEnabled = context.layers().layer("osm").enabled();
79147       if (!isOsmLayerEnabled) return;
79148       d3_event.preventDefault();
79149       var baseGraph = context.graph();
79150       var mouse = context.map().mouse();
79151       var projection2 = context.projection;
79152       var viewport = geoExtent(projection2.clipExtent()).polygon();
79153       if (!geoPointInPolygon(mouse, viewport)) return;
79154       var oldIDs = context.copyIDs();
79155       if (!oldIDs.length) return;
79156       var extent = geoExtent();
79157       var oldGraph = context.copyGraph();
79158       var newIDs = [];
79159       var action = actionCopyEntities(oldIDs, oldGraph);
79160       context.perform(action);
79161       var copies = action.copies();
79162       var originals = /* @__PURE__ */ new Set();
79163       Object.values(copies).forEach(function(entity) {
79164         originals.add(entity.id);
79165       });
79166       for (var id2 in copies) {
79167         var oldEntity = oldGraph.entity(id2);
79168         var newEntity = copies[id2];
79169         extent._extend(oldEntity.extent(oldGraph));
79170         var parents = context.graph().parentWays(newEntity);
79171         var parentCopied = parents.some(function(parent2) {
79172           return originals.has(parent2.id);
79173         });
79174         if (!parentCopied) {
79175           newIDs.push(newEntity.id);
79176         }
79177       }
79178       var copyPoint = context.copyLonLat() && projection2(context.copyLonLat()) || projection2(extent.center());
79179       var delta = geoVecSubtract(mouse, copyPoint);
79180       context.perform(actionMove(newIDs, delta, projection2));
79181       context.enter(modeMove(context, newIDs, baseGraph).annotation(operationPaste(context).annotation()));
79182     }
79183     function behavior() {
79184       context.keybinding().on(uiCmd("\u2318V"), doPaste);
79185       return behavior;
79186     }
79187     behavior.off = function() {
79188       context.keybinding().off(uiCmd("\u2318V"));
79189     };
79190     return behavior;
79191   }
79192
79193   // modules/modes/select.js
79194   function modeSelect(context, selectedIDs) {
79195     var mode = {
79196       id: "select",
79197       button: "browse"
79198     };
79199     var keybinding = utilKeybinding("select");
79200     var _breatheBehavior = behaviorBreathe(context);
79201     var _modeDragNode = modeDragNode(context);
79202     var _selectBehavior;
79203     var _behaviors = [];
79204     var _operations = [];
79205     var _newFeature = false;
79206     var _follow = false;
79207     var _focusedParentWayId;
79208     var _focusedVertexIds;
79209     function singular() {
79210       if (selectedIDs && selectedIDs.length === 1) {
79211         return context.hasEntity(selectedIDs[0]);
79212       }
79213     }
79214     function selectedEntities() {
79215       return selectedIDs.map(function(id2) {
79216         return context.hasEntity(id2);
79217       }).filter(Boolean);
79218     }
79219     function checkSelectedIDs() {
79220       var ids = [];
79221       if (Array.isArray(selectedIDs)) {
79222         ids = selectedIDs.filter(function(id2) {
79223           return context.hasEntity(id2);
79224         });
79225       }
79226       if (!ids.length) {
79227         context.enter(modeBrowse(context));
79228         return false;
79229       } else if (selectedIDs.length > 1 && ids.length === 1 || selectedIDs.length === 1 && ids.length > 1) {
79230         context.enter(modeSelect(context, ids));
79231         return false;
79232       }
79233       selectedIDs = ids;
79234       return true;
79235     }
79236     function parentWaysIdsOfSelection(onlyCommonParents) {
79237       var graph = context.graph();
79238       var parents = [];
79239       for (var i3 = 0; i3 < selectedIDs.length; i3++) {
79240         var entity = context.hasEntity(selectedIDs[i3]);
79241         if (!entity || entity.geometry(graph) !== "vertex") {
79242           return [];
79243         }
79244         var currParents = graph.parentWays(entity).map(function(w3) {
79245           return w3.id;
79246         });
79247         if (!parents.length) {
79248           parents = currParents;
79249           continue;
79250         }
79251         parents = (onlyCommonParents ? utilArrayIntersection : utilArrayUnion)(parents, currParents);
79252         if (!parents.length) {
79253           return [];
79254         }
79255       }
79256       return parents;
79257     }
79258     function childNodeIdsOfSelection(onlyCommon) {
79259       var graph = context.graph();
79260       var childs = [];
79261       for (var i3 = 0; i3 < selectedIDs.length; i3++) {
79262         var entity = context.hasEntity(selectedIDs[i3]);
79263         if (!entity || !["area", "line"].includes(entity.geometry(graph))) {
79264           return [];
79265         }
79266         var currChilds = graph.childNodes(entity).map(function(node) {
79267           return node.id;
79268         });
79269         if (!childs.length) {
79270           childs = currChilds;
79271           continue;
79272         }
79273         childs = (onlyCommon ? utilArrayIntersection : utilArrayUnion)(childs, currChilds);
79274         if (!childs.length) {
79275           return [];
79276         }
79277       }
79278       return childs;
79279     }
79280     function checkFocusedParent() {
79281       if (_focusedParentWayId) {
79282         var parents = parentWaysIdsOfSelection(true);
79283         if (parents.indexOf(_focusedParentWayId) === -1) _focusedParentWayId = null;
79284       }
79285     }
79286     function parentWayIdForVertexNavigation() {
79287       var parentIds = parentWaysIdsOfSelection(true);
79288       if (_focusedParentWayId && parentIds.indexOf(_focusedParentWayId) !== -1) {
79289         return _focusedParentWayId;
79290       }
79291       return parentIds.length ? parentIds[0] : null;
79292     }
79293     mode.selectedIDs = function(val) {
79294       if (!arguments.length) return selectedIDs;
79295       selectedIDs = val;
79296       return mode;
79297     };
79298     mode.zoomToSelected = function() {
79299       context.map().zoomToEase(selectedEntities());
79300     };
79301     mode.newFeature = function(val) {
79302       if (!arguments.length) return _newFeature;
79303       _newFeature = val;
79304       return mode;
79305     };
79306     mode.selectBehavior = function(val) {
79307       if (!arguments.length) return _selectBehavior;
79308       _selectBehavior = val;
79309       return mode;
79310     };
79311     mode.follow = function(val) {
79312       if (!arguments.length) return _follow;
79313       _follow = val;
79314       return mode;
79315     };
79316     function loadOperations() {
79317       _operations.forEach(function(operation2) {
79318         if (operation2.behavior) {
79319           context.uninstall(operation2.behavior);
79320         }
79321       });
79322       _operations = Object.values(operations_exports).map((o2) => o2(context, selectedIDs)).filter((o2) => o2.id !== "delete" && o2.id !== "downgrade" && o2.id !== "copy").concat([
79323         // group copy/downgrade/delete operation together at the end of the list
79324         operationCopy(context, selectedIDs),
79325         operationDowngrade(context, selectedIDs),
79326         operationDelete(context, selectedIDs)
79327       ]);
79328       _operations.filter((operation2) => operation2.available()).forEach((operation2) => {
79329         if (operation2.behavior) {
79330           context.install(operation2.behavior);
79331         }
79332       });
79333       _operations.filter((operation2) => !operation2.available()).forEach((operation2) => {
79334         if (operation2.behavior) {
79335           operation2.behavior.on();
79336         }
79337       });
79338       context.ui().closeEditMenu();
79339     }
79340     mode.operations = function() {
79341       return _operations.filter((operation2) => operation2.available());
79342     };
79343     mode.enter = function() {
79344       if (!checkSelectedIDs()) return;
79345       context.features().forceVisible(selectedIDs);
79346       _modeDragNode.restoreSelectedIDs(selectedIDs);
79347       loadOperations();
79348       if (!_behaviors.length) {
79349         if (!_selectBehavior) _selectBehavior = behaviorSelect(context);
79350         _behaviors = [
79351           behaviorPaste(context),
79352           _breatheBehavior,
79353           behaviorHover(context).on("hover", context.ui().sidebar.hoverModeSelect),
79354           _selectBehavior,
79355           behaviorLasso(context),
79356           _modeDragNode.behavior,
79357           modeDragNote(context).behavior
79358         ];
79359       }
79360       _behaviors.forEach(context.install);
79361       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);
79362       select_default2(document).call(keybinding);
79363       context.ui().sidebar.select(selectedIDs, _newFeature);
79364       context.history().on("change.select", function() {
79365         loadOperations();
79366         selectElements();
79367       }).on("undone.select", checkSelectedIDs).on("redone.select", checkSelectedIDs);
79368       context.map().on("drawn.select", selectElements).on("crossEditableZoom.select", function() {
79369         selectElements();
79370         _breatheBehavior.restartIfNeeded(context.surface());
79371       });
79372       context.map().doubleUpHandler().on("doubleUp.modeSelect", didDoubleUp);
79373       selectElements();
79374       if (_follow) {
79375         var extent = geoExtent();
79376         var graph = context.graph();
79377         selectedIDs.forEach(function(id2) {
79378           var entity = context.entity(id2);
79379           extent._extend(entity.extent(graph));
79380         });
79381         var loc = extent.center();
79382         context.map().centerEase(loc);
79383         _follow = false;
79384       }
79385       function nudgeSelection(delta) {
79386         return function() {
79387           if (!context.map().withinEditableZoom()) return;
79388           var moveOp = operationMove(context, selectedIDs);
79389           if (moveOp.disabled()) {
79390             context.ui().flash.duration(4e3).iconName("#iD-operation-" + moveOp.id).iconClass("operation disabled").label(moveOp.tooltip())();
79391           } else {
79392             context.perform(actionMove(selectedIDs, delta, context.projection), moveOp.annotation());
79393             context.validator().validate();
79394           }
79395         };
79396       }
79397       function scaleSelection(factor) {
79398         return function() {
79399           if (!context.map().withinEditableZoom()) return;
79400           let nodes = utilGetAllNodes(selectedIDs, context.graph());
79401           let isUp = factor > 1;
79402           if (nodes.length <= 1) return;
79403           let extent2 = utilTotalExtent(selectedIDs, context.graph());
79404           function scalingDisabled() {
79405             if (tooSmall()) {
79406               return "too_small";
79407             } else if (extent2.percentContainedIn(context.map().extent()) < 0.8) {
79408               return "too_large";
79409             } else if (someMissing() || selectedIDs.some(incompleteRelation)) {
79410               return "not_downloaded";
79411             } else if (selectedIDs.some(context.hasHiddenConnections)) {
79412               return "connected_to_hidden";
79413             }
79414             return false;
79415             function tooSmall() {
79416               if (isUp) return false;
79417               let dLon = Math.abs(extent2[1][0] - extent2[0][0]);
79418               let dLat = Math.abs(extent2[1][1] - extent2[0][1]);
79419               return dLon < geoMetersToLon(1, extent2[1][1]) && dLat < geoMetersToLat(1);
79420             }
79421             function someMissing() {
79422               if (context.inIntro()) return false;
79423               let osm = context.connection();
79424               if (osm) {
79425                 let missing = nodes.filter(function(n3) {
79426                   return !osm.isDataLoaded(n3.loc);
79427                 });
79428                 if (missing.length) {
79429                   missing.forEach(function(loc2) {
79430                     context.loadTileAtLoc(loc2);
79431                   });
79432                   return true;
79433                 }
79434               }
79435               return false;
79436             }
79437             function incompleteRelation(id2) {
79438               let entity = context.entity(id2);
79439               return entity.type === "relation" && !entity.isComplete(context.graph());
79440             }
79441           }
79442           const disabled = scalingDisabled();
79443           if (disabled) {
79444             let multi = selectedIDs.length === 1 ? "single" : "multiple";
79445             context.ui().flash.duration(4e3).iconName("#iD-icon-no").iconClass("operation disabled").label(_t.append("operations.scale." + disabled + "." + multi))();
79446           } else {
79447             const pivot = context.projection(extent2.center());
79448             const annotation = _t("operations.scale.annotation." + (isUp ? "up" : "down") + ".feature", { n: selectedIDs.length });
79449             context.perform(actionScale(selectedIDs, pivot, factor, context.projection), annotation);
79450             context.validator().validate();
79451           }
79452         };
79453       }
79454       function didDoubleUp(d3_event, loc2) {
79455         if (!context.map().withinEditableZoom()) return;
79456         var target = select_default2(d3_event.target);
79457         var datum2 = target.datum();
79458         var entity = datum2 && datum2.properties && datum2.properties.entity;
79459         if (!entity) return;
79460         if (entity instanceof osmWay && target.classed("target")) {
79461           var choice = geoChooseEdge(context.graph().childNodes(entity), loc2, context.projection);
79462           var prev = entity.nodes[choice.index - 1];
79463           var next = entity.nodes[choice.index];
79464           context.perform(
79465             actionAddMidpoint({ loc: choice.loc, edge: [prev, next] }, osmNode()),
79466             _t("operations.add.annotation.vertex")
79467           );
79468           context.validator().validate();
79469         } else if (entity.type === "midpoint") {
79470           context.perform(
79471             actionAddMidpoint({ loc: entity.loc, edge: entity.edge }, osmNode()),
79472             _t("operations.add.annotation.vertex")
79473           );
79474           context.validator().validate();
79475         }
79476       }
79477       function selectElements() {
79478         if (!checkSelectedIDs()) return;
79479         var surface = context.surface();
79480         surface.selectAll(".selected-member").classed("selected-member", false);
79481         surface.selectAll(".selected").classed("selected", false);
79482         surface.selectAll(".related").classed("related", false);
79483         checkFocusedParent();
79484         if (_focusedParentWayId) {
79485           surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
79486         }
79487         if (context.map().withinEditableZoom()) {
79488           surface.selectAll(utilDeepMemberSelector(
79489             selectedIDs,
79490             context.graph(),
79491             true
79492             /* skipMultipolgonMembers */
79493           )).classed("selected-member", true);
79494           surface.selectAll(utilEntityOrDeepMemberSelector(selectedIDs, context.graph())).classed("selected", true);
79495         }
79496       }
79497       function esc() {
79498         if (context.container().select(".combobox").size()) return;
79499         context.enter(modeBrowse(context));
79500       }
79501       function firstVertex(d3_event) {
79502         d3_event.preventDefault();
79503         var entity = singular();
79504         var parentId = parentWayIdForVertexNavigation();
79505         var way;
79506         if (entity && entity.type === "way") {
79507           way = entity;
79508         } else if (parentId) {
79509           way = context.entity(parentId);
79510         }
79511         _focusedParentWayId = way && way.id;
79512         if (way) {
79513           context.enter(
79514             mode.selectedIDs([way.first()]).follow(true)
79515           );
79516         }
79517       }
79518       function lastVertex(d3_event) {
79519         d3_event.preventDefault();
79520         var entity = singular();
79521         var parentId = parentWayIdForVertexNavigation();
79522         var way;
79523         if (entity && entity.type === "way") {
79524           way = entity;
79525         } else if (parentId) {
79526           way = context.entity(parentId);
79527         }
79528         _focusedParentWayId = way && way.id;
79529         if (way) {
79530           context.enter(
79531             mode.selectedIDs([way.last()]).follow(true)
79532           );
79533         }
79534       }
79535       function previousVertex(d3_event) {
79536         d3_event.preventDefault();
79537         var parentId = parentWayIdForVertexNavigation();
79538         _focusedParentWayId = parentId;
79539         if (!parentId) return;
79540         var way = context.entity(parentId);
79541         var length2 = way.nodes.length;
79542         var curr = way.nodes.indexOf(selectedIDs[0]);
79543         var index = -1;
79544         if (curr > 0) {
79545           index = curr - 1;
79546         } else if (way.isClosed()) {
79547           index = length2 - 2;
79548         }
79549         if (index !== -1) {
79550           context.enter(
79551             mode.selectedIDs([way.nodes[index]]).follow(true)
79552           );
79553         }
79554       }
79555       function nextVertex(d3_event) {
79556         d3_event.preventDefault();
79557         var parentId = parentWayIdForVertexNavigation();
79558         _focusedParentWayId = parentId;
79559         if (!parentId) return;
79560         var way = context.entity(parentId);
79561         var length2 = way.nodes.length;
79562         var curr = way.nodes.indexOf(selectedIDs[0]);
79563         var index = -1;
79564         if (curr < length2 - 1) {
79565           index = curr + 1;
79566         } else if (way.isClosed()) {
79567           index = 0;
79568         }
79569         if (index !== -1) {
79570           context.enter(
79571             mode.selectedIDs([way.nodes[index]]).follow(true)
79572           );
79573         }
79574       }
79575       function focusNextParent(d3_event) {
79576         d3_event.preventDefault();
79577         var parents = parentWaysIdsOfSelection(true);
79578         if (!parents || parents.length < 2) return;
79579         var index = parents.indexOf(_focusedParentWayId);
79580         if (index < 0 || index > parents.length - 2) {
79581           _focusedParentWayId = parents[0];
79582         } else {
79583           _focusedParentWayId = parents[index + 1];
79584         }
79585         var surface = context.surface();
79586         surface.selectAll(".related").classed("related", false);
79587         if (_focusedParentWayId) {
79588           surface.selectAll(utilEntitySelector([_focusedParentWayId])).classed("related", true);
79589         }
79590       }
79591       function selectParent(d3_event) {
79592         d3_event.preventDefault();
79593         var currentSelectedIds = mode.selectedIDs();
79594         var parentIds = _focusedParentWayId ? [_focusedParentWayId] : parentWaysIdsOfSelection(false);
79595         if (!parentIds.length) return;
79596         context.enter(
79597           mode.selectedIDs(parentIds)
79598         );
79599         _focusedVertexIds = currentSelectedIds;
79600       }
79601       function selectChild(d3_event) {
79602         d3_event.preventDefault();
79603         var currentSelectedIds = mode.selectedIDs();
79604         var childIds = _focusedVertexIds ? _focusedVertexIds.filter((id2) => context.hasEntity(id2)) : childNodeIdsOfSelection(true);
79605         if (!childIds || !childIds.length) return;
79606         if (currentSelectedIds.length === 1) _focusedParentWayId = currentSelectedIds[0];
79607         context.enter(
79608           mode.selectedIDs(childIds)
79609         );
79610       }
79611     };
79612     mode.exit = function() {
79613       _newFeature = false;
79614       _focusedVertexIds = null;
79615       _operations.forEach((operation2) => {
79616         if (operation2.behavior) {
79617           context.uninstall(operation2.behavior);
79618         }
79619       });
79620       _operations = [];
79621       _behaviors.forEach(context.uninstall);
79622       select_default2(document).call(keybinding.unbind);
79623       context.ui().closeEditMenu();
79624       context.history().on("change.select", null).on("undone.select", null).on("redone.select", null);
79625       var surface = context.surface();
79626       surface.selectAll(".selected-member").classed("selected-member", false);
79627       surface.selectAll(".selected").classed("selected", false);
79628       surface.selectAll(".highlighted").classed("highlighted", false);
79629       surface.selectAll(".related").classed("related", false);
79630       context.map().on("drawn.select", null);
79631       context.ui().sidebar.hide();
79632       context.features().forceVisible([]);
79633       var entity = singular();
79634       if (_newFeature && entity && entity.type === "relation" && // no tags
79635       Object.keys(entity.tags).length === 0 && // no parent relations
79636       context.graph().parentRelations(entity).length === 0 && // no members or one member with no role
79637       (entity.members.length === 0 || entity.members.length === 1 && !entity.members[0].role)) {
79638         var deleteAction = actionDeleteRelation(
79639           entity.id,
79640           true
79641           /* don't delete untagged members */
79642         );
79643         context.perform(deleteAction, _t("operations.delete.annotation.relation"));
79644         context.validator().validate();
79645       }
79646     };
79647     return mode;
79648   }
79649
79650   // modules/behavior/lasso.js
79651   function behaviorLasso(context) {
79652     var _pointerPrefix = "PointerEvent" in window ? "pointer" : "mouse";
79653     var behavior = function(selection2) {
79654       var lasso;
79655       function pointerdown(d3_event) {
79656         var button = 0;
79657         if (d3_event.button === button && d3_event.shiftKey === true) {
79658           lasso = null;
79659           select_default2(window).on(_pointerPrefix + "move.lasso", pointermove).on(_pointerPrefix + "up.lasso", pointerup);
79660           d3_event.stopPropagation();
79661         }
79662       }
79663       function pointermove() {
79664         if (!lasso) {
79665           lasso = uiLasso(context);
79666           context.surface().call(lasso);
79667         }
79668         lasso.p(context.map().mouse());
79669       }
79670       function normalize2(a2, b3) {
79671         return [
79672           [Math.min(a2[0], b3[0]), Math.min(a2[1], b3[1])],
79673           [Math.max(a2[0], b3[0]), Math.max(a2[1], b3[1])]
79674         ];
79675       }
79676       function lassoed() {
79677         if (!lasso) return [];
79678         var graph = context.graph();
79679         var limitToNodes;
79680         if (context.map().editableDataEnabled(
79681           true
79682           /* skipZoomCheck */
79683         ) && context.map().isInWideSelection()) {
79684           limitToNodes = new Set(utilGetAllNodes(context.selectedIDs(), graph));
79685         } else if (!context.map().editableDataEnabled()) {
79686           return [];
79687         }
79688         var bounds = lasso.extent().map(context.projection.invert);
79689         var extent = geoExtent(normalize2(bounds[0], bounds[1]));
79690         var intersects2 = context.history().intersects(extent).filter(function(entity) {
79691           return entity.type === "node" && (!limitToNodes || limitToNodes.has(entity)) && geoPointInPolygon(context.projection(entity.loc), lasso.coordinates) && !context.features().isHidden(entity, graph, entity.geometry(graph));
79692         });
79693         intersects2.sort(function(node1, node2) {
79694           var parents1 = graph.parentWays(node1);
79695           var parents2 = graph.parentWays(node2);
79696           if (parents1.length && parents2.length) {
79697             var sharedParents = utilArrayIntersection(parents1, parents2);
79698             if (sharedParents.length) {
79699               var sharedParentNodes = sharedParents[0].nodes;
79700               return sharedParentNodes.indexOf(node1.id) - sharedParentNodes.indexOf(node2.id);
79701             } else {
79702               return Number(parents1[0].id.slice(1)) - Number(parents2[0].id.slice(1));
79703             }
79704           } else if (parents1.length || parents2.length) {
79705             return parents1.length - parents2.length;
79706           }
79707           return node1.loc[0] - node2.loc[0];
79708         });
79709         return intersects2.map(function(entity) {
79710           return entity.id;
79711         });
79712       }
79713       function pointerup() {
79714         select_default2(window).on(_pointerPrefix + "move.lasso", null).on(_pointerPrefix + "up.lasso", null);
79715         if (!lasso) return;
79716         var ids = lassoed();
79717         lasso.close();
79718         if (ids.length) {
79719           context.enter(modeSelect(context, ids));
79720         }
79721       }
79722       selection2.on(_pointerPrefix + "down.lasso", pointerdown);
79723     };
79724     behavior.off = function(selection2) {
79725       selection2.on(_pointerPrefix + "down.lasso", null);
79726     };
79727     return behavior;
79728   }
79729
79730   // modules/modes/browse.js
79731   function modeBrowse(context) {
79732     var mode = {
79733       button: "browse",
79734       id: "browse",
79735       title: _t.append("modes.browse.title"),
79736       description: _t.append("modes.browse.description")
79737     };
79738     var sidebar;
79739     var _selectBehavior;
79740     var _behaviors = [];
79741     mode.selectBehavior = function(val) {
79742       if (!arguments.length) return _selectBehavior;
79743       _selectBehavior = val;
79744       return mode;
79745     };
79746     mode.enter = function() {
79747       if (!_behaviors.length) {
79748         if (!_selectBehavior) _selectBehavior = behaviorSelect(context);
79749         _behaviors = [
79750           behaviorPaste(context),
79751           behaviorHover(context).on("hover", context.ui().sidebar.hover),
79752           _selectBehavior,
79753           behaviorLasso(context),
79754           modeDragNode(context).behavior,
79755           modeDragNote(context).behavior
79756         ];
79757       }
79758       _behaviors.forEach(context.install);
79759       if (document.activeElement && document.activeElement.blur) {
79760         document.activeElement.blur();
79761       }
79762       if (sidebar) {
79763         context.ui().sidebar.show(sidebar);
79764       } else {
79765         context.ui().sidebar.select(null);
79766       }
79767     };
79768     mode.exit = function() {
79769       context.ui().sidebar.hover.cancel();
79770       _behaviors.forEach(context.uninstall);
79771       if (sidebar) {
79772         context.ui().sidebar.hide();
79773       }
79774     };
79775     mode.sidebar = function(_3) {
79776       if (!arguments.length) return sidebar;
79777       sidebar = _3;
79778       return mode;
79779     };
79780     mode.operations = function() {
79781       return [operationPaste(context)];
79782     };
79783     return mode;
79784   }
79785
79786   // modules/behavior/add_way.js
79787   function behaviorAddWay(context) {
79788     var dispatch12 = dispatch_default("start", "startFromWay", "startFromNode");
79789     var draw = behaviorDraw(context);
79790     function behavior(surface) {
79791       draw.on("click", function() {
79792         dispatch12.apply("start", this, arguments);
79793       }).on("clickWay", function() {
79794         dispatch12.apply("startFromWay", this, arguments);
79795       }).on("clickNode", function() {
79796         dispatch12.apply("startFromNode", this, arguments);
79797       }).on("cancel", behavior.cancel).on("finish", behavior.cancel);
79798       context.map().dblclickZoomEnable(false);
79799       surface.call(draw);
79800     }
79801     behavior.off = function(surface) {
79802       surface.call(draw.off);
79803     };
79804     behavior.cancel = function() {
79805       window.setTimeout(function() {
79806         context.map().dblclickZoomEnable(true);
79807       }, 1e3);
79808       context.enter(modeBrowse(context));
79809     };
79810     return utilRebind(behavior, dispatch12, "on");
79811   }
79812
79813   // modules/behavior/hash.js
79814   function behaviorHash(context) {
79815     var _cachedHash = null;
79816     var _latitudeLimit = 90 - 1e-8;
79817     function computedHashParameters() {
79818       var map2 = context.map();
79819       var center = map2.center();
79820       var zoom = map2.zoom();
79821       var precision3 = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
79822       var oldParams = utilObjectOmit(
79823         utilStringQs(window.location.hash),
79824         ["comment", "source", "hashtags", "walkthrough"]
79825       );
79826       var newParams = {};
79827       delete oldParams.id;
79828       var selected = context.selectedIDs().filter(function(id2) {
79829         return context.hasEntity(id2);
79830       });
79831       if (selected.length) {
79832         newParams.id = selected.join(",");
79833       } else if (context.selectedNoteID()) {
79834         newParams.id = "note/".concat(context.selectedNoteID());
79835       }
79836       newParams.map = zoom.toFixed(2) + "/" + center[1].toFixed(precision3) + "/" + center[0].toFixed(precision3);
79837       return Object.assign(oldParams, newParams);
79838     }
79839     function computedHash() {
79840       return "#" + utilQsString(computedHashParameters(), true);
79841     }
79842     function computedTitle(includeChangeCount) {
79843       var baseTitle = context.documentTitleBase() || "iD";
79844       var contextual;
79845       var changeCount;
79846       var titleID;
79847       var selected = context.selectedIDs().filter(function(id2) {
79848         return context.hasEntity(id2);
79849       });
79850       if (selected.length) {
79851         var firstLabel = utilDisplayLabel(context.entity(selected[0]), context.graph());
79852         if (selected.length > 1) {
79853           contextual = _t("title.labeled_and_more", {
79854             labeled: firstLabel,
79855             count: selected.length - 1
79856           });
79857         } else {
79858           contextual = firstLabel;
79859         }
79860         titleID = "context";
79861       }
79862       if (includeChangeCount) {
79863         changeCount = context.history().difference().summary().length;
79864         if (changeCount > 0) {
79865           titleID = contextual ? "changes_context" : "changes";
79866         }
79867       }
79868       if (titleID) {
79869         return _t("title.format." + titleID, {
79870           changes: changeCount,
79871           base: baseTitle,
79872           context: contextual
79873         });
79874       }
79875       return baseTitle;
79876     }
79877     function updateTitle(includeChangeCount) {
79878       if (!context.setsDocumentTitle()) return;
79879       var newTitle = computedTitle(includeChangeCount);
79880       if (document.title !== newTitle) {
79881         document.title = newTitle;
79882       }
79883     }
79884     function updateHashIfNeeded() {
79885       if (context.inIntro()) return;
79886       var latestHash = computedHash();
79887       if (_cachedHash !== latestHash) {
79888         _cachedHash = latestHash;
79889         window.history.replaceState(null, "", latestHash);
79890         updateTitle(
79891           true
79892           /* includeChangeCount */
79893         );
79894         const q3 = utilStringQs(latestHash);
79895         if (q3.map) {
79896           corePreferences("map-location", q3.map);
79897         }
79898       }
79899     }
79900     var _throttledUpdate = throttle_default(updateHashIfNeeded, 500);
79901     var _throttledUpdateTitle = throttle_default(function() {
79902       updateTitle(
79903         true
79904         /* includeChangeCount */
79905       );
79906     }, 500);
79907     function hashchange() {
79908       if (window.location.hash === _cachedHash) return;
79909       _cachedHash = window.location.hash;
79910       var q3 = utilStringQs(_cachedHash);
79911       if (q3.theme) {
79912         context.theme(q3.theme);
79913       }
79914       if (q3.locale && q3.locale !== _mainLocalizer.preferredLocaleCodes().join(",")) {
79915         _mainLocalizer.preferredLocaleCodes(q3.locale);
79916         context.ui().restart();
79917       }
79918       var mapArgs = (q3.map || "").split("/").map(Number);
79919       if (mapArgs.length < 3 || mapArgs.some(isNaN)) {
79920         updateHashIfNeeded();
79921       } else {
79922         if (_cachedHash === computedHash()) return;
79923         var mode = context.mode();
79924         context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
79925         if (q3.id && mode) {
79926           var ids = q3.id.split(",").filter(function(id2) {
79927             return context.hasEntity(id2) || id2.startsWith("note/");
79928           });
79929           if (ids.length && ["browse", "select-note", "select"].includes(mode.id)) {
79930             if (ids.length === 1 && ids[0].startsWith("note/")) {
79931               context.enter(modeSelectNote(context, ids[0]));
79932             } else if (!utilArrayIdentical(mode.selectedIDs(), ids)) {
79933               context.enter(modeSelect(context, ids));
79934             }
79935             return;
79936           }
79937         }
79938         var center = context.map().center();
79939         var dist = geoSphericalDistance(center, [mapArgs[2], mapArgs[1]]);
79940         var maxdist = 500;
79941         if (mode && mode.id.match(/^draw/) !== null && dist > maxdist) {
79942           context.enter(modeBrowse(context));
79943           return;
79944         }
79945       }
79946     }
79947     function behavior() {
79948       context.map().on("move.behaviorHash", _throttledUpdate);
79949       context.history().on("change.behaviorHash", _throttledUpdateTitle);
79950       context.on("enter.behaviorHash", _throttledUpdate);
79951       select_default2(window).on("hashchange.behaviorHash", hashchange);
79952       var q3 = utilStringQs(window.location.hash);
79953       if (q3.id) {
79954         const selectIds = q3.id.split(",");
79955         if (selectIds.length === 1 && selectIds[0].startsWith("note/")) {
79956           const noteId = selectIds[0].split("/")[1];
79957           context.moveToNote(noteId, !q3.map);
79958         } else {
79959           context.zoomToEntities(
79960             // convert ids to short form id: node/123 -> n123
79961             selectIds.map((id2) => id2.replace(/([nwr])[^/]*\//, "$1")),
79962             !q3.map
79963           );
79964         }
79965       }
79966       if (q3.walkthrough === "true") {
79967         behavior.startWalkthrough = true;
79968       }
79969       if (q3.map) {
79970         behavior.hadLocation = true;
79971       } else if (!q3.id && corePreferences("map-location")) {
79972         const mapArgs = corePreferences("map-location").split("/").map(Number);
79973         context.map().centerZoom([mapArgs[2], Math.min(_latitudeLimit, Math.max(-_latitudeLimit, mapArgs[1]))], mapArgs[0]);
79974         updateHashIfNeeded();
79975         behavior.hadLocation = true;
79976       }
79977       hashchange();
79978       updateTitle(false);
79979     }
79980     behavior.off = function() {
79981       _throttledUpdate.cancel();
79982       _throttledUpdateTitle.cancel();
79983       context.map().on("move.behaviorHash", null);
79984       context.on("enter.behaviorHash", null);
79985       select_default2(window).on("hashchange.behaviorHash", null);
79986       window.location.hash = "";
79987     };
79988     return behavior;
79989   }
79990
79991   // modules/index.js
79992   var debug = false;
79993   var setDebug = (newValue) => {
79994     debug = newValue;
79995   };
79996   var d3 = {
79997     dispatch: dispatch_default,
79998     geoMercator: mercator_default,
79999     geoProjection: projection,
80000     polygonArea: area_default,
80001     polygonCentroid: centroid_default,
80002     select: select_default2,
80003     selectAll: selectAll_default2,
80004     timerFlush
80005   };
80006
80007   // modules/id.js
80008   window.requestIdleCallback = window.requestIdleCallback || function(cb) {
80009     var start2 = Date.now();
80010     return window.requestAnimationFrame(function() {
80011       cb({
80012         didTimeout: false,
80013         timeRemaining: function() {
80014           return Math.max(0, 50 - (Date.now() - start2));
80015         }
80016       });
80017     });
80018   };
80019   window.cancelIdleCallback = window.cancelIdleCallback || function(id2) {
80020     window.cancelAnimationFrame(id2);
80021   };
80022   window.iD = index_exports;
80023 })();
80024 //# sourceMappingURL=iD.js.map