网站
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

28331 行
1.3 MiB

  1. !function (t, e) {
  2. "object" == typeof exports && "object" == typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define([], e) : "object" == typeof exports ? exports.ol = e() : t.ol = e()
  3. }(window, (function () {
  4. return function (t) {
  5. var e = {};
  6. function r(n) {
  7. if (e[n]) return e[n].exports;
  8. var i = e[n] = {i: n, l: !1, exports: {}};
  9. return t[n].call(i.exports, i, i.exports, r), i.l = !0, i.exports
  10. }
  11. return r.m = t, r.c = e, r.d = function (t, e, n) {
  12. r.o(t, e) || Object.defineProperty(t, e, {enumerable: !0, get: n})
  13. }, r.r = function (t) {
  14. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(t, "__esModule", {value: !0})
  15. }, r.t = function (t, e) {
  16. if (1 & e && (t = r(t)), 8 & e) return t;
  17. if (4 & e && "object" == typeof t && t && t.__esModule) return t;
  18. var n = Object.create(null);
  19. if (r.r(n), Object.defineProperty(n, "default", {
  20. enumerable: !0,
  21. value: t
  22. }), 2 & e && "string" != typeof t) for (var i in t) r.d(n, i, function (e) {
  23. return t[e]
  24. }.bind(null, i));
  25. return n
  26. }, r.n = function (t) {
  27. var e = t && t.__esModule ? function () {
  28. return t.default
  29. } : function () {
  30. return t
  31. };
  32. return r.d(e, "a", e), e
  33. }, r.o = function (t, e) {
  34. return Object.prototype.hasOwnProperty.call(t, e)
  35. }, r.p = "", r(r.s = 10)
  36. }([function (t, e, r) {
  37. "use strict";
  38. (function (t, n) {
  39. r.d(e, "a", (function () {
  40. return J
  41. })), r.d(e, "b", (function () {
  42. return br
  43. })), r.d(e, "c", (function () {
  44. return $r
  45. })), r.d(e, "d", (function () {
  46. return hr
  47. })), r.d(e, "e", (function () {
  48. return Jr
  49. })), r.d(e, "f", (function () {
  50. return i
  51. }));
  52. var i = {
  53. $version: 8,
  54. $root: {
  55. version: {
  56. required: !0,
  57. type: "enum",
  58. values: [8],
  59. doc: "Style specification version number. Must be 8.",
  60. example: 8
  61. },
  62. name: {type: "string", doc: "A human-readable name for the style.", example: "Bright"},
  63. metadata: {
  64. type: "*",
  65. doc: "Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
  66. },
  67. center: {
  68. type: "array",
  69. value: "number",
  70. doc: "Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
  71. example: [-73.9749, 40.7736]
  72. },
  73. zoom: {
  74. type: "number",
  75. doc: "Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
  76. example: 12.5
  77. },
  78. bearing: {
  79. type: "number",
  80. default: 0,
  81. period: 360,
  82. units: "degrees",
  83. doc: 'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',
  84. example: 29
  85. },
  86. pitch: {
  87. type: "number",
  88. default: 0,
  89. units: "degrees",
  90. doc: "Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",
  91. example: 50
  92. },
  93. light: {
  94. type: "light",
  95. doc: "The global light source.",
  96. example: {anchor: "viewport", color: "white", intensity: .4}
  97. },
  98. terrain: {
  99. type: "terrain",
  100. doc: "A global modifier that elevates layers and markers based on a DEM data source."
  101. },
  102. sources: {
  103. required: !0,
  104. type: "sources",
  105. doc: "Data source specifications.",
  106. example: {"mapbox-streets": {type: "vector", url: "mapbox://mapbox.mapbox-streets-v6"}}
  107. },
  108. sprite: {
  109. type: "string",
  110. doc: "A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
  111. example: "mapbox://sprites/mapbox/bright-v8"
  112. },
  113. glyphs: {
  114. type: "string",
  115. doc: "A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",
  116. example: "mapbox://fonts/mapbox/{fontstack}/{range}.pbf"
  117. },
  118. transition: {
  119. type: "transition",
  120. doc: "A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",
  121. example: {duration: 300, delay: 0}
  122. },
  123. layers: {
  124. required: !0,
  125. type: "array",
  126. value: "layer",
  127. doc: "Layers will be drawn in the order of this array.",
  128. example: [{
  129. id: "water",
  130. source: "mapbox-streets",
  131. "source-layer": "water",
  132. type: "fill",
  133. paint: {"fill-color": "#00ffff"}
  134. }]
  135. }
  136. },
  137. sources: {
  138. "*": {
  139. type: "source",
  140. doc: "Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."
  141. }
  142. },
  143. source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"],
  144. source_vector: {
  145. type: {
  146. required: !0,
  147. type: "enum",
  148. values: {vector: {doc: "A vector tile source."}},
  149. doc: "The type of the source."
  150. },
  151. url: {
  152. type: "string",
  153. doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."
  154. },
  155. tiles: {
  156. type: "array",
  157. value: "string",
  158. doc: "An array of one or more tile source URLs, as in the TileJSON spec."
  159. },
  160. bounds: {
  161. type: "array",
  162. value: "number",
  163. length: 4,
  164. default: [-180, -85.051129, 180, 85.051129],
  165. doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
  166. },
  167. scheme: {
  168. type: "enum",
  169. values: {xyz: {doc: "Slippy map tilenames scheme."}, tms: {doc: "OSGeo spec scheme."}},
  170. default: "xyz",
  171. doc: "Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."
  172. },
  173. minzoom: {
  174. type: "number",
  175. default: 0,
  176. doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
  177. },
  178. maxzoom: {
  179. type: "number",
  180. default: 22,
  181. doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
  182. },
  183. attribution: {
  184. type: "string",
  185. doc: "Contains an attribution to be displayed when the map is shown to a user."
  186. },
  187. promoteId: {
  188. type: "promoteId",
  189. doc: "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."
  190. },
  191. volatile: {
  192. type: "boolean",
  193. default: !1,
  194. doc: "A setting to determine whether a source's tiles are cached locally.",
  195. "sdk-support": {"basic functionality": {android: "9.3.0", ios: "5.10.0"}}
  196. },
  197. "*": {type: "*", doc: "Other keys to configure the data source."}
  198. },
  199. source_raster: {
  200. type: {
  201. required: !0,
  202. type: "enum",
  203. values: {raster: {doc: "A raster tile source."}},
  204. doc: "The type of the source."
  205. },
  206. url: {
  207. type: "string",
  208. doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."
  209. },
  210. tiles: {
  211. type: "array",
  212. value: "string",
  213. doc: "An array of one or more tile source URLs, as in the TileJSON spec."
  214. },
  215. bounds: {
  216. type: "array",
  217. value: "number",
  218. length: 4,
  219. default: [-180, -85.051129, 180, 85.051129],
  220. doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
  221. },
  222. minzoom: {
  223. type: "number",
  224. default: 0,
  225. doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
  226. },
  227. maxzoom: {
  228. type: "number",
  229. default: 22,
  230. doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
  231. },
  232. tileSize: {
  233. type: "number",
  234. default: 512,
  235. units: "pixels",
  236. doc: "The minimum visual size to display tiles for this layer. Only configurable for raster layers."
  237. },
  238. scheme: {
  239. type: "enum",
  240. values: {xyz: {doc: "Slippy map tilenames scheme."}, tms: {doc: "OSGeo spec scheme."}},
  241. default: "xyz",
  242. doc: "Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."
  243. },
  244. attribution: {
  245. type: "string",
  246. doc: "Contains an attribution to be displayed when the map is shown to a user."
  247. },
  248. volatile: {
  249. type: "boolean",
  250. default: !1,
  251. doc: "A setting to determine whether a source's tiles are cached locally.",
  252. "sdk-support": {"basic functionality": {android: "9.3.0", ios: "5.10.0"}}
  253. },
  254. "*": {type: "*", doc: "Other keys to configure the data source."}
  255. },
  256. source_raster_dem: {
  257. type: {
  258. required: !0,
  259. type: "enum",
  260. values: {"raster-dem": {doc: "A RGB-encoded raster DEM source"}},
  261. doc: "The type of the source."
  262. },
  263. url: {
  264. type: "string",
  265. doc: "A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."
  266. },
  267. tiles: {
  268. type: "array",
  269. value: "string",
  270. doc: "An array of one or more tile source URLs, as in the TileJSON spec."
  271. },
  272. bounds: {
  273. type: "array",
  274. value: "number",
  275. length: 4,
  276. default: [-180, -85.051129, 180, 85.051129],
  277. doc: "An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."
  278. },
  279. minzoom: {
  280. type: "number",
  281. default: 0,
  282. doc: "Minimum zoom level for which tiles are available, as in the TileJSON spec."
  283. },
  284. maxzoom: {
  285. type: "number",
  286. default: 22,
  287. doc: "Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."
  288. },
  289. tileSize: {
  290. type: "number",
  291. default: 512,
  292. units: "pixels",
  293. doc: "The minimum visual size to display tiles for this layer. Only configurable for raster layers."
  294. },
  295. attribution: {
  296. type: "string",
  297. doc: "Contains an attribution to be displayed when the map is shown to a user."
  298. },
  299. encoding: {
  300. type: "enum",
  301. values: {
  302. terrarium: {doc: "Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},
  303. mapbox: {doc: "Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}
  304. },
  305. default: "mapbox",
  306. doc: "The encoding used by this source. Mapbox Terrain RGB is used by default"
  307. },
  308. volatile: {
  309. type: "boolean",
  310. default: !1,
  311. doc: "A setting to determine whether a source's tiles are cached locally.",
  312. "sdk-support": {"basic functionality": {android: "9.3.0", ios: "5.10.0"}}
  313. },
  314. "*": {type: "*", doc: "Other keys to configure the data source."}
  315. },
  316. source_geojson: {
  317. type: {
  318. required: !0,
  319. type: "enum",
  320. values: {geojson: {doc: "A GeoJSON data source."}},
  321. doc: "The data type of the GeoJSON source."
  322. },
  323. data: {type: "*", doc: "A URL to a GeoJSON file, or inline GeoJSON."},
  324. maxzoom: {
  325. type: "number",
  326. default: 18,
  327. doc: "Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."
  328. },
  329. attribution: {
  330. type: "string",
  331. doc: "Contains an attribution to be displayed when the map is shown to a user."
  332. },
  333. buffer: {
  334. type: "number",
  335. default: 128,
  336. maximum: 512,
  337. minimum: 0,
  338. doc: "Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."
  339. },
  340. filter: {type: "*", doc: "An expression for filtering features prior to processing them for rendering."},
  341. tolerance: {
  342. type: "number",
  343. default: .375,
  344. doc: "Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."
  345. },
  346. cluster: {
  347. type: "boolean",
  348. default: !1,
  349. doc: "If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"
  350. },
  351. clusterRadius: {
  352. type: "number",
  353. default: 50,
  354. minimum: 0,
  355. doc: "Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."
  356. },
  357. clusterMaxZoom: {
  358. type: "number",
  359. doc: "Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."
  360. },
  361. clusterMinPoints: {
  362. type: "number",
  363. doc: "Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."
  364. },
  365. clusterProperties: {
  366. type: "*",
  367. doc: 'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'
  368. },
  369. lineMetrics: {
  370. type: "boolean",
  371. default: !1,
  372. doc: "Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."
  373. },
  374. generateId: {
  375. type: "boolean",
  376. default: !1,
  377. doc: "Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."
  378. },
  379. promoteId: {
  380. type: "promoteId",
  381. doc: "A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."
  382. }
  383. },
  384. source_video: {
  385. type: {
  386. required: !0,
  387. type: "enum",
  388. values: {video: {doc: "A video data source."}},
  389. doc: "The data type of the video source."
  390. },
  391. urls: {
  392. required: !0,
  393. type: "array",
  394. value: "string",
  395. doc: "URLs to video content in order of preferred format."
  396. },
  397. coordinates: {
  398. required: !0,
  399. doc: "Corners of video specified in longitude, latitude pairs.",
  400. type: "array",
  401. length: 4,
  402. value: {type: "array", length: 2, value: "number", doc: "A single longitude, latitude pair."}
  403. }
  404. },
  405. source_image: {
  406. type: {
  407. required: !0,
  408. type: "enum",
  409. values: {image: {doc: "An image data source."}},
  410. doc: "The data type of the image source."
  411. },
  412. url: {required: !0, type: "string", doc: "URL that points to an image."},
  413. coordinates: {
  414. required: !0,
  415. doc: "Corners of image specified in longitude, latitude pairs.",
  416. type: "array",
  417. length: 4,
  418. value: {type: "array", length: 2, value: "number", doc: "A single longitude, latitude pair."}
  419. }
  420. },
  421. layer: {
  422. id: {type: "string", doc: "Unique layer name.", required: !0},
  423. type: {
  424. type: "enum", values: {
  425. fill: {
  426. doc: "A filled polygon with an optional stroked border.",
  427. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}}
  428. },
  429. line: {
  430. doc: "A stroked line.",
  431. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}}
  432. },
  433. symbol: {
  434. doc: "An icon or a text label.",
  435. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}}
  436. },
  437. circle: {
  438. doc: "A filled circle.",
  439. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}}
  440. },
  441. heatmap: {
  442. doc: "A heatmap.",
  443. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  444. },
  445. "fill-extrusion": {
  446. doc: "An extruded (3D) polygon.",
  447. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}}
  448. },
  449. raster: {
  450. doc: "Raster map textures such as satellite imagery.",
  451. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}}
  452. },
  453. hillshade: {
  454. doc: "Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.",
  455. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  456. },
  457. background: {
  458. doc: "The background color or pattern of the map.",
  459. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}}
  460. },
  461. sky: {
  462. doc: "A spherical dome around the map that is always rendered behind all other layers.",
  463. "sdk-support": {"basic functionality": {js: "2.0.0"}}
  464. }
  465. }, doc: "Rendering type of this layer.", required: !0
  466. },
  467. metadata: {
  468. type: "*",
  469. doc: "Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."
  470. },
  471. source: {
  472. type: "string",
  473. doc: "Name of a source description to be used for this layer. Required for all layer types except `background`."
  474. },
  475. "source-layer": {
  476. type: "string",
  477. doc: "Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."
  478. },
  479. minzoom: {
  480. type: "number",
  481. minimum: 0,
  482. maximum: 24,
  483. doc: "The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."
  484. },
  485. maxzoom: {
  486. type: "number",
  487. minimum: 0,
  488. maximum: 24,
  489. doc: "The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."
  490. },
  491. filter: {
  492. type: "filter",
  493. doc: "A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."
  494. },
  495. layout: {type: "layout", doc: "Layout properties for the layer."},
  496. paint: {type: "paint", doc: "Default paint properties for this layer."}
  497. },
  498. layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background", "layout_sky"],
  499. layout_background: {
  500. visibility: {
  501. type: "enum",
  502. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  503. default: "visible",
  504. doc: "Whether this layer is displayed.",
  505. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  506. "property-type": "constant"
  507. }
  508. },
  509. layout_sky: {
  510. visibility: {
  511. type: "enum",
  512. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  513. default: "visible",
  514. doc: "Whether this layer is displayed.",
  515. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  516. "property-type": "constant"
  517. }
  518. },
  519. layout_fill: {
  520. "fill-sort-key": {
  521. type: "number",
  522. doc: "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.",
  523. "sdk-support": {
  524. "basic functionality": {js: "1.2.0", android: "9.1.0", ios: "5.8.0", macos: "0.15.0"},
  525. "data-driven styling": {js: "1.2.0", android: "9.1.0", ios: "5.8.0", macos: "0.15.0"}
  526. },
  527. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  528. "property-type": "data-driven"
  529. },
  530. visibility: {
  531. type: "enum",
  532. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  533. default: "visible",
  534. doc: "Whether this layer is displayed.",
  535. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  536. "property-type": "constant"
  537. }
  538. },
  539. layout_circle: {
  540. "circle-sort-key": {
  541. type: "number",
  542. doc: "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.",
  543. "sdk-support": {
  544. "basic functionality": {js: "1.2.0", android: "9.2.0", ios: "5.9.0", macos: "0.16.0"},
  545. "data-driven styling": {js: "1.2.0", android: "9.2.0", ios: "5.9.0", macos: "0.16.0"}
  546. },
  547. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  548. "property-type": "data-driven"
  549. },
  550. visibility: {
  551. type: "enum",
  552. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  553. default: "visible",
  554. doc: "Whether this layer is displayed.",
  555. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  556. "property-type": "constant"
  557. }
  558. },
  559. layout_heatmap: {
  560. visibility: {
  561. type: "enum",
  562. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  563. default: "visible",
  564. doc: "Whether this layer is displayed.",
  565. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  566. "property-type": "constant"
  567. }
  568. },
  569. "layout_fill-extrusion": {
  570. visibility: {
  571. type: "enum",
  572. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  573. default: "visible",
  574. doc: "Whether this layer is displayed.",
  575. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}},
  576. "property-type": "constant"
  577. }
  578. },
  579. layout_line: {
  580. "line-cap": {
  581. type: "enum",
  582. values: {
  583. butt: {doc: "A cap with a squared-off end which is drawn to the exact endpoint of the line."},
  584. round: {doc: "A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},
  585. square: {doc: "A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}
  586. },
  587. default: "butt",
  588. doc: "The display of line endings.",
  589. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  590. expression: {interpolated: !1, parameters: ["zoom"]},
  591. "property-type": "data-constant"
  592. },
  593. "line-join": {
  594. type: "enum",
  595. values: {
  596. bevel: {doc: "A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},
  597. round: {doc: "A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},
  598. miter: {doc: "A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}
  599. },
  600. default: "miter",
  601. doc: "The display of lines when joining.",
  602. "sdk-support": {
  603. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  604. "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
  605. },
  606. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  607. "property-type": "data-driven"
  608. },
  609. "line-miter-limit": {
  610. type: "number",
  611. default: 2,
  612. doc: "Used to automatically convert miter joins to bevel joins for sharp angles.",
  613. requires: [{"line-join": "miter"}],
  614. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  615. expression: {interpolated: !0, parameters: ["zoom"]},
  616. "property-type": "data-constant"
  617. },
  618. "line-round-limit": {
  619. type: "number",
  620. default: 1.05,
  621. doc: "Used to automatically convert round joins to miter joins for shallow angles.",
  622. requires: [{"line-join": "round"}],
  623. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  624. expression: {interpolated: !0, parameters: ["zoom"]},
  625. "property-type": "data-constant"
  626. },
  627. "line-sort-key": {
  628. type: "number",
  629. doc: "Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.",
  630. "sdk-support": {
  631. "basic functionality": {js: "1.2.0", android: "9.1.0", ios: "5.8.0", macos: "0.15.0"},
  632. "data-driven styling": {js: "1.2.0", android: "9.1.0", ios: "5.8.0", macos: "0.15.0"}
  633. },
  634. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  635. "property-type": "data-driven"
  636. },
  637. visibility: {
  638. type: "enum",
  639. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  640. default: "visible",
  641. doc: "Whether this layer is displayed.",
  642. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  643. "property-type": "constant"
  644. }
  645. },
  646. layout_symbol: {
  647. "symbol-placement": {
  648. type: "enum",
  649. values: {
  650. point: {doc: "The label is placed at the point where the geometry is located."},
  651. line: {doc: "The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},
  652. "line-center": {doc: "The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}
  653. },
  654. default: "point",
  655. doc: "Label placement relative to its geometry.",
  656. "sdk-support": {
  657. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  658. "`line-center` value": {js: "0.47.0", android: "6.4.0", ios: "4.3.0", macos: "0.10.0"}
  659. },
  660. expression: {interpolated: !1, parameters: ["zoom"]},
  661. "property-type": "data-constant"
  662. },
  663. "symbol-spacing": {
  664. type: "number",
  665. default: 250,
  666. minimum: 1,
  667. units: "pixels",
  668. doc: "Distance between two symbol anchors.",
  669. requires: [{"symbol-placement": "line"}],
  670. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  671. expression: {interpolated: !0, parameters: ["zoom"]},
  672. "property-type": "data-constant"
  673. },
  674. "symbol-avoid-edges": {
  675. type: "boolean",
  676. default: !1,
  677. doc: "If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.",
  678. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  679. expression: {interpolated: !1, parameters: ["zoom"]},
  680. "property-type": "data-constant"
  681. },
  682. "symbol-sort-key": {
  683. type: "number",
  684. doc: "Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.",
  685. "sdk-support": {
  686. "basic functionality": {js: "0.53.0", android: "7.4.0", ios: "4.11.0", macos: "0.14.0"},
  687. "data-driven styling": {js: "0.53.0", android: "7.4.0", ios: "4.11.0", macos: "0.14.0"}
  688. },
  689. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  690. "property-type": "data-driven"
  691. },
  692. "symbol-z-order": {
  693. type: "enum",
  694. values: {
  695. auto: {doc: "Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},
  696. "viewport-y": {doc: "Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},
  697. source: {doc: "Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}
  698. },
  699. default: "auto",
  700. doc: "Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.",
  701. "sdk-support": {"basic functionality": {js: "0.49.0", android: "6.6.0", ios: "4.5.0", macos: "0.12.0"}},
  702. expression: {interpolated: !1, parameters: ["zoom"]},
  703. "property-type": "data-constant"
  704. },
  705. "icon-allow-overlap": {
  706. type: "boolean",
  707. default: !1,
  708. doc: "If true, the icon will be visible even if it collides with other previously drawn symbols.",
  709. requires: ["icon-image"],
  710. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  711. expression: {interpolated: !1, parameters: ["zoom"]},
  712. "property-type": "data-constant"
  713. },
  714. "icon-ignore-placement": {
  715. type: "boolean",
  716. default: !1,
  717. doc: "If true, other symbols can be visible even if they collide with the icon.",
  718. requires: ["icon-image"],
  719. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  720. expression: {interpolated: !1, parameters: ["zoom"]},
  721. "property-type": "data-constant"
  722. },
  723. "icon-optional": {
  724. type: "boolean",
  725. default: !1,
  726. doc: "If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",
  727. requires: ["icon-image", "text-field"],
  728. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  729. expression: {interpolated: !1, parameters: ["zoom"]},
  730. "property-type": "data-constant"
  731. },
  732. "icon-rotation-alignment": {
  733. type: "enum",
  734. values: {
  735. map: {doc: "When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},
  736. viewport: {doc: "Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},
  737. auto: {doc: "When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}
  738. },
  739. default: "auto",
  740. doc: "In combination with `symbol-placement`, determines the rotation behavior of icons.",
  741. requires: ["icon-image"],
  742. "sdk-support": {
  743. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  744. "`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"}
  745. },
  746. expression: {interpolated: !1, parameters: ["zoom"]},
  747. "property-type": "data-constant"
  748. },
  749. "icon-size": {
  750. type: "number",
  751. default: 1,
  752. minimum: 0,
  753. units: "factor of the original icon size",
  754. doc: "Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",
  755. requires: ["icon-image"],
  756. "sdk-support": {
  757. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  758. "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  759. },
  760. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  761. "property-type": "data-driven"
  762. },
  763. "icon-text-fit": {
  764. type: "enum",
  765. values: {
  766. none: {doc: "The icon is displayed at its intrinsic aspect ratio."},
  767. width: {doc: "The icon is scaled in the x-dimension to fit the width of the text."},
  768. height: {doc: "The icon is scaled in the y-dimension to fit the height of the text."},
  769. both: {doc: "The icon is scaled in both x- and y-dimensions."}
  770. },
  771. default: "none",
  772. doc: "Scales the icon to fit around the associated text.",
  773. requires: ["icon-image", "text-field"],
  774. "sdk-support": {
  775. "basic functionality": {js: "0.21.0", android: "4.2.0", ios: "3.4.0", macos: "0.2.1"},
  776. "stretchable icons": {js: "1.6.0", android: "9.2.0", ios: "5.8.0", macos: "0.15.0"}
  777. },
  778. expression: {interpolated: !1, parameters: ["zoom"]},
  779. "property-type": "data-constant"
  780. },
  781. "icon-text-fit-padding": {
  782. type: "array",
  783. value: "number",
  784. length: 4,
  785. default: [0, 0, 0, 0],
  786. units: "pixels",
  787. doc: "Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",
  788. requires: ["icon-image", "text-field", {"icon-text-fit": ["both", "width", "height"]}],
  789. "sdk-support": {"basic functionality": {js: "0.21.0", android: "4.2.0", ios: "3.4.0", macos: "0.2.1"}},
  790. expression: {interpolated: !0, parameters: ["zoom"]},
  791. "property-type": "data-constant"
  792. },
  793. "icon-image": {
  794. type: "resolvedImage",
  795. doc: "Name of image in sprite to use for drawing an image background.",
  796. tokens: !0,
  797. "sdk-support": {
  798. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  799. "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  800. },
  801. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  802. "property-type": "data-driven"
  803. },
  804. "icon-rotate": {
  805. type: "number",
  806. default: 0,
  807. period: 360,
  808. units: "degrees",
  809. doc: "Rotates the icon clockwise.",
  810. requires: ["icon-image"],
  811. "sdk-support": {
  812. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  813. "data-driven styling": {js: "0.21.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  814. },
  815. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  816. "property-type": "data-driven"
  817. },
  818. "icon-padding": {
  819. type: "number",
  820. default: 2,
  821. minimum: 0,
  822. units: "pixels",
  823. doc: "Size of the additional area around the icon bounding box used for detecting symbol collisions.",
  824. requires: ["icon-image"],
  825. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  826. expression: {interpolated: !0, parameters: ["zoom"]},
  827. "property-type": "data-constant"
  828. },
  829. "icon-keep-upright": {
  830. type: "boolean",
  831. default: !1,
  832. doc: "If true, the icon may be flipped to prevent it from being rendered upside-down.",
  833. requires: ["icon-image", {"icon-rotation-alignment": "map"}, {"symbol-placement": ["line", "line-center"]}],
  834. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  835. expression: {interpolated: !1, parameters: ["zoom"]},
  836. "property-type": "data-constant"
  837. },
  838. "icon-offset": {
  839. type: "array",
  840. value: "number",
  841. length: 2,
  842. default: [0, 0],
  843. doc: "Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",
  844. requires: ["icon-image"],
  845. "sdk-support": {
  846. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  847. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  848. },
  849. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  850. "property-type": "data-driven"
  851. },
  852. "icon-anchor": {
  853. type: "enum",
  854. values: {
  855. center: {doc: "The center of the icon is placed closest to the anchor."},
  856. left: {doc: "The left side of the icon is placed closest to the anchor."},
  857. right: {doc: "The right side of the icon is placed closest to the anchor."},
  858. top: {doc: "The top of the icon is placed closest to the anchor."},
  859. bottom: {doc: "The bottom of the icon is placed closest to the anchor."},
  860. "top-left": {doc: "The top left corner of the icon is placed closest to the anchor."},
  861. "top-right": {doc: "The top right corner of the icon is placed closest to the anchor."},
  862. "bottom-left": {doc: "The bottom left corner of the icon is placed closest to the anchor."},
  863. "bottom-right": {doc: "The bottom right corner of the icon is placed closest to the anchor."}
  864. },
  865. default: "center",
  866. doc: "Part of the icon placed closest to the anchor.",
  867. requires: ["icon-image"],
  868. "sdk-support": {
  869. "basic functionality": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"},
  870. "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
  871. },
  872. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  873. "property-type": "data-driven"
  874. },
  875. "icon-pitch-alignment": {
  876. type: "enum",
  877. values: {
  878. map: {doc: "The icon is aligned to the plane of the map."},
  879. viewport: {doc: "The icon is aligned to the plane of the viewport."},
  880. auto: {doc: "Automatically matches the value of `icon-rotation-alignment`."}
  881. },
  882. default: "auto",
  883. doc: "Orientation of icon when map is pitched.",
  884. requires: ["icon-image"],
  885. "sdk-support": {"basic functionality": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}},
  886. expression: {interpolated: !1, parameters: ["zoom"]},
  887. "property-type": "data-constant"
  888. },
  889. "text-pitch-alignment": {
  890. type: "enum",
  891. values: {
  892. map: {doc: "The text is aligned to the plane of the map."},
  893. viewport: {doc: "The text is aligned to the plane of the viewport."},
  894. auto: {doc: "Automatically matches the value of `text-rotation-alignment`."}
  895. },
  896. default: "auto",
  897. doc: "Orientation of text when map is pitched.",
  898. requires: ["text-field"],
  899. "sdk-support": {
  900. "basic functionality": {js: "0.21.0", android: "4.2.0", ios: "3.4.0", macos: "0.2.1"},
  901. "`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"}
  902. },
  903. expression: {interpolated: !1, parameters: ["zoom"]},
  904. "property-type": "data-constant"
  905. },
  906. "text-rotation-alignment": {
  907. type: "enum",
  908. values: {
  909. map: {doc: "When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},
  910. viewport: {doc: "Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},
  911. auto: {doc: "When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}
  912. },
  913. default: "auto",
  914. doc: "In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",
  915. requires: ["text-field"],
  916. "sdk-support": {
  917. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  918. "`auto` value": {js: "0.25.0", android: "4.2.0", ios: "3.4.0", macos: "0.3.0"}
  919. },
  920. expression: {interpolated: !1, parameters: ["zoom"]},
  921. "property-type": "data-constant"
  922. },
  923. "text-field": {
  924. type: "formatted",
  925. default: "",
  926. tokens: !0,
  927. doc: "Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.",
  928. "sdk-support": {
  929. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  930. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  931. },
  932. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  933. "property-type": "data-driven"
  934. },
  935. "text-font": {
  936. type: "array",
  937. value: "string",
  938. default: ["Open Sans Regular", "Arial Unicode MS Regular"],
  939. doc: "Font stack to use for displaying text.",
  940. requires: ["text-field"],
  941. "sdk-support": {
  942. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  943. "data-driven styling": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
  944. },
  945. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  946. "property-type": "data-driven"
  947. },
  948. "text-size": {
  949. type: "number",
  950. default: 16,
  951. minimum: 0,
  952. units: "pixels",
  953. doc: "Font size.",
  954. requires: ["text-field"],
  955. "sdk-support": {
  956. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  957. "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  958. },
  959. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  960. "property-type": "data-driven"
  961. },
  962. "text-max-width": {
  963. type: "number",
  964. default: 10,
  965. minimum: 0,
  966. units: "ems",
  967. doc: "The maximum line width for text wrapping.",
  968. requires: ["text-field"],
  969. "sdk-support": {
  970. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  971. "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
  972. },
  973. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  974. "property-type": "data-driven"
  975. },
  976. "text-line-height": {
  977. type: "number",
  978. default: 1.2,
  979. units: "ems",
  980. doc: "Text leading value for multi-line text.",
  981. requires: ["text-field"],
  982. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  983. expression: {interpolated: !0, parameters: ["zoom"]},
  984. "property-type": "data-constant"
  985. },
  986. "text-letter-spacing": {
  987. type: "number",
  988. default: 0,
  989. units: "ems",
  990. doc: "Text tracking amount.",
  991. requires: ["text-field"],
  992. "sdk-support": {
  993. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  994. "data-driven styling": {js: "0.40.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
  995. },
  996. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  997. "property-type": "data-driven"
  998. },
  999. "text-justify": {
  1000. type: "enum",
  1001. values: {
  1002. auto: {doc: "The text is aligned towards the anchor position."},
  1003. left: {doc: "The text is aligned to the left."},
  1004. center: {doc: "The text is centered."},
  1005. right: {doc: "The text is aligned to the right."}
  1006. },
  1007. default: "center",
  1008. doc: "Text justification options.",
  1009. requires: ["text-field"],
  1010. "sdk-support": {
  1011. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1012. "data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"},
  1013. auto: {js: "0.54.0", android: "7.4.0", ios: "4.10.0", macos: "0.14.0"}
  1014. },
  1015. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  1016. "property-type": "data-driven"
  1017. },
  1018. "text-radial-offset": {
  1019. type: "number",
  1020. units: "ems",
  1021. default: 0,
  1022. doc: "Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.",
  1023. "sdk-support": {
  1024. "basic functionality": {js: "0.54.0", android: "7.4.0", ios: "4.10.0", macos: "0.14.0"},
  1025. "data-driven styling": {js: "0.54.0", android: "7.4.0", ios: "4.10.0", macos: "0.14.0"}
  1026. },
  1027. requires: ["text-field"],
  1028. "property-type": "data-driven",
  1029. expression: {interpolated: !0, parameters: ["zoom", "feature"]}
  1030. },
  1031. "text-variable-anchor": {
  1032. type: "array",
  1033. value: "enum",
  1034. values: {
  1035. center: {doc: "The center of the text is placed closest to the anchor."},
  1036. left: {doc: "The left side of the text is placed closest to the anchor."},
  1037. right: {doc: "The right side of the text is placed closest to the anchor."},
  1038. top: {doc: "The top of the text is placed closest to the anchor."},
  1039. bottom: {doc: "The bottom of the text is placed closest to the anchor."},
  1040. "top-left": {doc: "The top left corner of the text is placed closest to the anchor."},
  1041. "top-right": {doc: "The top right corner of the text is placed closest to the anchor."},
  1042. "bottom-left": {doc: "The bottom left corner of the text is placed closest to the anchor."},
  1043. "bottom-right": {doc: "The bottom right corner of the text is placed closest to the anchor."}
  1044. },
  1045. requires: ["text-field", {"symbol-placement": ["point"]}],
  1046. doc: "To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.",
  1047. "sdk-support": {"basic functionality": {js: "0.54.0", android: "7.4.0", ios: "4.10.0", macos: "0.14.0"}},
  1048. expression: {interpolated: !1, parameters: ["zoom"]},
  1049. "property-type": "data-constant"
  1050. },
  1051. "text-anchor": {
  1052. type: "enum",
  1053. values: {
  1054. center: {doc: "The center of the text is placed closest to the anchor."},
  1055. left: {doc: "The left side of the text is placed closest to the anchor."},
  1056. right: {doc: "The right side of the text is placed closest to the anchor."},
  1057. top: {doc: "The top of the text is placed closest to the anchor."},
  1058. bottom: {doc: "The bottom of the text is placed closest to the anchor."},
  1059. "top-left": {doc: "The top left corner of the text is placed closest to the anchor."},
  1060. "top-right": {doc: "The top right corner of the text is placed closest to the anchor."},
  1061. "bottom-left": {doc: "The bottom left corner of the text is placed closest to the anchor."},
  1062. "bottom-right": {doc: "The bottom right corner of the text is placed closest to the anchor."}
  1063. },
  1064. default: "center",
  1065. doc: "Part of the text placed closest to the anchor.",
  1066. requires: ["text-field", {"!": "text-variable-anchor"}],
  1067. "sdk-support": {
  1068. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1069. "data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
  1070. },
  1071. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  1072. "property-type": "data-driven"
  1073. },
  1074. "text-max-angle": {
  1075. type: "number",
  1076. default: 45,
  1077. units: "degrees",
  1078. doc: "Maximum angle change between adjacent characters.",
  1079. requires: ["text-field", {"symbol-placement": ["line", "line-center"]}],
  1080. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1081. expression: {interpolated: !0, parameters: ["zoom"]},
  1082. "property-type": "data-constant"
  1083. },
  1084. "text-writing-mode": {
  1085. type: "array",
  1086. value: "enum",
  1087. values: {
  1088. horizontal: {doc: "If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},
  1089. vertical: {doc: "If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}
  1090. },
  1091. doc: "The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",
  1092. requires: ["text-field", {"symbol-placement": ["point"]}],
  1093. "sdk-support": {"basic functionality": {js: "1.3.0", android: "8.3.0", ios: "5.3.0", macos: "0.15.0"}},
  1094. expression: {interpolated: !1, parameters: ["zoom"]},
  1095. "property-type": "data-constant"
  1096. },
  1097. "text-rotate": {
  1098. type: "number",
  1099. default: 0,
  1100. period: 360,
  1101. units: "degrees",
  1102. doc: "Rotates the text clockwise.",
  1103. requires: ["text-field"],
  1104. "sdk-support": {
  1105. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1106. "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  1107. },
  1108. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  1109. "property-type": "data-driven"
  1110. },
  1111. "text-padding": {
  1112. type: "number",
  1113. default: 2,
  1114. minimum: 0,
  1115. units: "pixels",
  1116. doc: "Size of the additional area around the text bounding box used for detecting symbol collisions.",
  1117. requires: ["text-field"],
  1118. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1119. expression: {interpolated: !0, parameters: ["zoom"]},
  1120. "property-type": "data-constant"
  1121. },
  1122. "text-keep-upright": {
  1123. type: "boolean",
  1124. default: !0,
  1125. doc: "If true, the text may be flipped vertically to prevent it from being rendered upside-down.",
  1126. requires: ["text-field", {"text-rotation-alignment": "map"}, {"symbol-placement": ["line", "line-center"]}],
  1127. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1128. expression: {interpolated: !1, parameters: ["zoom"]},
  1129. "property-type": "data-constant"
  1130. },
  1131. "text-transform": {
  1132. type: "enum",
  1133. values: {
  1134. none: {doc: "The text is not altered."},
  1135. uppercase: {doc: "Forces all letters to be displayed in uppercase."},
  1136. lowercase: {doc: "Forces all letters to be displayed in lowercase."}
  1137. },
  1138. default: "none",
  1139. doc: "Specifies how to capitalize text, similar to the CSS `text-transform` property.",
  1140. requires: ["text-field"],
  1141. "sdk-support": {
  1142. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1143. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  1144. },
  1145. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  1146. "property-type": "data-driven"
  1147. },
  1148. "text-offset": {
  1149. type: "array",
  1150. doc: "Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",
  1151. value: "number",
  1152. units: "ems",
  1153. length: 2,
  1154. default: [0, 0],
  1155. requires: ["text-field", {"!": "text-radial-offset"}],
  1156. "sdk-support": {
  1157. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1158. "data-driven styling": {js: "0.35.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  1159. },
  1160. expression: {interpolated: !0, parameters: ["zoom", "feature"]},
  1161. "property-type": "data-driven"
  1162. },
  1163. "text-allow-overlap": {
  1164. type: "boolean",
  1165. default: !1,
  1166. doc: "If true, the text will be visible even if it collides with other previously drawn symbols.",
  1167. requires: ["text-field"],
  1168. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1169. expression: {interpolated: !1, parameters: ["zoom"]},
  1170. "property-type": "data-constant"
  1171. },
  1172. "text-ignore-placement": {
  1173. type: "boolean",
  1174. default: !1,
  1175. doc: "If true, other symbols can be visible even if they collide with the text.",
  1176. requires: ["text-field"],
  1177. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1178. expression: {interpolated: !1, parameters: ["zoom"]},
  1179. "property-type": "data-constant"
  1180. },
  1181. "text-optional": {
  1182. type: "boolean",
  1183. default: !1,
  1184. doc: "If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",
  1185. requires: ["text-field", "icon-image"],
  1186. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1187. expression: {interpolated: !1, parameters: ["zoom"]},
  1188. "property-type": "data-constant"
  1189. },
  1190. visibility: {
  1191. type: "enum",
  1192. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  1193. default: "visible",
  1194. doc: "Whether this layer is displayed.",
  1195. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1196. "property-type": "constant"
  1197. }
  1198. },
  1199. layout_raster: {
  1200. visibility: {
  1201. type: "enum",
  1202. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  1203. default: "visible",
  1204. doc: "Whether this layer is displayed.",
  1205. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1206. "property-type": "constant"
  1207. }
  1208. },
  1209. layout_hillshade: {
  1210. visibility: {
  1211. type: "enum",
  1212. values: {visible: {doc: "The layer is shown."}, none: {doc: "The layer is not shown."}},
  1213. default: "visible",
  1214. doc: "Whether this layer is displayed.",
  1215. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  1216. "property-type": "constant"
  1217. }
  1218. },
  1219. filter: {type: "array", value: "*", doc: "A filter selects specific features from a layer."},
  1220. filter_operator: {
  1221. type: "enum",
  1222. values: {
  1223. "==": {doc: '`["==", key, value]` equality: `feature[key] = value`'},
  1224. "!=": {doc: '`["!=", key, value]` inequality: `feature[key] ≠ value`'},
  1225. ">": {doc: '`[">", key, value]` greater than: `feature[key] > value`'},
  1226. ">=": {doc: '`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},
  1227. "<": {doc: '`["<", key, value]` less than: `feature[key] < value`'},
  1228. "<=": {doc: '`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},
  1229. in: {doc: '`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},
  1230. "!in": {doc: '`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},
  1231. all: {doc: '`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},
  1232. any: {doc: '`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},
  1233. none: {doc: '`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},
  1234. has: {doc: '`["has", key]` `feature[key]` exists'},
  1235. "!has": {doc: '`["!has", key]` `feature[key]` does not exist'},
  1236. within: {doc: '`["within", object]` feature geometry is within object geometry'}
  1237. },
  1238. doc: "The filter operator."
  1239. },
  1240. geometry_type: {
  1241. type: "enum",
  1242. values: {
  1243. Point: {doc: "Filter to point geometries."},
  1244. LineString: {doc: "Filter to line geometries."},
  1245. Polygon: {doc: "Filter to polygon geometries."}
  1246. },
  1247. doc: "The geometry type for the filter to select."
  1248. },
  1249. function: {
  1250. expression: {type: "expression", doc: "An expression."},
  1251. stops: {type: "array", doc: "An array of stops.", value: "function_stop"},
  1252. base: {
  1253. type: "number",
  1254. default: 1,
  1255. minimum: 0,
  1256. doc: "The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."
  1257. },
  1258. property: {
  1259. type: "string",
  1260. doc: "The name of a feature property to use as the function input.",
  1261. default: "$zoom"
  1262. },
  1263. type: {
  1264. type: "enum",
  1265. values: {
  1266. identity: {doc: "Return the input value as the output value."},
  1267. exponential: {doc: "Generate an output by interpolating between stops just less than and just greater than the function input."},
  1268. interval: {doc: "Return the output value of the stop just less than the function input."},
  1269. categorical: {doc: "Return the output value of the stop equal to the function input."}
  1270. },
  1271. doc: "The interpolation strategy to use in function evaluation.",
  1272. default: "exponential"
  1273. },
  1274. colorSpace: {
  1275. type: "enum",
  1276. values: {
  1277. rgb: {doc: "Use the RGB color space to interpolate color values"},
  1278. lab: {doc: "Use the LAB color space to interpolate color values."},
  1279. hcl: {doc: "Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}
  1280. },
  1281. doc: "The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",
  1282. default: "rgb"
  1283. },
  1284. default: {
  1285. type: "*",
  1286. required: !1,
  1287. doc: "A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."
  1288. }
  1289. },
  1290. function_stop: {
  1291. type: "array",
  1292. minimum: 0,
  1293. maximum: 24,
  1294. value: ["number", "color"],
  1295. length: 2,
  1296. doc: "Zoom level and value pair."
  1297. },
  1298. expression: {
  1299. type: "array",
  1300. value: "*",
  1301. minimum: 1,
  1302. doc: "An expression defines a function that can be used for data-driven style properties or feature filters."
  1303. },
  1304. expression_name: {
  1305. doc: "", type: "enum", values: {
  1306. let: {
  1307. doc: 'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',
  1308. group: "Variable binding",
  1309. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1310. },
  1311. var: {
  1312. doc: 'References variable bound using "let".',
  1313. group: "Variable binding",
  1314. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1315. },
  1316. literal: {
  1317. doc: "Provides a literal array or object value.",
  1318. group: "Types",
  1319. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1320. },
  1321. array: {
  1322. doc: "Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",
  1323. group: "Types",
  1324. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1325. },
  1326. at: {
  1327. doc: "Retrieves an item from an array.",
  1328. group: "Lookup",
  1329. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1330. },
  1331. in: {
  1332. doc: "Determines whether an item exists in an array or a substring exists in a string.",
  1333. group: "Lookup",
  1334. "sdk-support": {"basic functionality": {js: "1.6.0", android: "9.1.0", ios: "5.8.0", macos: "0.15.0"}}
  1335. },
  1336. "index-of": {
  1337. doc: "Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",
  1338. group: "Lookup",
  1339. "sdk-support": {"basic functionality": {js: "1.10.0"}}
  1340. },
  1341. slice: {
  1342. doc: "Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",
  1343. group: "Lookup",
  1344. "sdk-support": {"basic functionality": {js: "1.10.0"}}
  1345. },
  1346. case: {
  1347. doc: "Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",
  1348. group: "Decision",
  1349. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1350. },
  1351. match: {
  1352. doc: 'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',
  1353. group: "Decision",
  1354. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1355. },
  1356. coalesce: {
  1357. doc: "Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",
  1358. group: "Decision",
  1359. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1360. },
  1361. step: {
  1362. doc: 'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',
  1363. group: "Ramps, scales, curves",
  1364. "sdk-support": {"basic functionality": {js: "0.42.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1365. },
  1366. interpolate: {
  1367. doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',
  1368. group: "Ramps, scales, curves",
  1369. "sdk-support": {"basic functionality": {js: "0.42.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1370. },
  1371. "interpolate-hcl": {
  1372. doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',
  1373. group: "Ramps, scales, curves",
  1374. "sdk-support": {"basic functionality": {js: "0.49.0"}}
  1375. },
  1376. "interpolate-lab": {
  1377. doc: 'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',
  1378. group: "Ramps, scales, curves",
  1379. "sdk-support": {"basic functionality": {js: "0.49.0"}}
  1380. },
  1381. ln2: {
  1382. doc: "Returns mathematical constant ln(2).",
  1383. group: "Math",
  1384. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1385. },
  1386. pi: {
  1387. doc: "Returns the mathematical constant pi.",
  1388. group: "Math",
  1389. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1390. },
  1391. e: {
  1392. doc: "Returns the mathematical constant e.",
  1393. group: "Math",
  1394. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1395. },
  1396. typeof: {
  1397. doc: "Returns a string describing the type of the given value.",
  1398. group: "Types",
  1399. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1400. },
  1401. string: {
  1402. doc: "Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",
  1403. group: "Types",
  1404. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1405. },
  1406. number: {
  1407. doc: "Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",
  1408. group: "Types",
  1409. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1410. },
  1411. boolean: {
  1412. doc: "Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",
  1413. group: "Types",
  1414. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1415. },
  1416. object: {
  1417. doc: "Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",
  1418. group: "Types",
  1419. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1420. },
  1421. collator: {
  1422. doc: "Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",
  1423. group: "Types",
  1424. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}}
  1425. },
  1426. format: {
  1427. doc: 'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',
  1428. group: "Types",
  1429. "sdk-support": {
  1430. "basic functionality": {js: "0.48.0", android: "6.7.0", ios: "4.6.0", macos: "0.12.0"},
  1431. "text-font": {js: "0.48.0", android: "6.7.0", ios: "4.6.0", macos: "0.12.0"},
  1432. "font-scale": {js: "0.48.0", android: "6.7.0", ios: "4.6.0", macos: "0.12.0"},
  1433. "text-color": {js: "1.3.0", android: "7.3.0", ios: "4.10.0", macos: "0.14.0"},
  1434. image: {js: "1.6.0", android: "8.6.0", ios: "5.7.0", macos: "0.15.0"}
  1435. }
  1436. },
  1437. image: {
  1438. doc: "Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",
  1439. group: "Types",
  1440. "sdk-support": {"basic functionality": {js: "1.4.0", android: "8.6.0", ios: "5.7.0", macos: "0.15.0"}}
  1441. },
  1442. "number-format": {
  1443. doc: "Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",
  1444. group: "Types",
  1445. "sdk-support": {"basic functionality": {js: "0.54.0"}}
  1446. },
  1447. "to-string": {
  1448. doc: 'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',
  1449. group: "Types",
  1450. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1451. },
  1452. "to-number": {
  1453. doc: 'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',
  1454. group: "Types",
  1455. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1456. },
  1457. "to-boolean": {
  1458. doc: "Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",
  1459. group: "Types",
  1460. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1461. },
  1462. "to-rgba": {
  1463. doc: "Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",
  1464. group: "Color",
  1465. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1466. },
  1467. "to-color": {
  1468. doc: "Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",
  1469. group: "Types",
  1470. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1471. },
  1472. rgb: {
  1473. doc: "Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",
  1474. group: "Color",
  1475. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1476. },
  1477. rgba: {
  1478. doc: "Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",
  1479. group: "Color",
  1480. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1481. },
  1482. get: {
  1483. doc: "Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",
  1484. group: "Lookup",
  1485. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1486. },
  1487. has: {
  1488. doc: "Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",
  1489. group: "Lookup",
  1490. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1491. },
  1492. length: {
  1493. doc: "Gets the length of an array or string.",
  1494. group: "Lookup",
  1495. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1496. },
  1497. properties: {
  1498. doc: 'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',
  1499. group: "Feature data",
  1500. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1501. },
  1502. "feature-state": {
  1503. doc: "Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",
  1504. group: "Feature data",
  1505. "sdk-support": {"basic functionality": {js: "0.46.0"}}
  1506. },
  1507. "geometry-type": {
  1508. doc: "Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",
  1509. group: "Feature data",
  1510. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1511. },
  1512. id: {
  1513. doc: "Gets the feature's id, if it has one.",
  1514. group: "Feature data",
  1515. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1516. },
  1517. zoom: {
  1518. doc: 'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',
  1519. group: "Zoom",
  1520. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1521. },
  1522. "heatmap-density": {
  1523. doc: "Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",
  1524. group: "Heatmap",
  1525. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1526. },
  1527. "line-progress": {
  1528. doc: "Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",
  1529. group: "Feature data",
  1530. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.5.0", ios: "4.6.0", macos: "0.12.0"}}
  1531. },
  1532. "sky-radial-progress": {
  1533. doc: "Gets the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",
  1534. group: "sky",
  1535. "sdk-support": {"basic functionality": {js: "2.0.0"}}
  1536. },
  1537. accumulated: {
  1538. doc: "Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",
  1539. group: "Feature data",
  1540. "sdk-support": {"basic functionality": {js: "0.53.0"}}
  1541. },
  1542. "+": {
  1543. doc: "Returns the sum of the inputs.",
  1544. group: "Math",
  1545. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1546. },
  1547. "*": {
  1548. doc: "Returns the product of the inputs.",
  1549. group: "Math",
  1550. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1551. },
  1552. "-": {
  1553. doc: "For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",
  1554. group: "Math",
  1555. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1556. },
  1557. "/": {
  1558. doc: "Returns the result of floating point division of the first input by the second.",
  1559. group: "Math",
  1560. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1561. },
  1562. "%": {
  1563. doc: "Returns the remainder after integer division of the first input by the second.",
  1564. group: "Math",
  1565. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1566. },
  1567. "^": {
  1568. doc: "Returns the result of raising the first input to the power specified by the second.",
  1569. group: "Math",
  1570. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1571. },
  1572. sqrt: {
  1573. doc: "Returns the square root of the input.",
  1574. group: "Math",
  1575. "sdk-support": {"basic functionality": {js: "0.42.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1576. },
  1577. log10: {
  1578. doc: "Returns the base-ten logarithm of the input.",
  1579. group: "Math",
  1580. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1581. },
  1582. ln: {
  1583. doc: "Returns the natural logarithm of the input.",
  1584. group: "Math",
  1585. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1586. },
  1587. log2: {
  1588. doc: "Returns the base-two logarithm of the input.",
  1589. group: "Math",
  1590. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1591. },
  1592. sin: {
  1593. doc: "Returns the sine of the input.",
  1594. group: "Math",
  1595. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1596. },
  1597. cos: {
  1598. doc: "Returns the cosine of the input.",
  1599. group: "Math",
  1600. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1601. },
  1602. tan: {
  1603. doc: "Returns the tangent of the input.",
  1604. group: "Math",
  1605. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1606. },
  1607. asin: {
  1608. doc: "Returns the arcsine of the input.",
  1609. group: "Math",
  1610. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1611. },
  1612. acos: {
  1613. doc: "Returns the arccosine of the input.",
  1614. group: "Math",
  1615. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1616. },
  1617. atan: {
  1618. doc: "Returns the arctangent of the input.",
  1619. group: "Math",
  1620. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1621. },
  1622. min: {
  1623. doc: "Returns the minimum value of the inputs.",
  1624. group: "Math",
  1625. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1626. },
  1627. max: {
  1628. doc: "Returns the maximum value of the inputs.",
  1629. group: "Math",
  1630. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1631. },
  1632. round: {
  1633. doc: 'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',
  1634. group: "Math",
  1635. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1636. },
  1637. abs: {
  1638. doc: "Returns the absolute value of the input.",
  1639. group: "Math",
  1640. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1641. },
  1642. ceil: {
  1643. doc: "Returns the smallest integer that is greater than or equal to the input.",
  1644. group: "Math",
  1645. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1646. },
  1647. floor: {
  1648. doc: "Returns the largest integer that is less than or equal to the input.",
  1649. group: "Math",
  1650. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1651. },
  1652. distance: {
  1653. doc: "Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",
  1654. group: "Math",
  1655. "sdk-support": {"basic functionality": {android: "9.2.0", ios: "5.9.0", macos: "0.16.0"}}
  1656. },
  1657. "==": {
  1658. doc: "Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
  1659. group: "Decision",
  1660. "sdk-support": {
  1661. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  1662. collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
  1663. }
  1664. },
  1665. "!=": {
  1666. doc: "Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
  1667. group: "Decision",
  1668. "sdk-support": {
  1669. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  1670. collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
  1671. }
  1672. },
  1673. ">": {
  1674. doc: "Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
  1675. group: "Decision",
  1676. "sdk-support": {
  1677. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  1678. collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
  1679. }
  1680. },
  1681. "<": {
  1682. doc: "Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
  1683. group: "Decision",
  1684. "sdk-support": {
  1685. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  1686. collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
  1687. }
  1688. },
  1689. ">=": {
  1690. doc: "Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
  1691. group: "Decision",
  1692. "sdk-support": {
  1693. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  1694. collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
  1695. }
  1696. },
  1697. "<=": {
  1698. doc: "Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",
  1699. group: "Decision",
  1700. "sdk-support": {
  1701. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  1702. collator: {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}
  1703. }
  1704. },
  1705. all: {
  1706. doc: "Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",
  1707. group: "Decision",
  1708. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1709. },
  1710. any: {
  1711. doc: "Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",
  1712. group: "Decision",
  1713. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1714. },
  1715. "!": {
  1716. doc: "Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",
  1717. group: "Decision",
  1718. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1719. },
  1720. within: {
  1721. doc: "Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",
  1722. group: "Decision",
  1723. "sdk-support": {"basic functionality": {js: "1.9.0", android: "9.1.0", ios: "5.8.0", macos: "0.15.0"}}
  1724. },
  1725. "is-supported-script": {
  1726. doc: "Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",
  1727. group: "String",
  1728. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.6.0"}}
  1729. },
  1730. upcase: {
  1731. doc: "Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",
  1732. group: "String",
  1733. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1734. },
  1735. downcase: {
  1736. doc: "Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",
  1737. group: "String",
  1738. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1739. },
  1740. concat: {
  1741. doc: "Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",
  1742. group: "String",
  1743. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}}
  1744. },
  1745. "resolved-locale": {
  1746. doc: "Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",
  1747. group: "String",
  1748. "sdk-support": {"basic functionality": {js: "0.45.0", android: "6.5.0", ios: "4.2.0", macos: "0.9.0"}}
  1749. }
  1750. }
  1751. },
  1752. light: {
  1753. anchor: {
  1754. type: "enum",
  1755. default: "viewport",
  1756. values: {
  1757. map: {doc: "The position of the light source is aligned to the rotation of the map."},
  1758. viewport: {doc: "The position of the light source is aligned to the rotation of the viewport."}
  1759. },
  1760. "property-type": "data-constant",
  1761. transition: !1,
  1762. expression: {interpolated: !1, parameters: ["zoom"]},
  1763. doc: "Whether extruded geometries are lit relative to the map or viewport.",
  1764. example: "map",
  1765. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}}
  1766. },
  1767. position: {
  1768. type: "array",
  1769. default: [1.15, 210, 30],
  1770. length: 3,
  1771. value: "number",
  1772. "property-type": "data-constant",
  1773. transition: !0,
  1774. expression: {interpolated: !0, parameters: ["zoom"]},
  1775. doc: "Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",
  1776. example: [1.5, 90, 80],
  1777. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}}
  1778. },
  1779. color: {
  1780. type: "color",
  1781. "property-type": "data-constant",
  1782. default: "#ffffff",
  1783. expression: {interpolated: !0, parameters: ["zoom"]},
  1784. transition: !0,
  1785. doc: "Color tint for lighting extruded geometries.",
  1786. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}}
  1787. },
  1788. intensity: {
  1789. type: "number",
  1790. "property-type": "data-constant",
  1791. default: .5,
  1792. minimum: 0,
  1793. maximum: 1,
  1794. expression: {interpolated: !0, parameters: ["zoom"]},
  1795. transition: !0,
  1796. doc: "Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.",
  1797. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}}
  1798. }
  1799. },
  1800. terrain: {
  1801. source: {
  1802. type: "string",
  1803. doc: "Name of a source of `raster_dem` type to be used for terrain elevation.",
  1804. required: !0
  1805. },
  1806. exaggeration: {
  1807. type: "number",
  1808. "property-type": "data-constant",
  1809. default: 1,
  1810. minimum: 0,
  1811. maximum: 1e3,
  1812. expression: {interpolated: !0, parameters: ["zoom"]},
  1813. transition: !0,
  1814. doc: "Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",
  1815. "sdk-support": {"basic functionality": {js: "2.0.0"}}
  1816. }
  1817. },
  1818. paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background", "paint_sky"],
  1819. paint_fill: {
  1820. "fill-antialias": {
  1821. type: "boolean",
  1822. default: !0,
  1823. doc: "Whether or not the fill should be antialiased.",
  1824. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1825. expression: {interpolated: !1, parameters: ["zoom"]},
  1826. "property-type": "data-constant"
  1827. },
  1828. "fill-opacity": {
  1829. type: "number",
  1830. default: 1,
  1831. minimum: 0,
  1832. maximum: 1,
  1833. doc: "The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",
  1834. transition: !0,
  1835. "sdk-support": {
  1836. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1837. "data-driven styling": {js: "0.21.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  1838. },
  1839. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  1840. "property-type": "data-driven"
  1841. },
  1842. "fill-color": {
  1843. type: "color",
  1844. default: "#000000",
  1845. doc: "The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",
  1846. transition: !0,
  1847. requires: [{"!": "fill-pattern"}],
  1848. "sdk-support": {
  1849. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1850. "data-driven styling": {js: "0.19.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  1851. },
  1852. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  1853. "property-type": "data-driven"
  1854. },
  1855. "fill-outline-color": {
  1856. type: "color",
  1857. doc: "The outline color of the fill. Matches the value of `fill-color` if unspecified.",
  1858. transition: !0,
  1859. requires: [{"!": "fill-pattern"}, {"fill-antialias": !0}],
  1860. "sdk-support": {
  1861. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1862. "data-driven styling": {js: "0.19.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  1863. },
  1864. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  1865. "property-type": "data-driven"
  1866. },
  1867. "fill-translate": {
  1868. type: "array",
  1869. value: "number",
  1870. length: 2,
  1871. default: [0, 0],
  1872. transition: !0,
  1873. units: "pixels",
  1874. doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
  1875. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1876. expression: {interpolated: !0, parameters: ["zoom"]},
  1877. "property-type": "data-constant"
  1878. },
  1879. "fill-translate-anchor": {
  1880. type: "enum",
  1881. values: {
  1882. map: {doc: "The fill is translated relative to the map."},
  1883. viewport: {doc: "The fill is translated relative to the viewport."}
  1884. },
  1885. doc: "Controls the frame of reference for `fill-translate`.",
  1886. default: "map",
  1887. requires: ["fill-translate"],
  1888. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  1889. expression: {interpolated: !1, parameters: ["zoom"]},
  1890. "property-type": "data-constant"
  1891. },
  1892. "fill-pattern": {
  1893. type: "resolvedImage",
  1894. transition: !0,
  1895. doc: "Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
  1896. "sdk-support": {
  1897. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  1898. "data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
  1899. },
  1900. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  1901. "property-type": "cross-faded-data-driven"
  1902. }
  1903. },
  1904. "paint_fill-extrusion": {
  1905. "fill-extrusion-opacity": {
  1906. type: "number",
  1907. default: 1,
  1908. minimum: 0,
  1909. maximum: 1,
  1910. doc: "The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",
  1911. transition: !0,
  1912. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}},
  1913. expression: {interpolated: !0, parameters: ["zoom"]},
  1914. "property-type": "data-constant"
  1915. },
  1916. "fill-extrusion-color": {
  1917. type: "color",
  1918. default: "#000000",
  1919. doc: "The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",
  1920. transition: !0,
  1921. requires: [{"!": "fill-extrusion-pattern"}],
  1922. "sdk-support": {
  1923. "basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"},
  1924. "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  1925. },
  1926. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  1927. "property-type": "data-driven"
  1928. },
  1929. "fill-extrusion-translate": {
  1930. type: "array",
  1931. value: "number",
  1932. length: 2,
  1933. default: [0, 0],
  1934. transition: !0,
  1935. units: "pixels",
  1936. doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.",
  1937. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}},
  1938. expression: {interpolated: !0, parameters: ["zoom"]},
  1939. "property-type": "data-constant"
  1940. },
  1941. "fill-extrusion-translate-anchor": {
  1942. type: "enum",
  1943. values: {
  1944. map: {doc: "The fill extrusion is translated relative to the map."},
  1945. viewport: {doc: "The fill extrusion is translated relative to the viewport."}
  1946. },
  1947. doc: "Controls the frame of reference for `fill-extrusion-translate`.",
  1948. default: "map",
  1949. requires: ["fill-extrusion-translate"],
  1950. "sdk-support": {"basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}},
  1951. expression: {interpolated: !1, parameters: ["zoom"]},
  1952. "property-type": "data-constant"
  1953. },
  1954. "fill-extrusion-pattern": {
  1955. type: "resolvedImage",
  1956. transition: !0,
  1957. doc: "Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
  1958. "sdk-support": {
  1959. "basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"},
  1960. "data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
  1961. },
  1962. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  1963. "property-type": "cross-faded-data-driven"
  1964. },
  1965. "fill-extrusion-height": {
  1966. type: "number",
  1967. default: 0,
  1968. minimum: 0,
  1969. units: "meters",
  1970. doc: "The height with which to extrude this layer.",
  1971. transition: !0,
  1972. "sdk-support": {
  1973. "basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"},
  1974. "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  1975. },
  1976. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  1977. "property-type": "data-driven"
  1978. },
  1979. "fill-extrusion-base": {
  1980. type: "number",
  1981. default: 0,
  1982. minimum: 0,
  1983. units: "meters",
  1984. doc: "The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",
  1985. transition: !0,
  1986. requires: ["fill-extrusion-height"],
  1987. "sdk-support": {
  1988. "basic functionality": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"},
  1989. "data-driven styling": {js: "0.27.0", android: "5.1.0", ios: "3.6.0", macos: "0.5.0"}
  1990. },
  1991. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  1992. "property-type": "data-driven"
  1993. },
  1994. "fill-extrusion-vertical-gradient": {
  1995. type: "boolean",
  1996. default: !0,
  1997. doc: "Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",
  1998. transition: !1,
  1999. "sdk-support": {"basic functionality": {js: "0.50.0", ios: "4.7.0", macos: "0.13.0"}},
  2000. expression: {interpolated: !1, parameters: ["zoom"]},
  2001. "property-type": "data-constant"
  2002. }
  2003. },
  2004. paint_line: {
  2005. "line-opacity": {
  2006. type: "number",
  2007. doc: "The opacity at which the line will be drawn.",
  2008. default: 1,
  2009. minimum: 0,
  2010. maximum: 1,
  2011. transition: !0,
  2012. "sdk-support": {
  2013. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2014. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2015. },
  2016. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2017. "property-type": "data-driven"
  2018. },
  2019. "line-color": {
  2020. type: "color",
  2021. doc: "The color with which the line will be drawn.",
  2022. default: "#000000",
  2023. transition: !0,
  2024. requires: [{"!": "line-pattern"}],
  2025. "sdk-support": {
  2026. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2027. "data-driven styling": {js: "0.23.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2028. },
  2029. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2030. "property-type": "data-driven"
  2031. },
  2032. "line-translate": {
  2033. type: "array",
  2034. value: "number",
  2035. length: 2,
  2036. default: [0, 0],
  2037. transition: !0,
  2038. units: "pixels",
  2039. doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
  2040. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2041. expression: {interpolated: !0, parameters: ["zoom"]},
  2042. "property-type": "data-constant"
  2043. },
  2044. "line-translate-anchor": {
  2045. type: "enum",
  2046. values: {
  2047. map: {doc: "The line is translated relative to the map."},
  2048. viewport: {doc: "The line is translated relative to the viewport."}
  2049. },
  2050. doc: "Controls the frame of reference for `line-translate`.",
  2051. default: "map",
  2052. requires: ["line-translate"],
  2053. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2054. expression: {interpolated: !1, parameters: ["zoom"]},
  2055. "property-type": "data-constant"
  2056. },
  2057. "line-width": {
  2058. type: "number",
  2059. default: 1,
  2060. minimum: 0,
  2061. transition: !0,
  2062. units: "pixels",
  2063. doc: "Stroke thickness.",
  2064. "sdk-support": {
  2065. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2066. "data-driven styling": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}
  2067. },
  2068. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2069. "property-type": "data-driven"
  2070. },
  2071. "line-gap-width": {
  2072. type: "number",
  2073. default: 0,
  2074. minimum: 0,
  2075. doc: "Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",
  2076. transition: !0,
  2077. units: "pixels",
  2078. "sdk-support": {
  2079. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2080. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2081. },
  2082. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2083. "property-type": "data-driven"
  2084. },
  2085. "line-offset": {
  2086. type: "number",
  2087. default: 0,
  2088. doc: "The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",
  2089. transition: !0,
  2090. units: "pixels",
  2091. "sdk-support": {
  2092. "basic functionality": {js: "0.12.1", android: "3.0.0", ios: "3.1.0", macos: "0.1.0"},
  2093. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2094. },
  2095. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2096. "property-type": "data-driven"
  2097. },
  2098. "line-blur": {
  2099. type: "number",
  2100. default: 0,
  2101. minimum: 0,
  2102. transition: !0,
  2103. units: "pixels",
  2104. doc: "Blur applied to the line, in pixels.",
  2105. "sdk-support": {
  2106. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2107. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2108. },
  2109. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2110. "property-type": "data-driven"
  2111. },
  2112. "line-dasharray": {
  2113. type: "array",
  2114. value: "number",
  2115. doc: "Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
  2116. minimum: 0,
  2117. transition: !0,
  2118. units: "line widths",
  2119. requires: [{"!": "line-pattern"}],
  2120. "sdk-support": {
  2121. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2122. "data-driven styling": {}
  2123. },
  2124. expression: {interpolated: !1, parameters: ["zoom"]},
  2125. "property-type": "cross-faded"
  2126. },
  2127. "line-pattern": {
  2128. type: "resolvedImage",
  2129. transition: !0,
  2130. doc: "Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
  2131. "sdk-support": {
  2132. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2133. "data-driven styling": {js: "0.49.0", android: "6.5.0", macos: "0.11.0", ios: "4.4.0"}
  2134. },
  2135. expression: {interpolated: !1, parameters: ["zoom", "feature"]},
  2136. "property-type": "cross-faded-data-driven"
  2137. },
  2138. "line-gradient": {
  2139. type: "color",
  2140. doc: 'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',
  2141. transition: !1,
  2142. requires: [{"!": "line-dasharray"}, {"!": "line-pattern"}, {source: "geojson", has: {lineMetrics: !0}}],
  2143. "sdk-support": {
  2144. "basic functionality": {js: "0.45.0", android: "6.5.0", ios: "4.4.0", macos: "0.11.0"},
  2145. "data-driven styling": {}
  2146. },
  2147. expression: {interpolated: !0, parameters: ["line-progress"]},
  2148. "property-type": "color-ramp"
  2149. }
  2150. },
  2151. paint_circle: {
  2152. "circle-radius": {
  2153. type: "number",
  2154. default: 5,
  2155. minimum: 0,
  2156. transition: !0,
  2157. units: "pixels",
  2158. doc: "Circle radius.",
  2159. "sdk-support": {
  2160. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2161. "data-driven styling": {js: "0.18.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2162. },
  2163. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2164. "property-type": "data-driven"
  2165. },
  2166. "circle-color": {
  2167. type: "color",
  2168. default: "#000000",
  2169. doc: "The fill color of the circle.",
  2170. transition: !0,
  2171. "sdk-support": {
  2172. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2173. "data-driven styling": {js: "0.18.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2174. },
  2175. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2176. "property-type": "data-driven"
  2177. },
  2178. "circle-blur": {
  2179. type: "number",
  2180. default: 0,
  2181. doc: "Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",
  2182. transition: !0,
  2183. "sdk-support": {
  2184. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2185. "data-driven styling": {js: "0.20.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2186. },
  2187. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2188. "property-type": "data-driven"
  2189. },
  2190. "circle-opacity": {
  2191. type: "number",
  2192. doc: "The opacity at which the circle will be drawn.",
  2193. default: 1,
  2194. minimum: 0,
  2195. maximum: 1,
  2196. transition: !0,
  2197. "sdk-support": {
  2198. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2199. "data-driven styling": {js: "0.20.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2200. },
  2201. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2202. "property-type": "data-driven"
  2203. },
  2204. "circle-translate": {
  2205. type: "array",
  2206. value: "number",
  2207. length: 2,
  2208. default: [0, 0],
  2209. transition: !0,
  2210. units: "pixels",
  2211. doc: "The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.",
  2212. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2213. expression: {interpolated: !0, parameters: ["zoom"]},
  2214. "property-type": "data-constant"
  2215. },
  2216. "circle-translate-anchor": {
  2217. type: "enum",
  2218. values: {
  2219. map: {doc: "The circle is translated relative to the map."},
  2220. viewport: {doc: "The circle is translated relative to the viewport."}
  2221. },
  2222. doc: "Controls the frame of reference for `circle-translate`.",
  2223. default: "map",
  2224. requires: ["circle-translate"],
  2225. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2226. expression: {interpolated: !1, parameters: ["zoom"]},
  2227. "property-type": "data-constant"
  2228. },
  2229. "circle-pitch-scale": {
  2230. type: "enum",
  2231. values: {
  2232. map: {doc: "Circles are scaled according to their apparent distance to the camera."},
  2233. viewport: {doc: "Circles are not scaled."}
  2234. },
  2235. default: "map",
  2236. doc: "Controls the scaling behavior of the circle when the map is pitched.",
  2237. "sdk-support": {"basic functionality": {js: "0.21.0", android: "4.2.0", ios: "3.4.0", macos: "0.2.1"}},
  2238. expression: {interpolated: !1, parameters: ["zoom"]},
  2239. "property-type": "data-constant"
  2240. },
  2241. "circle-pitch-alignment": {
  2242. type: "enum",
  2243. values: {
  2244. map: {doc: "The circle is aligned to the plane of the map."},
  2245. viewport: {doc: "The circle is aligned to the plane of the viewport."}
  2246. },
  2247. default: "viewport",
  2248. doc: "Orientation of circle when map is pitched.",
  2249. "sdk-support": {"basic functionality": {js: "0.39.0", android: "5.2.0", ios: "3.7.0", macos: "0.6.0"}},
  2250. expression: {interpolated: !1, parameters: ["zoom"]},
  2251. "property-type": "data-constant"
  2252. },
  2253. "circle-stroke-width": {
  2254. type: "number",
  2255. default: 0,
  2256. minimum: 0,
  2257. transition: !0,
  2258. units: "pixels",
  2259. doc: "The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.",
  2260. "sdk-support": {
  2261. "basic functionality": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"},
  2262. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2263. },
  2264. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2265. "property-type": "data-driven"
  2266. },
  2267. "circle-stroke-color": {
  2268. type: "color",
  2269. default: "#000000",
  2270. doc: "The stroke color of the circle.",
  2271. transition: !0,
  2272. "sdk-support": {
  2273. "basic functionality": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"},
  2274. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2275. },
  2276. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2277. "property-type": "data-driven"
  2278. },
  2279. "circle-stroke-opacity": {
  2280. type: "number",
  2281. doc: "The opacity of the circle's stroke.",
  2282. default: 1,
  2283. minimum: 0,
  2284. maximum: 1,
  2285. transition: !0,
  2286. "sdk-support": {
  2287. "basic functionality": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"},
  2288. "data-driven styling": {js: "0.29.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2289. },
  2290. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2291. "property-type": "data-driven"
  2292. }
  2293. },
  2294. paint_heatmap: {
  2295. "heatmap-radius": {
  2296. type: "number",
  2297. default: 30,
  2298. minimum: 1,
  2299. transition: !0,
  2300. units: "pixels",
  2301. doc: "Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.",
  2302. "sdk-support": {
  2303. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  2304. "data-driven styling": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
  2305. },
  2306. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2307. "property-type": "data-driven"
  2308. },
  2309. "heatmap-weight": {
  2310. type: "number",
  2311. default: 1,
  2312. minimum: 0,
  2313. transition: !1,
  2314. doc: "A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.",
  2315. "sdk-support": {
  2316. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  2317. "data-driven styling": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}
  2318. },
  2319. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2320. "property-type": "data-driven"
  2321. },
  2322. "heatmap-intensity": {
  2323. type: "number",
  2324. default: 1,
  2325. minimum: 0,
  2326. transition: !0,
  2327. doc: "Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.",
  2328. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2329. expression: {interpolated: !0, parameters: ["zoom"]},
  2330. "property-type": "data-constant"
  2331. },
  2332. "heatmap-color": {
  2333. type: "color",
  2334. default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", .1, "royalblue", .3, "cyan", .5, "lime", .7, "yellow", 1, "red"],
  2335. doc: 'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',
  2336. transition: !1,
  2337. "sdk-support": {
  2338. "basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"},
  2339. "data-driven styling": {}
  2340. },
  2341. expression: {interpolated: !0, parameters: ["heatmap-density"]},
  2342. "property-type": "color-ramp"
  2343. },
  2344. "heatmap-opacity": {
  2345. type: "number",
  2346. doc: "The global opacity at which the heatmap layer will be drawn.",
  2347. default: 1,
  2348. minimum: 0,
  2349. maximum: 1,
  2350. transition: !0,
  2351. "sdk-support": {"basic functionality": {js: "0.41.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2352. expression: {interpolated: !0, parameters: ["zoom"]},
  2353. "property-type": "data-constant"
  2354. }
  2355. },
  2356. paint_symbol: {
  2357. "icon-opacity": {
  2358. doc: "The opacity at which the icon will be drawn.",
  2359. type: "number",
  2360. default: 1,
  2361. minimum: 0,
  2362. maximum: 1,
  2363. transition: !0,
  2364. requires: ["icon-image"],
  2365. "sdk-support": {
  2366. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2367. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2368. },
  2369. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2370. "property-type": "data-driven"
  2371. },
  2372. "icon-color": {
  2373. type: "color",
  2374. default: "#000000",
  2375. transition: !0,
  2376. doc: "The color of the icon. This can only be used with sdf icons.",
  2377. requires: ["icon-image"],
  2378. "sdk-support": {
  2379. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2380. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2381. },
  2382. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2383. "property-type": "data-driven"
  2384. },
  2385. "icon-halo-color": {
  2386. type: "color",
  2387. default: "rgba(0, 0, 0, 0)",
  2388. transition: !0,
  2389. doc: "The color of the icon's halo. Icon halos can only be used with SDF icons.",
  2390. requires: ["icon-image"],
  2391. "sdk-support": {
  2392. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2393. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2394. },
  2395. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2396. "property-type": "data-driven"
  2397. },
  2398. "icon-halo-width": {
  2399. type: "number",
  2400. default: 0,
  2401. minimum: 0,
  2402. transition: !0,
  2403. units: "pixels",
  2404. doc: "Distance of halo to the icon outline.",
  2405. requires: ["icon-image"],
  2406. "sdk-support": {
  2407. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2408. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2409. },
  2410. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2411. "property-type": "data-driven"
  2412. },
  2413. "icon-halo-blur": {
  2414. type: "number",
  2415. default: 0,
  2416. minimum: 0,
  2417. transition: !0,
  2418. units: "pixels",
  2419. doc: "Fade out the halo towards the outside.",
  2420. requires: ["icon-image"],
  2421. "sdk-support": {
  2422. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2423. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2424. },
  2425. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2426. "property-type": "data-driven"
  2427. },
  2428. "icon-translate": {
  2429. type: "array",
  2430. value: "number",
  2431. length: 2,
  2432. default: [0, 0],
  2433. transition: !0,
  2434. units: "pixels",
  2435. doc: "Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",
  2436. requires: ["icon-image"],
  2437. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2438. expression: {interpolated: !0, parameters: ["zoom"]},
  2439. "property-type": "data-constant"
  2440. },
  2441. "icon-translate-anchor": {
  2442. type: "enum",
  2443. values: {
  2444. map: {doc: "Icons are translated relative to the map."},
  2445. viewport: {doc: "Icons are translated relative to the viewport."}
  2446. },
  2447. doc: "Controls the frame of reference for `icon-translate`.",
  2448. default: "map",
  2449. requires: ["icon-image", "icon-translate"],
  2450. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2451. expression: {interpolated: !1, parameters: ["zoom"]},
  2452. "property-type": "data-constant"
  2453. },
  2454. "text-opacity": {
  2455. type: "number",
  2456. doc: "The opacity at which the text will be drawn.",
  2457. default: 1,
  2458. minimum: 0,
  2459. maximum: 1,
  2460. transition: !0,
  2461. requires: ["text-field"],
  2462. "sdk-support": {
  2463. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2464. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2465. },
  2466. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2467. "property-type": "data-driven"
  2468. },
  2469. "text-color": {
  2470. type: "color",
  2471. doc: "The color with which the text will be drawn.",
  2472. default: "#000000",
  2473. transition: !0,
  2474. overridable: !0,
  2475. requires: ["text-field"],
  2476. "sdk-support": {
  2477. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2478. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2479. },
  2480. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2481. "property-type": "data-driven"
  2482. },
  2483. "text-halo-color": {
  2484. type: "color",
  2485. default: "rgba(0, 0, 0, 0)",
  2486. transition: !0,
  2487. doc: "The color of the text's halo, which helps it stand out from backgrounds.",
  2488. requires: ["text-field"],
  2489. "sdk-support": {
  2490. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2491. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2492. },
  2493. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2494. "property-type": "data-driven"
  2495. },
  2496. "text-halo-width": {
  2497. type: "number",
  2498. default: 0,
  2499. minimum: 0,
  2500. transition: !0,
  2501. units: "pixels",
  2502. doc: "Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",
  2503. requires: ["text-field"],
  2504. "sdk-support": {
  2505. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2506. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2507. },
  2508. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2509. "property-type": "data-driven"
  2510. },
  2511. "text-halo-blur": {
  2512. type: "number",
  2513. default: 0,
  2514. minimum: 0,
  2515. transition: !0,
  2516. units: "pixels",
  2517. doc: "The halo's fadeout distance towards the outside.",
  2518. requires: ["text-field"],
  2519. "sdk-support": {
  2520. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2521. "data-driven styling": {js: "0.33.0", android: "5.0.0", ios: "3.5.0", macos: "0.4.0"}
  2522. },
  2523. expression: {interpolated: !0, parameters: ["zoom", "feature", "feature-state"]},
  2524. "property-type": "data-driven"
  2525. },
  2526. "text-translate": {
  2527. type: "array",
  2528. value: "number",
  2529. length: 2,
  2530. default: [0, 0],
  2531. transition: !0,
  2532. units: "pixels",
  2533. doc: "Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",
  2534. requires: ["text-field"],
  2535. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2536. expression: {interpolated: !0, parameters: ["zoom"]},
  2537. "property-type": "data-constant"
  2538. },
  2539. "text-translate-anchor": {
  2540. type: "enum",
  2541. values: {
  2542. map: {doc: "The text is translated relative to the map."},
  2543. viewport: {doc: "The text is translated relative to the viewport."}
  2544. },
  2545. doc: "Controls the frame of reference for `text-translate`.",
  2546. default: "map",
  2547. requires: ["text-field", "text-translate"],
  2548. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2549. expression: {interpolated: !1, parameters: ["zoom"]},
  2550. "property-type": "data-constant"
  2551. }
  2552. },
  2553. paint_raster: {
  2554. "raster-opacity": {
  2555. type: "number",
  2556. doc: "The opacity at which the image will be drawn.",
  2557. default: 1,
  2558. minimum: 0,
  2559. maximum: 1,
  2560. transition: !0,
  2561. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2562. expression: {interpolated: !0, parameters: ["zoom"]},
  2563. "property-type": "data-constant"
  2564. },
  2565. "raster-hue-rotate": {
  2566. type: "number",
  2567. default: 0,
  2568. period: 360,
  2569. transition: !0,
  2570. units: "degrees",
  2571. doc: "Rotates hues around the color wheel.",
  2572. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2573. expression: {interpolated: !0, parameters: ["zoom"]},
  2574. "property-type": "data-constant"
  2575. },
  2576. "raster-brightness-min": {
  2577. type: "number",
  2578. doc: "Increase or reduce the brightness of the image. The value is the minimum brightness.",
  2579. default: 0,
  2580. minimum: 0,
  2581. maximum: 1,
  2582. transition: !0,
  2583. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2584. expression: {interpolated: !0, parameters: ["zoom"]},
  2585. "property-type": "data-constant"
  2586. },
  2587. "raster-brightness-max": {
  2588. type: "number",
  2589. doc: "Increase or reduce the brightness of the image. The value is the maximum brightness.",
  2590. default: 1,
  2591. minimum: 0,
  2592. maximum: 1,
  2593. transition: !0,
  2594. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2595. expression: {interpolated: !0, parameters: ["zoom"]},
  2596. "property-type": "data-constant"
  2597. },
  2598. "raster-saturation": {
  2599. type: "number",
  2600. doc: "Increase or reduce the saturation of the image.",
  2601. default: 0,
  2602. minimum: -1,
  2603. maximum: 1,
  2604. transition: !0,
  2605. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2606. expression: {interpolated: !0, parameters: ["zoom"]},
  2607. "property-type": "data-constant"
  2608. },
  2609. "raster-contrast": {
  2610. type: "number",
  2611. doc: "Increase or reduce the contrast of the image.",
  2612. default: 0,
  2613. minimum: -1,
  2614. maximum: 1,
  2615. transition: !0,
  2616. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2617. expression: {interpolated: !0, parameters: ["zoom"]},
  2618. "property-type": "data-constant"
  2619. },
  2620. "raster-resampling": {
  2621. type: "enum",
  2622. doc: "The resampling/interpolation method to use for overscaling, also known as texture magnification filter",
  2623. values: {
  2624. linear: {doc: "(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},
  2625. nearest: {doc: "Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}
  2626. },
  2627. default: "linear",
  2628. "sdk-support": {"basic functionality": {js: "0.47.0", android: "6.3.0", ios: "4.2.0", macos: "0.9.0"}},
  2629. expression: {interpolated: !1, parameters: ["zoom"]},
  2630. "property-type": "data-constant"
  2631. },
  2632. "raster-fade-duration": {
  2633. type: "number",
  2634. default: 300,
  2635. minimum: 0,
  2636. transition: !1,
  2637. units: "milliseconds",
  2638. doc: "Fade duration when a new tile is added.",
  2639. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2640. expression: {interpolated: !0, parameters: ["zoom"]},
  2641. "property-type": "data-constant"
  2642. }
  2643. },
  2644. paint_hillshade: {
  2645. "hillshade-illumination-direction": {
  2646. type: "number",
  2647. default: 335,
  2648. minimum: 0,
  2649. maximum: 359,
  2650. doc: "The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",
  2651. transition: !1,
  2652. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2653. expression: {interpolated: !0, parameters: ["zoom"]},
  2654. "property-type": "data-constant"
  2655. },
  2656. "hillshade-illumination-anchor": {
  2657. type: "enum",
  2658. values: {
  2659. map: {doc: "The hillshade illumination is relative to the north direction."},
  2660. viewport: {doc: "The hillshade illumination is relative to the top of the viewport."}
  2661. },
  2662. default: "viewport",
  2663. doc: "Direction of light source when map is rotated.",
  2664. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2665. expression: {interpolated: !1, parameters: ["zoom"]},
  2666. "property-type": "data-constant"
  2667. },
  2668. "hillshade-exaggeration": {
  2669. type: "number",
  2670. doc: "Intensity of the hillshade",
  2671. default: .5,
  2672. minimum: 0,
  2673. maximum: 1,
  2674. transition: !0,
  2675. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2676. expression: {interpolated: !0, parameters: ["zoom"]},
  2677. "property-type": "data-constant"
  2678. },
  2679. "hillshade-shadow-color": {
  2680. type: "color",
  2681. default: "#000000",
  2682. doc: "The shading color of areas that face away from the light source.",
  2683. transition: !0,
  2684. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2685. expression: {interpolated: !0, parameters: ["zoom"]},
  2686. "property-type": "data-constant"
  2687. },
  2688. "hillshade-highlight-color": {
  2689. type: "color",
  2690. default: "#FFFFFF",
  2691. doc: "The shading color of areas that faces towards the light source.",
  2692. transition: !0,
  2693. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2694. expression: {interpolated: !0, parameters: ["zoom"]},
  2695. "property-type": "data-constant"
  2696. },
  2697. "hillshade-accent-color": {
  2698. type: "color",
  2699. default: "#000000",
  2700. doc: "The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",
  2701. transition: !0,
  2702. "sdk-support": {"basic functionality": {js: "0.43.0", android: "6.0.0", ios: "4.0.0", macos: "0.7.0"}},
  2703. expression: {interpolated: !0, parameters: ["zoom"]},
  2704. "property-type": "data-constant"
  2705. }
  2706. },
  2707. paint_background: {
  2708. "background-color": {
  2709. type: "color",
  2710. default: "#000000",
  2711. doc: "The color with which the background will be drawn.",
  2712. transition: !0,
  2713. requires: [{"!": "background-pattern"}],
  2714. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2715. expression: {interpolated: !0, parameters: ["zoom"]},
  2716. "property-type": "data-constant"
  2717. },
  2718. "background-pattern": {
  2719. type: "resolvedImage",
  2720. transition: !0,
  2721. doc: "Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.",
  2722. "sdk-support": {
  2723. "basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"},
  2724. "data-driven styling": {}
  2725. },
  2726. expression: {interpolated: !1, parameters: ["zoom"]},
  2727. "property-type": "cross-faded"
  2728. },
  2729. "background-opacity": {
  2730. type: "number",
  2731. default: 1,
  2732. minimum: 0,
  2733. maximum: 1,
  2734. doc: "The opacity at which the background will be drawn.",
  2735. transition: !0,
  2736. "sdk-support": {"basic functionality": {js: "0.10.0", android: "2.0.1", ios: "2.0.0", macos: "0.1.0"}},
  2737. expression: {interpolated: !0, parameters: ["zoom"]},
  2738. "property-type": "data-constant"
  2739. }
  2740. },
  2741. paint_sky: {
  2742. "sky-type": {
  2743. type: "enum",
  2744. values: {
  2745. gradient: {doc: "Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},
  2746. atmosphere: {doc: "Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}
  2747. },
  2748. default: "atmosphere",
  2749. doc: "The type of the sky",
  2750. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2751. expression: {interpolated: !1, parameters: ["zoom"]},
  2752. "property-type": "data-constant"
  2753. },
  2754. "sky-atmosphere-sun": {
  2755. type: "array",
  2756. value: "number",
  2757. length: 2,
  2758. transition: !1,
  2759. doc: "Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.",
  2760. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2761. requires: [{"sky-type": "atmosphere"}],
  2762. expression: {interpolated: !1, parameters: ["zoom"]},
  2763. "property-type": "data-constant"
  2764. },
  2765. "sky-atmosphere-sun-intensity": {
  2766. type: "number",
  2767. requires: [{"sky-type": "atmosphere"}],
  2768. default: 10,
  2769. minimum: 0,
  2770. maximum: 100,
  2771. transition: !1,
  2772. doc: "Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.",
  2773. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2774. "property-type": "data-constant"
  2775. },
  2776. "sky-gradient-center": {
  2777. type: "array",
  2778. requires: [{"sky-type": "gradient"}],
  2779. value: "number",
  2780. default: [0, 0],
  2781. length: 2,
  2782. transition: !1,
  2783. doc: "Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.",
  2784. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2785. expression: {interpolated: !1, parameters: ["zoom"]},
  2786. "property-type": "data-constant"
  2787. },
  2788. "sky-gradient-radius": {
  2789. type: "number",
  2790. requires: [{"sky-type": "gradient"}],
  2791. default: 90,
  2792. minimum: 0,
  2793. maximum: 180,
  2794. transition: !1,
  2795. doc: "The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.",
  2796. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2797. expression: {interpolated: !1, parameters: ["zoom"]},
  2798. "property-type": "data-constant"
  2799. },
  2800. "sky-gradient": {
  2801. type: "color",
  2802. default: ["interpolate", ["linear"], ["sky-radial-progress"], .8, "#87ceeb", 1, "white"],
  2803. doc: "Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",
  2804. transition: !1,
  2805. requires: [{"sky-type": "gradient"}],
  2806. "sdk-support": {"basic functionality": {js: "2.0.0"}, "data-driven styling": {}},
  2807. expression: {interpolated: !0, parameters: ["sky-radial-progress"]},
  2808. "property-type": "color-ramp"
  2809. },
  2810. "sky-atmosphere-halo-color": {
  2811. type: "color",
  2812. default: "white",
  2813. doc: "A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",
  2814. transition: !1,
  2815. requires: [{"sky-type": "atmosphere"}],
  2816. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2817. "property-type": "data-constant"
  2818. },
  2819. "sky-atmosphere-color": {
  2820. type: "color",
  2821. default: "white",
  2822. doc: "A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",
  2823. transition: !1,
  2824. requires: [{"sky-type": "atmosphere"}],
  2825. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2826. "property-type": "data-constant"
  2827. },
  2828. "sky-opacity": {
  2829. type: "number",
  2830. default: 1,
  2831. minimum: 0,
  2832. maximum: 1,
  2833. doc: "The opacity of the entire sky layer.",
  2834. transition: !0,
  2835. "sdk-support": {"basic functionality": {js: "2.0.0"}},
  2836. expression: {interpolated: !0, parameters: ["zoom"]},
  2837. "property-type": "data-constant"
  2838. }
  2839. },
  2840. transition: {
  2841. duration: {
  2842. type: "number",
  2843. default: 300,
  2844. minimum: 0,
  2845. units: "milliseconds",
  2846. doc: "Time allotted for transitions to complete."
  2847. },
  2848. delay: {
  2849. type: "number",
  2850. default: 0,
  2851. minimum: 0,
  2852. units: "milliseconds",
  2853. doc: "Length of time before a transition begins."
  2854. }
  2855. },
  2856. "property-type": {
  2857. "data-driven": {
  2858. type: "property-type",
  2859. doc: "Property is interpolable and can be represented using a property expression."
  2860. },
  2861. "cross-faded": {
  2862. type: "property-type",
  2863. doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."
  2864. },
  2865. "cross-faded-data-driven": {
  2866. type: "property-type",
  2867. doc: "Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."
  2868. },
  2869. "color-ramp": {
  2870. type: "property-type",
  2871. doc: "Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."
  2872. },
  2873. "data-constant": {
  2874. type: "property-type",
  2875. doc: "Property is interpolable but cannot be represented using a property expression."
  2876. },
  2877. constant: {type: "property-type", doc: "Property is constant across all zoom levels and property values."}
  2878. },
  2879. promoteId: {"*": {type: "string", doc: "A name of a feature property to use as ID for feature state."}}
  2880. };
  2881. var o = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : void 0 !== t ? t : "undefined" != typeof self ? self : {};
  2882. function a() {
  2883. throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")
  2884. }
  2885. function s(t, e) {
  2886. return t(e = {exports: {}}, e.exports), e.exports
  2887. }
  2888. var l = s((function (t, e) {
  2889. !function (r) {
  2890. var n = e && !e.nodeType && e, i = t && !t.nodeType && t, a = "object" == typeof o && o;
  2891. a.global !== a && a.window !== a && a.self !== a || (r = a);
  2892. var s, l, u = 2147483647, c = /^xn--/, h = /[^\x20-\x7E]/, p = /[\x2E\u3002\uFF0E\uFF61]/g, f = {
  2893. overflow: "Overflow: input needs wider integers to process",
  2894. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  2895. "invalid-input": "Invalid input"
  2896. }, d = Math.floor, g = String.fromCharCode;
  2897. function y(t) {
  2898. throw RangeError(f[t])
  2899. }
  2900. function m(t, e) {
  2901. for (var r = t.length, n = []; r--;) n[r] = e(t[r]);
  2902. return n
  2903. }
  2904. function v(t, e) {
  2905. var r = t.split("@"), n = "";
  2906. return r.length > 1 && (n = r[0] + "@", t = r[1]), n + m((t = t.replace(p, ".")).split("."), e).join(".")
  2907. }
  2908. function _(t) {
  2909. for (var e, r, n = [], i = 0, o = t.length; i < o;) (e = t.charCodeAt(i++)) >= 55296 && e <= 56319 && i < o ? 56320 == (64512 & (r = t.charCodeAt(i++))) ? n.push(((1023 & e) << 10) + (1023 & r) + 65536) : (n.push(e), i--) : n.push(e);
  2910. return n
  2911. }
  2912. function b(t) {
  2913. return m(t, (function (t) {
  2914. var e = "";
  2915. return t > 65535 && (e += g((t -= 65536) >>> 10 & 1023 | 55296), t = 56320 | 1023 & t), e += g(t)
  2916. })).join("")
  2917. }
  2918. function x(t, e) {
  2919. return t + 22 + 75 * (t < 26) - ((0 != e) << 5)
  2920. }
  2921. function w(t, e, r) {
  2922. var n = 0;
  2923. for (t = r ? d(t / 700) : t >> 1, t += d(t / e); t > 455; n += 36) t = d(t / 35);
  2924. return d(n + 36 * t / (t + 38))
  2925. }
  2926. function S(t) {
  2927. var e, r, n, i, o, a, s, l, c, h, p, f = [], g = t.length, m = 0, v = 128, _ = 72;
  2928. for ((r = t.lastIndexOf("-")) < 0 && (r = 0), n = 0; n < r; ++n) t.charCodeAt(n) >= 128 && y("not-basic"), f.push(t.charCodeAt(n));
  2929. for (i = r > 0 ? r + 1 : 0; i < g;) {
  2930. for (o = m, a = 1, s = 36; i >= g && y("invalid-input"), ((l = (p = t.charCodeAt(i++)) - 48 < 10 ? p - 22 : p - 65 < 26 ? p - 65 : p - 97 < 26 ? p - 97 : 36) >= 36 || l > d((u - m) / a)) && y("overflow"), m += l * a, !(l < (c = s <= _ ? 1 : s >= _ + 26 ? 26 : s - _)); s += 36) a > d(u / (h = 36 - c)) && y("overflow"), a *= h;
  2931. _ = w(m - o, e = f.length + 1, 0 == o), d(m / e) > u - v && y("overflow"), v += d(m / e), m %= e, f.splice(m++, 0, v)
  2932. }
  2933. return b(f)
  2934. }
  2935. function E(t) {
  2936. var e, r, n, i, o, a, s, l, c, h, p, f, m, v, b, S = [];
  2937. for (f = (t = _(t)).length, e = 128, r = 0, o = 72, a = 0; a < f; ++a) (p = t[a]) < 128 && S.push(g(p));
  2938. for (n = i = S.length, i && S.push("-"); n < f;) {
  2939. for (s = u, a = 0; a < f; ++a) (p = t[a]) >= e && p < s && (s = p);
  2940. for (s - e > d((u - r) / (m = n + 1)) && y("overflow"), r += (s - e) * m, e = s, a = 0; a < f; ++a) if ((p = t[a]) < e && ++r > u && y("overflow"), p == e) {
  2941. for (l = r, c = 36; !(l < (h = c <= o ? 1 : c >= o + 26 ? 26 : c - o)); c += 36) b = l - h, v = 36 - h, S.push(g(x(h + b % v, 0))), l = d(b / v);
  2942. S.push(g(x(l, 0))), o = w(r, m, n == i), r = 0, ++n
  2943. }
  2944. ++r, ++e
  2945. }
  2946. return S.join("")
  2947. }
  2948. if (s = {
  2949. version: "1.3.2", ucs2: {decode: _, encode: b}, decode: S, encode: E, toASCII: function (t) {
  2950. return v(t, (function (t) {
  2951. return h.test(t) ? "xn--" + E(t) : t
  2952. }))
  2953. }, toUnicode: function (t) {
  2954. return v(t, (function (t) {
  2955. return c.test(t) ? S(t.slice(4).toLowerCase()) : t
  2956. }))
  2957. }
  2958. }, n && i) if (t.exports == n) i.exports = s; else for (l in s) s.hasOwnProperty(l) && (n[l] = s[l]); else r.punycode = s
  2959. }(o)
  2960. })), u = function (t) {
  2961. return "string" == typeof t
  2962. }, c = function (t) {
  2963. return "object" == typeof t && null !== t
  2964. }, h = function (t) {
  2965. return null === t
  2966. }, p = function (t) {
  2967. return null == t
  2968. };
  2969. function f(t, e) {
  2970. return Object.prototype.hasOwnProperty.call(t, e)
  2971. }
  2972. var d = function (t, e, r, n) {
  2973. e = e || "&", r = r || "=";
  2974. var i = {};
  2975. if ("string" != typeof t || 0 === t.length) return i;
  2976. var o = /\+/g;
  2977. t = t.split(e);
  2978. var a = 1e3;
  2979. n && "number" == typeof n.maxKeys && (a = n.maxKeys);
  2980. var s = t.length;
  2981. a > 0 && s > a && (s = a);
  2982. for (var l = 0; l < s; ++l) {
  2983. var u, c, h, p, d = t[l].replace(o, "%20"), g = d.indexOf(r);
  2984. g >= 0 ? (u = d.substr(0, g), c = d.substr(g + 1)) : (u = d, c = ""), h = decodeURIComponent(u), p = decodeURIComponent(c), f(i, h) ? Array.isArray(i[h]) ? i[h].push(p) : i[h] = [i[h], p] : i[h] = p
  2985. }
  2986. return i
  2987. }, g = function (t) {
  2988. switch (typeof t) {
  2989. case"string":
  2990. return t;
  2991. case"boolean":
  2992. return t ? "true" : "false";
  2993. case"number":
  2994. return isFinite(t) ? t : "";
  2995. default:
  2996. return ""
  2997. }
  2998. }, y = function (t, e, r, n) {
  2999. return e = e || "&", r = r || "=", null === t && (t = void 0), "object" == typeof t ? Object.keys(t).map((function (n) {
  3000. var i = encodeURIComponent(g(n)) + r;
  3001. return Array.isArray(t[n]) ? t[n].map((function (t) {
  3002. return i + encodeURIComponent(g(t))
  3003. })).join(e) : i + encodeURIComponent(g(t[n]))
  3004. })).join(e) : n ? encodeURIComponent(g(n)) + r + encodeURIComponent(g(t)) : ""
  3005. }, m = s((function (t, e) {
  3006. e.decode = e.parse = d, e.encode = e.stringify = y
  3007. }));
  3008. m.decode, m.parse, m.encode, m.stringify;
  3009. function v() {
  3010. this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null
  3011. }
  3012. var _ = /^([a-z0-9.+-]+:)/i, b = /:[0-9]*$/, x = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  3013. w = ["{", "}", "|", "\\", "^", "`"].concat(["<", ">", '"', "`", " ", "\r", "\n", "\t"]), S = ["'"].concat(w),
  3014. E = ["%", "/", "?", ";", "#"].concat(S), T = ["/", "?", "#"], C = /^[+a-z0-9A-Z_-]{0,63}$/,
  3015. O = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, P = {javascript: !0, "javascript:": !0},
  3016. R = {javascript: !0, "javascript:": !0}, I = {
  3017. http: !0,
  3018. https: !0,
  3019. ftp: !0,
  3020. gopher: !0,
  3021. file: !0,
  3022. "http:": !0,
  3023. "https:": !0,
  3024. "ftp:": !0,
  3025. "gopher:": !0,
  3026. "file:": !0
  3027. };
  3028. function L(t, e, r) {
  3029. if (t && c(t) && t instanceof v) return t;
  3030. var n = new v;
  3031. return n.parse(t, e, r), n
  3032. }
  3033. v.prototype.parse = function (t, e, r) {
  3034. if (!u(t)) throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
  3035. var n = t.indexOf("?"), i = -1 !== n && n < t.indexOf("#") ? "?" : "#", o = t.split(i);
  3036. o[0] = o[0].replace(/\\/g, "/");
  3037. var a = t = o.join(i);
  3038. if (a = a.trim(), !r && 1 === t.split("#").length) {
  3039. var s = x.exec(a);
  3040. if (s) return this.path = a, this.href = a, this.pathname = s[1], s[2] ? (this.search = s[2], this.query = e ? m.parse(this.search.substr(1)) : this.search.substr(1)) : e && (this.search = "", this.query = {}), this
  3041. }
  3042. var c = _.exec(a);
  3043. if (c) {
  3044. var h = (c = c[0]).toLowerCase();
  3045. this.protocol = h, a = a.substr(c.length)
  3046. }
  3047. if (r || c || a.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  3048. var p = "//" === a.substr(0, 2);
  3049. !p || c && R[c] || (a = a.substr(2), this.slashes = !0)
  3050. }
  3051. if (!R[c] && (p || c && !I[c])) {
  3052. for (var f, d, g = -1, y = 0; y < T.length; y++) {
  3053. -1 !== (v = a.indexOf(T[y])) && (-1 === g || v < g) && (g = v)
  3054. }
  3055. -1 !== (d = -1 === g ? a.lastIndexOf("@") : a.lastIndexOf("@", g)) && (f = a.slice(0, d), a = a.slice(d + 1), this.auth = decodeURIComponent(f)), g = -1;
  3056. for (y = 0; y < E.length; y++) {
  3057. var v;
  3058. -1 !== (v = a.indexOf(E[y])) && (-1 === g || v < g) && (g = v)
  3059. }
  3060. -1 === g && (g = a.length), this.host = a.slice(0, g), a = a.slice(g), this.parseHost(), this.hostname = this.hostname || "";
  3061. var b = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  3062. if (!b) for (var w = this.hostname.split(/\./), L = (y = 0, w.length); y < L; y++) {
  3063. var M = w[y];
  3064. if (M && !M.match(C)) {
  3065. for (var F = "", A = 0, k = M.length; A < k; A++) M.charCodeAt(A) > 127 ? F += "x" : F += M[A];
  3066. if (!F.match(C)) {
  3067. var j = w.slice(0, y), N = w.slice(y + 1), D = M.match(O);
  3068. D && (j.push(D[1]), N.unshift(D[2])), N.length && (a = "/" + N.join(".") + a), this.hostname = j.join(".");
  3069. break
  3070. }
  3071. }
  3072. }
  3073. this.hostname.length > 255 ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), b || (this.hostname = l.toASCII(this.hostname));
  3074. var G = this.port ? ":" + this.port : "", z = this.hostname || "";
  3075. this.host = z + G, this.href += this.host, b && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), "/" !== a[0] && (a = "/" + a))
  3076. }
  3077. if (!P[h]) for (y = 0, L = S.length; y < L; y++) {
  3078. var U = S[y];
  3079. if (-1 !== a.indexOf(U)) {
  3080. var B = encodeURIComponent(U);
  3081. B === U && (B = escape(U)), a = a.split(U).join(B)
  3082. }
  3083. }
  3084. var V = a.indexOf("#");
  3085. -1 !== V && (this.hash = a.substr(V), a = a.slice(0, V));
  3086. var Y = a.indexOf("?");
  3087. if (-1 !== Y ? (this.search = a.substr(Y), this.query = a.substr(Y + 1), e && (this.query = m.parse(this.query)), a = a.slice(0, Y)) : e && (this.search = "", this.query = {}), a && (this.pathname = a), I[h] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
  3088. G = this.pathname || "";
  3089. var W = this.search || "";
  3090. this.path = G + W
  3091. }
  3092. return this.href = this.format(), this
  3093. }, v.prototype.format = function () {
  3094. var t = this.auth || "";
  3095. t && (t = (t = encodeURIComponent(t)).replace(/%3A/i, ":"), t += "@");
  3096. var e = this.protocol || "", r = this.pathname || "", n = this.hash || "", i = !1, o = "";
  3097. this.host ? i = t + this.host : this.hostname && (i = t + (-1 === this.hostname.indexOf(":") ? this.hostname : "[" + this.hostname + "]"), this.port && (i += ":" + this.port)), this.query && c(this.query) && Object.keys(this.query).length && (o = m.stringify(this.query));
  3098. var a = this.search || o && "?" + o || "";
  3099. return e && ":" !== e.substr(-1) && (e += ":"), this.slashes || (!e || I[e]) && !1 !== i ? (i = "//" + (i || ""), r && "/" !== r.charAt(0) && (r = "/" + r)) : i || (i = ""), n && "#" !== n.charAt(0) && (n = "#" + n), a && "?" !== a.charAt(0) && (a = "?" + a), e + i + (r = r.replace(/[?#]/g, (function (t) {
  3100. return encodeURIComponent(t)
  3101. }))) + (a = a.replace("#", "%23")) + n
  3102. }, v.prototype.resolve = function (t) {
  3103. return this.resolveObject(L(t, !1, !0)).format()
  3104. }, v.prototype.resolveObject = function (t) {
  3105. if (u(t)) {
  3106. var e = new v;
  3107. e.parse(t, !1, !0), t = e
  3108. }
  3109. for (var r = new v, n = Object.keys(this), i = 0; i < n.length; i++) {
  3110. var o = n[i];
  3111. r[o] = this[o]
  3112. }
  3113. if (r.hash = t.hash, "" === t.href) return r.href = r.format(), r;
  3114. if (t.slashes && !t.protocol) {
  3115. for (var a = Object.keys(t), s = 0; s < a.length; s++) {
  3116. var l = a[s];
  3117. "protocol" !== l && (r[l] = t[l])
  3118. }
  3119. return I[r.protocol] && r.hostname && !r.pathname && (r.path = r.pathname = "/"), r.href = r.format(), r
  3120. }
  3121. if (t.protocol && t.protocol !== r.protocol) {
  3122. if (!I[t.protocol]) {
  3123. for (var c = Object.keys(t), f = 0; f < c.length; f++) {
  3124. var d = c[f];
  3125. r[d] = t[d]
  3126. }
  3127. return r.href = r.format(), r
  3128. }
  3129. if (r.protocol = t.protocol, t.host || R[t.protocol]) r.pathname = t.pathname; else {
  3130. for (var g = (t.pathname || "").split("/"); g.length && !(t.host = g.shift());) ;
  3131. t.host || (t.host = ""), t.hostname || (t.hostname = ""), "" !== g[0] && g.unshift(""), g.length < 2 && g.unshift(""), r.pathname = g.join("/")
  3132. }
  3133. if (r.search = t.search, r.query = t.query, r.host = t.host || "", r.auth = t.auth, r.hostname = t.hostname || t.host, r.port = t.port, r.pathname || r.search) {
  3134. var y = r.pathname || "", m = r.search || "";
  3135. r.path = y + m
  3136. }
  3137. return r.slashes = r.slashes || t.slashes, r.href = r.format(), r
  3138. }
  3139. var _ = r.pathname && "/" === r.pathname.charAt(0), b = t.host || t.pathname && "/" === t.pathname.charAt(0),
  3140. x = b || _ || r.host && t.pathname, w = x, S = r.pathname && r.pathname.split("/") || [],
  3141. E = (g = t.pathname && t.pathname.split("/") || [], r.protocol && !I[r.protocol]);
  3142. if (E && (r.hostname = "", r.port = null, r.host && ("" === S[0] ? S[0] = r.host : S.unshift(r.host)), r.host = "", t.protocol && (t.hostname = null, t.port = null, t.host && ("" === g[0] ? g[0] = t.host : g.unshift(t.host)), t.host = null), x = x && ("" === g[0] || "" === S[0])), b) r.host = t.host || "" === t.host ? t.host : r.host, r.hostname = t.hostname || "" === t.hostname ? t.hostname : r.hostname, r.search = t.search, r.query = t.query, S = g; else if (g.length) S || (S = []), S.pop(), S = S.concat(g), r.search = t.search, r.query = t.query; else if (!p(t.search)) {
  3143. if (E) r.hostname = r.host = S.shift(), (L = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = L.shift(), r.host = r.hostname = L.shift());
  3144. return r.search = t.search, r.query = t.query, h(r.pathname) && h(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.href = r.format(), r
  3145. }
  3146. if (!S.length) return r.pathname = null, r.search ? r.path = "/" + r.search : r.path = null, r.href = r.format(), r;
  3147. for (var T = S.slice(-1)[0], C = (r.host || t.host || S.length > 1) && ("." === T || ".." === T) || "" === T, O = 0, P = S.length; P >= 0; P--) "." === (T = S[P]) ? S.splice(P, 1) : ".." === T ? (S.splice(P, 1), O++) : O && (S.splice(P, 1), O--);
  3148. if (!x && !w) for (; O--; O) S.unshift("..");
  3149. !x || "" === S[0] || S[0] && "/" === S[0].charAt(0) || S.unshift(""), C && "/" !== S.join("/").substr(-1) && S.push("");
  3150. var L, M = "" === S[0] || S[0] && "/" === S[0].charAt(0);
  3151. E && (r.hostname = r.host = M ? "" : S.length ? S.shift() : "", (L = !!(r.host && r.host.indexOf("@") > 0) && r.host.split("@")) && (r.auth = L.shift(), r.host = r.hostname = L.shift()));
  3152. return (x = x || r.host && S.length) && !M && S.unshift(""), S.length ? r.pathname = S.join("/") : (r.pathname = null, r.path = null), h(r.pathname) && h(r.search) || (r.path = (r.pathname ? r.pathname : "") + (r.search ? r.search : "")), r.auth = t.auth || r.auth, r.slashes = r.slashes || t.slashes, r.href = r.format(), r
  3153. }, v.prototype.parseHost = function () {
  3154. var t = this.host, e = b.exec(t);
  3155. e && (":" !== (e = e[0]) && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t)
  3156. };
  3157. function M(t, ...e) {
  3158. for (const r of e) for (const e in r) t[e] = r[e];
  3159. return t
  3160. }
  3161. class F extends Error {
  3162. constructor(t, e) {
  3163. super(e), this.message = e, this.key = t
  3164. }
  3165. }
  3166. class A {
  3167. constructor(t, e = []) {
  3168. this.parent = t, this.bindings = {};
  3169. for (const [t, r] of e) this.bindings[t] = r
  3170. }
  3171. concat(t) {
  3172. return new A(this, t)
  3173. }
  3174. get(t) {
  3175. if (this.bindings[t]) return this.bindings[t];
  3176. if (this.parent) return this.parent.get(t);
  3177. throw new Error(t + " not found in scope.")
  3178. }
  3179. has(t) {
  3180. return !!this.bindings[t] || !!this.parent && this.parent.has(t)
  3181. }
  3182. }
  3183. const k = {kind: "null"}, j = {kind: "number"}, N = {kind: "string"}, D = {kind: "boolean"}, G = {kind: "color"},
  3184. z = {kind: "object"}, U = {kind: "value"}, B = {kind: "collator"}, V = {kind: "formatted"},
  3185. Y = {kind: "resolvedImage"};
  3186. function W(t, e) {
  3187. return {kind: "array", itemType: t, N: e}
  3188. }
  3189. function q(t) {
  3190. if ("array" === t.kind) {
  3191. const e = q(t.itemType);
  3192. return "number" == typeof t.N ? `array<${e}, ${t.N}>` : "value" === t.itemType.kind ? "array" : `array<${e}>`
  3193. }
  3194. return t.kind
  3195. }
  3196. const X = [k, j, N, D, G, V, z, W(U), Y];
  3197. function Z(t, e) {
  3198. if ("error" === e.kind) return null;
  3199. if ("array" === t.kind) {
  3200. if ("array" === e.kind && (0 === e.N && "value" === e.itemType.kind || !Z(t.itemType, e.itemType)) && ("number" != typeof t.N || t.N === e.N)) return null
  3201. } else {
  3202. if (t.kind === e.kind) return null;
  3203. if ("value" === t.kind) for (const t of X) if (!Z(t, e)) return null
  3204. }
  3205. return `Expected ${q(t)} but found ${q(e)} instead.`
  3206. }
  3207. function K(t, e) {
  3208. return e.some(e => e.kind === t.kind)
  3209. }
  3210. function H(t, e) {
  3211. return e.some(e => "null" === e ? null === t : "array" === e ? Array.isArray(t) : "object" === e ? t && !Array.isArray(t) && "object" == typeof t : e === typeof t)
  3212. }
  3213. var $ = s((function (t, e) {
  3214. var r = {
  3215. transparent: [0, 0, 0, 0],
  3216. aliceblue: [240, 248, 255, 1],
  3217. antiquewhite: [250, 235, 215, 1],
  3218. aqua: [0, 255, 255, 1],
  3219. aquamarine: [127, 255, 212, 1],
  3220. azure: [240, 255, 255, 1],
  3221. beige: [245, 245, 220, 1],
  3222. bisque: [255, 228, 196, 1],
  3223. black: [0, 0, 0, 1],
  3224. blanchedalmond: [255, 235, 205, 1],
  3225. blue: [0, 0, 255, 1],
  3226. blueviolet: [138, 43, 226, 1],
  3227. brown: [165, 42, 42, 1],
  3228. burlywood: [222, 184, 135, 1],
  3229. cadetblue: [95, 158, 160, 1],
  3230. chartreuse: [127, 255, 0, 1],
  3231. chocolate: [210, 105, 30, 1],
  3232. coral: [255, 127, 80, 1],
  3233. cornflowerblue: [100, 149, 237, 1],
  3234. cornsilk: [255, 248, 220, 1],
  3235. crimson: [220, 20, 60, 1],
  3236. cyan: [0, 255, 255, 1],
  3237. darkblue: [0, 0, 139, 1],
  3238. darkcyan: [0, 139, 139, 1],
  3239. darkgoldenrod: [184, 134, 11, 1],
  3240. darkgray: [169, 169, 169, 1],
  3241. darkgreen: [0, 100, 0, 1],
  3242. darkgrey: [169, 169, 169, 1],
  3243. darkkhaki: [189, 183, 107, 1],
  3244. darkmagenta: [139, 0, 139, 1],
  3245. darkolivegreen: [85, 107, 47, 1],
  3246. darkorange: [255, 140, 0, 1],
  3247. darkorchid: [153, 50, 204, 1],
  3248. darkred: [139, 0, 0, 1],
  3249. darksalmon: [233, 150, 122, 1],
  3250. darkseagreen: [143, 188, 143, 1],
  3251. darkslateblue: [72, 61, 139, 1],
  3252. darkslategray: [47, 79, 79, 1],
  3253. darkslategrey: [47, 79, 79, 1],
  3254. darkturquoise: [0, 206, 209, 1],
  3255. darkviolet: [148, 0, 211, 1],
  3256. deeppink: [255, 20, 147, 1],
  3257. deepskyblue: [0, 191, 255, 1],
  3258. dimgray: [105, 105, 105, 1],
  3259. dimgrey: [105, 105, 105, 1],
  3260. dodgerblue: [30, 144, 255, 1],
  3261. firebrick: [178, 34, 34, 1],
  3262. floralwhite: [255, 250, 240, 1],
  3263. forestgreen: [34, 139, 34, 1],
  3264. fuchsia: [255, 0, 255, 1],
  3265. gainsboro: [220, 220, 220, 1],
  3266. ghostwhite: [248, 248, 255, 1],
  3267. gold: [255, 215, 0, 1],
  3268. goldenrod: [218, 165, 32, 1],
  3269. gray: [128, 128, 128, 1],
  3270. green: [0, 128, 0, 1],
  3271. greenyellow: [173, 255, 47, 1],
  3272. grey: [128, 128, 128, 1],
  3273. honeydew: [240, 255, 240, 1],
  3274. hotpink: [255, 105, 180, 1],
  3275. indianred: [205, 92, 92, 1],
  3276. indigo: [75, 0, 130, 1],
  3277. ivory: [255, 255, 240, 1],
  3278. khaki: [240, 230, 140, 1],
  3279. lavender: [230, 230, 250, 1],
  3280. lavenderblush: [255, 240, 245, 1],
  3281. lawngreen: [124, 252, 0, 1],
  3282. lemonchiffon: [255, 250, 205, 1],
  3283. lightblue: [173, 216, 230, 1],
  3284. lightcoral: [240, 128, 128, 1],
  3285. lightcyan: [224, 255, 255, 1],
  3286. lightgoldenrodyellow: [250, 250, 210, 1],
  3287. lightgray: [211, 211, 211, 1],
  3288. lightgreen: [144, 238, 144, 1],
  3289. lightgrey: [211, 211, 211, 1],
  3290. lightpink: [255, 182, 193, 1],
  3291. lightsalmon: [255, 160, 122, 1],
  3292. lightseagreen: [32, 178, 170, 1],
  3293. lightskyblue: [135, 206, 250, 1],
  3294. lightslategray: [119, 136, 153, 1],
  3295. lightslategrey: [119, 136, 153, 1],
  3296. lightsteelblue: [176, 196, 222, 1],
  3297. lightyellow: [255, 255, 224, 1],
  3298. lime: [0, 255, 0, 1],
  3299. limegreen: [50, 205, 50, 1],
  3300. linen: [250, 240, 230, 1],
  3301. magenta: [255, 0, 255, 1],
  3302. maroon: [128, 0, 0, 1],
  3303. mediumaquamarine: [102, 205, 170, 1],
  3304. mediumblue: [0, 0, 205, 1],
  3305. mediumorchid: [186, 85, 211, 1],
  3306. mediumpurple: [147, 112, 219, 1],
  3307. mediumseagreen: [60, 179, 113, 1],
  3308. mediumslateblue: [123, 104, 238, 1],
  3309. mediumspringgreen: [0, 250, 154, 1],
  3310. mediumturquoise: [72, 209, 204, 1],
  3311. mediumvioletred: [199, 21, 133, 1],
  3312. midnightblue: [25, 25, 112, 1],
  3313. mintcream: [245, 255, 250, 1],
  3314. mistyrose: [255, 228, 225, 1],
  3315. moccasin: [255, 228, 181, 1],
  3316. navajowhite: [255, 222, 173, 1],
  3317. navy: [0, 0, 128, 1],
  3318. oldlace: [253, 245, 230, 1],
  3319. olive: [128, 128, 0, 1],
  3320. olivedrab: [107, 142, 35, 1],
  3321. orange: [255, 165, 0, 1],
  3322. orangered: [255, 69, 0, 1],
  3323. orchid: [218, 112, 214, 1],
  3324. palegoldenrod: [238, 232, 170, 1],
  3325. palegreen: [152, 251, 152, 1],
  3326. paleturquoise: [175, 238, 238, 1],
  3327. palevioletred: [219, 112, 147, 1],
  3328. papayawhip: [255, 239, 213, 1],
  3329. peachpuff: [255, 218, 185, 1],
  3330. peru: [205, 133, 63, 1],
  3331. pink: [255, 192, 203, 1],
  3332. plum: [221, 160, 221, 1],
  3333. powderblue: [176, 224, 230, 1],
  3334. purple: [128, 0, 128, 1],
  3335. rebeccapurple: [102, 51, 153, 1],
  3336. red: [255, 0, 0, 1],
  3337. rosybrown: [188, 143, 143, 1],
  3338. royalblue: [65, 105, 225, 1],
  3339. saddlebrown: [139, 69, 19, 1],
  3340. salmon: [250, 128, 114, 1],
  3341. sandybrown: [244, 164, 96, 1],
  3342. seagreen: [46, 139, 87, 1],
  3343. seashell: [255, 245, 238, 1],
  3344. sienna: [160, 82, 45, 1],
  3345. silver: [192, 192, 192, 1],
  3346. skyblue: [135, 206, 235, 1],
  3347. slateblue: [106, 90, 205, 1],
  3348. slategray: [112, 128, 144, 1],
  3349. slategrey: [112, 128, 144, 1],
  3350. snow: [255, 250, 250, 1],
  3351. springgreen: [0, 255, 127, 1],
  3352. steelblue: [70, 130, 180, 1],
  3353. tan: [210, 180, 140, 1],
  3354. teal: [0, 128, 128, 1],
  3355. thistle: [216, 191, 216, 1],
  3356. tomato: [255, 99, 71, 1],
  3357. turquoise: [64, 224, 208, 1],
  3358. violet: [238, 130, 238, 1],
  3359. wheat: [245, 222, 179, 1],
  3360. white: [255, 255, 255, 1],
  3361. whitesmoke: [245, 245, 245, 1],
  3362. yellow: [255, 255, 0, 1],
  3363. yellowgreen: [154, 205, 50, 1]
  3364. };
  3365. function n(t) {
  3366. return (t = Math.round(t)) < 0 ? 0 : t > 255 ? 255 : t
  3367. }
  3368. function i(t) {
  3369. return t < 0 ? 0 : t > 1 ? 1 : t
  3370. }
  3371. function o(t) {
  3372. return "%" === t[t.length - 1] ? n(parseFloat(t) / 100 * 255) : n(parseInt(t))
  3373. }
  3374. function a(t) {
  3375. return "%" === t[t.length - 1] ? i(parseFloat(t) / 100) : i(parseFloat(t))
  3376. }
  3377. function s(t, e, r) {
  3378. return r < 0 ? r += 1 : r > 1 && (r -= 1), 6 * r < 1 ? t + (e - t) * r * 6 : 2 * r < 1 ? e : 3 * r < 2 ? t + (e - t) * (2 / 3 - r) * 6 : t
  3379. }
  3380. try {
  3381. e.parseCSSColor = function (t) {
  3382. var e, i = t.replace(/ /g, "").toLowerCase();
  3383. if (i in r) return r[i].slice();
  3384. if ("#" === i[0]) return 4 === i.length ? (e = parseInt(i.substr(1), 16)) >= 0 && e <= 4095 ? [(3840 & e) >> 4 | (3840 & e) >> 8, 240 & e | (240 & e) >> 4, 15 & e | (15 & e) << 4, 1] : null : 7 === i.length && (e = parseInt(i.substr(1), 16)) >= 0 && e <= 16777215 ? [(16711680 & e) >> 16, (65280 & e) >> 8, 255 & e, 1] : null;
  3385. var l = i.indexOf("("), u = i.indexOf(")");
  3386. if (-1 !== l && u + 1 === i.length) {
  3387. var c = i.substr(0, l), h = i.substr(l + 1, u - (l + 1)).split(","), p = 1;
  3388. switch (c) {
  3389. case"rgba":
  3390. if (4 !== h.length) return null;
  3391. p = a(h.pop());
  3392. case"rgb":
  3393. return 3 !== h.length ? null : [o(h[0]), o(h[1]), o(h[2]), p];
  3394. case"hsla":
  3395. if (4 !== h.length) return null;
  3396. p = a(h.pop());
  3397. case"hsl":
  3398. if (3 !== h.length) return null;
  3399. var f = (parseFloat(h[0]) % 360 + 360) % 360 / 360, d = a(h[1]), g = a(h[2]),
  3400. y = g <= .5 ? g * (d + 1) : g + d - g * d, m = 2 * g - y;
  3401. return [n(255 * s(m, y, f + 1 / 3)), n(255 * s(m, y, f)), n(255 * s(m, y, f - 1 / 3)), p];
  3402. default:
  3403. return null
  3404. }
  3405. }
  3406. return null
  3407. }
  3408. } catch (t) {
  3409. }
  3410. })).parseCSSColor;
  3411. class J {
  3412. constructor(t, e, r, n = 1) {
  3413. this.r = t, this.g = e, this.b = r, this.a = n
  3414. }
  3415. static parse(t) {
  3416. if (!t) return;
  3417. if (t instanceof J) return t;
  3418. if ("string" != typeof t) return;
  3419. const e = $(t);
  3420. return e ? new J(e[0] / 255 * e[3], e[1] / 255 * e[3], e[2] / 255 * e[3], e[3]) : void 0
  3421. }
  3422. toString() {
  3423. const [t, e, r, n] = this.toArray();
  3424. return `rgba(${Math.round(t)},${Math.round(e)},${Math.round(r)},${n})`
  3425. }
  3426. toArray() {
  3427. const {r: t, g: e, b: r, a: n} = this;
  3428. return 0 === n ? [0, 0, 0, 0] : [255 * t / n, 255 * e / n, 255 * r / n, n]
  3429. }
  3430. }
  3431. J.black = new J(0, 0, 0, 1), J.white = new J(1, 1, 1, 1), J.transparent = new J(0, 0, 0, 0), J.red = new J(1, 0, 0, 1), J.blue = new J(0, 0, 1, 1);
  3432. class Q {
  3433. constructor(t, e, r) {
  3434. this.sensitivity = t ? e ? "variant" : "case" : e ? "accent" : "base", this.locale = r, this.collator = new Intl.Collator(this.locale ? this.locale : [], {
  3435. sensitivity: this.sensitivity,
  3436. usage: "search"
  3437. })
  3438. }
  3439. compare(t, e) {
  3440. return this.collator.compare(t, e)
  3441. }
  3442. resolvedLocale() {
  3443. return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale
  3444. }
  3445. }
  3446. class tt {
  3447. constructor(t, e, r, n, i) {
  3448. this.text = t, this.image = e, this.scale = r, this.fontStack = n, this.textColor = i
  3449. }
  3450. }
  3451. class et {
  3452. constructor(t) {
  3453. this.sections = t
  3454. }
  3455. static fromString(t) {
  3456. return new et([new tt(t, null, null, null, null)])
  3457. }
  3458. isEmpty() {
  3459. return 0 === this.sections.length || !this.sections.some(t => 0 !== t.text.length || t.image && 0 !== t.image.name.length)
  3460. }
  3461. static factory(t) {
  3462. return t instanceof et ? t : et.fromString(t)
  3463. }
  3464. toString() {
  3465. return 0 === this.sections.length ? "" : this.sections.map(t => t.text).join("")
  3466. }
  3467. serialize() {
  3468. const t = ["format"];
  3469. for (const e of this.sections) {
  3470. if (e.image) {
  3471. t.push(["image", e.image.name]);
  3472. continue
  3473. }
  3474. t.push(e.text);
  3475. const r = {};
  3476. e.fontStack && (r["text-font"] = ["literal", e.fontStack.split(",")]), e.scale && (r["font-scale"] = e.scale), e.textColor && (r["text-color"] = ["rgba"].concat(e.textColor.toArray())), t.push(r)
  3477. }
  3478. return t
  3479. }
  3480. }
  3481. class rt {
  3482. constructor(t) {
  3483. this.name = t.name, this.available = t.available
  3484. }
  3485. toString() {
  3486. return this.name
  3487. }
  3488. static fromString(t) {
  3489. return t ? new rt({name: t, available: !1}) : null
  3490. }
  3491. serialize() {
  3492. return ["image", this.name]
  3493. }
  3494. }
  3495. function nt(t, e, r, n) {
  3496. if (!("number" == typeof t && t >= 0 && t <= 255 && "number" == typeof e && e >= 0 && e <= 255 && "number" == typeof r && r >= 0 && r <= 255)) {
  3497. return `Invalid rgba value [${("number" == typeof n ? [t, e, r, n] : [t, e, r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`
  3498. }
  3499. return void 0 === n || "number" == typeof n && n >= 0 && n <= 1 ? null : `Invalid rgba value [${[t, e, r, n].join(", ")}]: 'a' must be between 0 and 1.`
  3500. }
  3501. function it(t) {
  3502. if (null === t) return !0;
  3503. if ("string" == typeof t) return !0;
  3504. if ("boolean" == typeof t) return !0;
  3505. if ("number" == typeof t) return !0;
  3506. if (t instanceof J) return !0;
  3507. if (t instanceof Q) return !0;
  3508. if (t instanceof et) return !0;
  3509. if (t instanceof rt) return !0;
  3510. if (Array.isArray(t)) {
  3511. for (const e of t) if (!it(e)) return !1;
  3512. return !0
  3513. }
  3514. if ("object" == typeof t) {
  3515. for (const e in t) if (!it(t[e])) return !1;
  3516. return !0
  3517. }
  3518. return !1
  3519. }
  3520. function ot(t) {
  3521. if (null === t) return k;
  3522. if ("string" == typeof t) return N;
  3523. if ("boolean" == typeof t) return D;
  3524. if ("number" == typeof t) return j;
  3525. if (t instanceof J) return G;
  3526. if (t instanceof Q) return B;
  3527. if (t instanceof et) return V;
  3528. if (t instanceof rt) return Y;
  3529. if (Array.isArray(t)) {
  3530. const e = t.length;
  3531. let r;
  3532. for (const e of t) {
  3533. const t = ot(e);
  3534. if (r) {
  3535. if (r === t) continue;
  3536. r = U;
  3537. break
  3538. }
  3539. r = t
  3540. }
  3541. return W(r || U, e)
  3542. }
  3543. return z
  3544. }
  3545. function at(t) {
  3546. const e = typeof t;
  3547. return null === t ? "" : "string" === e || "number" === e || "boolean" === e ? String(t) : t instanceof J || t instanceof et || t instanceof rt ? t.toString() : JSON.stringify(t)
  3548. }
  3549. class st {
  3550. constructor(t, e) {
  3551. this.type = t, this.value = e
  3552. }
  3553. static parse(t, e) {
  3554. if (2 !== t.length) return e.error(`'literal' expression requires exactly one argument, but found ${t.length - 1} instead.`);
  3555. if (!it(t[1])) return e.error("invalid value");
  3556. const r = t[1];
  3557. let n = ot(r);
  3558. const i = e.expectedType;
  3559. return "array" !== n.kind || 0 !== n.N || !i || "array" !== i.kind || "number" == typeof i.N && 0 !== i.N || (n = i), new st(n, r)
  3560. }
  3561. evaluate() {
  3562. return this.value
  3563. }
  3564. eachChild() {
  3565. }
  3566. outputDefined() {
  3567. return !0
  3568. }
  3569. serialize() {
  3570. return "array" === this.type.kind || "object" === this.type.kind ? ["literal", this.value] : this.value instanceof J ? ["rgba"].concat(this.value.toArray()) : this.value instanceof et ? this.value.serialize() : this.value
  3571. }
  3572. }
  3573. class lt {
  3574. constructor(t) {
  3575. this.name = "ExpressionEvaluationError", this.message = t
  3576. }
  3577. toJSON() {
  3578. return this.message
  3579. }
  3580. }
  3581. const ut = {string: N, number: j, boolean: D, object: z};
  3582. class ct {
  3583. constructor(t, e) {
  3584. this.type = t, this.args = e
  3585. }
  3586. static parse(t, e) {
  3587. if (t.length < 2) return e.error("Expected at least one argument.");
  3588. let r, n = 1;
  3589. const i = t[0];
  3590. if ("array" === i) {
  3591. let i, o;
  3592. if (t.length > 2) {
  3593. const r = t[1];
  3594. if ("string" != typeof r || !(r in ut) || "object" === r) return e.error('The item type argument of "array" must be one of string, number, boolean', 1);
  3595. i = ut[r], n++
  3596. } else i = U;
  3597. if (t.length > 3) {
  3598. if (null !== t[2] && ("number" != typeof t[2] || t[2] < 0 || t[2] !== Math.floor(t[2]))) return e.error('The length argument to "array" must be a positive integer literal', 2);
  3599. o = t[2], n++
  3600. }
  3601. r = W(i, o)
  3602. } else r = ut[i];
  3603. const o = [];
  3604. for (; n < t.length; n++) {
  3605. const r = e.parse(t[n], n, U);
  3606. if (!r) return null;
  3607. o.push(r)
  3608. }
  3609. return new ct(r, o)
  3610. }
  3611. evaluate(t) {
  3612. for (let e = 0; e < this.args.length; e++) {
  3613. const r = this.args[e].evaluate(t);
  3614. if (!Z(this.type, ot(r))) return r;
  3615. if (e === this.args.length - 1) throw new lt(`Expected value to be of type ${q(this.type)}, but found ${q(ot(r))} instead.`)
  3616. }
  3617. return null
  3618. }
  3619. eachChild(t) {
  3620. this.args.forEach(t)
  3621. }
  3622. outputDefined() {
  3623. return this.args.every(t => t.outputDefined())
  3624. }
  3625. serialize() {
  3626. const t = this.type, e = [t.kind];
  3627. if ("array" === t.kind) {
  3628. const r = t.itemType;
  3629. if ("string" === r.kind || "number" === r.kind || "boolean" === r.kind) {
  3630. e.push(r.kind);
  3631. const n = t.N;
  3632. ("number" == typeof n || this.args.length > 1) && e.push(n)
  3633. }
  3634. }
  3635. return e.concat(this.args.map(t => t.serialize()))
  3636. }
  3637. }
  3638. class ht {
  3639. constructor(t) {
  3640. this.type = V, this.sections = t
  3641. }
  3642. static parse(t, e) {
  3643. if (t.length < 2) return e.error("Expected at least one argument.");
  3644. const r = t[1];
  3645. if (!Array.isArray(r) && "object" == typeof r) return e.error("First argument must be an image or text section.");
  3646. const n = [];
  3647. let i = !1;
  3648. for (let r = 1; r <= t.length - 1; ++r) {
  3649. const o = t[r];
  3650. if (i && "object" == typeof o && !Array.isArray(o)) {
  3651. i = !1;
  3652. let t = null;
  3653. if (o["font-scale"] && (t = e.parse(o["font-scale"], 1, j), !t)) return null;
  3654. let r = null;
  3655. if (o["text-font"] && (r = e.parse(o["text-font"], 1, W(N)), !r)) return null;
  3656. let a = null;
  3657. if (o["text-color"] && (a = e.parse(o["text-color"], 1, G), !a)) return null;
  3658. const s = n[n.length - 1];
  3659. s.scale = t, s.font = r, s.textColor = a
  3660. } else {
  3661. const o = e.parse(t[r], 1, U);
  3662. if (!o) return null;
  3663. const a = o.type.kind;
  3664. if ("string" !== a && "value" !== a && "null" !== a && "resolvedImage" !== a) return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");
  3665. i = !0, n.push({content: o, scale: null, font: null, textColor: null})
  3666. }
  3667. }
  3668. return new ht(n)
  3669. }
  3670. evaluate(t) {
  3671. return new et(this.sections.map(e => {
  3672. const r = e.content.evaluate(t);
  3673. return ot(r) === Y ? new tt("", r, null, null, null) : new tt(at(r), null, e.scale ? e.scale.evaluate(t) : null, e.font ? e.font.evaluate(t).join(",") : null, e.textColor ? e.textColor.evaluate(t) : null)
  3674. }))
  3675. }
  3676. eachChild(t) {
  3677. for (const e of this.sections) t(e.content), e.scale && t(e.scale), e.font && t(e.font), e.textColor && t(e.textColor)
  3678. }
  3679. outputDefined() {
  3680. return !1
  3681. }
  3682. serialize() {
  3683. const t = ["format"];
  3684. for (const e of this.sections) {
  3685. t.push(e.content.serialize());
  3686. const r = {};
  3687. e.scale && (r["font-scale"] = e.scale.serialize()), e.font && (r["text-font"] = e.font.serialize()), e.textColor && (r["text-color"] = e.textColor.serialize()), t.push(r)
  3688. }
  3689. return t
  3690. }
  3691. }
  3692. class pt {
  3693. constructor(t) {
  3694. this.type = Y, this.input = t
  3695. }
  3696. static parse(t, e) {
  3697. if (2 !== t.length) return e.error("Expected two arguments.");
  3698. const r = e.parse(t[1], 1, N);
  3699. return r ? new pt(r) : e.error("No image name provided.")
  3700. }
  3701. evaluate(t) {
  3702. const e = this.input.evaluate(t), r = rt.fromString(e);
  3703. return r && t.availableImages && (r.available = t.availableImages.indexOf(e) > -1), r
  3704. }
  3705. eachChild(t) {
  3706. t(this.input)
  3707. }
  3708. outputDefined() {
  3709. return !1
  3710. }
  3711. serialize() {
  3712. return ["image", this.input.serialize()]
  3713. }
  3714. }
  3715. const ft = {"to-boolean": D, "to-color": G, "to-number": j, "to-string": N};
  3716. class dt {
  3717. constructor(t, e) {
  3718. this.type = t, this.args = e
  3719. }
  3720. static parse(t, e) {
  3721. if (t.length < 2) return e.error("Expected at least one argument.");
  3722. const r = t[0];
  3723. if (("to-boolean" === r || "to-string" === r) && 2 !== t.length) return e.error("Expected one argument.");
  3724. const n = ft[r], i = [];
  3725. for (let r = 1; r < t.length; r++) {
  3726. const n = e.parse(t[r], r, U);
  3727. if (!n) return null;
  3728. i.push(n)
  3729. }
  3730. return new dt(n, i)
  3731. }
  3732. evaluate(t) {
  3733. if ("boolean" === this.type.kind) return Boolean(this.args[0].evaluate(t));
  3734. if ("color" === this.type.kind) {
  3735. let e, r;
  3736. for (const n of this.args) {
  3737. if (e = n.evaluate(t), r = null, e instanceof J) return e;
  3738. if ("string" == typeof e) {
  3739. const r = t.parseColor(e);
  3740. if (r) return r
  3741. } else if (Array.isArray(e) && (r = e.length < 3 || e.length > 4 ? `Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.` : nt(e[0], e[1], e[2], e[3]), !r)) return new J(e[0] / 255, e[1] / 255, e[2] / 255, e[3])
  3742. }
  3743. throw new lt(r || `Could not parse color from value '${"string" == typeof e ? e : String(JSON.stringify(e))}'`)
  3744. }
  3745. if ("number" === this.type.kind) {
  3746. let e = null;
  3747. for (const r of this.args) {
  3748. if (e = r.evaluate(t), null === e) return 0;
  3749. const n = Number(e);
  3750. if (!isNaN(n)) return n
  3751. }
  3752. throw new lt(`Could not convert ${JSON.stringify(e)} to number.`)
  3753. }
  3754. return "formatted" === this.type.kind ? et.fromString(at(this.args[0].evaluate(t))) : "resolvedImage" === this.type.kind ? rt.fromString(at(this.args[0].evaluate(t))) : at(this.args[0].evaluate(t))
  3755. }
  3756. eachChild(t) {
  3757. this.args.forEach(t)
  3758. }
  3759. outputDefined() {
  3760. return this.args.every(t => t.outputDefined())
  3761. }
  3762. serialize() {
  3763. if ("formatted" === this.type.kind) return new ht([{
  3764. content: this.args[0],
  3765. scale: null,
  3766. font: null,
  3767. textColor: null
  3768. }]).serialize();
  3769. if ("resolvedImage" === this.type.kind) return new pt(this.args[0]).serialize();
  3770. const t = ["to-" + this.type.kind];
  3771. return this.eachChild(e => {
  3772. t.push(e.serialize())
  3773. }), t
  3774. }
  3775. }
  3776. const gt = ["Unknown", "Point", "LineString", "Polygon"];
  3777. class yt {
  3778. constructor() {
  3779. this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null
  3780. }
  3781. id() {
  3782. return this.feature && "id" in this.feature ? this.feature.id : null
  3783. }
  3784. geometryType() {
  3785. return this.feature ? "number" == typeof this.feature.type ? gt[this.feature.type] : this.feature.type : null
  3786. }
  3787. geometry() {
  3788. return this.feature && "geometry" in this.feature ? this.feature.geometry : null
  3789. }
  3790. canonicalID() {
  3791. return this.canonical
  3792. }
  3793. properties() {
  3794. return this.feature && this.feature.properties || {}
  3795. }
  3796. parseColor(t) {
  3797. let e = this._parseColorCache[t];
  3798. return e || (e = this._parseColorCache[t] = J.parse(t)), e
  3799. }
  3800. }
  3801. class mt {
  3802. constructor(t, e, r, n) {
  3803. this.name = t, this.type = e, this._evaluate = r, this.args = n
  3804. }
  3805. evaluate(t) {
  3806. return this._evaluate(t, this.args)
  3807. }
  3808. eachChild(t) {
  3809. this.args.forEach(t)
  3810. }
  3811. outputDefined() {
  3812. return !1
  3813. }
  3814. serialize() {
  3815. return [this.name].concat(this.args.map(t => t.serialize()))
  3816. }
  3817. static parse(t, e) {
  3818. const r = t[0], n = mt.definitions[r];
  3819. if (!n) return e.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`, 0);
  3820. const i = Array.isArray(n) ? n[0] : n.type, o = Array.isArray(n) ? [[n[1], n[2]]] : n.overloads,
  3821. a = o.filter(([e]) => !Array.isArray(e) || e.length === t.length - 1);
  3822. let s = null;
  3823. for (const [n, o] of a) {
  3824. s = new zt(e.registry, e.path, null, e.scope);
  3825. const a = [];
  3826. let l = !1;
  3827. for (let e = 1; e < t.length; e++) {
  3828. const r = t[e], i = Array.isArray(n) ? n[e - 1] : n.type, o = s.parse(r, 1 + a.length, i);
  3829. if (!o) {
  3830. l = !0;
  3831. break
  3832. }
  3833. a.push(o)
  3834. }
  3835. if (!l) if (Array.isArray(n) && n.length !== a.length) s.error(`Expected ${n.length} arguments, but found ${a.length} instead.`); else {
  3836. for (let t = 0; t < a.length; t++) {
  3837. const e = Array.isArray(n) ? n[t] : n.type, r = a[t];
  3838. s.concat(t + 1).checkSubtype(e, r.type)
  3839. }
  3840. if (0 === s.errors.length) return new mt(r, i, o, a)
  3841. }
  3842. }
  3843. if (1 === a.length) e.errors.push(...s.errors); else {
  3844. const r = (a.length ? a : o).map(([t]) => {
  3845. return e = t, Array.isArray(e) ? `(${e.map(q).join(", ")})` : `(${q(e.type)}...)`;
  3846. var e
  3847. }).join(" | "), n = [];
  3848. for (let r = 1; r < t.length; r++) {
  3849. const i = e.parse(t[r], 1 + n.length);
  3850. if (!i) return null;
  3851. n.push(q(i.type))
  3852. }
  3853. e.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)
  3854. }
  3855. return null
  3856. }
  3857. static register(t, e) {
  3858. mt.definitions = e;
  3859. for (const r in e) t[r] = mt
  3860. }
  3861. }
  3862. class vt {
  3863. constructor(t, e, r) {
  3864. this.type = B, this.locale = r, this.caseSensitive = t, this.diacriticSensitive = e
  3865. }
  3866. static parse(t, e) {
  3867. if (2 !== t.length) return e.error("Expected one argument.");
  3868. const r = t[1];
  3869. if ("object" != typeof r || Array.isArray(r)) return e.error("Collator options argument must be an object.");
  3870. const n = e.parse(void 0 !== r["case-sensitive"] && r["case-sensitive"], 1, D);
  3871. if (!n) return null;
  3872. const i = e.parse(void 0 !== r["diacritic-sensitive"] && r["diacritic-sensitive"], 1, D);
  3873. if (!i) return null;
  3874. let o = null;
  3875. return r.locale && (o = e.parse(r.locale, 1, N), !o) ? null : new vt(n, i, o)
  3876. }
  3877. evaluate(t) {
  3878. return new Q(this.caseSensitive.evaluate(t), this.diacriticSensitive.evaluate(t), this.locale ? this.locale.evaluate(t) : null)
  3879. }
  3880. eachChild(t) {
  3881. t(this.caseSensitive), t(this.diacriticSensitive), this.locale && t(this.locale)
  3882. }
  3883. outputDefined() {
  3884. return !1
  3885. }
  3886. serialize() {
  3887. const t = {};
  3888. return t["case-sensitive"] = this.caseSensitive.serialize(), t["diacritic-sensitive"] = this.diacriticSensitive.serialize(), this.locale && (t.locale = this.locale.serialize()), ["collator", t]
  3889. }
  3890. }
  3891. function _t(t, e) {
  3892. t[0] = Math.min(t[0], e[0]), t[1] = Math.min(t[1], e[1]), t[2] = Math.max(t[2], e[0]), t[3] = Math.max(t[3], e[1])
  3893. }
  3894. function bt(t, e) {
  3895. return !(t[0] <= e[0]) && (!(t[2] >= e[2]) && (!(t[1] <= e[1]) && !(t[3] >= e[3])))
  3896. }
  3897. function xt(t, e) {
  3898. const r = (180 + t[0]) / 360;
  3899. const n = (i = t[1], (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + i * Math.PI / 360))) / 360);
  3900. var i;
  3901. const o = Math.pow(2, e.z);
  3902. return [Math.round(r * o * 8192), Math.round(n * o * 8192)]
  3903. }
  3904. function wt(t, e, r) {
  3905. const n = t[0] - e[0], i = t[1] - e[1], o = t[0] - r[0], a = t[1] - r[1];
  3906. return n * a - o * i == 0 && n * o <= 0 && i * a <= 0
  3907. }
  3908. function St(t, e) {
  3909. let r = !1;
  3910. for (let a = 0, s = e.length; a < s; a++) {
  3911. const s = e[a];
  3912. for (let e = 0, a = s.length; e < a - 1; e++) {
  3913. if (wt(t, s[e], s[e + 1])) return !1;
  3914. n = t, i = s[e], o = s[e + 1], i[1] > n[1] != o[1] > n[1] && n[0] < (o[0] - i[0]) * (n[1] - i[1]) / (o[1] - i[1]) + i[0] && (r = !r)
  3915. }
  3916. }
  3917. var n, i, o;
  3918. return r
  3919. }
  3920. function Et(t, e) {
  3921. for (let r = 0; r < e.length; r++) if (St(t, e[r])) return !0;
  3922. return !1
  3923. }
  3924. function Tt(t, e, r, n) {
  3925. const i = t[0] - r[0], o = t[1] - r[1], a = e[0] - r[0], s = e[1] - r[1], l = n[0] - r[0], u = n[1] - r[1],
  3926. c = i * u - l * o, h = a * u - l * s;
  3927. return c > 0 && h < 0 || c < 0 && h > 0
  3928. }
  3929. function Ct(t, e, r, n) {
  3930. const i = [e[0] - t[0], e[1] - t[1]], o = [n[0] - r[0], n[1] - r[1]];
  3931. return 0 != (a = o)[0] * (s = i)[1] - a[1] * s[0] && !(!Tt(t, e, r, n) || !Tt(r, n, t, e));
  3932. var a, s
  3933. }
  3934. function Ot(t, e, r) {
  3935. for (const n of r) for (let r = 0; r < n.length - 1; ++r) if (Ct(t, e, n[r], n[r + 1])) return !0;
  3936. return !1
  3937. }
  3938. function Pt(t, e) {
  3939. for (let r = 0; r < t.length; ++r) if (!St(t[r], e)) return !1;
  3940. for (let r = 0; r < t.length - 1; ++r) if (Ot(t[r], t[r + 1], e)) return !1;
  3941. return !0
  3942. }
  3943. function Rt(t, e) {
  3944. for (let r = 0; r < e.length; r++) if (Pt(t, e[r])) return !0;
  3945. return !1
  3946. }
  3947. function It(t, e, r) {
  3948. const n = [];
  3949. for (let i = 0; i < t.length; i++) {
  3950. const o = [];
  3951. for (let n = 0; n < t[i].length; n++) {
  3952. const a = xt(t[i][n], r);
  3953. _t(e, a), o.push(a)
  3954. }
  3955. n.push(o)
  3956. }
  3957. return n
  3958. }
  3959. function Lt(t, e, r) {
  3960. const n = [];
  3961. for (let i = 0; i < t.length; i++) {
  3962. const o = It(t[i], e, r);
  3963. n.push(o)
  3964. }
  3965. return n
  3966. }
  3967. function Mt(t, e, r, n) {
  3968. if (t[0] < r[0] || t[0] > r[2]) {
  3969. const e = .5 * n;
  3970. let i = t[0] - r[0] > e ? -n : r[0] - t[0] > e ? n : 0;
  3971. 0 === i && (i = t[0] - r[2] > e ? -n : r[2] - t[0] > e ? n : 0), t[0] += i
  3972. }
  3973. _t(e, t)
  3974. }
  3975. function Ft(t, e, r, n) {
  3976. const i = 8192 * Math.pow(2, n.z), o = [8192 * n.x, 8192 * n.y], a = [];
  3977. for (const n of t) for (const t of n) {
  3978. const n = [t.x + o[0], t.y + o[1]];
  3979. Mt(n, e, r, i), a.push(n)
  3980. }
  3981. return a
  3982. }
  3983. function At(t, e, r, n) {
  3984. const i = 8192 * Math.pow(2, n.z), o = [8192 * n.x, 8192 * n.y], a = [];
  3985. for (const r of t) {
  3986. const t = [];
  3987. for (const n of r) {
  3988. const r = [n.x + o[0], n.y + o[1]];
  3989. _t(e, r), t.push(r)
  3990. }
  3991. a.push(t)
  3992. }
  3993. if (e[2] - e[0] <= i / 2) {
  3994. (s = e)[0] = s[1] = 1 / 0, s[2] = s[3] = -1 / 0;
  3995. for (const t of a) for (const n of t) Mt(n, e, r, i)
  3996. }
  3997. var s;
  3998. return a
  3999. }
  4000. class kt {
  4001. constructor(t, e) {
  4002. this.type = D, this.geojson = t, this.geometries = e
  4003. }
  4004. static parse(t, e) {
  4005. if (2 !== t.length) return e.error(`'within' expression requires exactly one argument, but found ${t.length - 1} instead.`);
  4006. if (it(t[1])) {
  4007. const e = t[1];
  4008. if ("FeatureCollection" === e.type) for (let t = 0; t < e.features.length; ++t) {
  4009. const r = e.features[t].geometry.type;
  4010. if ("Polygon" === r || "MultiPolygon" === r) return new kt(e, e.features[t].geometry)
  4011. } else if ("Feature" === e.type) {
  4012. const t = e.geometry.type;
  4013. if ("Polygon" === t || "MultiPolygon" === t) return new kt(e, e.geometry)
  4014. } else if ("Polygon" === e.type || "MultiPolygon" === e.type) return new kt(e, e)
  4015. }
  4016. return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")
  4017. }
  4018. evaluate(t) {
  4019. if (null != t.geometry() && null != t.canonicalID()) {
  4020. if ("Point" === t.geometryType()) return function (t, e) {
  4021. const r = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], i = t.canonicalID();
  4022. if ("Polygon" === e.type) {
  4023. const o = It(e.coordinates, n, i), a = Ft(t.geometry(), r, n, i);
  4024. if (!bt(r, n)) return !1;
  4025. for (const t of a) if (!St(t, o)) return !1
  4026. }
  4027. if ("MultiPolygon" === e.type) {
  4028. const o = Lt(e.coordinates, n, i), a = Ft(t.geometry(), r, n, i);
  4029. if (!bt(r, n)) return !1;
  4030. for (const t of a) if (!Et(t, o)) return !1
  4031. }
  4032. return !0
  4033. }(t, this.geometries);
  4034. if ("LineString" === t.geometryType()) return function (t, e) {
  4035. const r = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n = [1 / 0, 1 / 0, -1 / 0, -1 / 0], i = t.canonicalID();
  4036. if ("Polygon" === e.type) {
  4037. const o = It(e.coordinates, n, i), a = At(t.geometry(), r, n, i);
  4038. if (!bt(r, n)) return !1;
  4039. for (const t of a) if (!Pt(t, o)) return !1
  4040. }
  4041. if ("MultiPolygon" === e.type) {
  4042. const o = Lt(e.coordinates, n, i), a = At(t.geometry(), r, n, i);
  4043. if (!bt(r, n)) return !1;
  4044. for (const t of a) if (!Rt(t, o)) return !1
  4045. }
  4046. return !0
  4047. }(t, this.geometries)
  4048. }
  4049. return !1
  4050. }
  4051. eachChild() {
  4052. }
  4053. outputDefined() {
  4054. return !0
  4055. }
  4056. serialize() {
  4057. return ["within", this.geojson]
  4058. }
  4059. }
  4060. function jt(t) {
  4061. if (t instanceof mt) {
  4062. if ("get" === t.name && 1 === t.args.length) return !1;
  4063. if ("feature-state" === t.name) return !1;
  4064. if ("has" === t.name && 1 === t.args.length) return !1;
  4065. if ("properties" === t.name || "geometry-type" === t.name || "id" === t.name) return !1;
  4066. if (/^filter-/.test(t.name)) return !1
  4067. }
  4068. if (t instanceof kt) return !1;
  4069. let e = !0;
  4070. return t.eachChild(t => {
  4071. e && !jt(t) && (e = !1)
  4072. }), e
  4073. }
  4074. function Nt(t) {
  4075. if (t instanceof mt && "feature-state" === t.name) return !1;
  4076. let e = !0;
  4077. return t.eachChild(t => {
  4078. e && !Nt(t) && (e = !1)
  4079. }), e
  4080. }
  4081. function Dt(t, e) {
  4082. if (t instanceof mt && e.indexOf(t.name) >= 0) return !1;
  4083. let r = !0;
  4084. return t.eachChild(t => {
  4085. r && !Dt(t, e) && (r = !1)
  4086. }), r
  4087. }
  4088. class Gt {
  4089. constructor(t, e) {
  4090. this.type = e.type, this.name = t, this.boundExpression = e
  4091. }
  4092. static parse(t, e) {
  4093. if (2 !== t.length || "string" != typeof t[1]) return e.error("'var' expression requires exactly one string literal argument.");
  4094. const r = t[1];
  4095. return e.scope.has(r) ? new Gt(r, e.scope.get(r)) : e.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`, 1)
  4096. }
  4097. evaluate(t) {
  4098. return this.boundExpression.evaluate(t)
  4099. }
  4100. eachChild() {
  4101. }
  4102. outputDefined() {
  4103. return !1
  4104. }
  4105. serialize() {
  4106. return ["var", this.name]
  4107. }
  4108. }
  4109. class zt {
  4110. constructor(t, e = [], r, n = new A, i = []) {
  4111. this.registry = t, this.path = e, this.key = e.map(t => `[${t}]`).join(""), this.scope = n, this.errors = i, this.expectedType = r
  4112. }
  4113. parse(t, e, r, n, i = {}) {
  4114. return e ? this.concat(e, r, n)._parse(t, i) : this._parse(t, i)
  4115. }
  4116. _parse(t, e) {
  4117. function r(t, e, r) {
  4118. return "assert" === r ? new ct(e, [t]) : "coerce" === r ? new dt(e, [t]) : t
  4119. }
  4120. if (null !== t && "string" != typeof t && "boolean" != typeof t && "number" != typeof t || (t = ["literal", t]), Array.isArray(t)) {
  4121. if (0 === t.length) return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');
  4122. const n = t[0];
  4123. if ("string" != typeof n) return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`, 0), null;
  4124. const i = this.registry[n];
  4125. if (i) {
  4126. let n = i.parse(t, this);
  4127. if (!n) return null;
  4128. if (this.expectedType) {
  4129. const t = this.expectedType, i = n.type;
  4130. if ("string" !== t.kind && "number" !== t.kind && "boolean" !== t.kind && "object" !== t.kind && "array" !== t.kind || "value" !== i.kind) if ("color" !== t.kind && "formatted" !== t.kind && "resolvedImage" !== t.kind || "value" !== i.kind && "string" !== i.kind) {
  4131. if (this.checkSubtype(t, i)) return null
  4132. } else n = r(n, t, e.typeAnnotation || "coerce"); else n = r(n, t, e.typeAnnotation || "assert")
  4133. }
  4134. if (!(n instanceof st) && "resolvedImage" !== n.type.kind && function t(e) {
  4135. if (e instanceof Gt) return t(e.boundExpression);
  4136. if (e instanceof mt && "error" === e.name) return !1;
  4137. if (e instanceof vt) return !1;
  4138. if (e instanceof kt) return !1;
  4139. const r = e instanceof dt || e instanceof ct;
  4140. let n = !0;
  4141. if (e.eachChild(e => {
  4142. n = r ? n && t(e) : n && e instanceof st
  4143. }), !n) return !1;
  4144. return jt(e) && Dt(e, ["zoom", "heatmap-density", "line-progress", "sky-radial-progress", "accumulated", "is-supported-script"])
  4145. }(n)) {
  4146. const t = new yt;
  4147. try {
  4148. n = new st(n.type, n.evaluate(t))
  4149. } catch (t) {
  4150. return this.error(t.message), null
  4151. }
  4152. }
  4153. return n
  4154. }
  4155. return this.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`, 0)
  4156. }
  4157. return void 0 === t ? this.error("'undefined' value invalid. Use null instead.") : "object" == typeof t ? this.error('Bare objects invalid. Use ["literal", {...}] instead.') : this.error(`Expected an array, but found ${typeof t} instead.`)
  4158. }
  4159. concat(t, e, r) {
  4160. const n = "number" == typeof t ? this.path.concat(t) : this.path, i = r ? this.scope.concat(r) : this.scope;
  4161. return new zt(this.registry, n, e || null, i, this.errors)
  4162. }
  4163. error(t, ...e) {
  4164. const r = `${this.key}${e.map(t => `[${t}]`).join("")}`;
  4165. this.errors.push(new F(r, t))
  4166. }
  4167. checkSubtype(t, e) {
  4168. const r = Z(t, e);
  4169. return r && this.error(r), r
  4170. }
  4171. }
  4172. function Ut(t, e) {
  4173. const r = t.length - 1;
  4174. let n, i, o = 0, a = r, s = 0;
  4175. for (; o <= a;) if (s = Math.floor((o + a) / 2), n = t[s], i = t[s + 1], n <= e) {
  4176. if (s === r || e < i) return s;
  4177. o = s + 1
  4178. } else {
  4179. if (!(n > e)) throw new lt("Input is not a number.");
  4180. a = s - 1
  4181. }
  4182. return 0
  4183. }
  4184. class Bt {
  4185. constructor(t, e, r) {
  4186. this.type = t, this.input = e, this.labels = [], this.outputs = [];
  4187. for (const [t, e] of r) this.labels.push(t), this.outputs.push(e)
  4188. }
  4189. static parse(t, e) {
  4190. if (t.length - 1 < 4) return e.error(`Expected at least 4 arguments, but found only ${t.length - 1}.`);
  4191. if ((t.length - 1) % 2 != 0) return e.error("Expected an even number of arguments.");
  4192. const r = e.parse(t[1], 1, j);
  4193. if (!r) return null;
  4194. const n = [];
  4195. let i = null;
  4196. e.expectedType && "value" !== e.expectedType.kind && (i = e.expectedType);
  4197. for (let r = 1; r < t.length; r += 2) {
  4198. const o = 1 === r ? -1 / 0 : t[r], a = t[r + 1], s = r, l = r + 1;
  4199. if ("number" != typeof o) return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', s);
  4200. if (n.length && n[n.length - 1][0] >= o) return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', s);
  4201. const u = e.parse(a, l, i);
  4202. if (!u) return null;
  4203. i = i || u.type, n.push([o, u])
  4204. }
  4205. return new Bt(i, r, n)
  4206. }
  4207. evaluate(t) {
  4208. const e = this.labels, r = this.outputs;
  4209. if (1 === e.length) return r[0].evaluate(t);
  4210. const n = this.input.evaluate(t);
  4211. if (n <= e[0]) return r[0].evaluate(t);
  4212. const i = e.length;
  4213. if (n >= e[i - 1]) return r[i - 1].evaluate(t);
  4214. return r[Ut(e, n)].evaluate(t)
  4215. }
  4216. eachChild(t) {
  4217. t(this.input);
  4218. for (const e of this.outputs) t(e)
  4219. }
  4220. outputDefined() {
  4221. return this.outputs.every(t => t.outputDefined())
  4222. }
  4223. serialize() {
  4224. const t = ["step", this.input.serialize()];
  4225. for (let e = 0; e < this.labels.length; e++) e > 0 && t.push(this.labels[e]), t.push(this.outputs[e].serialize());
  4226. return t
  4227. }
  4228. }
  4229. var Vt = Yt;
  4230. function Yt(t, e, r, n) {
  4231. this.cx = 3 * t, this.bx = 3 * (r - t) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * e, this.by = 3 * (n - e) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = t, this.p1y = n, this.p2x = r, this.p2y = n
  4232. }
  4233. function Wt(t, e, r) {
  4234. return t * (1 - r) + e * r
  4235. }
  4236. Yt.prototype.sampleCurveX = function (t) {
  4237. return ((this.ax * t + this.bx) * t + this.cx) * t
  4238. }, Yt.prototype.sampleCurveY = function (t) {
  4239. return ((this.ay * t + this.by) * t + this.cy) * t
  4240. }, Yt.prototype.sampleCurveDerivativeX = function (t) {
  4241. return (3 * this.ax * t + 2 * this.bx) * t + this.cx
  4242. }, Yt.prototype.solveCurveX = function (t, e) {
  4243. var r, n, i, o, a;
  4244. for (void 0 === e && (e = 1e-6), i = t, a = 0; a < 8; a++) {
  4245. if (o = this.sampleCurveX(i) - t, Math.abs(o) < e) return i;
  4246. var s = this.sampleCurveDerivativeX(i);
  4247. if (Math.abs(s) < 1e-6) break;
  4248. i -= o / s
  4249. }
  4250. if ((i = t) < (r = 0)) return r;
  4251. if (i > (n = 1)) return n;
  4252. for (; r < n;) {
  4253. if (o = this.sampleCurveX(i), Math.abs(o - t) < e) return i;
  4254. t > o ? r = i : n = i, i = .5 * (n - r) + r
  4255. }
  4256. return i
  4257. }, Yt.prototype.solve = function (t, e) {
  4258. return this.sampleCurveY(this.solveCurveX(t, e))
  4259. };
  4260. var qt = Object.freeze({
  4261. __proto__: null, number: Wt, color: function (t, e, r) {
  4262. return new J(Wt(t.r, e.r, r), Wt(t.g, e.g, r), Wt(t.b, e.b, r), Wt(t.a, e.a, r))
  4263. }, array: function (t, e, r) {
  4264. return t.map((t, n) => Wt(t, e[n], r))
  4265. }
  4266. });
  4267. const Xt = 6 / 29, Zt = 3 * Xt * Xt, Kt = Math.PI / 180, Ht = 180 / Math.PI;
  4268. function $t(t) {
  4269. return t > .008856451679035631 ? Math.pow(t, 1 / 3) : t / Zt + 4 / 29
  4270. }
  4271. function Jt(t) {
  4272. return t > Xt ? t * t * t : Zt * (t - 4 / 29)
  4273. }
  4274. function Qt(t) {
  4275. return 255 * (t <= .0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - .055)
  4276. }
  4277. function te(t) {
  4278. return (t /= 255) <= .04045 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4)
  4279. }
  4280. function ee(t) {
  4281. const e = te(t.r), r = te(t.g), n = te(t.b), i = $t((.4124564 * e + .3575761 * r + .1804375 * n) / .95047),
  4282. o = $t((.2126729 * e + .7151522 * r + .072175 * n) / 1);
  4283. return {
  4284. l: 116 * o - 16,
  4285. a: 500 * (i - o),
  4286. b: 200 * (o - $t((.0193339 * e + .119192 * r + .9503041 * n) / 1.08883)),
  4287. alpha: t.a
  4288. }
  4289. }
  4290. function re(t) {
  4291. let e = (t.l + 16) / 116, r = isNaN(t.a) ? e : e + t.a / 500, n = isNaN(t.b) ? e : e - t.b / 200;
  4292. return e = 1 * Jt(e), r = .95047 * Jt(r), n = 1.08883 * Jt(n), new J(Qt(3.2404542 * r - 1.5371385 * e - .4985314 * n), Qt(-.969266 * r + 1.8760108 * e + .041556 * n), Qt(.0556434 * r - .2040259 * e + 1.0572252 * n), t.alpha)
  4293. }
  4294. function ne(t, e, r) {
  4295. const n = e - t;
  4296. return t + r * (n > 180 || n < -180 ? n - 360 * Math.round(n / 360) : n)
  4297. }
  4298. const ie = {
  4299. forward: ee, reverse: re, interpolate: function (t, e, r) {
  4300. return {l: Wt(t.l, e.l, r), a: Wt(t.a, e.a, r), b: Wt(t.b, e.b, r), alpha: Wt(t.alpha, e.alpha, r)}
  4301. }
  4302. }, oe = {
  4303. forward: function (t) {
  4304. const {l: e, a: r, b: n} = ee(t), i = Math.atan2(n, r) * Ht;
  4305. return {h: i < 0 ? i + 360 : i, c: Math.sqrt(r * r + n * n), l: e, alpha: t.a}
  4306. }, reverse: function (t) {
  4307. const e = t.h * Kt, r = t.c;
  4308. return re({l: t.l, a: Math.cos(e) * r, b: Math.sin(e) * r, alpha: t.alpha})
  4309. }, interpolate: function (t, e, r) {
  4310. return {h: ne(t.h, e.h, r), c: Wt(t.c, e.c, r), l: Wt(t.l, e.l, r), alpha: Wt(t.alpha, e.alpha, r)}
  4311. }
  4312. };
  4313. var ae = Object.freeze({__proto__: null, lab: ie, hcl: oe});
  4314. class se {
  4315. constructor(t, e, r, n, i) {
  4316. this.type = t, this.operator = e, this.interpolation = r, this.input = n, this.labels = [], this.outputs = [];
  4317. for (const [t, e] of i) this.labels.push(t), this.outputs.push(e)
  4318. }
  4319. static interpolationFactor(t, e, r, n) {
  4320. let i = 0;
  4321. if ("exponential" === t.name) i = le(e, t.base, r, n); else if ("linear" === t.name) i = le(e, 1, r, n); else if ("cubic-bezier" === t.name) {
  4322. const o = t.controlPoints;
  4323. i = new Vt(o[0], o[1], o[2], o[3]).solve(le(e, 1, r, n))
  4324. }
  4325. return i
  4326. }
  4327. static parse(t, e) {
  4328. let [r, n, i, ...o] = t;
  4329. if (!Array.isArray(n) || 0 === n.length) return e.error("Expected an interpolation type expression.", 1);
  4330. if ("linear" === n[0]) n = {name: "linear"}; else if ("exponential" === n[0]) {
  4331. const t = n[1];
  4332. if ("number" != typeof t) return e.error("Exponential interpolation requires a numeric base.", 1, 1);
  4333. n = {name: "exponential", base: t}
  4334. } else {
  4335. if ("cubic-bezier" !== n[0]) return e.error("Unknown interpolation type " + String(n[0]), 1, 0);
  4336. {
  4337. const t = n.slice(1);
  4338. if (4 !== t.length || t.some(t => "number" != typeof t || t < 0 || t > 1)) return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1);
  4339. n = {name: "cubic-bezier", controlPoints: t}
  4340. }
  4341. }
  4342. if (t.length - 1 < 4) return e.error(`Expected at least 4 arguments, but found only ${t.length - 1}.`);
  4343. if ((t.length - 1) % 2 != 0) return e.error("Expected an even number of arguments.");
  4344. if (i = e.parse(i, 2, j), !i) return null;
  4345. const a = [];
  4346. let s = null;
  4347. "interpolate-hcl" === r || "interpolate-lab" === r ? s = G : e.expectedType && "value" !== e.expectedType.kind && (s = e.expectedType);
  4348. for (let t = 0; t < o.length; t += 2) {
  4349. const r = o[t], n = o[t + 1], i = t + 3, l = t + 4;
  4350. if ("number" != typeof r) return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', i);
  4351. if (a.length && a[a.length - 1][0] >= r) return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', i);
  4352. const u = e.parse(n, l, s);
  4353. if (!u) return null;
  4354. s = s || u.type, a.push([r, u])
  4355. }
  4356. return "number" === s.kind || "color" === s.kind || "array" === s.kind && "number" === s.itemType.kind && "number" == typeof s.N ? new se(s, r, n, i, a) : e.error(`Type ${q(s)} is not interpolatable.`)
  4357. }
  4358. evaluate(t) {
  4359. const e = this.labels, r = this.outputs;
  4360. if (1 === e.length) return r[0].evaluate(t);
  4361. const n = this.input.evaluate(t);
  4362. if (n <= e[0]) return r[0].evaluate(t);
  4363. const i = e.length;
  4364. if (n >= e[i - 1]) return r[i - 1].evaluate(t);
  4365. const o = Ut(e, n), a = e[o], s = e[o + 1], l = se.interpolationFactor(this.interpolation, n, a, s),
  4366. u = r[o].evaluate(t), c = r[o + 1].evaluate(t);
  4367. return "interpolate" === this.operator ? qt[this.type.kind.toLowerCase()](u, c, l) : "interpolate-hcl" === this.operator ? oe.reverse(oe.interpolate(oe.forward(u), oe.forward(c), l)) : ie.reverse(ie.interpolate(ie.forward(u), ie.forward(c), l))
  4368. }
  4369. eachChild(t) {
  4370. t(this.input);
  4371. for (const e of this.outputs) t(e)
  4372. }
  4373. outputDefined() {
  4374. return this.outputs.every(t => t.outputDefined())
  4375. }
  4376. serialize() {
  4377. let t;
  4378. t = "linear" === this.interpolation.name ? ["linear"] : "exponential" === this.interpolation.name ? 1 === this.interpolation.base ? ["linear"] : ["exponential", this.interpolation.base] : ["cubic-bezier"].concat(this.interpolation.controlPoints);
  4379. const e = [this.operator, t, this.input.serialize()];
  4380. for (let t = 0; t < this.labels.length; t++) e.push(this.labels[t], this.outputs[t].serialize());
  4381. return e
  4382. }
  4383. }
  4384. function le(t, e, r, n) {
  4385. const i = n - r, o = t - r;
  4386. return 0 === i ? 0 : 1 === e ? o / i : (Math.pow(e, o) - 1) / (Math.pow(e, i) - 1)
  4387. }
  4388. class ue {
  4389. constructor(t, e) {
  4390. this.type = t, this.args = e
  4391. }
  4392. static parse(t, e) {
  4393. if (t.length < 2) return e.error("Expectected at least one argument.");
  4394. let r = null;
  4395. const n = e.expectedType;
  4396. n && "value" !== n.kind && (r = n);
  4397. const i = [];
  4398. for (const n of t.slice(1)) {
  4399. const t = e.parse(n, 1 + i.length, r, void 0, {typeAnnotation: "omit"});
  4400. if (!t) return null;
  4401. r = r || t.type, i.push(t)
  4402. }
  4403. const o = n && i.some(t => Z(n, t.type));
  4404. return new ue(o ? U : r, i)
  4405. }
  4406. evaluate(t) {
  4407. let e, r = null, n = 0;
  4408. for (const i of this.args) if (n++, r = i.evaluate(t), r && r instanceof rt && !r.available && (e || (e = r.name), r = null, n === this.args.length && (r = e)), null !== r) break;
  4409. return r
  4410. }
  4411. eachChild(t) {
  4412. this.args.forEach(t)
  4413. }
  4414. outputDefined() {
  4415. return this.args.every(t => t.outputDefined())
  4416. }
  4417. serialize() {
  4418. const t = ["coalesce"];
  4419. return this.eachChild(e => {
  4420. t.push(e.serialize())
  4421. }), t
  4422. }
  4423. }
  4424. class ce {
  4425. constructor(t, e) {
  4426. this.type = e.type, this.bindings = [].concat(t), this.result = e
  4427. }
  4428. evaluate(t) {
  4429. return this.result.evaluate(t)
  4430. }
  4431. eachChild(t) {
  4432. for (const e of this.bindings) t(e[1]);
  4433. t(this.result)
  4434. }
  4435. static parse(t, e) {
  4436. if (t.length < 4) return e.error(`Expected at least 3 arguments, but found ${t.length - 1} instead.`);
  4437. const r = [];
  4438. for (let n = 1; n < t.length - 1; n += 2) {
  4439. const i = t[n];
  4440. if ("string" != typeof i) return e.error(`Expected string, but found ${typeof i} instead.`, n);
  4441. if (/[^a-zA-Z0-9_]/.test(i)) return e.error("Variable names must contain only alphanumeric characters or '_'.", n);
  4442. const o = e.parse(t[n + 1], n + 1);
  4443. if (!o) return null;
  4444. r.push([i, o])
  4445. }
  4446. const n = e.parse(t[t.length - 1], t.length - 1, e.expectedType, r);
  4447. return n ? new ce(r, n) : null
  4448. }
  4449. outputDefined() {
  4450. return this.result.outputDefined()
  4451. }
  4452. serialize() {
  4453. const t = ["let"];
  4454. for (const [e, r] of this.bindings) t.push(e, r.serialize());
  4455. return t.push(this.result.serialize()), t
  4456. }
  4457. }
  4458. class he {
  4459. constructor(t, e, r) {
  4460. this.type = t, this.index = e, this.input = r
  4461. }
  4462. static parse(t, e) {
  4463. if (3 !== t.length) return e.error(`Expected 2 arguments, but found ${t.length - 1} instead.`);
  4464. const r = e.parse(t[1], 1, j), n = e.parse(t[2], 2, W(e.expectedType || U));
  4465. if (!r || !n) return null;
  4466. const i = n.type;
  4467. return new he(i.itemType, r, n)
  4468. }
  4469. evaluate(t) {
  4470. const e = this.index.evaluate(t), r = this.input.evaluate(t);
  4471. if (e < 0) throw new lt(`Array index out of bounds: ${e} < 0.`);
  4472. if (e >= r.length) throw new lt(`Array index out of bounds: ${e} > ${r.length - 1}.`);
  4473. if (e !== Math.floor(e)) throw new lt(`Array index must be an integer, but found ${e} instead.`);
  4474. return r[e]
  4475. }
  4476. eachChild(t) {
  4477. t(this.index), t(this.input)
  4478. }
  4479. outputDefined() {
  4480. return !1
  4481. }
  4482. serialize() {
  4483. return ["at", this.index.serialize(), this.input.serialize()]
  4484. }
  4485. }
  4486. class pe {
  4487. constructor(t, e) {
  4488. this.type = D, this.needle = t, this.haystack = e
  4489. }
  4490. static parse(t, e) {
  4491. if (3 !== t.length) return e.error(`Expected 2 arguments, but found ${t.length - 1} instead.`);
  4492. const r = e.parse(t[1], 1, U), n = e.parse(t[2], 2, U);
  4493. return r && n ? K(r.type, [D, N, j, k, U]) ? new pe(r, n) : e.error(`Expected first argument to be of type boolean, string, number or null, but found ${q(r.type)} instead`) : null
  4494. }
  4495. evaluate(t) {
  4496. const e = this.needle.evaluate(t), r = this.haystack.evaluate(t);
  4497. if (!r) return !1;
  4498. if (!H(e, ["boolean", "string", "number", "null"])) throw new lt(`Expected first argument to be of type boolean, string, number or null, but found ${q(ot(e))} instead.`);
  4499. if (!H(r, ["string", "array"])) throw new lt(`Expected second argument to be of type array or string, but found ${q(ot(r))} instead.`);
  4500. return r.indexOf(e) >= 0
  4501. }
  4502. eachChild(t) {
  4503. t(this.needle), t(this.haystack)
  4504. }
  4505. outputDefined() {
  4506. return !0
  4507. }
  4508. serialize() {
  4509. return ["in", this.needle.serialize(), this.haystack.serialize()]
  4510. }
  4511. }
  4512. class fe {
  4513. constructor(t, e, r) {
  4514. this.type = j, this.needle = t, this.haystack = e, this.fromIndex = r
  4515. }
  4516. static parse(t, e) {
  4517. if (t.length <= 2 || t.length >= 5) return e.error(`Expected 3 or 4 arguments, but found ${t.length - 1} instead.`);
  4518. const r = e.parse(t[1], 1, U), n = e.parse(t[2], 2, U);
  4519. if (!r || !n) return null;
  4520. if (!K(r.type, [D, N, j, k, U])) return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${q(r.type)} instead`);
  4521. if (4 === t.length) {
  4522. const i = e.parse(t[3], 3, j);
  4523. return i ? new fe(r, n, i) : null
  4524. }
  4525. return new fe(r, n)
  4526. }
  4527. evaluate(t) {
  4528. const e = this.needle.evaluate(t), r = this.haystack.evaluate(t);
  4529. if (!H(e, ["boolean", "string", "number", "null"])) throw new lt(`Expected first argument to be of type boolean, string, number or null, but found ${q(ot(e))} instead.`);
  4530. if (!H(r, ["string", "array"])) throw new lt(`Expected second argument to be of type array or string, but found ${q(ot(r))} instead.`);
  4531. if (this.fromIndex) {
  4532. const n = this.fromIndex.evaluate(t);
  4533. return r.indexOf(e, n)
  4534. }
  4535. return r.indexOf(e)
  4536. }
  4537. eachChild(t) {
  4538. t(this.needle), t(this.haystack), this.fromIndex && t(this.fromIndex)
  4539. }
  4540. outputDefined() {
  4541. return !1
  4542. }
  4543. serialize() {
  4544. if (null != this.fromIndex && void 0 !== this.fromIndex) {
  4545. const t = this.fromIndex.serialize();
  4546. return ["index-of", this.needle.serialize(), this.haystack.serialize(), t]
  4547. }
  4548. return ["index-of", this.needle.serialize(), this.haystack.serialize()]
  4549. }
  4550. }
  4551. class de {
  4552. constructor(t, e, r, n, i, o) {
  4553. this.inputType = t, this.type = e, this.input = r, this.cases = n, this.outputs = i, this.otherwise = o
  4554. }
  4555. static parse(t, e) {
  4556. if (t.length < 5) return e.error(`Expected at least 4 arguments, but found only ${t.length - 1}.`);
  4557. if (t.length % 2 != 1) return e.error("Expected an even number of arguments.");
  4558. let r, n;
  4559. e.expectedType && "value" !== e.expectedType.kind && (n = e.expectedType);
  4560. const i = {}, o = [];
  4561. for (let a = 2; a < t.length - 1; a += 2) {
  4562. let s = t[a];
  4563. const l = t[a + 1];
  4564. Array.isArray(s) || (s = [s]);
  4565. const u = e.concat(a);
  4566. if (0 === s.length) return u.error("Expected at least one branch label.");
  4567. for (const t of s) {
  4568. if ("number" != typeof t && "string" != typeof t) return u.error("Branch labels must be numbers or strings.");
  4569. if ("number" == typeof t && Math.abs(t) > Number.MAX_SAFE_INTEGER) return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);
  4570. if ("number" == typeof t && Math.floor(t) !== t) return u.error("Numeric branch labels must be integer values.");
  4571. if (r) {
  4572. if (u.checkSubtype(r, ot(t))) return null
  4573. } else r = ot(t);
  4574. if (void 0 !== i[String(t)]) return u.error("Branch labels must be unique.");
  4575. i[String(t)] = o.length
  4576. }
  4577. const c = e.parse(l, a, n);
  4578. if (!c) return null;
  4579. n = n || c.type, o.push(c)
  4580. }
  4581. const a = e.parse(t[1], 1, U);
  4582. if (!a) return null;
  4583. const s = e.parse(t[t.length - 1], t.length - 1, n);
  4584. return s ? "value" !== a.type.kind && e.concat(1).checkSubtype(r, a.type) ? null : new de(r, n, a, i, o, s) : null
  4585. }
  4586. evaluate(t) {
  4587. const e = this.input.evaluate(t);
  4588. return (ot(e) === this.inputType && this.outputs[this.cases[e]] || this.otherwise).evaluate(t)
  4589. }
  4590. eachChild(t) {
  4591. t(this.input), this.outputs.forEach(t), t(this.otherwise)
  4592. }
  4593. outputDefined() {
  4594. return this.outputs.every(t => t.outputDefined()) && this.otherwise.outputDefined()
  4595. }
  4596. serialize() {
  4597. const t = ["match", this.input.serialize()], e = Object.keys(this.cases).sort(), r = [], n = {};
  4598. for (const t of e) {
  4599. const e = n[this.cases[t]];
  4600. void 0 === e ? (n[this.cases[t]] = r.length, r.push([this.cases[t], [t]])) : r[e][1].push(t)
  4601. }
  4602. const i = t => "number" === this.inputType.kind ? Number(t) : t;
  4603. for (const [e, n] of r) 1 === n.length ? t.push(i(n[0])) : t.push(n.map(i)), t.push(this.outputs[e].serialize());
  4604. return t.push(this.otherwise.serialize()), t
  4605. }
  4606. }
  4607. class ge {
  4608. constructor(t, e, r) {
  4609. this.type = t, this.branches = e, this.otherwise = r
  4610. }
  4611. static parse(t, e) {
  4612. if (t.length < 4) return e.error(`Expected at least 3 arguments, but found only ${t.length - 1}.`);
  4613. if (t.length % 2 != 0) return e.error("Expected an odd number of arguments.");
  4614. let r;
  4615. e.expectedType && "value" !== e.expectedType.kind && (r = e.expectedType);
  4616. const n = [];
  4617. for (let i = 1; i < t.length - 1; i += 2) {
  4618. const o = e.parse(t[i], i, D);
  4619. if (!o) return null;
  4620. const a = e.parse(t[i + 1], i + 1, r);
  4621. if (!a) return null;
  4622. n.push([o, a]), r = r || a.type
  4623. }
  4624. const i = e.parse(t[t.length - 1], t.length - 1, r);
  4625. return i ? new ge(r, n, i) : null
  4626. }
  4627. evaluate(t) {
  4628. for (const [e, r] of this.branches) if (e.evaluate(t)) return r.evaluate(t);
  4629. return this.otherwise.evaluate(t)
  4630. }
  4631. eachChild(t) {
  4632. for (const [e, r] of this.branches) t(e), t(r);
  4633. t(this.otherwise)
  4634. }
  4635. outputDefined() {
  4636. return this.branches.every(([t, e]) => e.outputDefined()) && this.otherwise.outputDefined()
  4637. }
  4638. serialize() {
  4639. const t = ["case"];
  4640. return this.eachChild(e => {
  4641. t.push(e.serialize())
  4642. }), t
  4643. }
  4644. }
  4645. class ye {
  4646. constructor(t, e, r, n) {
  4647. this.type = t, this.input = e, this.beginIndex = r, this.endIndex = n
  4648. }
  4649. static parse(t, e) {
  4650. if (t.length <= 2 || t.length >= 5) return e.error(`Expected 3 or 4 arguments, but found ${t.length - 1} instead.`);
  4651. const r = e.parse(t[1], 1, U), n = e.parse(t[2], 2, j);
  4652. if (!r || !n) return null;
  4653. if (!K(r.type, [W(U), N, U])) return e.error(`Expected first argument to be of type array or string, but found ${q(r.type)} instead`);
  4654. if (4 === t.length) {
  4655. const i = e.parse(t[3], 3, j);
  4656. return i ? new ye(r.type, r, n, i) : null
  4657. }
  4658. return new ye(r.type, r, n)
  4659. }
  4660. evaluate(t) {
  4661. const e = this.input.evaluate(t), r = this.beginIndex.evaluate(t);
  4662. if (!H(e, ["string", "array"])) throw new lt(`Expected first argument to be of type array or string, but found ${q(ot(e))} instead.`);
  4663. if (this.endIndex) {
  4664. const n = this.endIndex.evaluate(t);
  4665. return e.slice(r, n)
  4666. }
  4667. return e.slice(r)
  4668. }
  4669. eachChild(t) {
  4670. t(this.input), t(this.beginIndex), this.endIndex && t(this.endIndex)
  4671. }
  4672. outputDefined() {
  4673. return !1
  4674. }
  4675. serialize() {
  4676. if (null != this.endIndex && void 0 !== this.endIndex) {
  4677. const t = this.endIndex.serialize();
  4678. return ["slice", this.input.serialize(), this.beginIndex.serialize(), t]
  4679. }
  4680. return ["slice", this.input.serialize(), this.beginIndex.serialize()]
  4681. }
  4682. }
  4683. function me(t, e) {
  4684. return "==" === t || "!=" === t ? "boolean" === e.kind || "string" === e.kind || "number" === e.kind || "null" === e.kind || "value" === e.kind : "string" === e.kind || "number" === e.kind || "value" === e.kind
  4685. }
  4686. function ve(t, e, r, n) {
  4687. return 0 === n.compare(e, r)
  4688. }
  4689. function _e(t, e, r) {
  4690. const n = "==" !== t && "!=" !== t;
  4691. return class i {
  4692. constructor(t, e, r) {
  4693. this.type = D, this.lhs = t, this.rhs = e, this.collator = r, this.hasUntypedArgument = "value" === t.type.kind || "value" === e.type.kind
  4694. }
  4695. static parse(t, e) {
  4696. if (3 !== t.length && 4 !== t.length) return e.error("Expected two or three arguments.");
  4697. const r = t[0];
  4698. let o = e.parse(t[1], 1, U);
  4699. if (!o) return null;
  4700. if (!me(r, o.type)) return e.concat(1).error(`"${r}" comparisons are not supported for type '${q(o.type)}'.`);
  4701. let a = e.parse(t[2], 2, U);
  4702. if (!a) return null;
  4703. if (!me(r, a.type)) return e.concat(2).error(`"${r}" comparisons are not supported for type '${q(a.type)}'.`);
  4704. if (o.type.kind !== a.type.kind && "value" !== o.type.kind && "value" !== a.type.kind) return e.error(`Cannot compare types '${q(o.type)}' and '${q(a.type)}'.`);
  4705. n && ("value" === o.type.kind && "value" !== a.type.kind ? o = new ct(a.type, [o]) : "value" !== o.type.kind && "value" === a.type.kind && (a = new ct(o.type, [a])));
  4706. let s = null;
  4707. if (4 === t.length) {
  4708. if ("string" !== o.type.kind && "string" !== a.type.kind && "value" !== o.type.kind && "value" !== a.type.kind) return e.error("Cannot use collator to compare non-string types.");
  4709. if (s = e.parse(t[3], 3, B), !s) return null
  4710. }
  4711. return new i(o, a, s)
  4712. }
  4713. evaluate(i) {
  4714. const o = this.lhs.evaluate(i), a = this.rhs.evaluate(i);
  4715. if (n && this.hasUntypedArgument) {
  4716. const e = ot(o), r = ot(a);
  4717. if (e.kind !== r.kind || "string" !== e.kind && "number" !== e.kind) throw new lt(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${r.kind}) instead.`)
  4718. }
  4719. if (this.collator && !n && this.hasUntypedArgument) {
  4720. const t = ot(o), r = ot(a);
  4721. if ("string" !== t.kind || "string" !== r.kind) return e(i, o, a)
  4722. }
  4723. return this.collator ? r(i, o, a, this.collator.evaluate(i)) : e(i, o, a)
  4724. }
  4725. eachChild(t) {
  4726. t(this.lhs), t(this.rhs), this.collator && t(this.collator)
  4727. }
  4728. outputDefined() {
  4729. return !0
  4730. }
  4731. serialize() {
  4732. const e = [t];
  4733. return this.eachChild(t => {
  4734. e.push(t.serialize())
  4735. }), e
  4736. }
  4737. }
  4738. }
  4739. const be = _e("==", (function (t, e, r) {
  4740. return e === r
  4741. }), ve), xe = _e("!=", (function (t, e, r) {
  4742. return e !== r
  4743. }), (function (t, e, r, n) {
  4744. return !ve(0, e, r, n)
  4745. })), we = _e("<", (function (t, e, r) {
  4746. return e < r
  4747. }), (function (t, e, r, n) {
  4748. return n.compare(e, r) < 0
  4749. })), Se = _e(">", (function (t, e, r) {
  4750. return e > r
  4751. }), (function (t, e, r, n) {
  4752. return n.compare(e, r) > 0
  4753. })), Ee = _e("<=", (function (t, e, r) {
  4754. return e <= r
  4755. }), (function (t, e, r, n) {
  4756. return n.compare(e, r) <= 0
  4757. })), Te = _e(">=", (function (t, e, r) {
  4758. return e >= r
  4759. }), (function (t, e, r, n) {
  4760. return n.compare(e, r) >= 0
  4761. }));
  4762. class Ce {
  4763. constructor(t, e, r, n, i) {
  4764. this.type = N, this.number = t, this.locale = e, this.currency = r, this.minFractionDigits = n, this.maxFractionDigits = i
  4765. }
  4766. static parse(t, e) {
  4767. if (3 !== t.length) return e.error("Expected two arguments.");
  4768. const r = e.parse(t[1], 1, j);
  4769. if (!r) return null;
  4770. const n = t[2];
  4771. if ("object" != typeof n || Array.isArray(n)) return e.error("NumberFormat options argument must be an object.");
  4772. let i = null;
  4773. if (n.locale && (i = e.parse(n.locale, 1, N), !i)) return null;
  4774. let o = null;
  4775. if (n.currency && (o = e.parse(n.currency, 1, N), !o)) return null;
  4776. let a = null;
  4777. if (n["min-fraction-digits"] && (a = e.parse(n["min-fraction-digits"], 1, j), !a)) return null;
  4778. let s = null;
  4779. return n["max-fraction-digits"] && (s = e.parse(n["max-fraction-digits"], 1, j), !s) ? null : new Ce(r, i, o, a, s)
  4780. }
  4781. evaluate(t) {
  4782. return new Intl.NumberFormat(this.locale ? this.locale.evaluate(t) : [], {
  4783. style: this.currency ? "currency" : "decimal",
  4784. currency: this.currency ? this.currency.evaluate(t) : void 0,
  4785. minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(t) : void 0,
  4786. maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(t) : void 0
  4787. }).format(this.number.evaluate(t))
  4788. }
  4789. eachChild(t) {
  4790. t(this.number), this.locale && t(this.locale), this.currency && t(this.currency), this.minFractionDigits && t(this.minFractionDigits), this.maxFractionDigits && t(this.maxFractionDigits)
  4791. }
  4792. outputDefined() {
  4793. return !1
  4794. }
  4795. serialize() {
  4796. const t = {};
  4797. return this.locale && (t.locale = this.locale.serialize()), this.currency && (t.currency = this.currency.serialize()), this.minFractionDigits && (t["min-fraction-digits"] = this.minFractionDigits.serialize()), this.maxFractionDigits && (t["max-fraction-digits"] = this.maxFractionDigits.serialize()), ["number-format", this.number.serialize(), t]
  4798. }
  4799. }
  4800. class Oe {
  4801. constructor(t) {
  4802. this.type = j, this.input = t
  4803. }
  4804. static parse(t, e) {
  4805. if (2 !== t.length) return e.error(`Expected 1 argument, but found ${t.length - 1} instead.`);
  4806. const r = e.parse(t[1], 1);
  4807. return r ? "array" !== r.type.kind && "string" !== r.type.kind && "value" !== r.type.kind ? e.error(`Expected argument of type string or array, but found ${q(r.type)} instead.`) : new Oe(r) : null
  4808. }
  4809. evaluate(t) {
  4810. const e = this.input.evaluate(t);
  4811. if ("string" == typeof e) return e.length;
  4812. if (Array.isArray(e)) return e.length;
  4813. throw new lt(`Expected value to be of type string or array, but found ${q(ot(e))} instead.`)
  4814. }
  4815. eachChild(t) {
  4816. t(this.input)
  4817. }
  4818. outputDefined() {
  4819. return !1
  4820. }
  4821. serialize() {
  4822. const t = ["length"];
  4823. return this.eachChild(e => {
  4824. t.push(e.serialize())
  4825. }), t
  4826. }
  4827. }
  4828. const Pe = {
  4829. "==": be,
  4830. "!=": xe,
  4831. ">": Se,
  4832. "<": we,
  4833. ">=": Te,
  4834. "<=": Ee,
  4835. array: ct,
  4836. at: he,
  4837. boolean: ct,
  4838. case: ge,
  4839. coalesce: ue,
  4840. collator: vt,
  4841. format: ht,
  4842. image: pt,
  4843. in: pe,
  4844. "index-of": fe,
  4845. interpolate: se,
  4846. "interpolate-hcl": se,
  4847. "interpolate-lab": se,
  4848. length: Oe,
  4849. let: ce,
  4850. literal: st,
  4851. match: de,
  4852. number: ct,
  4853. "number-format": Ce,
  4854. object: ct,
  4855. slice: ye,
  4856. step: Bt,
  4857. string: ct,
  4858. "to-boolean": dt,
  4859. "to-color": dt,
  4860. "to-number": dt,
  4861. "to-string": dt,
  4862. var: Gt,
  4863. within: kt
  4864. };
  4865. function Re(t, [e, r, n, i]) {
  4866. e = e.evaluate(t), r = r.evaluate(t), n = n.evaluate(t);
  4867. const o = i ? i.evaluate(t) : 1, a = nt(e, r, n, o);
  4868. if (a) throw new lt(a);
  4869. return new J(e / 255 * o, r / 255 * o, n / 255 * o, o)
  4870. }
  4871. function Ie(t, e) {
  4872. return t in e
  4873. }
  4874. function Le(t, e) {
  4875. const r = e[t];
  4876. return void 0 === r ? null : r
  4877. }
  4878. function Me(t) {
  4879. return {type: t}
  4880. }
  4881. function Fe(t) {
  4882. return {result: "success", value: t}
  4883. }
  4884. function Ae(t) {
  4885. return {result: "error", value: t}
  4886. }
  4887. function ke(t) {
  4888. return "data-driven" === t["property-type"] || "cross-faded-data-driven" === t["property-type"]
  4889. }
  4890. function je(t) {
  4891. return !!t.expression && t.expression.parameters.indexOf("zoom") > -1
  4892. }
  4893. function Ne(t) {
  4894. return !!t.expression && t.expression.interpolated
  4895. }
  4896. function De(t) {
  4897. return t instanceof Number ? "number" : t instanceof String ? "string" : t instanceof Boolean ? "boolean" : Array.isArray(t) ? "array" : null === t ? "null" : typeof t
  4898. }
  4899. function Ge(t) {
  4900. return "object" == typeof t && null !== t && !Array.isArray(t)
  4901. }
  4902. function ze(t) {
  4903. return t
  4904. }
  4905. function Ue(t, e) {
  4906. const r = "color" === e.type, n = t.stops && "object" == typeof t.stops[0][0], i = n || void 0 !== t.property,
  4907. o = n || !i, a = t.type || (Ne(e) ? "exponential" : "interval");
  4908. if (r && ((t = M({}, t)).stops && (t.stops = t.stops.map(t => [t[0], J.parse(t[1])])), t.default ? t.default = J.parse(t.default) : t.default = J.parse(e.default)), t.colorSpace && "rgb" !== t.colorSpace && !ae[t.colorSpace]) throw new Error("Unknown color space: " + t.colorSpace);
  4909. let s, l, u;
  4910. if ("exponential" === a) s = We; else if ("interval" === a) s = Ye; else if ("categorical" === a) {
  4911. s = Ve, l = Object.create(null);
  4912. for (const e of t.stops) l[e[0]] = e[1];
  4913. u = typeof t.stops[0][0]
  4914. } else {
  4915. if ("identity" !== a) throw new Error(`Unknown function type "${a}"`);
  4916. s = qe
  4917. }
  4918. if (n) {
  4919. const r = {}, n = [];
  4920. for (let e = 0; e < t.stops.length; e++) {
  4921. const i = t.stops[e], o = i[0].zoom;
  4922. void 0 === r[o] && (r[o] = {
  4923. zoom: o,
  4924. type: t.type,
  4925. property: t.property,
  4926. default: t.default,
  4927. stops: []
  4928. }, n.push(o)), r[o].stops.push([i[0].value, i[1]])
  4929. }
  4930. const i = [];
  4931. for (const t of n) i.push([r[t].zoom, Ue(r[t], e)]);
  4932. const o = {name: "linear"};
  4933. return {
  4934. kind: "composite",
  4935. interpolationType: o,
  4936. interpolationFactor: se.interpolationFactor.bind(void 0, o),
  4937. zoomStops: i.map(t => t[0]),
  4938. evaluate: ({zoom: r}, n) => We({stops: i, base: t.base}, e, r).evaluate(r, n)
  4939. }
  4940. }
  4941. if (o) {
  4942. const r = "exponential" === a ? {name: "exponential", base: void 0 !== t.base ? t.base : 1} : null;
  4943. return {
  4944. kind: "camera",
  4945. interpolationType: r,
  4946. interpolationFactor: se.interpolationFactor.bind(void 0, r),
  4947. zoomStops: t.stops.map(t => t[0]),
  4948. evaluate: ({zoom: r}) => s(t, e, r, l, u)
  4949. }
  4950. }
  4951. return {
  4952. kind: "source", evaluate(r, n) {
  4953. const i = n && n.properties ? n.properties[t.property] : void 0;
  4954. return void 0 === i ? Be(t.default, e.default) : s(t, e, i, l, u)
  4955. }
  4956. }
  4957. }
  4958. function Be(t, e, r) {
  4959. return void 0 !== t ? t : void 0 !== e ? e : void 0 !== r ? r : void 0
  4960. }
  4961. function Ve(t, e, r, n, i) {
  4962. return Be(typeof r === i ? n[r] : void 0, t.default, e.default)
  4963. }
  4964. function Ye(t, e, r) {
  4965. if ("number" !== De(r)) return Be(t.default, e.default);
  4966. const n = t.stops.length;
  4967. if (1 === n) return t.stops[0][1];
  4968. if (r <= t.stops[0][0]) return t.stops[0][1];
  4969. if (r >= t.stops[n - 1][0]) return t.stops[n - 1][1];
  4970. const i = Ut(t.stops.map(t => t[0]), r);
  4971. return t.stops[i][1]
  4972. }
  4973. function We(t, e, r) {
  4974. const n = void 0 !== t.base ? t.base : 1;
  4975. if ("number" !== De(r)) return Be(t.default, e.default);
  4976. const i = t.stops.length;
  4977. if (1 === i) return t.stops[0][1];
  4978. if (r <= t.stops[0][0]) return t.stops[0][1];
  4979. if (r >= t.stops[i - 1][0]) return t.stops[i - 1][1];
  4980. const o = Ut(t.stops.map(t => t[0]), r), a = function (t, e, r, n) {
  4981. const i = n - r, o = t - r;
  4982. return 0 === i ? 0 : 1 === e ? o / i : (Math.pow(e, o) - 1) / (Math.pow(e, i) - 1)
  4983. }(r, n, t.stops[o][0], t.stops[o + 1][0]), s = t.stops[o][1], l = t.stops[o + 1][1];
  4984. let u = qt[e.type] || ze;
  4985. if (t.colorSpace && "rgb" !== t.colorSpace) {
  4986. const e = ae[t.colorSpace];
  4987. u = (t, r) => e.reverse(e.interpolate(e.forward(t), e.forward(r), a))
  4988. }
  4989. return "function" == typeof s.evaluate ? {
  4990. evaluate(...t) {
  4991. const e = s.evaluate.apply(void 0, t), r = l.evaluate.apply(void 0, t);
  4992. if (void 0 !== e && void 0 !== r) return u(e, r, a)
  4993. }
  4994. } : u(s, l, a)
  4995. }
  4996. function qe(t, e, r) {
  4997. return "color" === e.type ? r = J.parse(r) : "formatted" === e.type ? r = et.fromString(r.toString()) : "resolvedImage" === e.type ? r = rt.fromString(r.toString()) : De(r) === e.type || "enum" === e.type && e.values[r] || (r = void 0), Be(r, t.default, e.default)
  4998. }
  4999. mt.register(Pe, {
  5000. error: [{kind: "error"}, [N], (t, [e]) => {
  5001. throw new lt(e.evaluate(t))
  5002. }],
  5003. typeof: [N, [U], (t, [e]) => q(ot(e.evaluate(t)))],
  5004. "to-rgba": [W(j, 4), [G], (t, [e]) => e.evaluate(t).toArray()],
  5005. rgb: [G, [j, j, j], Re],
  5006. rgba: [G, [j, j, j, j], Re],
  5007. has: {
  5008. type: D,
  5009. overloads: [[[N], (t, [e]) => Ie(e.evaluate(t), t.properties())], [[N, z], (t, [e, r]) => Ie(e.evaluate(t), r.evaluate(t))]]
  5010. },
  5011. get: {
  5012. type: U,
  5013. overloads: [[[N], (t, [e]) => Le(e.evaluate(t), t.properties())], [[N, z], (t, [e, r]) => Le(e.evaluate(t), r.evaluate(t))]]
  5014. },
  5015. "feature-state": [U, [N], (t, [e]) => Le(e.evaluate(t), t.featureState || {})],
  5016. properties: [z, [], t => t.properties()],
  5017. "geometry-type": [N, [], t => t.geometryType()],
  5018. id: [U, [], t => t.id()],
  5019. zoom: [j, [], t => t.globals.zoom],
  5020. "heatmap-density": [j, [], t => t.globals.heatmapDensity || 0],
  5021. "line-progress": [j, [], t => t.globals.lineProgress || 0],
  5022. "sky-radial-progress": [j, [], t => t.globals.skyRadialProgress || 0],
  5023. accumulated: [U, [], t => void 0 === t.globals.accumulated ? null : t.globals.accumulated],
  5024. "+": [j, Me(j), (t, e) => {
  5025. let r = 0;
  5026. for (const n of e) r += n.evaluate(t);
  5027. return r
  5028. }],
  5029. "*": [j, Me(j), (t, e) => {
  5030. let r = 1;
  5031. for (const n of e) r *= n.evaluate(t);
  5032. return r
  5033. }],
  5034. "-": {
  5035. type: j,
  5036. overloads: [[[j, j], (t, [e, r]) => e.evaluate(t) - r.evaluate(t)], [[j], (t, [e]) => -e.evaluate(t)]]
  5037. },
  5038. "/": [j, [j, j], (t, [e, r]) => e.evaluate(t) / r.evaluate(t)],
  5039. "%": [j, [j, j], (t, [e, r]) => e.evaluate(t) % r.evaluate(t)],
  5040. ln2: [j, [], () => Math.LN2],
  5041. pi: [j, [], () => Math.PI],
  5042. e: [j, [], () => Math.E],
  5043. "^": [j, [j, j], (t, [e, r]) => Math.pow(e.evaluate(t), r.evaluate(t))],
  5044. sqrt: [j, [j], (t, [e]) => Math.sqrt(e.evaluate(t))],
  5045. log10: [j, [j], (t, [e]) => Math.log(e.evaluate(t)) / Math.LN10],
  5046. ln: [j, [j], (t, [e]) => Math.log(e.evaluate(t))],
  5047. log2: [j, [j], (t, [e]) => Math.log(e.evaluate(t)) / Math.LN2],
  5048. sin: [j, [j], (t, [e]) => Math.sin(e.evaluate(t))],
  5049. cos: [j, [j], (t, [e]) => Math.cos(e.evaluate(t))],
  5050. tan: [j, [j], (t, [e]) => Math.tan(e.evaluate(t))],
  5051. asin: [j, [j], (t, [e]) => Math.asin(e.evaluate(t))],
  5052. acos: [j, [j], (t, [e]) => Math.acos(e.evaluate(t))],
  5053. atan: [j, [j], (t, [e]) => Math.atan(e.evaluate(t))],
  5054. min: [j, Me(j), (t, e) => Math.min(...e.map(e => e.evaluate(t)))],
  5055. max: [j, Me(j), (t, e) => Math.max(...e.map(e => e.evaluate(t)))],
  5056. abs: [j, [j], (t, [e]) => Math.abs(e.evaluate(t))],
  5057. round: [j, [j], (t, [e]) => {
  5058. const r = e.evaluate(t);
  5059. return r < 0 ? -Math.round(-r) : Math.round(r)
  5060. }],
  5061. floor: [j, [j], (t, [e]) => Math.floor(e.evaluate(t))],
  5062. ceil: [j, [j], (t, [e]) => Math.ceil(e.evaluate(t))],
  5063. "filter-==": [D, [N, U], (t, [e, r]) => t.properties()[e.value] === r.value],
  5064. "filter-id-==": [D, [U], (t, [e]) => t.id() === e.value],
  5065. "filter-type-==": [D, [N], (t, [e]) => t.geometryType() === e.value],
  5066. "filter-<": [D, [N, U], (t, [e, r]) => {
  5067. const n = t.properties()[e.value], i = r.value;
  5068. return typeof n == typeof i && n < i
  5069. }],
  5070. "filter-id-<": [D, [U], (t, [e]) => {
  5071. const r = t.id(), n = e.value;
  5072. return typeof r == typeof n && r < n
  5073. }],
  5074. "filter->": [D, [N, U], (t, [e, r]) => {
  5075. const n = t.properties()[e.value], i = r.value;
  5076. return typeof n == typeof i && n > i
  5077. }],
  5078. "filter-id->": [D, [U], (t, [e]) => {
  5079. const r = t.id(), n = e.value;
  5080. return typeof r == typeof n && r > n
  5081. }],
  5082. "filter-<=": [D, [N, U], (t, [e, r]) => {
  5083. const n = t.properties()[e.value], i = r.value;
  5084. return typeof n == typeof i && n <= i
  5085. }],
  5086. "filter-id-<=": [D, [U], (t, [e]) => {
  5087. const r = t.id(), n = e.value;
  5088. return typeof r == typeof n && r <= n
  5089. }],
  5090. "filter->=": [D, [N, U], (t, [e, r]) => {
  5091. const n = t.properties()[e.value], i = r.value;
  5092. return typeof n == typeof i && n >= i
  5093. }],
  5094. "filter-id->=": [D, [U], (t, [e]) => {
  5095. const r = t.id(), n = e.value;
  5096. return typeof r == typeof n && r >= n
  5097. }],
  5098. "filter-has": [D, [U], (t, [e]) => e.value in t.properties()],
  5099. "filter-has-id": [D, [], t => null !== t.id() && void 0 !== t.id()],
  5100. "filter-type-in": [D, [W(N)], (t, [e]) => e.value.indexOf(t.geometryType()) >= 0],
  5101. "filter-id-in": [D, [W(U)], (t, [e]) => e.value.indexOf(t.id()) >= 0],
  5102. "filter-in-small": [D, [N, W(U)], (t, [e, r]) => r.value.indexOf(t.properties()[e.value]) >= 0],
  5103. "filter-in-large": [D, [N, W(U)], (t, [e, r]) => function (t, e, r, n) {
  5104. for (; r <= n;) {
  5105. const i = r + n >> 1;
  5106. if (e[i] === t) return !0;
  5107. e[i] > t ? n = i - 1 : r = i + 1
  5108. }
  5109. return !1
  5110. }(t.properties()[e.value], r.value, 0, r.value.length - 1)],
  5111. all: {
  5112. type: D, overloads: [[[D, D], (t, [e, r]) => e.evaluate(t) && r.evaluate(t)], [Me(D), (t, e) => {
  5113. for (const r of e) if (!r.evaluate(t)) return !1;
  5114. return !0
  5115. }]]
  5116. },
  5117. any: {
  5118. type: D, overloads: [[[D, D], (t, [e, r]) => e.evaluate(t) || r.evaluate(t)], [Me(D), (t, e) => {
  5119. for (const r of e) if (r.evaluate(t)) return !0;
  5120. return !1
  5121. }]]
  5122. },
  5123. "!": [D, [D], (t, [e]) => !e.evaluate(t)],
  5124. "is-supported-script": [D, [N], (t, [e]) => {
  5125. const r = t.globals && t.globals.isSupportedScript;
  5126. return !r || r(e.evaluate(t))
  5127. }],
  5128. upcase: [N, [N], (t, [e]) => e.evaluate(t).toUpperCase()],
  5129. downcase: [N, [N], (t, [e]) => e.evaluate(t).toLowerCase()],
  5130. concat: [N, Me(U), (t, e) => e.map(e => at(e.evaluate(t))).join("")],
  5131. "resolved-locale": [N, [B], (t, [e]) => e.evaluate(t).resolvedLocale()]
  5132. });
  5133. class Xe {
  5134. constructor(t, e) {
  5135. var r;
  5136. this.expression = t, this._warningHistory = {}, this._evaluator = new yt, this._defaultValue = e ? "color" === (r = e).type && Ge(r.default) ? new J(0, 0, 0, 0) : "color" === r.type ? J.parse(r.default) || null : void 0 === r.default ? null : r.default : null, this._enumValues = e && "enum" === e.type ? e.values : null
  5137. }
  5138. evaluateWithoutErrorHandling(t, e, r, n, i, o) {
  5139. return this._evaluator.globals = t, this._evaluator.feature = e, this._evaluator.featureState = r, this._evaluator.canonical = n, this._evaluator.availableImages = i || null, this._evaluator.formattedSection = o, this.expression.evaluate(this._evaluator)
  5140. }
  5141. evaluate(t, e, r, n, i, o) {
  5142. this._evaluator.globals = t, this._evaluator.feature = e || null, this._evaluator.featureState = r || null, this._evaluator.canonical = n, this._evaluator.availableImages = i || null, this._evaluator.formattedSection = o || null;
  5143. try {
  5144. const t = this.expression.evaluate(this._evaluator);
  5145. if (null == t || "number" == typeof t && t != t) return this._defaultValue;
  5146. if (this._enumValues && !(t in this._enumValues)) throw new lt(`Expected value to be one of ${Object.keys(this._enumValues).map(t => JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);
  5147. return t
  5148. } catch (t) {
  5149. return this._warningHistory[t.message] || (this._warningHistory[t.message] = !0, "undefined" != typeof console && console.warn(t.message)), this._defaultValue
  5150. }
  5151. }
  5152. }
  5153. function Ze(t) {
  5154. return Array.isArray(t) && t.length > 0 && "string" == typeof t[0] && t[0] in Pe
  5155. }
  5156. function Ke(t, e) {
  5157. const r = new zt(Pe, [], e ? function (t) {
  5158. const e = {color: G, string: N, number: j, enum: N, boolean: D, formatted: V, resolvedImage: Y};
  5159. if ("array" === t.type) return W(e[t.value] || U, t.length);
  5160. return e[t.type]
  5161. }(e) : void 0),
  5162. n = r.parse(t, void 0, void 0, void 0, e && "string" === e.type ? {typeAnnotation: "coerce"} : void 0);
  5163. return n ? Fe(new Xe(n, e)) : Ae(r.errors)
  5164. }
  5165. class He {
  5166. constructor(t, e) {
  5167. this.kind = t, this._styleExpression = e, this.isStateDependent = "constant" !== t && !Nt(e.expression)
  5168. }
  5169. evaluateWithoutErrorHandling(t, e, r, n, i, o) {
  5170. return this._styleExpression.evaluateWithoutErrorHandling(t, e, r, n, i, o)
  5171. }
  5172. evaluate(t, e, r, n, i, o) {
  5173. return this._styleExpression.evaluate(t, e, r, n, i, o)
  5174. }
  5175. }
  5176. class $e {
  5177. constructor(t, e, r, n) {
  5178. this.kind = t, this.zoomStops = r, this._styleExpression = e, this.isStateDependent = "camera" !== t && !Nt(e.expression), this.interpolationType = n
  5179. }
  5180. evaluateWithoutErrorHandling(t, e, r, n, i, o) {
  5181. return this._styleExpression.evaluateWithoutErrorHandling(t, e, r, n, i, o)
  5182. }
  5183. evaluate(t, e, r, n, i, o) {
  5184. return this._styleExpression.evaluate(t, e, r, n, i, o)
  5185. }
  5186. interpolationFactor(t, e, r) {
  5187. return this.interpolationType ? se.interpolationFactor(this.interpolationType, t, e, r) : 0
  5188. }
  5189. }
  5190. function Je(t, e) {
  5191. if ("error" === (t = Ke(t, e)).result) return t;
  5192. const r = t.value.expression, n = jt(r);
  5193. if (!n && !ke(e)) return Ae([new F("", "data expressions not supported")]);
  5194. const i = Dt(r, ["zoom"]);
  5195. if (!i && !je(e)) return Ae([new F("", "zoom expressions not supported")]);
  5196. const o = function t(e) {
  5197. let r = null;
  5198. if (e instanceof ce) r = t(e.result); else if (e instanceof ue) {
  5199. for (const n of e.args) if (r = t(n), r) break
  5200. } else (e instanceof Bt || e instanceof se) && e.input instanceof mt && "zoom" === e.input.name && (r = e);
  5201. if (r instanceof F) return r;
  5202. return e.eachChild(e => {
  5203. const n = t(e);
  5204. n instanceof F ? r = n : !r && n ? r = new F("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : r && n && r !== n && (r = new F("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))
  5205. }), r
  5206. }(r);
  5207. if (!o && !i) return Ae([new F("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
  5208. if (o instanceof F) return Ae([o]);
  5209. if (o instanceof se && !Ne(e)) return Ae([new F("", '"interpolate" expressions cannot be used with this property')]);
  5210. if (!o) return Fe(new He(n ? "constant" : "source", t.value));
  5211. const a = o instanceof se ? o.interpolation : void 0;
  5212. return Fe(new $e(n ? "camera" : "composite", t.value, o.labels, a))
  5213. }
  5214. class Qe {
  5215. constructor(t, e) {
  5216. this._parameters = t, this._specification = e, M(this, Ue(this._parameters, this._specification))
  5217. }
  5218. static deserialize(t) {
  5219. return new Qe(t._parameters, t._specification)
  5220. }
  5221. static serialize(t) {
  5222. return {_parameters: t._parameters, _specification: t._specification}
  5223. }
  5224. }
  5225. function tr(t) {
  5226. return "object" == typeof t ? ["literal", t] : t
  5227. }
  5228. function er(t, e) {
  5229. let r = t.stops;
  5230. if (!r) return function (t, e) {
  5231. const r = ["get", t.property];
  5232. if (void 0 === t.default) return "string" === e.type ? ["string", r] : r;
  5233. if ("enum" === e.type) return ["match", r, Object.keys(e.values), r, t.default];
  5234. {
  5235. const n = ["color" === e.type ? "to-color" : e.type, r, tr(t.default)];
  5236. return "array" === e.type && n.splice(1, 0, e.value, e.length || null), n
  5237. }
  5238. }(t, e);
  5239. const n = r && "object" == typeof r[0][0], i = n || void 0 !== t.property, o = n || !i;
  5240. return r = r.map(t => !i && e.tokens && "string" == typeof t[1] ? [t[0], lr(t[1])] : [t[0], tr(t[1])]), n ? function (t, e, r) {
  5241. const n = {}, i = {}, o = [];
  5242. for (let e = 0; e < r.length; e++) {
  5243. const a = r[e], s = a[0].zoom;
  5244. void 0 === n[s] && (n[s] = {
  5245. zoom: s,
  5246. type: t.type,
  5247. property: t.property,
  5248. default: t.default
  5249. }, i[s] = [], o.push(s)), i[s].push([a[0].value, a[1]])
  5250. }
  5251. if ("exponential" === sr({}, e)) {
  5252. const r = [rr(t), ["linear"], ["zoom"]];
  5253. for (const t of o) {
  5254. const o = ir(n[t], e, i[t]);
  5255. ar(r, t, o, !1)
  5256. }
  5257. return r
  5258. }
  5259. {
  5260. const t = ["step", ["zoom"]];
  5261. for (const r of o) {
  5262. const o = ir(n[r], e, i[r]);
  5263. ar(t, r, o, !0)
  5264. }
  5265. return or(t), t
  5266. }
  5267. }(t, e, r) : o ? function (t, e, r, n = ["zoom"]) {
  5268. const i = sr(t, e);
  5269. let o, a = !1;
  5270. if ("interval" === i) o = ["step", n], a = !0; else {
  5271. if ("exponential" !== i) throw new Error(`Unknown zoom function type "${i}"`);
  5272. {
  5273. const e = void 0 !== t.base ? t.base : 1;
  5274. o = [rr(t), 1 === e ? ["linear"] : ["exponential", e], n]
  5275. }
  5276. }
  5277. for (const t of r) ar(o, t[0], t[1], a);
  5278. return or(o), o
  5279. }(t, e, r) : ir(t, e, r)
  5280. }
  5281. function rr(t) {
  5282. switch (t.colorSpace) {
  5283. case"hcl":
  5284. return "interpolate-hcl";
  5285. case"lab":
  5286. return "interpolate-lab";
  5287. default:
  5288. return "interpolate"
  5289. }
  5290. }
  5291. function nr(t, e) {
  5292. const r = tr((n = t.default, i = e.default, void 0 !== n ? n : void 0 !== i ? i : void 0));
  5293. var n, i;
  5294. return void 0 === r && "resolvedImage" === e.type ? "" : r
  5295. }
  5296. function ir(t, e, r) {
  5297. const n = sr(t, e), i = ["get", t.property];
  5298. if ("categorical" === n && "boolean" == typeof r[0][0]) {
  5299. const n = ["case"];
  5300. for (const t of r) n.push(["==", i, t[0]], t[1]);
  5301. return n.push(nr(t, e)), n
  5302. }
  5303. if ("categorical" === n) {
  5304. const n = ["match", i];
  5305. for (const t of r) ar(n, t[0], t[1], !1);
  5306. return n.push(nr(t, e)), n
  5307. }
  5308. if ("interval" === n) {
  5309. const e = ["step", ["number", i]];
  5310. for (const t of r) ar(e, t[0], t[1], !0);
  5311. return or(e), void 0 === t.default ? e : ["case", ["==", ["typeof", i], "number"], e, tr(t.default)]
  5312. }
  5313. if ("exponential" === n) {
  5314. const e = void 0 !== t.base ? t.base : 1,
  5315. n = [rr(t), 1 === e ? ["linear"] : ["exponential", e], ["number", i]];
  5316. for (const t of r) ar(n, t[0], t[1], !1);
  5317. return void 0 === t.default ? n : ["case", ["==", ["typeof", i], "number"], n, tr(t.default)]
  5318. }
  5319. throw new Error("Unknown property function type " + n)
  5320. }
  5321. function or(t) {
  5322. "step" === t[0] && 3 === t.length && (t.push(0), t.push(t[3]))
  5323. }
  5324. function ar(t, e, r, n) {
  5325. t.length > 3 && e === t[t.length - 2] || (n && 2 === t.length || t.push(e), t.push(r))
  5326. }
  5327. function sr(t, e) {
  5328. return t.type ? t.type : e.expression.interpolated ? "exponential" : "interval"
  5329. }
  5330. function lr(t) {
  5331. const e = ["concat"], r = /{([^{}]+)}/g;
  5332. let n = 0;
  5333. for (let i = r.exec(t); null !== i; i = r.exec(t)) {
  5334. const o = t.slice(n, r.lastIndex - i[0].length);
  5335. n = r.lastIndex, o.length > 0 && e.push(o), e.push(["get", i[1]])
  5336. }
  5337. if (1 === e.length) return t;
  5338. if (n < t.length) e.push(t.slice(n)); else if (2 === e.length) return ["to-string", e[1]];
  5339. return e
  5340. }
  5341. function ur(t) {
  5342. if (!0 === t || !1 === t) return !0;
  5343. if (!Array.isArray(t) || 0 === t.length) return !1;
  5344. switch (t[0]) {
  5345. case"has":
  5346. return t.length >= 2 && "$id" !== t[1] && "$type" !== t[1];
  5347. case"in":
  5348. return t.length >= 3 && ("string" != typeof t[1] || Array.isArray(t[2]));
  5349. case"!in":
  5350. case"!has":
  5351. case"none":
  5352. return !1;
  5353. case"==":
  5354. case"!=":
  5355. case">":
  5356. case">=":
  5357. case"<":
  5358. case"<=":
  5359. return 3 !== t.length || Array.isArray(t[1]) || Array.isArray(t[2]);
  5360. case"any":
  5361. case"all":
  5362. for (const e of t.slice(1)) if (!ur(e) && "boolean" != typeof e) return !1;
  5363. return !0;
  5364. default:
  5365. return !0
  5366. }
  5367. }
  5368. const cr = {
  5369. type: "boolean",
  5370. default: !1,
  5371. transition: !1,
  5372. "property-type": "data-driven",
  5373. expression: {interpolated: !1, parameters: ["zoom", "feature"]}
  5374. };
  5375. function hr(t) {
  5376. if (null == t) return {filter: () => !0, needGeometry: !1};
  5377. ur(t) || (t = fr(t));
  5378. const e = Ke(t, cr);
  5379. if ("error" === e.result) throw new Error(e.value.map(t => `${t.key}: ${t.message}`).join(", "));
  5380. return {
  5381. filter: (t, r, n) => e.value.evaluate(t, r, {}, n), needGeometry: function t(e) {
  5382. if (!Array.isArray(e)) return !1;
  5383. if ("within" === e[0]) return !0;
  5384. for (let r = 1; r < e.length; r++) if (t(e[r])) return !0;
  5385. return !1
  5386. }(t)
  5387. }
  5388. }
  5389. function pr(t, e) {
  5390. return t < e ? -1 : t > e ? 1 : 0
  5391. }
  5392. function fr(t) {
  5393. if (!t) return !0;
  5394. const e = t[0];
  5395. if (t.length <= 1) return "any" !== e;
  5396. var r;
  5397. return "==" === e ? dr(t[1], t[2], "==") : "!=" === e ? mr(dr(t[1], t[2], "==")) : "<" === e || ">" === e || "<=" === e || ">=" === e ? dr(t[1], t[2], e) : "any" === e ? (r = t.slice(1), ["any"].concat(r.map(fr))) : "all" === e ? ["all"].concat(t.slice(1).map(fr)) : "none" === e ? ["all"].concat(t.slice(1).map(fr).map(mr)) : "in" === e ? gr(t[1], t.slice(2)) : "!in" === e ? mr(gr(t[1], t.slice(2))) : "has" === e ? yr(t[1]) : "!has" === e ? mr(yr(t[1])) : "within" !== e || t
  5398. }
  5399. function dr(t, e, r) {
  5400. switch (t) {
  5401. case"$type":
  5402. return ["filter-type-" + r, e];
  5403. case"$id":
  5404. return ["filter-id-" + r, e];
  5405. default:
  5406. return ["filter-" + r, t, e]
  5407. }
  5408. }
  5409. function gr(t, e) {
  5410. if (0 === e.length) return !1;
  5411. switch (t) {
  5412. case"$type":
  5413. return ["filter-type-in", ["literal", e]];
  5414. case"$id":
  5415. return ["filter-id-in", ["literal", e]];
  5416. default:
  5417. return e.length > 200 && !e.some(t => typeof t != typeof e[0]) ? ["filter-in-large", t, ["literal", e.sort(pr)]] : ["filter-in-small", t, ["literal", e]]
  5418. }
  5419. }
  5420. function yr(t) {
  5421. switch (t) {
  5422. case"$type":
  5423. return !0;
  5424. case"$id":
  5425. return ["filter-has-id"];
  5426. default:
  5427. return ["filter-has", t]
  5428. }
  5429. }
  5430. function mr(t) {
  5431. return ["!", t]
  5432. }
  5433. var vr = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
  5434. function _r(t, e) {
  5435. const r = {};
  5436. for (const e in t) "ref" !== e && (r[e] = t[e]);
  5437. return vr.forEach(t => {
  5438. t in e && (r[t] = e[t])
  5439. }), r
  5440. }
  5441. function br(t) {
  5442. t = t.slice();
  5443. const e = Object.create(null);
  5444. for (let r = 0; r < t.length; r++) e[t[r].id] = t[r];
  5445. for (let r = 0; r < t.length; r++) "ref" in t[r] && (t[r] = _r(t[r], e[t[r].ref]));
  5446. return t
  5447. }
  5448. class xr {
  5449. constructor(t, e, r, n) {
  5450. this.message = (t ? t + ": " : "") + r, n && (this.identifier = n), null != e && e.__line__ && (this.line = e.__line__)
  5451. }
  5452. }
  5453. class wr {
  5454. constructor(t) {
  5455. this.error = t, this.message = t.message;
  5456. const e = t.message.match(/line (\d+)/);
  5457. this.line = e ? parseInt(e[1], 10) : 0
  5458. }
  5459. }
  5460. function Sr(t) {
  5461. const e = t.key, r = t.value;
  5462. return r ? [new xr(e, r, "constants have been deprecated as of v8")] : []
  5463. }
  5464. function Er(t) {
  5465. return t instanceof Number || t instanceof String || t instanceof Boolean ? t.valueOf() : t
  5466. }
  5467. function Tr(t) {
  5468. if (Array.isArray(t)) return t.map(Tr);
  5469. if (t instanceof Object && !(t instanceof Number || t instanceof String || t instanceof Boolean)) {
  5470. const e = {};
  5471. for (const r in t) e[r] = Tr(t[r]);
  5472. return e
  5473. }
  5474. return Er(t)
  5475. }
  5476. function Cr(t) {
  5477. const e = t.key, r = t.value, n = t.valueSpec || {}, i = t.objectElementValidators || {}, o = t.style,
  5478. a = t.styleSpec;
  5479. let s = [];
  5480. const l = De(r);
  5481. if ("object" !== l) return [new xr(e, r, `object expected, ${l} found`)];
  5482. for (const t in r) {
  5483. const l = t.split(".")[0], u = n[l] || n["*"];
  5484. let c;
  5485. if (i[l]) c = i[l]; else if (n[l]) c = Vr; else if (i["*"]) c = i["*"]; else {
  5486. if (!n["*"]) {
  5487. s.push(new xr(e, r[t], `unknown property "${t}"`));
  5488. continue
  5489. }
  5490. c = Vr
  5491. }
  5492. s = s.concat(c({
  5493. key: (e ? e + "." : e) + t,
  5494. value: r[t],
  5495. valueSpec: u,
  5496. style: o,
  5497. styleSpec: a,
  5498. object: r,
  5499. objectKey: t
  5500. }, r))
  5501. }
  5502. for (const t in n) i[t] || n[t].required && void 0 === n[t].default && void 0 === r[t] && s.push(new xr(e, r, `missing required property "${t}"`));
  5503. return s
  5504. }
  5505. function Or(t) {
  5506. const e = t.value, r = t.valueSpec, n = t.style, i = t.styleSpec, o = t.key, a = t.arrayElementValidator || Vr;
  5507. if ("array" !== De(e)) return [new xr(o, e, `array expected, ${De(e)} found`)];
  5508. if (r.length && e.length !== r.length) return [new xr(o, e, `array length ${r.length} expected, length ${e.length} found`)];
  5509. if (r["min-length"] && e.length < r["min-length"]) return [new xr(o, e, `array length at least ${r["min-length"]} expected, length ${e.length} found`)];
  5510. let s = {type: r.value, values: r.values};
  5511. i.$version < 7 && (s.function = r.function), "object" === De(r.value) && (s = r.value);
  5512. let l = [];
  5513. for (let t = 0; t < e.length; t++) l = l.concat(a({
  5514. array: e,
  5515. arrayIndex: t,
  5516. value: e[t],
  5517. valueSpec: s,
  5518. style: n,
  5519. styleSpec: i,
  5520. key: `${o}[${t}]`
  5521. }));
  5522. return l
  5523. }
  5524. function Pr(t) {
  5525. const e = t.key, r = t.value, n = t.valueSpec;
  5526. let i = De(r);
  5527. return "number" === i && r != r && (i = "NaN"), "number" !== i ? [new xr(e, r, `number expected, ${i} found`)] : "minimum" in n && r < n.minimum ? [new xr(e, r, `${r} is less than the minimum value ${n.minimum}`)] : "maximum" in n && r > n.maximum ? [new xr(e, r, `${r} is greater than the maximum value ${n.maximum}`)] : []
  5528. }
  5529. function Rr(t) {
  5530. const e = t.valueSpec, r = Er(t.value.type);
  5531. let n, i, o, a = {};
  5532. const s = "categorical" !== r && void 0 === t.value.property, l = !s,
  5533. u = "array" === De(t.value.stops) && "array" === De(t.value.stops[0]) && "object" === De(t.value.stops[0][0]),
  5534. c = Cr({
  5535. key: t.key,
  5536. value: t.value,
  5537. valueSpec: t.styleSpec.function,
  5538. style: t.style,
  5539. styleSpec: t.styleSpec,
  5540. objectElementValidators: {
  5541. stops: function (t) {
  5542. if ("identity" === r) return [new xr(t.key, t.value, 'identity function may not have a "stops" property')];
  5543. let e = [];
  5544. const n = t.value;
  5545. e = e.concat(Or({
  5546. key: t.key,
  5547. value: n,
  5548. valueSpec: t.valueSpec,
  5549. style: t.style,
  5550. styleSpec: t.styleSpec,
  5551. arrayElementValidator: h
  5552. })), "array" === De(n) && 0 === n.length && e.push(new xr(t.key, n, "array must have at least one stop"));
  5553. return e
  5554. }, default: function (t) {
  5555. return Vr({key: t.key, value: t.value, valueSpec: e, style: t.style, styleSpec: t.styleSpec})
  5556. }
  5557. }
  5558. });
  5559. return "identity" === r && s && c.push(new xr(t.key, t.value, 'missing required property "property"')), "identity" === r || t.value.stops || c.push(new xr(t.key, t.value, 'missing required property "stops"')), "exponential" === r && t.valueSpec.expression && !Ne(t.valueSpec) && c.push(new xr(t.key, t.value, "exponential functions not supported")), t.styleSpec.$version >= 8 && (l && !ke(t.valueSpec) ? c.push(new xr(t.key, t.value, "property functions not supported")) : s && !je(t.valueSpec) && c.push(new xr(t.key, t.value, "zoom functions not supported"))), "categorical" !== r && !u || void 0 !== t.value.property || c.push(new xr(t.key, t.value, '"property" property is required')), c;
  5560. function h(t) {
  5561. let r = [];
  5562. const n = t.value, s = t.key;
  5563. if ("array" !== De(n)) return [new xr(s, n, `array expected, ${De(n)} found`)];
  5564. if (2 !== n.length) return [new xr(s, n, `array length 2 expected, length ${n.length} found`)];
  5565. if (u) {
  5566. if ("object" !== De(n[0])) return [new xr(s, n, `object expected, ${De(n[0])} found`)];
  5567. if (void 0 === n[0].zoom) return [new xr(s, n, "object stop key must have zoom")];
  5568. if (void 0 === n[0].value) return [new xr(s, n, "object stop key must have value")];
  5569. if (o && o > Er(n[0].zoom)) return [new xr(s, n[0].zoom, "stop zoom values must appear in ascending order")];
  5570. Er(n[0].zoom) !== o && (o = Er(n[0].zoom), i = void 0, a = {}), r = r.concat(Cr({
  5571. key: s + "[0]",
  5572. value: n[0],
  5573. valueSpec: {zoom: {}},
  5574. style: t.style,
  5575. styleSpec: t.styleSpec,
  5576. objectElementValidators: {zoom: Pr, value: p}
  5577. }))
  5578. } else r = r.concat(p({
  5579. key: s + "[0]",
  5580. value: n[0],
  5581. valueSpec: {},
  5582. style: t.style,
  5583. styleSpec: t.styleSpec
  5584. }, n));
  5585. return Ze(Tr(n[1])) ? r.concat([new xr(s + "[1]", n[1], "expressions are not allowed in function stops.")]) : r.concat(Vr({
  5586. key: s + "[1]",
  5587. value: n[1],
  5588. valueSpec: e,
  5589. style: t.style,
  5590. styleSpec: t.styleSpec
  5591. }))
  5592. }
  5593. function p(t, o) {
  5594. const s = De(t.value), l = Er(t.value), u = null !== t.value ? t.value : o;
  5595. if (n) {
  5596. if (s !== n) return [new xr(t.key, u, `${s} stop domain type must match previous stop domain type ${n}`)]
  5597. } else n = s;
  5598. if ("number" !== s && "string" !== s && "boolean" !== s) return [new xr(t.key, u, "stop domain value must be a number, string, or boolean")];
  5599. if ("number" !== s && "categorical" !== r) {
  5600. let n = `number expected, ${s} found`;
  5601. return ke(e) && void 0 === r && (n += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new xr(t.key, u, n)]
  5602. }
  5603. return "categorical" !== r || "number" !== s || isFinite(l) && Math.floor(l) === l ? "categorical" !== r && "number" === s && void 0 !== i && l < i ? [new xr(t.key, u, "stop domain values must appear in ascending order")] : (i = l, "categorical" === r && l in a ? [new xr(t.key, u, "stop domain values must be unique")] : (a[l] = !0, [])) : [new xr(t.key, u, "integer expected, found " + l)]
  5604. }
  5605. }
  5606. function Ir(t) {
  5607. const e = ("property" === t.expressionContext ? Je : Ke)(Tr(t.value), t.valueSpec);
  5608. if ("error" === e.result) return e.value.map(e => new xr(`${t.key}${e.key}`, t.value, e.message));
  5609. const r = e.value.expression || e.value._styleExpression.expression;
  5610. if ("property" === t.expressionContext && "text-font" === t.propertyKey && !r.outputDefined()) return [new xr(t.key, t.value, `Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];
  5611. if ("property" === t.expressionContext && "layout" === t.propertyType && !Nt(r)) return [new xr(t.key, t.value, '"feature-state" data expressions are not supported with layout properties.')];
  5612. if ("filter" === t.expressionContext && !Nt(r)) return [new xr(t.key, t.value, '"feature-state" data expressions are not supported with filters.')];
  5613. if (t.expressionContext && 0 === t.expressionContext.indexOf("cluster")) {
  5614. if (!Dt(r, ["zoom", "feature-state"])) return [new xr(t.key, t.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')];
  5615. if ("cluster-initial" === t.expressionContext && !jt(r)) return [new xr(t.key, t.value, "Feature data expressions are not supported with initial expression part of cluster properties.")]
  5616. }
  5617. return []
  5618. }
  5619. function Lr(t) {
  5620. const e = t.key, r = t.value, n = t.valueSpec, i = [];
  5621. return Array.isArray(n.values) ? -1 === n.values.indexOf(Er(r)) && i.push(new xr(e, r, `expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)) : -1 === Object.keys(n.values).indexOf(Er(r)) && i.push(new xr(e, r, `expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)), i
  5622. }
  5623. function Mr(t) {
  5624. return ur(Tr(t.value)) ? Ir(M({}, t, {
  5625. expressionContext: "filter",
  5626. valueSpec: {value: "boolean"}
  5627. })) : function t(e) {
  5628. const r = e.value, n = e.key;
  5629. if ("array" !== De(r)) return [new xr(n, r, `array expected, ${De(r)} found`)];
  5630. const i = e.styleSpec;
  5631. let o, a = [];
  5632. if (r.length < 1) return [new xr(n, r, "filter array must have at least 1 element")];
  5633. switch (a = a.concat(Lr({
  5634. key: n + "[0]",
  5635. value: r[0],
  5636. valueSpec: i.filter_operator,
  5637. style: e.style,
  5638. styleSpec: e.styleSpec
  5639. })), Er(r[0])) {
  5640. case"<":
  5641. case"<=":
  5642. case">":
  5643. case">=":
  5644. r.length >= 2 && "$type" === Er(r[1]) && a.push(new xr(n, r, `"$type" cannot be use with operator "${r[0]}"`));
  5645. case"==":
  5646. case"!=":
  5647. 3 !== r.length && a.push(new xr(n, r, `filter array for operator "${r[0]}" must have 3 elements`));
  5648. case"in":
  5649. case"!in":
  5650. r.length >= 2 && (o = De(r[1]), "string" !== o && a.push(new xr(n + "[1]", r[1], `string expected, ${o} found`)));
  5651. for (let t = 2; t < r.length; t++) o = De(r[t]), "$type" === Er(r[1]) ? a = a.concat(Lr({
  5652. key: `${n}[${t}]`,
  5653. value: r[t],
  5654. valueSpec: i.geometry_type,
  5655. style: e.style,
  5656. styleSpec: e.styleSpec
  5657. })) : "string" !== o && "number" !== o && "boolean" !== o && a.push(new xr(`${n}[${t}]`, r[t], `string, number, or boolean expected, ${o} found`));
  5658. break;
  5659. case"any":
  5660. case"all":
  5661. case"none":
  5662. for (let i = 1; i < r.length; i++) a = a.concat(t({
  5663. key: `${n}[${i}]`,
  5664. value: r[i],
  5665. style: e.style,
  5666. styleSpec: e.styleSpec
  5667. }));
  5668. break;
  5669. case"has":
  5670. case"!has":
  5671. o = De(r[1]), 2 !== r.length ? a.push(new xr(n, r, `filter array for "${r[0]}" operator must have 2 elements`)) : "string" !== o && a.push(new xr(n + "[1]", r[1], `string expected, ${o} found`));
  5672. break;
  5673. case"within":
  5674. o = De(r[1]), 2 !== r.length ? a.push(new xr(n, r, `filter array for "${r[0]}" operator must have 2 elements`)) : "object" !== o && a.push(new xr(n + "[1]", r[1], `object expected, ${o} found`))
  5675. }
  5676. return a
  5677. }(t)
  5678. }
  5679. function Fr(t, e) {
  5680. const r = t.key, n = t.style, i = t.styleSpec, o = t.value, a = t.objectKey, s = i[`${e}_${t.layerType}`];
  5681. if (!s) return [];
  5682. const l = a.match(/^(.*)-transition$/);
  5683. if ("paint" === e && l && s[l[1]] && s[l[1]].transition) return Vr({
  5684. key: r,
  5685. value: o,
  5686. valueSpec: i.transition,
  5687. style: n,
  5688. styleSpec: i
  5689. });
  5690. const u = t.valueSpec || s[a];
  5691. if (!u) return [new xr(r, o, `unknown property "${a}"`)];
  5692. let c;
  5693. if ("string" === De(o) && ke(u) && !u.tokens && (c = /^{([^}]+)}$/.exec(o))) return [new xr(r, o, `"${a}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(c[1])} }\`.`)];
  5694. const h = [];
  5695. return "symbol" === t.layerType && ("text-field" === a && n && !n.glyphs && h.push(new xr(r, o, 'use of "text-field" requires a style "glyphs" property')), "text-font" === a && Ge(Tr(o)) && "identity" === Er(o.type) && h.push(new xr(r, o, '"text-font" does not support identity functions'))), h.concat(Vr({
  5696. key: t.key,
  5697. value: o,
  5698. valueSpec: u,
  5699. style: n,
  5700. styleSpec: i,
  5701. expressionContext: "property",
  5702. propertyType: e,
  5703. propertyKey: a
  5704. }))
  5705. }
  5706. function Ar(t) {
  5707. return Fr(t, "paint")
  5708. }
  5709. function kr(t) {
  5710. return Fr(t, "layout")
  5711. }
  5712. function jr(t) {
  5713. let e = [];
  5714. const r = t.value, n = t.key, i = t.style, o = t.styleSpec;
  5715. r.type || r.ref || e.push(new xr(n, r, 'either "type" or "ref" is required'));
  5716. let a = Er(r.type);
  5717. const s = Er(r.ref);
  5718. if (r.id) {
  5719. const o = Er(r.id);
  5720. for (let a = 0; a < t.arrayIndex; a++) {
  5721. const t = i.layers[a];
  5722. Er(t.id) === o && e.push(new xr(n, r.id, `duplicate layer id "${r.id}", previously used at line ${t.id.__line__}`))
  5723. }
  5724. }
  5725. if ("ref" in r) {
  5726. let t;
  5727. ["type", "source", "source-layer", "filter", "layout"].forEach(t => {
  5728. t in r && e.push(new xr(n, r[t], `"${t}" is prohibited for ref layers`))
  5729. }), i.layers.forEach(e => {
  5730. Er(e.id) === s && (t = e)
  5731. }), t ? t.ref ? e.push(new xr(n, r.ref, "ref cannot reference another ref layer")) : a = Er(t.type) : e.push(new xr(n, r.ref, `ref layer "${s}" not found`))
  5732. } else if ("background" !== a && "sky" !== a) if (r.source) {
  5733. const t = i.sources && i.sources[r.source], o = t && Er(t.type);
  5734. t ? "vector" === o && "raster" === a ? e.push(new xr(n, r.source, `layer "${r.id}" requires a raster source`)) : "raster" === o && "raster" !== a ? e.push(new xr(n, r.source, `layer "${r.id}" requires a vector source`)) : "vector" !== o || r["source-layer"] ? "raster-dem" === o && "hillshade" !== a ? e.push(new xr(n, r.source, "raster-dem source can only be used with layer type 'hillshade'.")) : "line" !== a || !r.paint || !r.paint["line-gradient"] || "geojson" === o && t.lineMetrics || e.push(new xr(n, r, `layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)) : e.push(new xr(n, r, `layer "${r.id}" must specify a "source-layer"`)) : e.push(new xr(n, r.source, `source "${r.source}" not found`))
  5735. } else e.push(new xr(n, r, 'missing required property "source"'));
  5736. return e = e.concat(Cr({
  5737. key: n,
  5738. value: r,
  5739. valueSpec: o.layer,
  5740. style: t.style,
  5741. styleSpec: t.styleSpec,
  5742. objectElementValidators: {
  5743. "*": () => [],
  5744. type: () => Vr({
  5745. key: n + ".type",
  5746. value: r.type,
  5747. valueSpec: o.layer.type,
  5748. style: t.style,
  5749. styleSpec: t.styleSpec,
  5750. object: r,
  5751. objectKey: "type"
  5752. }),
  5753. filter: Mr,
  5754. layout: t => Cr({
  5755. layer: r,
  5756. key: t.key,
  5757. value: t.value,
  5758. style: t.style,
  5759. styleSpec: t.styleSpec,
  5760. objectElementValidators: {"*": t => kr(M({layerType: a}, t))}
  5761. }),
  5762. paint: t => Cr({
  5763. layer: r,
  5764. key: t.key,
  5765. value: t.value,
  5766. style: t.style,
  5767. styleSpec: t.styleSpec,
  5768. objectElementValidators: {"*": t => Ar(M({layerType: a}, t))}
  5769. })
  5770. }
  5771. })), e
  5772. }
  5773. function Nr(t) {
  5774. const e = t.value, r = t.key, n = De(e);
  5775. return "string" !== n ? [new xr(r, e, `string expected, ${n} found`)] : []
  5776. }
  5777. const Dr = {
  5778. promoteId: function ({key: t, value: e}) {
  5779. if ("string" === De(e)) return Nr({key: t, value: e});
  5780. {
  5781. const r = [];
  5782. for (const n in e) r.push(...Nr({key: `${t}.${n}`, value: e[n]}));
  5783. return r
  5784. }
  5785. }
  5786. };
  5787. function Gr(t) {
  5788. const e = t.value, r = t.key, n = t.styleSpec, i = t.style;
  5789. if (!e.type) return [new xr(r, e, '"type" is required')];
  5790. const o = Er(e.type);
  5791. let a;
  5792. switch (o) {
  5793. case"vector":
  5794. case"raster":
  5795. case"raster-dem":
  5796. return a = Cr({
  5797. key: r,
  5798. value: e,
  5799. valueSpec: n["source_" + o.replace("-", "_")],
  5800. style: t.style,
  5801. styleSpec: n,
  5802. objectElementValidators: Dr
  5803. }), a;
  5804. case"geojson":
  5805. if (a = Cr({
  5806. key: r,
  5807. value: e,
  5808. valueSpec: n.source_geojson,
  5809. style: i,
  5810. styleSpec: n,
  5811. objectElementValidators: Dr
  5812. }), e.cluster) for (const t in e.clusterProperties) {
  5813. const [n, i] = e.clusterProperties[t], o = "string" == typeof n ? [n, ["accumulated"], ["get", t]] : n;
  5814. a.push(...Ir({
  5815. key: `${r}.${t}.map`,
  5816. value: i,
  5817. expressionContext: "cluster-map"
  5818. })), a.push(...Ir({key: `${r}.${t}.reduce`, value: o, expressionContext: "cluster-reduce"}))
  5819. }
  5820. return a;
  5821. case"video":
  5822. return Cr({key: r, value: e, valueSpec: n.source_video, style: i, styleSpec: n});
  5823. case"image":
  5824. return Cr({key: r, value: e, valueSpec: n.source_image, style: i, styleSpec: n});
  5825. case"canvas":
  5826. return [new xr(r, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")];
  5827. default:
  5828. return Lr({
  5829. key: r + ".type",
  5830. value: e.type,
  5831. valueSpec: {values: ["vector", "raster", "raster-dem", "geojson", "video", "image"]},
  5832. style: i,
  5833. styleSpec: n
  5834. })
  5835. }
  5836. }
  5837. function zr(t) {
  5838. const e = t.value, r = t.styleSpec, n = r.light, i = t.style;
  5839. let o = [];
  5840. const a = De(e);
  5841. if (void 0 === e) return o;
  5842. if ("object" !== a) return o = o.concat([new xr("light", e, `object expected, ${a} found`)]), o;
  5843. for (const t in e) {
  5844. const a = t.match(/^(.*)-transition$/);
  5845. o = a && n[a[1]] && n[a[1]].transition ? o.concat(Vr({
  5846. key: t,
  5847. value: e[t],
  5848. valueSpec: r.transition,
  5849. style: i,
  5850. styleSpec: r
  5851. })) : n[t] ? o.concat(Vr({
  5852. key: t,
  5853. value: e[t],
  5854. valueSpec: n[t],
  5855. style: i,
  5856. styleSpec: r
  5857. })) : o.concat([new xr(t, e[t], `unknown property "${t}"`)])
  5858. }
  5859. return o
  5860. }
  5861. function Ur(t) {
  5862. const e = t.value, r = t.key, n = t.style, i = t.styleSpec, o = i.terrain;
  5863. let a = [];
  5864. const s = De(e);
  5865. if (void 0 === e) return a;
  5866. if ("object" !== s) return a = a.concat([new xr("terrain", e, `object expected, ${s} found`)]), a;
  5867. for (const t in e) {
  5868. const r = t.match(/^(.*)-transition$/);
  5869. a = r && o[r[1]] && o[r[1]].transition ? a.concat(Vr({
  5870. key: t,
  5871. value: e[t],
  5872. valueSpec: i.transition,
  5873. style: n,
  5874. styleSpec: i
  5875. })) : o[t] ? a.concat(Vr({
  5876. key: t,
  5877. value: e[t],
  5878. valueSpec: o[t],
  5879. style: n,
  5880. styleSpec: i
  5881. })) : a.concat([new xr(t, e[t], `unknown property "${t}"`)])
  5882. }
  5883. if (e.source) {
  5884. const t = n.sources && n.sources[e.source], i = t && Er(t.type);
  5885. t ? "raster-dem" !== i && a.push(new xr(r, e.source, `terrain cannot be used with a source of type ${i}, it only be used with a "raster-dem" source type`)) : a.push(new xr(r, e.source, `source "${e.source}" not found`))
  5886. } else a.push(new xr(r, e, 'terrain is missing required property "source"'));
  5887. return a
  5888. }
  5889. const Br = {
  5890. "*": () => [],
  5891. array: Or,
  5892. boolean: function (t) {
  5893. const e = t.value, r = t.key, n = De(e);
  5894. return "boolean" !== n ? [new xr(r, e, `boolean expected, ${n} found`)] : []
  5895. },
  5896. number: Pr,
  5897. color: function (t) {
  5898. const e = t.key, r = t.value, n = De(r);
  5899. return "string" !== n ? [new xr(e, r, `color expected, ${n} found`)] : null === $(r) ? [new xr(e, r, `color expected, "${r}" found`)] : []
  5900. },
  5901. constants: Sr,
  5902. enum: Lr,
  5903. filter: Mr,
  5904. function: Rr,
  5905. layer: jr,
  5906. object: Cr,
  5907. source: Gr,
  5908. light: zr,
  5909. terrain: Ur,
  5910. string: Nr,
  5911. formatted: function (t) {
  5912. return 0 === Nr(t).length ? [] : Ir(t)
  5913. },
  5914. resolvedImage: function (t) {
  5915. return 0 === Nr(t).length ? [] : Ir(t)
  5916. }
  5917. };
  5918. function Vr(t) {
  5919. const e = t.value, r = t.valueSpec, n = t.styleSpec;
  5920. if (r.expression && Ge(Er(e))) return Rr(t);
  5921. if (r.expression && Ze(Tr(e))) return Ir(t);
  5922. if (r.type && Br[r.type]) return Br[r.type](t);
  5923. return Cr(M({}, t, {valueSpec: r.type ? n[r.type] : r}))
  5924. }
  5925. function Yr(t) {
  5926. const e = t.value, r = t.key, n = Nr(t);
  5927. return n.length || (-1 === e.indexOf("{fontstack}") && n.push(new xr(r, e, '"glyphs" url must include a "{fontstack}" token')), -1 === e.indexOf("{range}") && n.push(new xr(r, e, '"glyphs" url must include a "{range}" token'))), n
  5928. }
  5929. function Wr(t, e = i) {
  5930. let r = [];
  5931. return r = r.concat(Vr({
  5932. key: "",
  5933. value: t,
  5934. valueSpec: e.$root,
  5935. styleSpec: e,
  5936. style: t,
  5937. objectElementValidators: {glyphs: Yr, "*": () => []}
  5938. })), t.constants && (r = r.concat(Sr({key: "constants", value: t.constants, style: t, styleSpec: e}))), qr(r)
  5939. }
  5940. function qr(t) {
  5941. return [].concat(t).sort((t, e) => t.line - e.line)
  5942. }
  5943. function Xr(t) {
  5944. return function (...e) {
  5945. return qr(t.apply(this, e))
  5946. }
  5947. }
  5948. Wr.source = Xr(Gr), Wr.light = Xr(zr), Wr.terrain = Xr(Ur), Wr.layer = Xr(jr), Wr.filter = Xr(Mr), Wr.paintProperty = Xr(Ar), Wr.layoutProperty = Xr(kr);
  5949. var Zr = s((function (t, e) {
  5950. var r = function () {
  5951. var t = function (t, e, r, n) {
  5952. for (r = r || {}, n = t.length; n--; r[t[n]] = e) ;
  5953. return r
  5954. }, e = [1, 12], r = [1, 13], n = [1, 9], i = [1, 10], o = [1, 11], a = [1, 14], s = [1, 15],
  5955. l = [14, 18, 22, 24], u = [18, 22], c = [22, 24], h = {
  5956. trace: function () {
  5957. },
  5958. yy: {},
  5959. symbols_: {
  5960. error: 2,
  5961. JSONString: 3,
  5962. STRING: 4,
  5963. JSONNumber: 5,
  5964. NUMBER: 6,
  5965. JSONNullLiteral: 7,
  5966. NULL: 8,
  5967. JSONBooleanLiteral: 9,
  5968. TRUE: 10,
  5969. FALSE: 11,
  5970. JSONText: 12,
  5971. JSONValue: 13,
  5972. EOF: 14,
  5973. JSONObject: 15,
  5974. JSONArray: 16,
  5975. "{": 17,
  5976. "}": 18,
  5977. JSONMemberList: 19,
  5978. JSONMember: 20,
  5979. ":": 21,
  5980. ",": 22,
  5981. "[": 23,
  5982. "]": 24,
  5983. JSONElementList: 25,
  5984. $accept: 0,
  5985. $end: 1
  5986. },
  5987. terminals_: {
  5988. 2: "error",
  5989. 4: "STRING",
  5990. 6: "NUMBER",
  5991. 8: "NULL",
  5992. 10: "TRUE",
  5993. 11: "FALSE",
  5994. 14: "EOF",
  5995. 17: "{",
  5996. 18: "}",
  5997. 21: ":",
  5998. 22: ",",
  5999. 23: "[",
  6000. 24: "]"
  6001. },
  6002. productions_: [0, [3, 1], [5, 1], [7, 1], [9, 1], [9, 1], [12, 2], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [13, 1], [15, 2], [15, 3], [20, 3], [19, 1], [19, 3], [16, 2], [16, 3], [25, 1], [25, 3]],
  6003. performAction: function (t, e, r, n, i, o, a) {
  6004. var s = o.length - 1;
  6005. switch (i) {
  6006. case 1:
  6007. this.$ = new String(t.replace(/\\(\\|")/g, "$1").replace(/\\n/g, "\n").replace(/\\r/g, "\r").replace(/\\t/g, "\t").replace(/\\v/g, "\v").replace(/\\f/g, "\f").replace(/\\b/g, "\b")), this.$.__line__ = this._$.first_line;
  6008. break;
  6009. case 2:
  6010. this.$ = new Number(t), this.$.__line__ = this._$.first_line;
  6011. break;
  6012. case 3:
  6013. this.$ = null;
  6014. break;
  6015. case 4:
  6016. this.$ = new Boolean(!0), this.$.__line__ = this._$.first_line;
  6017. break;
  6018. case 5:
  6019. this.$ = new Boolean(!1), this.$.__line__ = this._$.first_line;
  6020. break;
  6021. case 6:
  6022. return this.$ = o[s - 1];
  6023. case 13:
  6024. this.$ = {}, Object.defineProperty(this.$, "__line__", {value: this._$.first_line, enumerable: !1});
  6025. break;
  6026. case 14:
  6027. case 19:
  6028. this.$ = o[s - 1], Object.defineProperty(this.$, "__line__", {
  6029. value: this._$.first_line,
  6030. enumerable: !1
  6031. });
  6032. break;
  6033. case 15:
  6034. this.$ = [o[s - 2], o[s]];
  6035. break;
  6036. case 16:
  6037. this.$ = {}, this.$[o[s][0]] = o[s][1];
  6038. break;
  6039. case 17:
  6040. this.$ = o[s - 2], o[s - 2][o[s][0]] = o[s][1];
  6041. break;
  6042. case 18:
  6043. this.$ = [], Object.defineProperty(this.$, "__line__", {value: this._$.first_line, enumerable: !1});
  6044. break;
  6045. case 20:
  6046. this.$ = [o[s]];
  6047. break;
  6048. case 21:
  6049. this.$ = o[s - 2], o[s - 2].push(o[s])
  6050. }
  6051. },
  6052. table: [{
  6053. 3: 5,
  6054. 4: e,
  6055. 5: 6,
  6056. 6: r,
  6057. 7: 3,
  6058. 8: n,
  6059. 9: 4,
  6060. 10: i,
  6061. 11: o,
  6062. 12: 1,
  6063. 13: 2,
  6064. 15: 7,
  6065. 16: 8,
  6066. 17: a,
  6067. 23: s
  6068. }, {1: [3]}, {14: [1, 16]}, t(l, [2, 7]), t(l, [2, 8]), t(l, [2, 9]), t(l, [2, 10]), t(l, [2, 11]), t(l, [2, 12]), t(l, [2, 3]), t(l, [2, 4]), t(l, [2, 5]), t([14, 18, 21, 22, 24], [2, 1]), t(l, [2, 2]), {
  6069. 3: 20,
  6070. 4: e,
  6071. 18: [1, 17],
  6072. 19: 18,
  6073. 20: 19
  6074. }, {
  6075. 3: 5,
  6076. 4: e,
  6077. 5: 6,
  6078. 6: r,
  6079. 7: 3,
  6080. 8: n,
  6081. 9: 4,
  6082. 10: i,
  6083. 11: o,
  6084. 13: 23,
  6085. 15: 7,
  6086. 16: 8,
  6087. 17: a,
  6088. 23: s,
  6089. 24: [1, 21],
  6090. 25: 22
  6091. }, {1: [2, 6]}, t(l, [2, 13]), {
  6092. 18: [1, 24],
  6093. 22: [1, 25]
  6094. }, t(u, [2, 16]), {21: [1, 26]}, t(l, [2, 18]), {
  6095. 22: [1, 28],
  6096. 24: [1, 27]
  6097. }, t(c, [2, 20]), t(l, [2, 14]), {3: 20, 4: e, 20: 29}, {
  6098. 3: 5,
  6099. 4: e,
  6100. 5: 6,
  6101. 6: r,
  6102. 7: 3,
  6103. 8: n,
  6104. 9: 4,
  6105. 10: i,
  6106. 11: o,
  6107. 13: 30,
  6108. 15: 7,
  6109. 16: 8,
  6110. 17: a,
  6111. 23: s
  6112. }, t(l, [2, 19]), {
  6113. 3: 5,
  6114. 4: e,
  6115. 5: 6,
  6116. 6: r,
  6117. 7: 3,
  6118. 8: n,
  6119. 9: 4,
  6120. 10: i,
  6121. 11: o,
  6122. 13: 31,
  6123. 15: 7,
  6124. 16: 8,
  6125. 17: a,
  6126. 23: s
  6127. }, t(u, [2, 17]), t(u, [2, 15]), t(c, [2, 21])],
  6128. defaultActions: {16: [2, 6]},
  6129. parseError: function (t, e) {
  6130. if (!e.recoverable) throw new Error(t);
  6131. this.trace(t)
  6132. },
  6133. parse: function (t) {
  6134. var e = this, r = [0], n = [null], i = [], o = this.table, a = "", s = 0, l = 0, u = 2, c = 1,
  6135. h = i.slice.call(arguments, 1), p = Object.create(this.lexer), f = {yy: {}};
  6136. for (var d in this.yy) Object.prototype.hasOwnProperty.call(this.yy, d) && (f.yy[d] = this.yy[d]);
  6137. p.setInput(t, f.yy), f.yy.lexer = p, f.yy.parser = this, void 0 === p.yylloc && (p.yylloc = {});
  6138. var g = p.yylloc;
  6139. i.push(g);
  6140. var y = p.options && p.options.ranges;
  6141. function m() {
  6142. var t;
  6143. return "number" != typeof (t = p.lex() || c) && (t = e.symbols_[t] || t), t
  6144. }
  6145. "function" == typeof f.yy.parseError ? this.parseError = f.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
  6146. for (var v, _, b, x, w, S, E, T, C = {}; ;) {
  6147. if (_ = r[r.length - 1], this.defaultActions[_] ? b = this.defaultActions[_] : (null == v && (v = m()), b = o[_] && o[_][v]), void 0 === b || !b.length || !b[0]) {
  6148. var O = "";
  6149. for (w in T = [], o[_]) this.terminals_[w] && w > u && T.push("'" + this.terminals_[w] + "'");
  6150. O = p.showPosition ? "Parse error on line " + (s + 1) + ":\n" + p.showPosition() + "\nExpecting " + T.join(", ") + ", got '" + (this.terminals_[v] || v) + "'" : "Parse error on line " + (s + 1) + ": Unexpected " + (v == c ? "end of input" : "'" + (this.terminals_[v] || v) + "'"), this.parseError(O, {
  6151. text: p.match,
  6152. token: this.terminals_[v] || v,
  6153. line: p.yylineno,
  6154. loc: g,
  6155. expected: T
  6156. })
  6157. }
  6158. if (b[0] instanceof Array && b.length > 1) throw new Error("Parse Error: multiple actions possible at state: " + _ + ", token: " + v);
  6159. switch (b[0]) {
  6160. case 1:
  6161. r.push(v), n.push(p.yytext), i.push(p.yylloc), r.push(b[1]), v = null, l = p.yyleng, a = p.yytext, s = p.yylineno, g = p.yylloc;
  6162. break;
  6163. case 2:
  6164. if (S = this.productions_[b[1]][1], C.$ = n[n.length - S], C._$ = {
  6165. first_line: i[i.length - (S || 1)].first_line,
  6166. last_line: i[i.length - 1].last_line,
  6167. first_column: i[i.length - (S || 1)].first_column,
  6168. last_column: i[i.length - 1].last_column
  6169. }, y && (C._$.range = [i[i.length - (S || 1)].range[0], i[i.length - 1].range[1]]), void 0 !== (x = this.performAction.apply(C, [a, l, s, f.yy, b[1], n, i].concat(h)))) return x;
  6170. S && (r = r.slice(0, -1 * S * 2), n = n.slice(0, -1 * S), i = i.slice(0, -1 * S)), r.push(this.productions_[b[1]][0]), n.push(C.$), i.push(C._$), E = o[r[r.length - 2]][r[r.length - 1]], r.push(E);
  6171. break;
  6172. case 3:
  6173. return !0
  6174. }
  6175. }
  6176. return !0
  6177. }
  6178. }, p = {
  6179. EOF: 1,
  6180. parseError: function (t, e) {
  6181. if (!this.yy.parser) throw new Error(t);
  6182. this.yy.parser.parseError(t, e)
  6183. },
  6184. setInput: function (t, e) {
  6185. return this.yy = e || this.yy || {}, this._input = t, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
  6186. first_line: 1,
  6187. first_column: 0,
  6188. last_line: 1,
  6189. last_column: 0
  6190. }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this
  6191. },
  6192. input: function () {
  6193. var t = this._input[0];
  6194. return this.yytext += t, this.yyleng++, this.offset++, this.match += t, this.matched += t, t.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), t
  6195. },
  6196. unput: function (t) {
  6197. var e = t.length, r = t.split(/(?:\r\n?|\n)/g);
  6198. this._input = t + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - e), this.offset -= e;
  6199. var n = this.match.split(/(?:\r\n?|\n)/g);
  6200. this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), r.length - 1 && (this.yylineno -= r.length - 1);
  6201. var i = this.yylloc.range;
  6202. return this.yylloc = {
  6203. first_line: this.yylloc.first_line,
  6204. last_line: this.yylineno + 1,
  6205. first_column: this.yylloc.first_column,
  6206. last_column: r ? (r.length === n.length ? this.yylloc.first_column : 0) + n[n.length - r.length].length - r[0].length : this.yylloc.first_column - e
  6207. }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - e]), this.yyleng = this.yytext.length, this
  6208. },
  6209. more: function () {
  6210. return this._more = !0, this
  6211. },
  6212. reject: function () {
  6213. return this.options.backtrack_lexer ? (this._backtrack = !0, this) : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
  6214. text: "",
  6215. token: null,
  6216. line: this.yylineno
  6217. })
  6218. },
  6219. less: function (t) {
  6220. this.unput(this.match.slice(t))
  6221. },
  6222. pastInput: function () {
  6223. var t = this.matched.substr(0, this.matched.length - this.match.length);
  6224. return (t.length > 20 ? "..." : "") + t.substr(-20).replace(/\n/g, "")
  6225. },
  6226. upcomingInput: function () {
  6227. var t = this.match;
  6228. return t.length < 20 && (t += this._input.substr(0, 20 - t.length)), (t.substr(0, 20) + (t.length > 20 ? "..." : "")).replace(/\n/g, "")
  6229. },
  6230. showPosition: function () {
  6231. var t = this.pastInput(), e = new Array(t.length + 1).join("-");
  6232. return t + this.upcomingInput() + "\n" + e + "^"
  6233. },
  6234. test_match: function (t, e) {
  6235. var r, n, i;
  6236. if (this.options.backtrack_lexer && (i = {
  6237. yylineno: this.yylineno,
  6238. yylloc: {
  6239. first_line: this.yylloc.first_line,
  6240. last_line: this.last_line,
  6241. first_column: this.yylloc.first_column,
  6242. last_column: this.yylloc.last_column
  6243. },
  6244. yytext: this.yytext,
  6245. match: this.match,
  6246. matches: this.matches,
  6247. matched: this.matched,
  6248. yyleng: this.yyleng,
  6249. offset: this.offset,
  6250. _more: this._more,
  6251. _input: this._input,
  6252. yy: this.yy,
  6253. conditionStack: this.conditionStack.slice(0),
  6254. done: this.done
  6255. }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), (n = t[0].match(/(?:\r\n?|\n).*/g)) && (this.yylineno += n.length), this.yylloc = {
  6256. first_line: this.yylloc.last_line,
  6257. last_line: this.yylineno + 1,
  6258. first_column: this.yylloc.last_column,
  6259. last_column: n ? n[n.length - 1].length - n[n.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + t[0].length
  6260. }, this.yytext += t[0], this.match += t[0], this.matches = t, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(t[0].length), this.matched += t[0], r = this.performAction.call(this, this.yy, this, e, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), r) return r;
  6261. if (this._backtrack) {
  6262. for (var o in i) this[o] = i[o];
  6263. return !1
  6264. }
  6265. return !1
  6266. },
  6267. next: function () {
  6268. if (this.done) return this.EOF;
  6269. var t, e, r, n;
  6270. this._input || (this.done = !0), this._more || (this.yytext = "", this.match = "");
  6271. for (var i = this._currentRules(), o = 0; o < i.length; o++) if ((r = this._input.match(this.rules[i[o]])) && (!e || r[0].length > e[0].length)) {
  6272. if (e = r, n = o, this.options.backtrack_lexer) {
  6273. if (!1 !== (t = this.test_match(r, i[o]))) return t;
  6274. if (this._backtrack) {
  6275. e = !1;
  6276. continue
  6277. }
  6278. return !1
  6279. }
  6280. if (!this.options.flex) break
  6281. }
  6282. return e ? !1 !== (t = this.test_match(e, i[n])) && t : "" === this._input ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
  6283. text: "",
  6284. token: null,
  6285. line: this.yylineno
  6286. })
  6287. },
  6288. lex: function () {
  6289. var t = this.next();
  6290. return t || this.lex()
  6291. },
  6292. begin: function (t) {
  6293. this.conditionStack.push(t)
  6294. },
  6295. popState: function () {
  6296. return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0]
  6297. },
  6298. _currentRules: function () {
  6299. return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules
  6300. },
  6301. topState: function (t) {
  6302. return (t = this.conditionStack.length - 1 - Math.abs(t || 0)) >= 0 ? this.conditionStack[t] : "INITIAL"
  6303. },
  6304. pushState: function (t) {
  6305. this.begin(t)
  6306. },
  6307. stateStackSize: function () {
  6308. return this.conditionStack.length
  6309. },
  6310. options: {},
  6311. performAction: function (t, e, r, n) {
  6312. switch (r) {
  6313. case 0:
  6314. break;
  6315. case 1:
  6316. return 6;
  6317. case 2:
  6318. return e.yytext = e.yytext.substr(1, e.yyleng - 2), 4;
  6319. case 3:
  6320. return 17;
  6321. case 4:
  6322. return 18;
  6323. case 5:
  6324. return 23;
  6325. case 6:
  6326. return 24;
  6327. case 7:
  6328. return 22;
  6329. case 8:
  6330. return 21;
  6331. case 9:
  6332. return 10;
  6333. case 10:
  6334. return 11;
  6335. case 11:
  6336. return 8;
  6337. case 12:
  6338. return 14;
  6339. case 13:
  6340. return "INVALID"
  6341. }
  6342. },
  6343. rules: [/^(?:\s+)/, /^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/, /^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/, /^(?:\{)/, /^(?:\})/, /^(?:\[)/, /^(?:\])/, /^(?:,)/, /^(?::)/, /^(?:true\b)/, /^(?:false\b)/, /^(?:null\b)/, /^(?:$)/, /^(?:.)/],
  6344. conditions: {INITIAL: {rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13], inclusive: !0}}
  6345. };
  6346. function f() {
  6347. this.yy = {}
  6348. }
  6349. return h.lexer = p, f.prototype = h, h.Parser = f, new f
  6350. }();
  6351. void 0 !== a && (e.parser = r, e.Parser = r.Parser, e.parse = function () {
  6352. return r.parse.apply(r, arguments)
  6353. })
  6354. }));
  6355. Zr.parser, Zr.Parser, Zr.parse;
  6356. function Kr(t) {
  6357. if (t instanceof String || "string" == typeof t || t instanceof n) try {
  6358. return Zr.parse(t.toString())
  6359. } catch (t) {
  6360. throw new wr(t)
  6361. }
  6362. return t
  6363. }
  6364. function Hr(t, e = i) {
  6365. let r = t;
  6366. try {
  6367. r = Kr(r)
  6368. } catch (t) {
  6369. return [t]
  6370. }
  6371. return Wr(r, e)
  6372. }
  6373. const $r = {
  6374. StyleExpression: Xe,
  6375. isExpression: Ze,
  6376. isExpressionFilter: ur,
  6377. createExpression: Ke,
  6378. createPropertyExpression: Je,
  6379. normalizePropertyExpression: function (t, e) {
  6380. if (Ge(t)) return new Qe(t, e);
  6381. if (Ze(t)) {
  6382. const r = Je(t, e);
  6383. if ("error" === r.result) throw new Error(r.value.map(t => `${t.key}: ${t.message}`).join(", "));
  6384. return r.value
  6385. }
  6386. {
  6387. let r = t;
  6388. return "string" == typeof t && "color" === e.type && (r = J.parse(t)), {kind: "constant", evaluate: () => r}
  6389. }
  6390. },
  6391. ZoomConstantExpression: He,
  6392. ZoomDependentExpression: $e,
  6393. StylePropertyFunction: Qe
  6394. }, Jr = {convertFunction: er, createFunction: Ue, isFunction: Ge};
  6395. Hr.parsed = Hr, Hr.latest = Hr
  6396. }).call(this, r(4), r(7).Buffer)
  6397. }, function (t, e, r) {
  6398. t.exports = function () {
  6399. "use strict";
  6400. function t(t, n, i, o, a) {
  6401. !function t(r, n, i, o, a) {
  6402. for (; o > i;) {
  6403. if (o - i > 600) {
  6404. var s = o - i + 1, l = n - i + 1, u = Math.log(s), c = .5 * Math.exp(2 * u / 3),
  6405. h = .5 * Math.sqrt(u * c * (s - c) / s) * (l - s / 2 < 0 ? -1 : 1);
  6406. t(r, n, Math.max(i, Math.floor(n - l * c / s + h)), Math.min(o, Math.floor(n + (s - l) * c / s + h)), a)
  6407. }
  6408. var p = r[n], f = i, d = o;
  6409. for (e(r, i, n), a(r[o], p) > 0 && e(r, i, o); f < d;) {
  6410. for (e(r, f, d), f++, d--; a(r[f], p) < 0;) f++;
  6411. for (; a(r[d], p) > 0;) d--
  6412. }
  6413. 0 === a(r[i], p) ? e(r, i, d) : e(r, ++d, o), d <= n && (i = d + 1), n <= d && (o = d - 1)
  6414. }
  6415. }(t, n, i || 0, o || t.length - 1, a || r)
  6416. }
  6417. function e(t, e, r) {
  6418. var n = t[e];
  6419. t[e] = t[r], t[r] = n
  6420. }
  6421. function r(t, e) {
  6422. return t < e ? -1 : t > e ? 1 : 0
  6423. }
  6424. var n = function (t) {
  6425. void 0 === t && (t = 9), this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(.4 * this._maxEntries)), this.clear()
  6426. };
  6427. function i(t, e, r) {
  6428. if (!r) return e.indexOf(t);
  6429. for (var n = 0; n < e.length; n++) if (r(t, e[n])) return n;
  6430. return -1
  6431. }
  6432. function o(t, e) {
  6433. a(t, 0, t.children.length, e, t)
  6434. }
  6435. function a(t, e, r, n, i) {
  6436. i || (i = d(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
  6437. for (var o = e; o < r; o++) {
  6438. var a = t.children[o];
  6439. s(i, t.leaf ? n(a) : a)
  6440. }
  6441. return i
  6442. }
  6443. function s(t, e) {
  6444. return t.minX = Math.min(t.minX, e.minX), t.minY = Math.min(t.minY, e.minY), t.maxX = Math.max(t.maxX, e.maxX), t.maxY = Math.max(t.maxY, e.maxY), t
  6445. }
  6446. function l(t, e) {
  6447. return t.minX - e.minX
  6448. }
  6449. function u(t, e) {
  6450. return t.minY - e.minY
  6451. }
  6452. function c(t) {
  6453. return (t.maxX - t.minX) * (t.maxY - t.minY)
  6454. }
  6455. function h(t) {
  6456. return t.maxX - t.minX + (t.maxY - t.minY)
  6457. }
  6458. function p(t, e) {
  6459. return t.minX <= e.minX && t.minY <= e.minY && e.maxX <= t.maxX && e.maxY <= t.maxY
  6460. }
  6461. function f(t, e) {
  6462. return e.minX <= t.maxX && e.minY <= t.maxY && e.maxX >= t.minX && e.maxY >= t.minY
  6463. }
  6464. function d(t) {
  6465. return {children: t, height: 1, leaf: !0, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0}
  6466. }
  6467. function g(e, r, n, i, o) {
  6468. for (var a = [r, n]; a.length;) if (!((n = a.pop()) - (r = a.pop()) <= i)) {
  6469. var s = r + Math.ceil((n - r) / i / 2) * i;
  6470. t(e, s, r, n, o), a.push(r, s, s, n)
  6471. }
  6472. }
  6473. return n.prototype.all = function () {
  6474. return this._all(this.data, [])
  6475. }, n.prototype.search = function (t) {
  6476. var e = this.data, r = [];
  6477. if (!f(t, e)) return r;
  6478. for (var n = this.toBBox, i = []; e;) {
  6479. for (var o = 0; o < e.children.length; o++) {
  6480. var a = e.children[o], s = e.leaf ? n(a) : a;
  6481. f(t, s) && (e.leaf ? r.push(a) : p(t, s) ? this._all(a, r) : i.push(a))
  6482. }
  6483. e = i.pop()
  6484. }
  6485. return r
  6486. }, n.prototype.collides = function (t) {
  6487. var e = this.data;
  6488. if (!f(t, e)) return !1;
  6489. for (var r = []; e;) {
  6490. for (var n = 0; n < e.children.length; n++) {
  6491. var i = e.children[n], o = e.leaf ? this.toBBox(i) : i;
  6492. if (f(t, o)) {
  6493. if (e.leaf || p(t, o)) return !0;
  6494. r.push(i)
  6495. }
  6496. }
  6497. e = r.pop()
  6498. }
  6499. return !1
  6500. }, n.prototype.load = function (t) {
  6501. if (!t || !t.length) return this;
  6502. if (t.length < this._minEntries) {
  6503. for (var e = 0; e < t.length; e++) this.insert(t[e]);
  6504. return this
  6505. }
  6506. var r = this._build(t.slice(), 0, t.length - 1, 0);
  6507. if (this.data.children.length) if (this.data.height === r.height) this._splitRoot(this.data, r); else {
  6508. if (this.data.height < r.height) {
  6509. var n = this.data;
  6510. this.data = r, r = n
  6511. }
  6512. this._insert(r, this.data.height - r.height - 1, !0)
  6513. } else this.data = r;
  6514. return this
  6515. }, n.prototype.insert = function (t) {
  6516. return t && this._insert(t, this.data.height - 1), this
  6517. }, n.prototype.clear = function () {
  6518. return this.data = d([]), this
  6519. }, n.prototype.remove = function (t, e) {
  6520. if (!t) return this;
  6521. for (var r, n, o, a = this.data, s = this.toBBox(t), l = [], u = []; a || l.length;) {
  6522. if (a || (a = l.pop(), n = l[l.length - 1], r = u.pop(), o = !0), a.leaf) {
  6523. var c = i(t, a.children, e);
  6524. if (-1 !== c) return a.children.splice(c, 1), l.push(a), this._condense(l), this
  6525. }
  6526. o || a.leaf || !p(a, s) ? n ? (r++, a = n.children[r], o = !1) : a = null : (l.push(a), u.push(r), r = 0, n = a, a = a.children[0])
  6527. }
  6528. return this
  6529. }, n.prototype.toBBox = function (t) {
  6530. return t
  6531. }, n.prototype.compareMinX = function (t, e) {
  6532. return t.minX - e.minX
  6533. }, n.prototype.compareMinY = function (t, e) {
  6534. return t.minY - e.minY
  6535. }, n.prototype.toJSON = function () {
  6536. return this.data
  6537. }, n.prototype.fromJSON = function (t) {
  6538. return this.data = t, this
  6539. }, n.prototype._all = function (t, e) {
  6540. for (var r = []; t;) t.leaf ? e.push.apply(e, t.children) : r.push.apply(r, t.children), t = r.pop();
  6541. return e
  6542. }, n.prototype._build = function (t, e, r, n) {
  6543. var i, a = r - e + 1, s = this._maxEntries;
  6544. if (a <= s) return o(i = d(t.slice(e, r + 1)), this.toBBox), i;
  6545. n || (n = Math.ceil(Math.log(a) / Math.log(s)), s = Math.ceil(a / Math.pow(s, n - 1))), (i = d([])).leaf = !1, i.height = n;
  6546. var l = Math.ceil(a / s), u = l * Math.ceil(Math.sqrt(s));
  6547. g(t, e, r, u, this.compareMinX);
  6548. for (var c = e; c <= r; c += u) {
  6549. var h = Math.min(c + u - 1, r);
  6550. g(t, c, h, l, this.compareMinY);
  6551. for (var p = c; p <= h; p += l) {
  6552. var f = Math.min(p + l - 1, h);
  6553. i.children.push(this._build(t, p, f, n - 1))
  6554. }
  6555. }
  6556. return o(i, this.toBBox), i
  6557. }, n.prototype._chooseSubtree = function (t, e, r, n) {
  6558. for (; n.push(e), !e.leaf && n.length - 1 !== r;) {
  6559. for (var i = 1 / 0, o = 1 / 0, a = void 0, s = 0; s < e.children.length; s++) {
  6560. var l = e.children[s], u = c(l),
  6561. h = (p = t, f = l, (Math.max(f.maxX, p.maxX) - Math.min(f.minX, p.minX)) * (Math.max(f.maxY, p.maxY) - Math.min(f.minY, p.minY)) - u);
  6562. h < o ? (o = h, i = u < i ? u : i, a = l) : h === o && u < i && (i = u, a = l)
  6563. }
  6564. e = a || e.children[0]
  6565. }
  6566. var p, f;
  6567. return e
  6568. }, n.prototype._insert = function (t, e, r) {
  6569. var n = r ? t : this.toBBox(t), i = [], o = this._chooseSubtree(n, this.data, e, i);
  6570. for (o.children.push(t), s(o, n); e >= 0 && i[e].children.length > this._maxEntries;) this._split(i, e), e--;
  6571. this._adjustParentBBoxes(n, i, e)
  6572. }, n.prototype._split = function (t, e) {
  6573. var r = t[e], n = r.children.length, i = this._minEntries;
  6574. this._chooseSplitAxis(r, i, n);
  6575. var a = this._chooseSplitIndex(r, i, n), s = d(r.children.splice(a, r.children.length - a));
  6576. s.height = r.height, s.leaf = r.leaf, o(r, this.toBBox), o(s, this.toBBox), e ? t[e - 1].children.push(s) : this._splitRoot(r, s)
  6577. }, n.prototype._splitRoot = function (t, e) {
  6578. this.data = d([t, e]), this.data.height = t.height + 1, this.data.leaf = !1, o(this.data, this.toBBox)
  6579. }, n.prototype._chooseSplitIndex = function (t, e, r) {
  6580. for (var n, i, o, s, l, u, h, p = 1 / 0, f = 1 / 0, d = e; d <= r - e; d++) {
  6581. var g = a(t, 0, d, this.toBBox), y = a(t, d, r, this.toBBox),
  6582. m = (i = g, o = y, s = Math.max(i.minX, o.minX), l = Math.max(i.minY, o.minY), u = Math.min(i.maxX, o.maxX), h = Math.min(i.maxY, o.maxY), Math.max(0, u - s) * Math.max(0, h - l)),
  6583. v = c(g) + c(y);
  6584. m < p ? (p = m, n = d, f = v < f ? v : f) : m === p && v < f && (f = v, n = d)
  6585. }
  6586. return n || r - e
  6587. }, n.prototype._chooseSplitAxis = function (t, e, r) {
  6588. var n = t.leaf ? this.compareMinX : l, i = t.leaf ? this.compareMinY : u;
  6589. this._allDistMargin(t, e, r, n) < this._allDistMargin(t, e, r, i) && t.children.sort(n)
  6590. }, n.prototype._allDistMargin = function (t, e, r, n) {
  6591. t.children.sort(n);
  6592. for (var i = this.toBBox, o = a(t, 0, e, i), l = a(t, r - e, r, i), u = h(o) + h(l), c = e; c < r - e; c++) {
  6593. var p = t.children[c];
  6594. s(o, t.leaf ? i(p) : p), u += h(o)
  6595. }
  6596. for (var f = r - e - 1; f >= e; f--) {
  6597. var d = t.children[f];
  6598. s(l, t.leaf ? i(d) : d), u += h(l)
  6599. }
  6600. return u
  6601. }, n.prototype._adjustParentBBoxes = function (t, e, r) {
  6602. for (var n = r; n >= 0; n--) s(e[n], t)
  6603. }, n.prototype._condense = function (t) {
  6604. for (var e = t.length - 1, r = void 0; e >= 0; e--) 0 === t[e].children.length ? e > 0 ? (r = t[e - 1].children).splice(r.indexOf(t[e]), 1) : this.clear() : o(t[e], this.toBBox)
  6605. }, n
  6606. }()
  6607. }, function (t, e) {
  6608. var r = {
  6609. thin: 100,
  6610. hairline: 100,
  6611. "ultra-light": 100,
  6612. "extra-light": 100,
  6613. light: 200,
  6614. book: 300,
  6615. regular: 400,
  6616. normal: 400,
  6617. plain: 400,
  6618. roman: 400,
  6619. standard: 400,
  6620. medium: 500,
  6621. "semi-bold": 600,
  6622. "demi-bold": 600,
  6623. bold: 700,
  6624. heavy: 800,
  6625. black: 800,
  6626. "extra-bold": 800,
  6627. "ultra-black": 900,
  6628. "extra-black": 900,
  6629. "ultra-bold": 900,
  6630. "heavy-black": 900,
  6631. fat: 900,
  6632. poster: 900
  6633. }, n = /(italic|oblique)$/i, i = {};
  6634. t.exports = function (t, e, o) {
  6635. var a = i[t];
  6636. if (!a) {
  6637. Array.isArray(t) || (t = [t]);
  6638. for (var s = 400, l = "normal", u = [], c = 0, h = t.length; c < h; ++c) {
  6639. var p = t[c].split(" "), f = p[p.length - 1].toLowerCase();
  6640. for (var d in "normal" == f || "italic" == f || "oblique" == f ? (l = f, p.pop(), f = p[p.length - 1].toLowerCase()) : n.test(f) && (f = f.replace(n, ""), l = p[p.length - 1].replace(f, "")), r) if (f == d || f == d.replace("-", "") || f == d.replace("-", " ")) {
  6641. s = r[d], p.pop();
  6642. break
  6643. }
  6644. "number" == typeof f && (s = f);
  6645. var g = p.join(" ").replace("Klokantech Noto Sans", "Noto Sans");
  6646. -1 !== g.indexOf(" ") && (g = '"' + g + '"'), u.push(g)
  6647. }
  6648. a = i[t] = [l, s, u]
  6649. }
  6650. return a[0] + " " + a[1] + " " + e + "px" + (o ? "/" + o : "") + " " + a[2]
  6651. }
  6652. }, function (t, e) {
  6653. e.read = function (t, e, r, n, i) {
  6654. var o, a, s = 8 * i - n - 1, l = (1 << s) - 1, u = l >> 1, c = -7, h = r ? i - 1 : 0, p = r ? -1 : 1,
  6655. f = t[e + h];
  6656. for (h += p, o = f & (1 << -c) - 1, f >>= -c, c += s; c > 0; o = 256 * o + t[e + h], h += p, c -= 8) ;
  6657. for (a = o & (1 << -c) - 1, o >>= -c, c += n; c > 0; a = 256 * a + t[e + h], h += p, c -= 8) ;
  6658. if (0 === o) o = 1 - u; else {
  6659. if (o === l) return a ? NaN : 1 / 0 * (f ? -1 : 1);
  6660. a += Math.pow(2, n), o -= u
  6661. }
  6662. return (f ? -1 : 1) * a * Math.pow(2, o - n)
  6663. }, e.write = function (t, e, r, n, i, o) {
  6664. var a, s, l, u = 8 * o - i - 1, c = (1 << u) - 1, h = c >> 1,
  6665. p = 23 === i ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f = n ? 0 : o - 1, d = n ? 1 : -1,
  6666. g = e < 0 || 0 === e && 1 / e < 0 ? 1 : 0;
  6667. for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (s = isNaN(e) ? 1 : 0, a = c) : (a = Math.floor(Math.log(e) / Math.LN2), e * (l = Math.pow(2, -a)) < 1 && (a--, l *= 2), (e += a + h >= 1 ? p / l : p * Math.pow(2, 1 - h)) * l >= 2 && (a++, l /= 2), a + h >= c ? (s = 0, a = c) : a + h >= 1 ? (s = (e * l - 1) * Math.pow(2, i), a += h) : (s = e * Math.pow(2, h - 1) * Math.pow(2, i), a = 0)); i >= 8; t[r + f] = 255 & s, f += d, s /= 256, i -= 8) ;
  6668. for (a = a << i | s, u += i; u > 0; t[r + f] = 255 & a, f += d, a /= 256, u -= 8) ;
  6669. t[r + f - d] |= 128 * g
  6670. }
  6671. }, function (t, e) {
  6672. var r;
  6673. r = function () {
  6674. return this
  6675. }();
  6676. try {
  6677. r = r || new Function("return this")()
  6678. } catch (t) {
  6679. "object" == typeof window && (r = window)
  6680. }
  6681. t.exports = r
  6682. }, function (t, e, r) {
  6683. "use strict";
  6684. t.exports = i;
  6685. var n = r(3);
  6686. function i(t) {
  6687. this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t) ? t : new Uint8Array(t || 0), this.pos = 0, this.type = 0, this.length = this.buf.length
  6688. }
  6689. i.Varint = 0, i.Fixed64 = 1, i.Bytes = 2, i.Fixed32 = 5;
  6690. var o = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf8");
  6691. function a(t) {
  6692. return t.type === i.Bytes ? t.readVarint() + t.pos : t.pos + 1
  6693. }
  6694. function s(t, e, r) {
  6695. return r ? 4294967296 * e + (t >>> 0) : 4294967296 * (e >>> 0) + (t >>> 0)
  6696. }
  6697. function l(t, e, r) {
  6698. var n = e <= 16383 ? 1 : e <= 2097151 ? 2 : e <= 268435455 ? 3 : Math.floor(Math.log(e) / (7 * Math.LN2));
  6699. r.realloc(n);
  6700. for (var i = r.pos - 1; i >= t; i--) r.buf[i + n] = r.buf[i]
  6701. }
  6702. function u(t, e) {
  6703. for (var r = 0; r < t.length; r++) e.writeVarint(t[r])
  6704. }
  6705. function c(t, e) {
  6706. for (var r = 0; r < t.length; r++) e.writeSVarint(t[r])
  6707. }
  6708. function h(t, e) {
  6709. for (var r = 0; r < t.length; r++) e.writeFloat(t[r])
  6710. }
  6711. function p(t, e) {
  6712. for (var r = 0; r < t.length; r++) e.writeDouble(t[r])
  6713. }
  6714. function f(t, e) {
  6715. for (var r = 0; r < t.length; r++) e.writeBoolean(t[r])
  6716. }
  6717. function d(t, e) {
  6718. for (var r = 0; r < t.length; r++) e.writeFixed32(t[r])
  6719. }
  6720. function g(t, e) {
  6721. for (var r = 0; r < t.length; r++) e.writeSFixed32(t[r])
  6722. }
  6723. function y(t, e) {
  6724. for (var r = 0; r < t.length; r++) e.writeFixed64(t[r])
  6725. }
  6726. function m(t, e) {
  6727. for (var r = 0; r < t.length; r++) e.writeSFixed64(t[r])
  6728. }
  6729. function v(t, e) {
  6730. return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + 16777216 * t[e + 3]
  6731. }
  6732. function _(t, e, r) {
  6733. t[r] = e, t[r + 1] = e >>> 8, t[r + 2] = e >>> 16, t[r + 3] = e >>> 24
  6734. }
  6735. function b(t, e) {
  6736. return (t[e] | t[e + 1] << 8 | t[e + 2] << 16) + (t[e + 3] << 24)
  6737. }
  6738. i.prototype = {
  6739. destroy: function () {
  6740. this.buf = null
  6741. }, readFields: function (t, e, r) {
  6742. for (r = r || this.length; this.pos < r;) {
  6743. var n = this.readVarint(), i = n >> 3, o = this.pos;
  6744. this.type = 7 & n, t(i, e, this), this.pos === o && this.skip(n)
  6745. }
  6746. return e
  6747. }, readMessage: function (t, e) {
  6748. return this.readFields(t, e, this.readVarint() + this.pos)
  6749. }, readFixed32: function () {
  6750. var t = v(this.buf, this.pos);
  6751. return this.pos += 4, t
  6752. }, readSFixed32: function () {
  6753. var t = b(this.buf, this.pos);
  6754. return this.pos += 4, t
  6755. }, readFixed64: function () {
  6756. var t = v(this.buf, this.pos) + 4294967296 * v(this.buf, this.pos + 4);
  6757. return this.pos += 8, t
  6758. }, readSFixed64: function () {
  6759. var t = v(this.buf, this.pos) + 4294967296 * b(this.buf, this.pos + 4);
  6760. return this.pos += 8, t
  6761. }, readFloat: function () {
  6762. var t = n.read(this.buf, this.pos, !0, 23, 4);
  6763. return this.pos += 4, t
  6764. }, readDouble: function () {
  6765. var t = n.read(this.buf, this.pos, !0, 52, 8);
  6766. return this.pos += 8, t
  6767. }, readVarint: function (t) {
  6768. var e, r, n = this.buf;
  6769. return e = 127 & (r = n[this.pos++]), r < 128 ? e : (e |= (127 & (r = n[this.pos++])) << 7, r < 128 ? e : (e |= (127 & (r = n[this.pos++])) << 14, r < 128 ? e : (e |= (127 & (r = n[this.pos++])) << 21, r < 128 ? e : function (t, e, r) {
  6770. var n, i, o = r.buf;
  6771. if (i = o[r.pos++], n = (112 & i) >> 4, i < 128) return s(t, n, e);
  6772. if (i = o[r.pos++], n |= (127 & i) << 3, i < 128) return s(t, n, e);
  6773. if (i = o[r.pos++], n |= (127 & i) << 10, i < 128) return s(t, n, e);
  6774. if (i = o[r.pos++], n |= (127 & i) << 17, i < 128) return s(t, n, e);
  6775. if (i = o[r.pos++], n |= (127 & i) << 24, i < 128) return s(t, n, e);
  6776. if (i = o[r.pos++], n |= (1 & i) << 31, i < 128) return s(t, n, e);
  6777. throw new Error("Expected varint not more than 10 bytes")
  6778. }(e |= (15 & (r = n[this.pos])) << 28, t, this))))
  6779. }, readVarint64: function () {
  6780. return this.readVarint(!0)
  6781. }, readSVarint: function () {
  6782. var t = this.readVarint();
  6783. return t % 2 == 1 ? (t + 1) / -2 : t / 2
  6784. }, readBoolean: function () {
  6785. return Boolean(this.readVarint())
  6786. }, readString: function () {
  6787. var t = this.readVarint() + this.pos, e = this.pos;
  6788. return this.pos = t, t - e >= 12 && o ? function (t, e, r) {
  6789. return o.decode(t.subarray(e, r))
  6790. }(this.buf, e, t) : function (t, e, r) {
  6791. var n = "", i = e;
  6792. for (; i < r;) {
  6793. var o, a, s, l = t[i], u = null, c = l > 239 ? 4 : l > 223 ? 3 : l > 191 ? 2 : 1;
  6794. if (i + c > r) break;
  6795. 1 === c ? l < 128 && (u = l) : 2 === c ? 128 == (192 & (o = t[i + 1])) && (u = (31 & l) << 6 | 63 & o) <= 127 && (u = null) : 3 === c ? (o = t[i + 1], a = t[i + 2], 128 == (192 & o) && 128 == (192 & a) && ((u = (15 & l) << 12 | (63 & o) << 6 | 63 & a) <= 2047 || u >= 55296 && u <= 57343) && (u = null)) : 4 === c && (o = t[i + 1], a = t[i + 2], s = t[i + 3], 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && ((u = (15 & l) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) <= 65535 || u >= 1114112) && (u = null)), null === u ? (u = 65533, c = 1) : u > 65535 && (u -= 65536, n += String.fromCharCode(u >>> 10 & 1023 | 55296), u = 56320 | 1023 & u), n += String.fromCharCode(u), i += c
  6796. }
  6797. return n
  6798. }(this.buf, e, t)
  6799. }, readBytes: function () {
  6800. var t = this.readVarint() + this.pos, e = this.buf.subarray(this.pos, t);
  6801. return this.pos = t, e
  6802. }, readPackedVarint: function (t, e) {
  6803. if (this.type !== i.Bytes) return t.push(this.readVarint(e));
  6804. var r = a(this);
  6805. for (t = t || []; this.pos < r;) t.push(this.readVarint(e));
  6806. return t
  6807. }, readPackedSVarint: function (t) {
  6808. if (this.type !== i.Bytes) return t.push(this.readSVarint());
  6809. var e = a(this);
  6810. for (t = t || []; this.pos < e;) t.push(this.readSVarint());
  6811. return t
  6812. }, readPackedBoolean: function (t) {
  6813. if (this.type !== i.Bytes) return t.push(this.readBoolean());
  6814. var e = a(this);
  6815. for (t = t || []; this.pos < e;) t.push(this.readBoolean());
  6816. return t
  6817. }, readPackedFloat: function (t) {
  6818. if (this.type !== i.Bytes) return t.push(this.readFloat());
  6819. var e = a(this);
  6820. for (t = t || []; this.pos < e;) t.push(this.readFloat());
  6821. return t
  6822. }, readPackedDouble: function (t) {
  6823. if (this.type !== i.Bytes) return t.push(this.readDouble());
  6824. var e = a(this);
  6825. for (t = t || []; this.pos < e;) t.push(this.readDouble());
  6826. return t
  6827. }, readPackedFixed32: function (t) {
  6828. if (this.type !== i.Bytes) return t.push(this.readFixed32());
  6829. var e = a(this);
  6830. for (t = t || []; this.pos < e;) t.push(this.readFixed32());
  6831. return t
  6832. }, readPackedSFixed32: function (t) {
  6833. if (this.type !== i.Bytes) return t.push(this.readSFixed32());
  6834. var e = a(this);
  6835. for (t = t || []; this.pos < e;) t.push(this.readSFixed32());
  6836. return t
  6837. }, readPackedFixed64: function (t) {
  6838. if (this.type !== i.Bytes) return t.push(this.readFixed64());
  6839. var e = a(this);
  6840. for (t = t || []; this.pos < e;) t.push(this.readFixed64());
  6841. return t
  6842. }, readPackedSFixed64: function (t) {
  6843. if (this.type !== i.Bytes) return t.push(this.readSFixed64());
  6844. var e = a(this);
  6845. for (t = t || []; this.pos < e;) t.push(this.readSFixed64());
  6846. return t
  6847. }, skip: function (t) {
  6848. var e = 7 & t;
  6849. if (e === i.Varint) for (; this.buf[this.pos++] > 127;) ; else if (e === i.Bytes) this.pos = this.readVarint() + this.pos; else if (e === i.Fixed32) this.pos += 4; else {
  6850. if (e !== i.Fixed64) throw new Error("Unimplemented type: " + e);
  6851. this.pos += 8
  6852. }
  6853. }, writeTag: function (t, e) {
  6854. this.writeVarint(t << 3 | e)
  6855. }, realloc: function (t) {
  6856. for (var e = this.length || 16; e < this.pos + t;) e *= 2;
  6857. if (e !== this.length) {
  6858. var r = new Uint8Array(e);
  6859. r.set(this.buf), this.buf = r, this.length = e
  6860. }
  6861. }, finish: function () {
  6862. return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length)
  6863. }, writeFixed32: function (t) {
  6864. this.realloc(4), _(this.buf, t, this.pos), this.pos += 4
  6865. }, writeSFixed32: function (t) {
  6866. this.realloc(4), _(this.buf, t, this.pos), this.pos += 4
  6867. }, writeFixed64: function (t) {
  6868. this.realloc(8), _(this.buf, -1 & t, this.pos), _(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), this.pos += 8
  6869. }, writeSFixed64: function (t) {
  6870. this.realloc(8), _(this.buf, -1 & t, this.pos), _(this.buf, Math.floor(t * (1 / 4294967296)), this.pos + 4), this.pos += 8
  6871. }, writeVarint: function (t) {
  6872. (t = +t || 0) > 268435455 || t < 0 ? function (t, e) {
  6873. var r, n;
  6874. t >= 0 ? (r = t % 4294967296 | 0, n = t / 4294967296 | 0) : (n = ~(-t / 4294967296), 4294967295 ^ (r = ~(-t % 4294967296)) ? r = r + 1 | 0 : (r = 0, n = n + 1 | 0));
  6875. if (t >= 0x10000000000000000 || t < -0x10000000000000000) throw new Error("Given varint doesn't fit into 10 bytes");
  6876. e.realloc(10), function (t, e, r) {
  6877. r.buf[r.pos++] = 127 & t | 128, t >>>= 7, r.buf[r.pos++] = 127 & t | 128, t >>>= 7, r.buf[r.pos++] = 127 & t | 128, t >>>= 7, r.buf[r.pos++] = 127 & t | 128, t >>>= 7, r.buf[r.pos] = 127 & t
  6878. }(r, 0, e), function (t, e) {
  6879. var r = (7 & t) << 4;
  6880. if (e.buf[e.pos++] |= r | ((t >>>= 3) ? 128 : 0), !t) return;
  6881. if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
  6882. if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
  6883. if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
  6884. if (e.buf[e.pos++] = 127 & t | ((t >>>= 7) ? 128 : 0), !t) return;
  6885. e.buf[e.pos++] = 127 & t
  6886. }(n, e)
  6887. }(t, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = 127 & (t >>>= 7) | (t > 127 ? 128 : 0), t <= 127 || (this.buf[this.pos++] = t >>> 7 & 127))))
  6888. }, writeSVarint: function (t) {
  6889. this.writeVarint(t < 0 ? 2 * -t - 1 : 2 * t)
  6890. }, writeBoolean: function (t) {
  6891. this.writeVarint(Boolean(t))
  6892. }, writeString: function (t) {
  6893. t = String(t), this.realloc(4 * t.length), this.pos++;
  6894. var e = this.pos;
  6895. this.pos = function (t, e, r) {
  6896. for (var n, i, o = 0; o < e.length; o++) {
  6897. if ((n = e.charCodeAt(o)) > 55295 && n < 57344) {
  6898. if (!i) {
  6899. n > 56319 || o + 1 === e.length ? (t[r++] = 239, t[r++] = 191, t[r++] = 189) : i = n;
  6900. continue
  6901. }
  6902. if (n < 56320) {
  6903. t[r++] = 239, t[r++] = 191, t[r++] = 189, i = n;
  6904. continue
  6905. }
  6906. n = i - 55296 << 10 | n - 56320 | 65536, i = null
  6907. } else i && (t[r++] = 239, t[r++] = 191, t[r++] = 189, i = null);
  6908. n < 128 ? t[r++] = n : (n < 2048 ? t[r++] = n >> 6 | 192 : (n < 65536 ? t[r++] = n >> 12 | 224 : (t[r++] = n >> 18 | 240, t[r++] = n >> 12 & 63 | 128), t[r++] = n >> 6 & 63 | 128), t[r++] = 63 & n | 128)
  6909. }
  6910. return r
  6911. }(this.buf, t, this.pos);
  6912. var r = this.pos - e;
  6913. r >= 128 && l(e, r, this), this.pos = e - 1, this.writeVarint(r), this.pos += r
  6914. }, writeFloat: function (t) {
  6915. this.realloc(4), n.write(this.buf, t, this.pos, !0, 23, 4), this.pos += 4
  6916. }, writeDouble: function (t) {
  6917. this.realloc(8), n.write(this.buf, t, this.pos, !0, 52, 8), this.pos += 8
  6918. }, writeBytes: function (t) {
  6919. var e = t.length;
  6920. this.writeVarint(e), this.realloc(e);
  6921. for (var r = 0; r < e; r++) this.buf[this.pos++] = t[r]
  6922. }, writeRawMessage: function (t, e) {
  6923. this.pos++;
  6924. var r = this.pos;
  6925. t(e, this);
  6926. var n = this.pos - r;
  6927. n >= 128 && l(r, n, this), this.pos = r - 1, this.writeVarint(n), this.pos += n
  6928. }, writeMessage: function (t, e, r) {
  6929. this.writeTag(t, i.Bytes), this.writeRawMessage(e, r)
  6930. }, writePackedVarint: function (t, e) {
  6931. e.length && this.writeMessage(t, u, e)
  6932. }, writePackedSVarint: function (t, e) {
  6933. e.length && this.writeMessage(t, c, e)
  6934. }, writePackedBoolean: function (t, e) {
  6935. e.length && this.writeMessage(t, f, e)
  6936. }, writePackedFloat: function (t, e) {
  6937. e.length && this.writeMessage(t, h, e)
  6938. }, writePackedDouble: function (t, e) {
  6939. e.length && this.writeMessage(t, p, e)
  6940. }, writePackedFixed32: function (t, e) {
  6941. e.length && this.writeMessage(t, d, e)
  6942. }, writePackedSFixed32: function (t, e) {
  6943. e.length && this.writeMessage(t, g, e)
  6944. }, writePackedFixed64: function (t, e) {
  6945. e.length && this.writeMessage(t, y, e)
  6946. }, writePackedSFixed64: function (t, e) {
  6947. e.length && this.writeMessage(t, m, e)
  6948. }, writeBytesField: function (t, e) {
  6949. this.writeTag(t, i.Bytes), this.writeBytes(e)
  6950. }, writeFixed32Field: function (t, e) {
  6951. this.writeTag(t, i.Fixed32), this.writeFixed32(e)
  6952. }, writeSFixed32Field: function (t, e) {
  6953. this.writeTag(t, i.Fixed32), this.writeSFixed32(e)
  6954. }, writeFixed64Field: function (t, e) {
  6955. this.writeTag(t, i.Fixed64), this.writeFixed64(e)
  6956. }, writeSFixed64Field: function (t, e) {
  6957. this.writeTag(t, i.Fixed64), this.writeSFixed64(e)
  6958. }, writeVarintField: function (t, e) {
  6959. this.writeTag(t, i.Varint), this.writeVarint(e)
  6960. }, writeSVarintField: function (t, e) {
  6961. this.writeTag(t, i.Varint), this.writeSVarint(e)
  6962. }, writeStringField: function (t, e) {
  6963. this.writeTag(t, i.Bytes), this.writeString(e)
  6964. }, writeFloatField: function (t, e) {
  6965. this.writeTag(t, i.Fixed32), this.writeFloat(e)
  6966. }, writeDoubleField: function (t, e) {
  6967. this.writeTag(t, i.Fixed64), this.writeDouble(e)
  6968. }, writeBooleanField: function (t, e) {
  6969. this.writeVarintField(t, Boolean(e))
  6970. }
  6971. }
  6972. }, function (t, e) {
  6973. (function () {
  6974. var e;
  6975. t.exports = {
  6976. icon: "icons/google.svg",
  6977. name: "google",
  6978. title: "Google Fonts",
  6979. link: "google.com/fonts",
  6980. getNames: function () {
  6981. return e
  6982. },
  6983. getLink: function (t) {
  6984. return "https://fonts.google.com/specimen/" + t.replace(/( )/g, "+")
  6985. },
  6986. normalizeName: function (t) {
  6987. return t
  6988. }
  6989. }, e = ["ABeeZee", "Abel", "Abril Fatface", "Aclonica", "Acme", "Actor", "Adamina", "Advent Pro", "Aguafina Script", "Akronim", "Aladin", "Aldrich", "Alef", "Alegreya", "Alegreya SC", "Alegreya Sans", "Alegreya Sans SC", "Alex Brush", "Alfa Slab One", "Alice", "Alike", "Alike Angular", "Allan", "Allerta", "Allerta Stencil", "Allura", "Almendra", "Almendra Display", "Almendra SC", "Amarante", "Amaranth", "Amatic SC", "Amethysta", "Amiri", "Amita", "Anaheim", "Andada", "Andika", "Angkor", "Annie Use Your Telescope", "Anonymous Pro", "Antic", "Antic Didone", "Antic Slab", "Anton", "Arapey", "Arbutus", "Arbutus Slab", "Architects Daughter", "Archivo Black", "Archivo Narrow", "Arimo", "Arizonia", "Armata", "Artifika", "Arvo", "Arya", "Asap", "Asar", "Asset", "Astloch", "Asul", "Atomic Age", "Aubrey", "Audiowide", "Autour One", "Average", "Average Sans", "Averia Gruesa Libre", "Averia Libre", "Averia Sans Libre", "Averia Serif Libre", "Bad Script", "Balthazar", "Bangers", "Basic", "Battambang", "Baumans", "Bayon", "Belgrano", "Belleza", "BenchNine", "Bentham", "Berkshire Swash", "Bevan", "Bigelow Rules", "Bigshot One", "Bilbo", "Bilbo Swash Caps", "Biryani", "Bitter", "Black Ops One", "Bokor", "Bonbon", "Boogaloo", "Bowlby One", "Bowlby One SC", "Brawler", "Bree Serif", "Bubblegum Sans", "Bubbler One", "Buda", "Buenard", "Butcherman", "Butterfly Kids", "Cabin", "Cabin Condensed", "Cabin Sketch", "Caesar Dressing", "Cagliostro", "Calligraffitti", "Cambay", "Cambo", "Candal", "Cantarell", "Cantata One", "Cantora One", "Capriola", "Cardo", "Carme", "Carrois Gothic", "Carrois Gothic SC", "Carter One", "Catamaran", "Caudex", "Caveat", "Caveat Brush", "Cedarville Cursive", "Ceviche One", "Changa One", "Chango", "Chau Philomene One", "Chela One", "Chelsea Market", "Chenla", "Cherry Cream Soda", "Cherry Swash", "Chewy", "Chicle", "Chivo", "Chonburi", "Cinzel", "Cinzel Decorative", "Clicker Script", "Coda", "Coda Caption", "Codystar", "Combo", "Comfortaa", "Coming Soon", "Concert One", "Condiment", "Content", "Contrail One", "Convergence", "Cookie", "Copse", "Corben", "Courgette", "Cousine", "Coustard", "Covered By Your Grace", "Crafty Girls", "Creepster", "Crete Round", "Crimson Text", "Croissant One", "Crushed", "Cuprum", "Cutive", "Cutive Mono", "Damion", "Dancing Script", "Dangrek", "Dawning of a New Day", "Days One", "Dekko", "Delius", "Delius Swash Caps", "Delius Unicase", "Della Respira", "Denk One", "Devonshire", "Dhurjati", "Didact Gothic", "Diplomata", "Diplomata SC", "Domine", "Donegal One", "Doppio One", "Dorsa", "Dosis", "Dr Sugiyama", "Droid Sans", "Droid Sans Mono", "Droid Serif", "Duru Sans", "Dynalight", "EB Garamond", "Eagle Lake", "Eater", "Economica", "Eczar", "Ek Mukta", "Electrolize", "Elsie", "Elsie Swash Caps", "Emblema One", "Emilys Candy", "Engagement", "Englebert", "Enriqueta", "Erica One", "Esteban", "Euphoria Script", "Ewert", "Exo", "Exo 2", "Expletus Sans", "Fanwood Text", "Fascinate", "Fascinate Inline", "Faster One", "Fasthand", "Fauna One", "Federant", "Federo", "Felipa", "Fenix", "Finger Paint", "Fira Mono", "Fira Sans", "Fjalla One", "Fjord One", "Flamenco", "Flavors", "Fondamento", "Fontdiner Swanky", "Forum", "Francois One", "Freckle Face", "Fredericka the Great", "Fredoka One", "Freehand", "Fresca", "Frijole", "Fruktur", "Fugaz One", "GFS Didot", "GFS Neohellenic", "Gabriela", "Gafata", "Galdeano", "Galindo", "Gentium Basic", "Gentium Book Basic", "Geo", "Geostar", "Geostar Fill", "Germania One", "Gidugu", "Gilda Display", "Give You Glory", "Glass Antiqua", "Glegoo", "Gloria Hallelujah", "Goblin One", "Gochi Hand", "Gorditas", "Goudy Bookletter 1911", "Graduate", "Grand Hotel", "Gravitas One", "Great Vibes", "Griffy", "Gruppo", "Gudea", "Gurajada", "Habibi", "Halant", "Hammersmith One", "Hanalei", "Hanalei Fill", "Handlee", "Hanuman", "Happy Monkey", "Headland One", "Henny Penny", "Herr Von Muellerhoff", "Hind", "Hind Siliguri", "Hind Vadodara", "Holtwood One SC", "Homemade Apple", "Homenaje", "IM Fell DW Pica", "IM Fell DW Pica SC", "IM Fell Double Pica", "IM Fell Double Pica SC", "IM Fell English", "IM Fell English SC", "IM Fell French Canon", "IM Fell French Canon SC", "IM Fell Great Primer", "IM Fell Great Primer SC", "Iceberg", "Iceland", "Imprima", "Inconsolata", "Inder", "Indie Flower", "Inika", "Inknut Antiqua", "Irish Grover", "Istok Web", "Italiana", "Italianno", "Itim", "Jacques Francois", "Jacques Francois Shadow", "Jaldi", "Jim Nightshade", "Jockey One", "Jolly Lodger", "Josefin Sans", "Josefin Slab", "Joti One", "Judson", "Julee", "Julius Sans One", "Junge", "Jura", "Just Another Hand", "Just Me Again Down Here", "Kadwa", "Kalam", "Kameron", "Kantumruy", "Karla", "Karma", "Kaushan Script", "Kavoon", "Kdam Thmor", "Keania One", "Kelly Slab", "Kenia", "Khand", "Khmer", "Khula", "Kite One", "Knewave", "Kotta One", "Koulen", "Kranky", "Kreon", "Kristi", "Krona One", "Kurale", "La Belle Aurore", "Laila", "Lakki Reddy", "Lancelot", "Lateef", "Lato", "League Script", "Leckerli One", "Ledger", "Lekton", "Lemon", "Libre Baskerville", "Life Savers", "Lilita One", "Lily Script One", "Limelight", "Linden Hill", "Lobster", "Lobster Two", "Londrina Outline", "Londrina Shadow", "Londrina Sketch", "Londrina Solid", "Lora", "Love Ya Like A Sister", "Loved by the King", "Lovers Quarrel", "Luckiest Guy", "Lusitana", "Lustria", "Macondo", "Macondo Swash Caps", "Magra", "Maiden Orange", "Mako", "Mallanna", "Mandali", "Marcellus", "Marcellus SC", "Marck Script", "Margarine", "Marko One", "Marmelad", "Martel", "Martel Sans", "Marvel", "Mate", "Mate SC", "Maven Pro", "McLaren", "Meddon", "MedievalSharp", "Medula One", "Megrim", "Meie Script", "Merienda", "Merienda One", "Merriweather", "Merriweather Sans", "Metal", "Metal Mania", "Metamorphous", "Metrophobic", "Michroma", "Milonga", "Miltonian", "Miltonian Tattoo", "Miniver", "Miss Fajardose", "Modak", "Modern Antiqua", "Molengo", "Molle", "Monda", "Monofett", "Monoton", "Monsieur La Doulaise", "Montaga", "Montez", "Montserrat", "Montserrat Alternates", "Montserrat Subrayada", "Moul", "Moulpali", "Mountains of Christmas", "Mouse Memoirs", "Mr Bedfort", "Mr Dafoe", "Mr De Haviland", "Mrs Saint Delafield", "Mrs Sheppards", "Muli", "Mystery Quest", "NTR", "Neucha", "Neuton", "New Rocker", "News Cycle", "Niconne", "Nixie One", "Nobile", "Nokora", "Norican", "Nosifer", "Nothing You Could Do", "Noticia Text", "Noto Sans", "Noto Serif", "Nova Cut", "Nova Flat", "Nova Mono", "Nova Oval", "Nova Round", "Nova Script", "Nova Slim", "Nova Square", "Numans", "Nunito", "Odor Mean Chey", "Offside", "Old Standard TT", "Oldenburg", "Oleo Script", "Oleo Script Swash Caps", "Open Sans", "Open Sans Condensed", "Oranienbaum", "Orbitron", "Oregano", "Orienta", "Original Surfer", "Oswald", "Over the Rainbow", "Overlock", "Overlock SC", "Ovo", "Oxygen", "Oxygen Mono", "PT Mono", "PT Sans", "PT Sans Caption", "PT Sans Narrow", "PT Serif", "PT Serif Caption", "Pacifico", "Palanquin", "Palanquin Dark", "Paprika", "Parisienne", "Passero One", "Passion One", "Pathway Gothic One", "Patrick Hand", "Patrick Hand SC", "Patua One", "Paytone One", "Peddana", "Peralta", "Permanent Marker", "Petit Formal Script", "Petrona", "Philosopher", "Piedra", "Pinyon Script", "Pirata One", "Plaster", "Play", "Playball", "Playfair Display", "Playfair Display SC", "Podkova", "Poiret One", "Poller One", "Poly", "Pompiere", "Pontano Sans", "Poppins", "Port Lligat Sans", "Port Lligat Slab", "Pragati Narrow", "Prata", "Preahvihear", "Press Start 2P", "Princess Sofia", "Prociono", "Prosto One", "Puritan", "Purple Purse", "Quando", "Quantico", "Quattrocento", "Quattrocento Sans", "Questrial", "Quicksand", "Quintessential", "Qwigley", "Racing Sans One", "Radley", "Rajdhani", "Raleway", "Raleway Dots", "Ramabhadra", "Ramaraja", "Rambla", "Rammetto One", "Ranchers", "Rancho", "Ranga", "Rationale", "Ravi Prakash", "Redressed", "Reenie Beanie", "Revalia", "Rhodium Libre", "Ribeye", "Ribeye Marrow", "Righteous", "Risque", "Roboto", "Roboto Condensed", "Roboto Mono", "Roboto Slab", "Rochester", "Rock Salt", "Rokkitt", "Romanesco", "Ropa Sans", "Rosario", "Rosarivo", "Rouge Script", "Rozha One", "Rubik", "Rubik Mono One", "Rubik One", "Ruda", "Rufina", "Ruge Boogie", "Ruluko", "Rum Raisin", "Ruslan Display", "Russo One", "Ruthie", "Rye", "Sacramento", "Sahitya", "Sail", "Salsa", "Sanchez", "Sancreek", "Sansita One", "Sarala", "Sarina", "Sarpanch", "Satisfy", "Scada", "Scheherazade", "Schoolbell", "Seaweed Script", "Sevillana", "Seymour One", "Shadows Into Light", "Shadows Into Light Two", "Shanti", "Share", "Share Tech", "Share Tech Mono", "Shojumaru", "Short Stack", "Siemreap", "Sigmar One", "Signika", "Signika Negative", "Simonetta", "Sintony", "Sirin Stencil", "Six Caps", "Skranji", "Slabo 13px", "Slabo 27px", "Slackey", "Smokum", "Smythe", "Sniglet", "Snippet", "Snowburst One", "Sofadi One", "Sofia", "Sonsie One", "Sorts Mill Goudy", "Source Code Pro", "Source Sans Pro", "Source Serif Pro", "Special Elite", "Spicy Rice", "Spinnaker", "Spirax", "Squada One", "Sree Krushnadevaraya", "Stalemate", "Stalinist One", "Stardos Stencil", "Stint Ultra Condensed", "Stint Ultra Expanded", "Stoke", "Strait", "Sue Ellen Francisco", "Sumana", "Sunshiney", "Supermercado One", "Sura", "Suranna", "Suravaram", "Suwannaphum", "Swanky and Moo Moo", "Syncopate", "Tangerine", "Taprom", "Tauri", "Teko", "Telex", "Tenali Ramakrishna", "Tenor Sans", "Text Me One", "The Girl Next Door", "Tienne", "Tillana", "Timmana", "Tinos", "Titan One", "Titillium Web", "Trade Winds", "Trocchi", "Trochut", "Trykker", "Tulpen One", "Ubuntu", "Ubuntu Condensed", "Ubuntu Mono", "Ultra", "Uncial Antiqua", "Underdog", "Unica One", "UnifrakturCook", "UnifrakturMaguntia", "Unkempt", "Unlock", "Unna", "VT323", "Vampiro One", "Varela", "Varela Round", "Vast Shadow", "Vesper Libre", "Vibur", "Vidaloka", "Viga", "Voces", "Volkhov", "Vollkorn", "Voltaire", "Waiting for the Sunrise", "Wallpoet", "Walter Turncoat", "Warnes", "Wellfleet", "Wendy One", "Wire One", "Work Sans", "Yanone Kaffeesatz", "Yantramanav", "Yellowtail", "Yeseva One", "Yesteryear", "Zeyada"]
  6990. }).call(this)
  6991. }, function (t, e, r) {
  6992. "use strict";
  6993. (function (t) {
  6994. /*!
  6995. * The buffer module from node.js, for the browser.
  6996. *
  6997. * @author Feross Aboukhadijeh <http://feross.org>
  6998. * @license MIT
  6999. */
  7000. var n = r(8), i = r(3), o = r(9);
  7001. function a() {
  7002. return l.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  7003. }
  7004. function s(t, e) {
  7005. if (a() < e) throw new RangeError("Invalid typed array length");
  7006. return l.TYPED_ARRAY_SUPPORT ? (t = new Uint8Array(e)).__proto__ = l.prototype : (null === t && (t = new l(e)), t.length = e), t
  7007. }
  7008. function l(t, e, r) {
  7009. if (!(l.TYPED_ARRAY_SUPPORT || this instanceof l)) return new l(t, e, r);
  7010. if ("number" == typeof t) {
  7011. if ("string" == typeof e) throw new Error("If encoding is specified then the first argument must be a string");
  7012. return h(this, t)
  7013. }
  7014. return u(this, t, e, r)
  7015. }
  7016. function u(t, e, r, n) {
  7017. if ("number" == typeof e) throw new TypeError('"value" argument must not be a number');
  7018. return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer ? function (t, e, r, n) {
  7019. if (e.byteLength, r < 0 || e.byteLength < r) throw new RangeError("'offset' is out of bounds");
  7020. if (e.byteLength < r + (n || 0)) throw new RangeError("'length' is out of bounds");
  7021. e = void 0 === r && void 0 === n ? new Uint8Array(e) : void 0 === n ? new Uint8Array(e, r) : new Uint8Array(e, r, n);
  7022. l.TYPED_ARRAY_SUPPORT ? (t = e).__proto__ = l.prototype : t = p(t, e);
  7023. return t
  7024. }(t, e, r, n) : "string" == typeof e ? function (t, e, r) {
  7025. "string" == typeof r && "" !== r || (r = "utf8");
  7026. if (!l.isEncoding(r)) throw new TypeError('"encoding" must be a valid string encoding');
  7027. var n = 0 | d(e, r), i = (t = s(t, n)).write(e, r);
  7028. i !== n && (t = t.slice(0, i));
  7029. return t
  7030. }(t, e, r) : function (t, e) {
  7031. if (l.isBuffer(e)) {
  7032. var r = 0 | f(e.length);
  7033. return 0 === (t = s(t, r)).length || e.copy(t, 0, 0, r), t
  7034. }
  7035. if (e) {
  7036. if ("undefined" != typeof ArrayBuffer && e.buffer instanceof ArrayBuffer || "length" in e) return "number" != typeof e.length || (n = e.length) != n ? s(t, 0) : p(t, e);
  7037. if ("Buffer" === e.type && o(e.data)) return p(t, e.data)
  7038. }
  7039. var n;
  7040. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  7041. }(t, e)
  7042. }
  7043. function c(t) {
  7044. if ("number" != typeof t) throw new TypeError('"size" argument must be a number');
  7045. if (t < 0) throw new RangeError('"size" argument must not be negative')
  7046. }
  7047. function h(t, e) {
  7048. if (c(e), t = s(t, e < 0 ? 0 : 0 | f(e)), !l.TYPED_ARRAY_SUPPORT) for (var r = 0; r < e; ++r) t[r] = 0;
  7049. return t
  7050. }
  7051. function p(t, e) {
  7052. var r = e.length < 0 ? 0 : 0 | f(e.length);
  7053. t = s(t, r);
  7054. for (var n = 0; n < r; n += 1) t[n] = 255 & e[n];
  7055. return t
  7056. }
  7057. function f(t) {
  7058. if (t >= a()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a().toString(16) + " bytes");
  7059. return 0 | t
  7060. }
  7061. function d(t, e) {
  7062. if (l.isBuffer(t)) return t.length;
  7063. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(t) || t instanceof ArrayBuffer)) return t.byteLength;
  7064. "string" != typeof t && (t = "" + t);
  7065. var r = t.length;
  7066. if (0 === r) return 0;
  7067. for (var n = !1; ;) switch (e) {
  7068. case"ascii":
  7069. case"latin1":
  7070. case"binary":
  7071. return r;
  7072. case"utf8":
  7073. case"utf-8":
  7074. case void 0:
  7075. return z(t).length;
  7076. case"ucs2":
  7077. case"ucs-2":
  7078. case"utf16le":
  7079. case"utf-16le":
  7080. return 2 * r;
  7081. case"hex":
  7082. return r >>> 1;
  7083. case"base64":
  7084. return U(t).length;
  7085. default:
  7086. if (n) return z(t).length;
  7087. e = ("" + e).toLowerCase(), n = !0
  7088. }
  7089. }
  7090. function g(t, e, r) {
  7091. var n = !1;
  7092. if ((void 0 === e || e < 0) && (e = 0), e > this.length) return "";
  7093. if ((void 0 === r || r > this.length) && (r = this.length), r <= 0) return "";
  7094. if ((r >>>= 0) <= (e >>>= 0)) return "";
  7095. for (t || (t = "utf8"); ;) switch (t) {
  7096. case"hex":
  7097. return R(this, e, r);
  7098. case"utf8":
  7099. case"utf-8":
  7100. return C(this, e, r);
  7101. case"ascii":
  7102. return O(this, e, r);
  7103. case"latin1":
  7104. case"binary":
  7105. return P(this, e, r);
  7106. case"base64":
  7107. return T(this, e, r);
  7108. case"ucs2":
  7109. case"ucs-2":
  7110. case"utf16le":
  7111. case"utf-16le":
  7112. return I(this, e, r);
  7113. default:
  7114. if (n) throw new TypeError("Unknown encoding: " + t);
  7115. t = (t + "").toLowerCase(), n = !0
  7116. }
  7117. }
  7118. function y(t, e, r) {
  7119. var n = t[e];
  7120. t[e] = t[r], t[r] = n
  7121. }
  7122. function m(t, e, r, n, i) {
  7123. if (0 === t.length) return -1;
  7124. if ("string" == typeof r ? (n = r, r = 0) : r > 2147483647 ? r = 2147483647 : r < -2147483648 && (r = -2147483648), r = +r, isNaN(r) && (r = i ? 0 : t.length - 1), r < 0 && (r = t.length + r), r >= t.length) {
  7125. if (i) return -1;
  7126. r = t.length - 1
  7127. } else if (r < 0) {
  7128. if (!i) return -1;
  7129. r = 0
  7130. }
  7131. if ("string" == typeof e && (e = l.from(e, n)), l.isBuffer(e)) return 0 === e.length ? -1 : v(t, e, r, n, i);
  7132. if ("number" == typeof e) return e &= 255, l.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? i ? Uint8Array.prototype.indexOf.call(t, e, r) : Uint8Array.prototype.lastIndexOf.call(t, e, r) : v(t, [e], r, n, i);
  7133. throw new TypeError("val must be string, number or Buffer")
  7134. }
  7135. function v(t, e, r, n, i) {
  7136. var o, a = 1, s = t.length, l = e.length;
  7137. if (void 0 !== n && ("ucs2" === (n = String(n).toLowerCase()) || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  7138. if (t.length < 2 || e.length < 2) return -1;
  7139. a = 2, s /= 2, l /= 2, r /= 2
  7140. }
  7141. function u(t, e) {
  7142. return 1 === a ? t[e] : t.readUInt16BE(e * a)
  7143. }
  7144. if (i) {
  7145. var c = -1;
  7146. for (o = r; o < s; o++) if (u(t, o) === u(e, -1 === c ? 0 : o - c)) {
  7147. if (-1 === c && (c = o), o - c + 1 === l) return c * a
  7148. } else -1 !== c && (o -= o - c), c = -1
  7149. } else for (r + l > s && (r = s - l), o = r; o >= 0; o--) {
  7150. for (var h = !0, p = 0; p < l; p++) if (u(t, o + p) !== u(e, p)) {
  7151. h = !1;
  7152. break
  7153. }
  7154. if (h) return o
  7155. }
  7156. return -1
  7157. }
  7158. function _(t, e, r, n) {
  7159. r = Number(r) || 0;
  7160. var i = t.length - r;
  7161. n ? (n = Number(n)) > i && (n = i) : n = i;
  7162. var o = e.length;
  7163. if (o % 2 != 0) throw new TypeError("Invalid hex string");
  7164. n > o / 2 && (n = o / 2);
  7165. for (var a = 0; a < n; ++a) {
  7166. var s = parseInt(e.substr(2 * a, 2), 16);
  7167. if (isNaN(s)) return a;
  7168. t[r + a] = s
  7169. }
  7170. return a
  7171. }
  7172. function b(t, e, r, n) {
  7173. return B(z(e, t.length - r), t, r, n)
  7174. }
  7175. function x(t, e, r, n) {
  7176. return B(function (t) {
  7177. for (var e = [], r = 0; r < t.length; ++r) e.push(255 & t.charCodeAt(r));
  7178. return e
  7179. }(e), t, r, n)
  7180. }
  7181. function w(t, e, r, n) {
  7182. return x(t, e, r, n)
  7183. }
  7184. function S(t, e, r, n) {
  7185. return B(U(e), t, r, n)
  7186. }
  7187. function E(t, e, r, n) {
  7188. return B(function (t, e) {
  7189. for (var r, n, i, o = [], a = 0; a < t.length && !((e -= 2) < 0); ++a) r = t.charCodeAt(a), n = r >> 8, i = r % 256, o.push(i), o.push(n);
  7190. return o
  7191. }(e, t.length - r), t, r, n)
  7192. }
  7193. function T(t, e, r) {
  7194. return 0 === e && r === t.length ? n.fromByteArray(t) : n.fromByteArray(t.slice(e, r))
  7195. }
  7196. function C(t, e, r) {
  7197. r = Math.min(t.length, r);
  7198. for (var n = [], i = e; i < r;) {
  7199. var o, a, s, l, u = t[i], c = null, h = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
  7200. if (i + h <= r) switch (h) {
  7201. case 1:
  7202. u < 128 && (c = u);
  7203. break;
  7204. case 2:
  7205. 128 == (192 & (o = t[i + 1])) && (l = (31 & u) << 6 | 63 & o) > 127 && (c = l);
  7206. break;
  7207. case 3:
  7208. o = t[i + 1], a = t[i + 2], 128 == (192 & o) && 128 == (192 & a) && (l = (15 & u) << 12 | (63 & o) << 6 | 63 & a) > 2047 && (l < 55296 || l > 57343) && (c = l);
  7209. break;
  7210. case 4:
  7211. o = t[i + 1], a = t[i + 2], s = t[i + 3], 128 == (192 & o) && 128 == (192 & a) && 128 == (192 & s) && (l = (15 & u) << 18 | (63 & o) << 12 | (63 & a) << 6 | 63 & s) > 65535 && l < 1114112 && (c = l)
  7212. }
  7213. null === c ? (c = 65533, h = 1) : c > 65535 && (c -= 65536, n.push(c >>> 10 & 1023 | 55296), c = 56320 | 1023 & c), n.push(c), i += h
  7214. }
  7215. return function (t) {
  7216. var e = t.length;
  7217. if (e <= 4096) return String.fromCharCode.apply(String, t);
  7218. var r = "", n = 0;
  7219. for (; n < e;) r += String.fromCharCode.apply(String, t.slice(n, n += 4096));
  7220. return r
  7221. }(n)
  7222. }
  7223. e.Buffer = l, e.SlowBuffer = function (t) {
  7224. +t != t && (t = 0);
  7225. return l.alloc(+t)
  7226. }, e.INSPECT_MAX_BYTES = 50, l.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : function () {
  7227. try {
  7228. var t = new Uint8Array(1);
  7229. return t.__proto__ = {
  7230. __proto__: Uint8Array.prototype, foo: function () {
  7231. return 42
  7232. }
  7233. }, 42 === t.foo() && "function" == typeof t.subarray && 0 === t.subarray(1, 1).byteLength
  7234. } catch (t) {
  7235. return !1
  7236. }
  7237. }(), e.kMaxLength = a(), l.poolSize = 8192, l._augment = function (t) {
  7238. return t.__proto__ = l.prototype, t
  7239. }, l.from = function (t, e, r) {
  7240. return u(null, t, e, r)
  7241. }, l.TYPED_ARRAY_SUPPORT && (l.prototype.__proto__ = Uint8Array.prototype, l.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && l[Symbol.species] === l && Object.defineProperty(l, Symbol.species, {
  7242. value: null,
  7243. configurable: !0
  7244. })), l.alloc = function (t, e, r) {
  7245. return function (t, e, r, n) {
  7246. return c(e), e <= 0 ? s(t, e) : void 0 !== r ? "string" == typeof n ? s(t, e).fill(r, n) : s(t, e).fill(r) : s(t, e)
  7247. }(null, t, e, r)
  7248. }, l.allocUnsafe = function (t) {
  7249. return h(null, t)
  7250. }, l.allocUnsafeSlow = function (t) {
  7251. return h(null, t)
  7252. }, l.isBuffer = function (t) {
  7253. return !(null == t || !t._isBuffer)
  7254. }, l.compare = function (t, e) {
  7255. if (!l.isBuffer(t) || !l.isBuffer(e)) throw new TypeError("Arguments must be Buffers");
  7256. if (t === e) return 0;
  7257. for (var r = t.length, n = e.length, i = 0, o = Math.min(r, n); i < o; ++i) if (t[i] !== e[i]) {
  7258. r = t[i], n = e[i];
  7259. break
  7260. }
  7261. return r < n ? -1 : n < r ? 1 : 0
  7262. }, l.isEncoding = function (t) {
  7263. switch (String(t).toLowerCase()) {
  7264. case"hex":
  7265. case"utf8":
  7266. case"utf-8":
  7267. case"ascii":
  7268. case"latin1":
  7269. case"binary":
  7270. case"base64":
  7271. case"ucs2":
  7272. case"ucs-2":
  7273. case"utf16le":
  7274. case"utf-16le":
  7275. return !0;
  7276. default:
  7277. return !1
  7278. }
  7279. }, l.concat = function (t, e) {
  7280. if (!o(t)) throw new TypeError('"list" argument must be an Array of Buffers');
  7281. if (0 === t.length) return l.alloc(0);
  7282. var r;
  7283. if (void 0 === e) for (e = 0, r = 0; r < t.length; ++r) e += t[r].length;
  7284. var n = l.allocUnsafe(e), i = 0;
  7285. for (r = 0; r < t.length; ++r) {
  7286. var a = t[r];
  7287. if (!l.isBuffer(a)) throw new TypeError('"list" argument must be an Array of Buffers');
  7288. a.copy(n, i), i += a.length
  7289. }
  7290. return n
  7291. }, l.byteLength = d, l.prototype._isBuffer = !0, l.prototype.swap16 = function () {
  7292. var t = this.length;
  7293. if (t % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
  7294. for (var e = 0; e < t; e += 2) y(this, e, e + 1);
  7295. return this
  7296. }, l.prototype.swap32 = function () {
  7297. var t = this.length;
  7298. if (t % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
  7299. for (var e = 0; e < t; e += 4) y(this, e, e + 3), y(this, e + 1, e + 2);
  7300. return this
  7301. }, l.prototype.swap64 = function () {
  7302. var t = this.length;
  7303. if (t % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
  7304. for (var e = 0; e < t; e += 8) y(this, e, e + 7), y(this, e + 1, e + 6), y(this, e + 2, e + 5), y(this, e + 3, e + 4);
  7305. return this
  7306. }, l.prototype.toString = function () {
  7307. var t = 0 | this.length;
  7308. return 0 === t ? "" : 0 === arguments.length ? C(this, 0, t) : g.apply(this, arguments)
  7309. }, l.prototype.equals = function (t) {
  7310. if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
  7311. return this === t || 0 === l.compare(this, t)
  7312. }, l.prototype.inspect = function () {
  7313. var t = "", r = e.INSPECT_MAX_BYTES;
  7314. return this.length > 0 && (t = this.toString("hex", 0, r).match(/.{2}/g).join(" "), this.length > r && (t += " ... ")), "<Buffer " + t + ">"
  7315. }, l.prototype.compare = function (t, e, r, n, i) {
  7316. if (!l.isBuffer(t)) throw new TypeError("Argument must be a Buffer");
  7317. if (void 0 === e && (e = 0), void 0 === r && (r = t ? t.length : 0), void 0 === n && (n = 0), void 0 === i && (i = this.length), e < 0 || r > t.length || n < 0 || i > this.length) throw new RangeError("out of range index");
  7318. if (n >= i && e >= r) return 0;
  7319. if (n >= i) return -1;
  7320. if (e >= r) return 1;
  7321. if (this === t) return 0;
  7322. for (var o = (i >>>= 0) - (n >>>= 0), a = (r >>>= 0) - (e >>>= 0), s = Math.min(o, a), u = this.slice(n, i), c = t.slice(e, r), h = 0; h < s; ++h) if (u[h] !== c[h]) {
  7323. o = u[h], a = c[h];
  7324. break
  7325. }
  7326. return o < a ? -1 : a < o ? 1 : 0
  7327. }, l.prototype.includes = function (t, e, r) {
  7328. return -1 !== this.indexOf(t, e, r)
  7329. }, l.prototype.indexOf = function (t, e, r) {
  7330. return m(this, t, e, r, !0)
  7331. }, l.prototype.lastIndexOf = function (t, e, r) {
  7332. return m(this, t, e, r, !1)
  7333. }, l.prototype.write = function (t, e, r, n) {
  7334. if (void 0 === e) n = "utf8", r = this.length, e = 0; else if (void 0 === r && "string" == typeof e) n = e, r = this.length, e = 0; else {
  7335. if (!isFinite(e)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  7336. e |= 0, isFinite(r) ? (r |= 0, void 0 === n && (n = "utf8")) : (n = r, r = void 0)
  7337. }
  7338. var i = this.length - e;
  7339. if ((void 0 === r || r > i) && (r = i), t.length > 0 && (r < 0 || e < 0) || e > this.length) throw new RangeError("Attempt to write outside buffer bounds");
  7340. n || (n = "utf8");
  7341. for (var o = !1; ;) switch (n) {
  7342. case"hex":
  7343. return _(this, t, e, r);
  7344. case"utf8":
  7345. case"utf-8":
  7346. return b(this, t, e, r);
  7347. case"ascii":
  7348. return x(this, t, e, r);
  7349. case"latin1":
  7350. case"binary":
  7351. return w(this, t, e, r);
  7352. case"base64":
  7353. return S(this, t, e, r);
  7354. case"ucs2":
  7355. case"ucs-2":
  7356. case"utf16le":
  7357. case"utf-16le":
  7358. return E(this, t, e, r);
  7359. default:
  7360. if (o) throw new TypeError("Unknown encoding: " + n);
  7361. n = ("" + n).toLowerCase(), o = !0
  7362. }
  7363. }, l.prototype.toJSON = function () {
  7364. return {type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0)}
  7365. };
  7366. function O(t, e, r) {
  7367. var n = "";
  7368. r = Math.min(t.length, r);
  7369. for (var i = e; i < r; ++i) n += String.fromCharCode(127 & t[i]);
  7370. return n
  7371. }
  7372. function P(t, e, r) {
  7373. var n = "";
  7374. r = Math.min(t.length, r);
  7375. for (var i = e; i < r; ++i) n += String.fromCharCode(t[i]);
  7376. return n
  7377. }
  7378. function R(t, e, r) {
  7379. var n = t.length;
  7380. (!e || e < 0) && (e = 0), (!r || r < 0 || r > n) && (r = n);
  7381. for (var i = "", o = e; o < r; ++o) i += G(t[o]);
  7382. return i
  7383. }
  7384. function I(t, e, r) {
  7385. for (var n = t.slice(e, r), i = "", o = 0; o < n.length; o += 2) i += String.fromCharCode(n[o] + 256 * n[o + 1]);
  7386. return i
  7387. }
  7388. function L(t, e, r) {
  7389. if (t % 1 != 0 || t < 0) throw new RangeError("offset is not uint");
  7390. if (t + e > r) throw new RangeError("Trying to access beyond buffer length")
  7391. }
  7392. function M(t, e, r, n, i, o) {
  7393. if (!l.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance');
  7394. if (e > i || e < o) throw new RangeError('"value" argument is out of bounds');
  7395. if (r + n > t.length) throw new RangeError("Index out of range")
  7396. }
  7397. function F(t, e, r, n) {
  7398. e < 0 && (e = 65535 + e + 1);
  7399. for (var i = 0, o = Math.min(t.length - r, 2); i < o; ++i) t[r + i] = (e & 255 << 8 * (n ? i : 1 - i)) >>> 8 * (n ? i : 1 - i)
  7400. }
  7401. function A(t, e, r, n) {
  7402. e < 0 && (e = 4294967295 + e + 1);
  7403. for (var i = 0, o = Math.min(t.length - r, 4); i < o; ++i) t[r + i] = e >>> 8 * (n ? i : 3 - i) & 255
  7404. }
  7405. function k(t, e, r, n, i, o) {
  7406. if (r + n > t.length) throw new RangeError("Index out of range");
  7407. if (r < 0) throw new RangeError("Index out of range")
  7408. }
  7409. function j(t, e, r, n, o) {
  7410. return o || k(t, 0, r, 4), i.write(t, e, r, n, 23, 4), r + 4
  7411. }
  7412. function N(t, e, r, n, o) {
  7413. return o || k(t, 0, r, 8), i.write(t, e, r, n, 52, 8), r + 8
  7414. }
  7415. l.prototype.slice = function (t, e) {
  7416. var r, n = this.length;
  7417. if ((t = ~~t) < 0 ? (t += n) < 0 && (t = 0) : t > n && (t = n), (e = void 0 === e ? n : ~~e) < 0 ? (e += n) < 0 && (e = 0) : e > n && (e = n), e < t && (e = t), l.TYPED_ARRAY_SUPPORT) (r = this.subarray(t, e)).__proto__ = l.prototype; else {
  7418. var i = e - t;
  7419. r = new l(i, void 0);
  7420. for (var o = 0; o < i; ++o) r[o] = this[o + t]
  7421. }
  7422. return r
  7423. }, l.prototype.readUIntLE = function (t, e, r) {
  7424. t |= 0, e |= 0, r || L(t, e, this.length);
  7425. for (var n = this[t], i = 1, o = 0; ++o < e && (i *= 256);) n += this[t + o] * i;
  7426. return n
  7427. }, l.prototype.readUIntBE = function (t, e, r) {
  7428. t |= 0, e |= 0, r || L(t, e, this.length);
  7429. for (var n = this[t + --e], i = 1; e > 0 && (i *= 256);) n += this[t + --e] * i;
  7430. return n
  7431. }, l.prototype.readUInt8 = function (t, e) {
  7432. return e || L(t, 1, this.length), this[t]
  7433. }, l.prototype.readUInt16LE = function (t, e) {
  7434. return e || L(t, 2, this.length), this[t] | this[t + 1] << 8
  7435. }, l.prototype.readUInt16BE = function (t, e) {
  7436. return e || L(t, 2, this.length), this[t] << 8 | this[t + 1]
  7437. }, l.prototype.readUInt32LE = function (t, e) {
  7438. return e || L(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + 16777216 * this[t + 3]
  7439. }, l.prototype.readUInt32BE = function (t, e) {
  7440. return e || L(t, 4, this.length), 16777216 * this[t] + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3])
  7441. }, l.prototype.readIntLE = function (t, e, r) {
  7442. t |= 0, e |= 0, r || L(t, e, this.length);
  7443. for (var n = this[t], i = 1, o = 0; ++o < e && (i *= 256);) n += this[t + o] * i;
  7444. return n >= (i *= 128) && (n -= Math.pow(2, 8 * e)), n
  7445. }, l.prototype.readIntBE = function (t, e, r) {
  7446. t |= 0, e |= 0, r || L(t, e, this.length);
  7447. for (var n = e, i = 1, o = this[t + --n]; n > 0 && (i *= 256);) o += this[t + --n] * i;
  7448. return o >= (i *= 128) && (o -= Math.pow(2, 8 * e)), o
  7449. }, l.prototype.readInt8 = function (t, e) {
  7450. return e || L(t, 1, this.length), 128 & this[t] ? -1 * (255 - this[t] + 1) : this[t]
  7451. }, l.prototype.readInt16LE = function (t, e) {
  7452. e || L(t, 2, this.length);
  7453. var r = this[t] | this[t + 1] << 8;
  7454. return 32768 & r ? 4294901760 | r : r
  7455. }, l.prototype.readInt16BE = function (t, e) {
  7456. e || L(t, 2, this.length);
  7457. var r = this[t + 1] | this[t] << 8;
  7458. return 32768 & r ? 4294901760 | r : r
  7459. }, l.prototype.readInt32LE = function (t, e) {
  7460. return e || L(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24
  7461. }, l.prototype.readInt32BE = function (t, e) {
  7462. return e || L(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]
  7463. }, l.prototype.readFloatLE = function (t, e) {
  7464. return e || L(t, 4, this.length), i.read(this, t, !0, 23, 4)
  7465. }, l.prototype.readFloatBE = function (t, e) {
  7466. return e || L(t, 4, this.length), i.read(this, t, !1, 23, 4)
  7467. }, l.prototype.readDoubleLE = function (t, e) {
  7468. return e || L(t, 8, this.length), i.read(this, t, !0, 52, 8)
  7469. }, l.prototype.readDoubleBE = function (t, e) {
  7470. return e || L(t, 8, this.length), i.read(this, t, !1, 52, 8)
  7471. }, l.prototype.writeUIntLE = function (t, e, r, n) {
  7472. (t = +t, e |= 0, r |= 0, n) || M(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
  7473. var i = 1, o = 0;
  7474. for (this[e] = 255 & t; ++o < r && (i *= 256);) this[e + o] = t / i & 255;
  7475. return e + r
  7476. }, l.prototype.writeUIntBE = function (t, e, r, n) {
  7477. (t = +t, e |= 0, r |= 0, n) || M(this, t, e, r, Math.pow(2, 8 * r) - 1, 0);
  7478. var i = r - 1, o = 1;
  7479. for (this[e + i] = 255 & t; --i >= 0 && (o *= 256);) this[e + i] = t / o & 255;
  7480. return e + r
  7481. }, l.prototype.writeUInt8 = function (t, e, r) {
  7482. return t = +t, e |= 0, r || M(this, t, e, 1, 255, 0), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), this[e] = 255 & t, e + 1
  7483. }, l.prototype.writeUInt16LE = function (t, e, r) {
  7484. return t = +t, e |= 0, r || M(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : F(this, t, e, !0), e + 2
  7485. }, l.prototype.writeUInt16BE = function (t, e, r) {
  7486. return t = +t, e |= 0, r || M(this, t, e, 2, 65535, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : F(this, t, e, !1), e + 2
  7487. }, l.prototype.writeUInt32LE = function (t, e, r) {
  7488. return t = +t, e |= 0, r || M(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = 255 & t) : A(this, t, e, !0), e + 4
  7489. }, l.prototype.writeUInt32BE = function (t, e, r) {
  7490. return t = +t, e |= 0, r || M(this, t, e, 4, 4294967295, 0), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : A(this, t, e, !1), e + 4
  7491. }, l.prototype.writeIntLE = function (t, e, r, n) {
  7492. if (t = +t, e |= 0, !n) {
  7493. var i = Math.pow(2, 8 * r - 1);
  7494. M(this, t, e, r, i - 1, -i)
  7495. }
  7496. var o = 0, a = 1, s = 0;
  7497. for (this[e] = 255 & t; ++o < r && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o - 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255;
  7498. return e + r
  7499. }, l.prototype.writeIntBE = function (t, e, r, n) {
  7500. if (t = +t, e |= 0, !n) {
  7501. var i = Math.pow(2, 8 * r - 1);
  7502. M(this, t, e, r, i - 1, -i)
  7503. }
  7504. var o = r - 1, a = 1, s = 0;
  7505. for (this[e + o] = 255 & t; --o >= 0 && (a *= 256);) t < 0 && 0 === s && 0 !== this[e + o + 1] && (s = 1), this[e + o] = (t / a >> 0) - s & 255;
  7506. return e + r
  7507. }, l.prototype.writeInt8 = function (t, e, r) {
  7508. return t = +t, e |= 0, r || M(this, t, e, 1, 127, -128), l.TYPED_ARRAY_SUPPORT || (t = Math.floor(t)), t < 0 && (t = 255 + t + 1), this[e] = 255 & t, e + 1
  7509. }, l.prototype.writeInt16LE = function (t, e, r) {
  7510. return t = +t, e |= 0, r || M(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8) : F(this, t, e, !0), e + 2
  7511. }, l.prototype.writeInt16BE = function (t, e, r) {
  7512. return t = +t, e |= 0, r || M(this, t, e, 2, 32767, -32768), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 8, this[e + 1] = 255 & t) : F(this, t, e, !1), e + 2
  7513. }, l.prototype.writeInt32LE = function (t, e, r) {
  7514. return t = +t, e |= 0, r || M(this, t, e, 4, 2147483647, -2147483648), l.TYPED_ARRAY_SUPPORT ? (this[e] = 255 & t, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24) : A(this, t, e, !0), e + 4
  7515. }, l.prototype.writeInt32BE = function (t, e, r) {
  7516. return t = +t, e |= 0, r || M(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), l.TYPED_ARRAY_SUPPORT ? (this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = 255 & t) : A(this, t, e, !1), e + 4
  7517. }, l.prototype.writeFloatLE = function (t, e, r) {
  7518. return j(this, t, e, !0, r)
  7519. }, l.prototype.writeFloatBE = function (t, e, r) {
  7520. return j(this, t, e, !1, r)
  7521. }, l.prototype.writeDoubleLE = function (t, e, r) {
  7522. return N(this, t, e, !0, r)
  7523. }, l.prototype.writeDoubleBE = function (t, e, r) {
  7524. return N(this, t, e, !1, r)
  7525. }, l.prototype.copy = function (t, e, r, n) {
  7526. if (r || (r = 0), n || 0 === n || (n = this.length), e >= t.length && (e = t.length), e || (e = 0), n > 0 && n < r && (n = r), n === r) return 0;
  7527. if (0 === t.length || 0 === this.length) return 0;
  7528. if (e < 0) throw new RangeError("targetStart out of bounds");
  7529. if (r < 0 || r >= this.length) throw new RangeError("sourceStart out of bounds");
  7530. if (n < 0) throw new RangeError("sourceEnd out of bounds");
  7531. n > this.length && (n = this.length), t.length - e < n - r && (n = t.length - e + r);
  7532. var i, o = n - r;
  7533. if (this === t && r < e && e < n) for (i = o - 1; i >= 0; --i) t[i + e] = this[i + r]; else if (o < 1e3 || !l.TYPED_ARRAY_SUPPORT) for (i = 0; i < o; ++i) t[i + e] = this[i + r]; else Uint8Array.prototype.set.call(t, this.subarray(r, r + o), e);
  7534. return o
  7535. }, l.prototype.fill = function (t, e, r, n) {
  7536. if ("string" == typeof t) {
  7537. if ("string" == typeof e ? (n = e, e = 0, r = this.length) : "string" == typeof r && (n = r, r = this.length), 1 === t.length) {
  7538. var i = t.charCodeAt(0);
  7539. i < 256 && (t = i)
  7540. }
  7541. if (void 0 !== n && "string" != typeof n) throw new TypeError("encoding must be a string");
  7542. if ("string" == typeof n && !l.isEncoding(n)) throw new TypeError("Unknown encoding: " + n)
  7543. } else "number" == typeof t && (t &= 255);
  7544. if (e < 0 || this.length < e || this.length < r) throw new RangeError("Out of range index");
  7545. if (r <= e) return this;
  7546. var o;
  7547. if (e >>>= 0, r = void 0 === r ? this.length : r >>> 0, t || (t = 0), "number" == typeof t) for (o = e; o < r; ++o) this[o] = t; else {
  7548. var a = l.isBuffer(t) ? t : z(new l(t, n).toString()), s = a.length;
  7549. for (o = 0; o < r - e; ++o) this[o + e] = a[o % s]
  7550. }
  7551. return this
  7552. };
  7553. var D = /[^+\/0-9A-Za-z-_]/g;
  7554. function G(t) {
  7555. return t < 16 ? "0" + t.toString(16) : t.toString(16)
  7556. }
  7557. function z(t, e) {
  7558. var r;
  7559. e = e || 1 / 0;
  7560. for (var n = t.length, i = null, o = [], a = 0; a < n; ++a) {
  7561. if ((r = t.charCodeAt(a)) > 55295 && r < 57344) {
  7562. if (!i) {
  7563. if (r > 56319) {
  7564. (e -= 3) > -1 && o.push(239, 191, 189);
  7565. continue
  7566. }
  7567. if (a + 1 === n) {
  7568. (e -= 3) > -1 && o.push(239, 191, 189);
  7569. continue
  7570. }
  7571. i = r;
  7572. continue
  7573. }
  7574. if (r < 56320) {
  7575. (e -= 3) > -1 && o.push(239, 191, 189), i = r;
  7576. continue
  7577. }
  7578. r = 65536 + (i - 55296 << 10 | r - 56320)
  7579. } else i && (e -= 3) > -1 && o.push(239, 191, 189);
  7580. if (i = null, r < 128) {
  7581. if ((e -= 1) < 0) break;
  7582. o.push(r)
  7583. } else if (r < 2048) {
  7584. if ((e -= 2) < 0) break;
  7585. o.push(r >> 6 | 192, 63 & r | 128)
  7586. } else if (r < 65536) {
  7587. if ((e -= 3) < 0) break;
  7588. o.push(r >> 12 | 224, r >> 6 & 63 | 128, 63 & r | 128)
  7589. } else {
  7590. if (!(r < 1114112)) throw new Error("Invalid code point");
  7591. if ((e -= 4) < 0) break;
  7592. o.push(r >> 18 | 240, r >> 12 & 63 | 128, r >> 6 & 63 | 128, 63 & r | 128)
  7593. }
  7594. }
  7595. return o
  7596. }
  7597. function U(t) {
  7598. return n.toByteArray(function (t) {
  7599. if ((t = function (t) {
  7600. return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
  7601. }(t).replace(D, "")).length < 2) return "";
  7602. for (; t.length % 4 != 0;) t += "=";
  7603. return t
  7604. }(t))
  7605. }
  7606. function B(t, e, r, n) {
  7607. for (var i = 0; i < n && !(i + r >= e.length || i >= t.length); ++i) e[i + r] = t[i];
  7608. return i
  7609. }
  7610. }).call(this, r(4))
  7611. }, function (t, e, r) {
  7612. "use strict";
  7613. e.byteLength = function (t) {
  7614. var e = u(t), r = e[0], n = e[1];
  7615. return 3 * (r + n) / 4 - n
  7616. }, e.toByteArray = function (t) {
  7617. var e, r, n = u(t), a = n[0], s = n[1], l = new o(function (t, e, r) {
  7618. return 3 * (e + r) / 4 - r
  7619. }(0, a, s)), c = 0, h = s > 0 ? a - 4 : a;
  7620. for (r = 0; r < h; r += 4) e = i[t.charCodeAt(r)] << 18 | i[t.charCodeAt(r + 1)] << 12 | i[t.charCodeAt(r + 2)] << 6 | i[t.charCodeAt(r + 3)], l[c++] = e >> 16 & 255, l[c++] = e >> 8 & 255, l[c++] = 255 & e;
  7621. 2 === s && (e = i[t.charCodeAt(r)] << 2 | i[t.charCodeAt(r + 1)] >> 4, l[c++] = 255 & e);
  7622. 1 === s && (e = i[t.charCodeAt(r)] << 10 | i[t.charCodeAt(r + 1)] << 4 | i[t.charCodeAt(r + 2)] >> 2, l[c++] = e >> 8 & 255, l[c++] = 255 & e);
  7623. return l
  7624. }, e.fromByteArray = function (t) {
  7625. for (var e, r = t.length, i = r % 3, o = [], a = 0, s = r - i; a < s; a += 16383) o.push(c(t, a, a + 16383 > s ? s : a + 16383));
  7626. 1 === i ? (e = t[r - 1], o.push(n[e >> 2] + n[e << 4 & 63] + "==")) : 2 === i && (e = (t[r - 2] << 8) + t[r - 1], o.push(n[e >> 10] + n[e >> 4 & 63] + n[e << 2 & 63] + "="));
  7627. return o.join("")
  7628. };
  7629. for (var n = [], i = [], o = "undefined" != typeof Uint8Array ? Uint8Array : Array, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, l = a.length; s < l; ++s) n[s] = a[s], i[a.charCodeAt(s)] = s;
  7630. function u(t) {
  7631. var e = t.length;
  7632. if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
  7633. var r = t.indexOf("=");
  7634. return -1 === r && (r = e), [r, r === e ? 0 : 4 - r % 4]
  7635. }
  7636. function c(t, e, r) {
  7637. for (var i, o, a = [], s = e; s < r; s += 3) i = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (255 & t[s + 2]), a.push(n[(o = i) >> 18 & 63] + n[o >> 12 & 63] + n[o >> 6 & 63] + n[63 & o]);
  7638. return a.join("")
  7639. }
  7640. i["-".charCodeAt(0)] = 62, i["_".charCodeAt(0)] = 63
  7641. }, function (t, e) {
  7642. var r = {}.toString;
  7643. t.exports = Array.isArray || function (t) {
  7644. return "[object Array]" == r.call(t)
  7645. }
  7646. }, function (t, e, r) {
  7647. "use strict";
  7648. function n() {
  7649. return function () {
  7650. throw new Error("Unimplemented abstract method.")
  7651. }()
  7652. }
  7653. r.r(e);
  7654. var i = 0;
  7655. function o(t) {
  7656. return t.ol_uid || (t.ol_uid = String(++i))
  7657. }
  7658. var a, s = (a = function (t, e) {
  7659. return (a = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  7660. t.__proto__ = e
  7661. } || function (t, e) {
  7662. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  7663. })(t, e)
  7664. }, function (t, e) {
  7665. function r() {
  7666. this.constructor = t
  7667. }
  7668. a(t, e), t.prototype = null === e ? Object.create(e) : (r.prototype = e.prototype, new r)
  7669. }), l = function (t) {
  7670. function e(e) {
  7671. var r = this,
  7672. n = "Assertion failed. See https://openlayers.org/en/" + ("v" + "6.5.0".split("-")[0]) + "/doc/errors/#" + e + " for details.";
  7673. return (r = t.call(this, n) || this).code = e, r.name = "AssertionError", r.message = n, r
  7674. }
  7675. return s(e, t), e
  7676. }(Error);
  7677. function u(t) {
  7678. t.stopPropagation()
  7679. }
  7680. var c = function () {
  7681. function t(t) {
  7682. this.propagationStopped, this.type = t, this.target = null
  7683. }
  7684. return t.prototype.preventDefault = function () {
  7685. this.propagationStopped = !0
  7686. }, t.prototype.stopPropagation = function () {
  7687. this.propagationStopped = !0
  7688. }, t
  7689. }(), h = "propertychange", p = function () {
  7690. function t() {
  7691. this.disposed = !1
  7692. }
  7693. return t.prototype.dispose = function () {
  7694. this.disposed || (this.disposed = !0, this.disposeInternal())
  7695. }, t.prototype.disposeInternal = function () {
  7696. }, t
  7697. }();
  7698. function f(t, e, r) {
  7699. for (var n, i, o = r || d, a = 0, s = t.length, l = !1; a < s;) (i = +o(t[n = a + (s - a >> 1)], e)) < 0 ? a = n + 1 : (s = n, l = !i);
  7700. return l ? a : ~a
  7701. }
  7702. function d(t, e) {
  7703. return t > e ? 1 : t < e ? -1 : 0
  7704. }
  7705. function g(t, e) {
  7706. return t.indexOf(e) >= 0
  7707. }
  7708. function y(t, e, r) {
  7709. var n = t.length;
  7710. if (t[0] <= e) return 0;
  7711. if (e <= t[n - 1]) return n - 1;
  7712. var i = void 0;
  7713. if (r > 0) {
  7714. for (i = 1; i < n; ++i) if (t[i] < e) return i - 1
  7715. } else if (r < 0) {
  7716. for (i = 1; i < n; ++i) if (t[i] <= e) return i
  7717. } else for (i = 1; i < n; ++i) {
  7718. if (t[i] == e) return i;
  7719. if (t[i] < e) return t[i - 1] - e < e - t[i] ? i - 1 : i
  7720. }
  7721. return n - 1
  7722. }
  7723. function m(t, e, r) {
  7724. for (; e < r;) {
  7725. var n = t[e];
  7726. t[e] = t[r], t[r] = n, ++e, --r
  7727. }
  7728. }
  7729. function v(t, e) {
  7730. for (var r = Array.isArray(e) ? e : [e], n = r.length, i = 0; i < n; i++) t[t.length] = r[i]
  7731. }
  7732. function _(t, e) {
  7733. for (var r, n = t.length >>> 0, i = 0; i < n; i++) if (e(r = t[i], i, t)) return r;
  7734. return null
  7735. }
  7736. function b(t, e) {
  7737. var r = t.length;
  7738. if (r !== e.length) return !1;
  7739. for (var n = 0; n < r; n++) if (t[n] !== e[n]) return !1;
  7740. return !0
  7741. }
  7742. function x(t, e) {
  7743. var r;
  7744. return !t.every((function (n, i) {
  7745. return r = i, !e(n, i, t)
  7746. })) ? r : -1
  7747. }
  7748. function w(t, e, r) {
  7749. var n = e || d;
  7750. return t.every((function (e, i) {
  7751. if (0 === i) return !0;
  7752. var o = n(t[i - 1], e);
  7753. return !(o > 0 || r && 0 === o)
  7754. }))
  7755. }
  7756. function S() {
  7757. return !0
  7758. }
  7759. function E() {
  7760. return !1
  7761. }
  7762. function T() {
  7763. }
  7764. function C(t) {
  7765. var e, r, n, i = !1;
  7766. return function () {
  7767. var o = Array.prototype.slice.call(arguments);
  7768. return i && this === n && b(o, r) || (i = !0, n = this, r = o, e = t.apply(this, arguments)), e
  7769. }
  7770. }
  7771. var O = "function" == typeof Object.assign ? Object.assign : function (t, e) {
  7772. if (null == t) throw new TypeError("Cannot convert undefined or null to object");
  7773. for (var r = Object(t), n = 1, i = arguments.length; n < i; ++n) {
  7774. var o = arguments[n];
  7775. if (null != o) for (var a in o) o.hasOwnProperty(a) && (r[a] = o[a])
  7776. }
  7777. return r
  7778. };
  7779. function P(t) {
  7780. for (var e in t) delete t[e]
  7781. }
  7782. var R = "function" == typeof Object.values ? Object.values : function (t) {
  7783. var e = [];
  7784. for (var r in t) e.push(t[r]);
  7785. return e
  7786. };
  7787. function I(t) {
  7788. var e;
  7789. for (e in t) return !1;
  7790. return !e
  7791. }
  7792. var L = function () {
  7793. var t = function (e, r) {
  7794. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  7795. t.__proto__ = e
  7796. } || function (t, e) {
  7797. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  7798. })(e, r)
  7799. };
  7800. return function (e, r) {
  7801. function n() {
  7802. this.constructor = e
  7803. }
  7804. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  7805. }
  7806. }(), M = function (t) {
  7807. function e(e) {
  7808. var r = t.call(this) || this;
  7809. return r.eventTarget_ = e, r.pendingRemovals_ = null, r.dispatching_ = null, r.listeners_ = null, r
  7810. }
  7811. return L(e, t), e.prototype.addEventListener = function (t, e) {
  7812. if (t && e) {
  7813. var r = this.listeners_ || (this.listeners_ = {}), n = r[t] || (r[t] = []);
  7814. -1 === n.indexOf(e) && n.push(e)
  7815. }
  7816. }, e.prototype.dispatchEvent = function (t) {
  7817. var e = "string" == typeof t ? new c(t) : t, r = e.type;
  7818. e.target || (e.target = this.eventTarget_ || this);
  7819. var n, i = this.listeners_ && this.listeners_[r];
  7820. if (i) {
  7821. var o = this.dispatching_ || (this.dispatching_ = {}),
  7822. a = this.pendingRemovals_ || (this.pendingRemovals_ = {});
  7823. r in o || (o[r] = 0, a[r] = 0), ++o[r];
  7824. for (var s = 0, l = i.length; s < l; ++s) if (!1 === (n = "handleEvent" in i[s] ? i[s].handleEvent(e) : i[s].call(this, e)) || e.propagationStopped) {
  7825. n = !1;
  7826. break
  7827. }
  7828. if (--o[r], 0 === o[r]) {
  7829. var u = a[r];
  7830. for (delete a[r]; u--;) this.removeEventListener(r, T);
  7831. delete o[r]
  7832. }
  7833. return n
  7834. }
  7835. }, e.prototype.disposeInternal = function () {
  7836. this.listeners_ && P(this.listeners_)
  7837. }, e.prototype.getListeners = function (t) {
  7838. return this.listeners_ && this.listeners_[t] || void 0
  7839. }, e.prototype.hasListener = function (t) {
  7840. return !!this.listeners_ && (t ? t in this.listeners_ : Object.keys(this.listeners_).length > 0)
  7841. }, e.prototype.removeEventListener = function (t, e) {
  7842. var r = this.listeners_ && this.listeners_[t];
  7843. if (r) {
  7844. var n = r.indexOf(e);
  7845. -1 !== n && (this.pendingRemovals_ && t in this.pendingRemovals_ ? (r[n] = T, ++this.pendingRemovals_[t]) : (r.splice(n, 1), 0 === r.length && delete this.listeners_[t]))
  7846. }
  7847. }, e
  7848. }(p), F = "change", A = "error", k = "clear", j = "contextmenu", N = "click", D = "dblclick", G = "dragenter",
  7849. z = "dragover", U = "drop", B = "keydown", V = "keypress", Y = "load", W = "resize", q = "touchmove", X = "wheel";
  7850. function Z(t, e, r, n, i) {
  7851. if (n && n !== t && (r = r.bind(n)), i) {
  7852. var o = r;
  7853. r = function () {
  7854. t.removeEventListener(e, r), o.apply(this, arguments)
  7855. }
  7856. }
  7857. var a = {target: t, type: e, listener: r};
  7858. return t.addEventListener(e, r), a
  7859. }
  7860. function K(t, e, r, n) {
  7861. return Z(t, e, r, n, !0)
  7862. }
  7863. function H(t) {
  7864. t && t.target && (t.target.removeEventListener(t.type, t.listener), P(t))
  7865. }
  7866. var $ = function () {
  7867. var t = function (e, r) {
  7868. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  7869. t.__proto__ = e
  7870. } || function (t, e) {
  7871. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  7872. })(e, r)
  7873. };
  7874. return function (e, r) {
  7875. function n() {
  7876. this.constructor = e
  7877. }
  7878. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  7879. }
  7880. }();
  7881. function J(t) {
  7882. if (Array.isArray(t)) for (var e = 0, r = t.length; e < r; ++e) H(t[e]); else H(t)
  7883. }
  7884. var Q = function (t) {
  7885. function e() {
  7886. var e = t.call(this) || this;
  7887. return e.revision_ = 0, e
  7888. }
  7889. return $(e, t), e.prototype.changed = function () {
  7890. ++this.revision_, this.dispatchEvent(F)
  7891. }, e.prototype.getRevision = function () {
  7892. return this.revision_
  7893. }, e.prototype.on = function (t, e) {
  7894. if (Array.isArray(t)) {
  7895. for (var r = t.length, n = new Array(r), i = 0; i < r; ++i) n[i] = Z(this, t[i], e);
  7896. return n
  7897. }
  7898. return Z(this, t, e)
  7899. }, e.prototype.once = function (t, e) {
  7900. var r;
  7901. if (Array.isArray(t)) {
  7902. var n = t.length;
  7903. r = new Array(n);
  7904. for (var i = 0; i < n; ++i) r[i] = K(this, t[i], e)
  7905. } else r = K(this, t, e);
  7906. return e.ol_key = r, r
  7907. }, e.prototype.un = function (t, e) {
  7908. var r = e.ol_key;
  7909. if (r) J(r); else if (Array.isArray(t)) for (var n = 0, i = t.length; n < i; ++n) this.removeEventListener(t[n], e); else this.removeEventListener(t, e)
  7910. }, e
  7911. }(M), tt = function () {
  7912. var t = function (e, r) {
  7913. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  7914. t.__proto__ = e
  7915. } || function (t, e) {
  7916. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  7917. })(e, r)
  7918. };
  7919. return function (e, r) {
  7920. function n() {
  7921. this.constructor = e
  7922. }
  7923. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  7924. }
  7925. }(), et = function (t) {
  7926. function e(e, r, n) {
  7927. var i = t.call(this, e) || this;
  7928. return i.key = r, i.oldValue = n, i
  7929. }
  7930. return tt(e, t), e
  7931. }(c), rt = function (t) {
  7932. function e(e) {
  7933. var r = t.call(this) || this;
  7934. return o(r), r.values_ = null, void 0 !== e && r.setProperties(e), r
  7935. }
  7936. return tt(e, t), e.prototype.get = function (t) {
  7937. var e;
  7938. return this.values_ && this.values_.hasOwnProperty(t) && (e = this.values_[t]), e
  7939. }, e.prototype.getKeys = function () {
  7940. return this.values_ && Object.keys(this.values_) || []
  7941. }, e.prototype.getProperties = function () {
  7942. return this.values_ && O({}, this.values_) || {}
  7943. }, e.prototype.hasProperties = function () {
  7944. return !!this.values_
  7945. }, e.prototype.notify = function (t, e) {
  7946. var r;
  7947. r = it(t), this.dispatchEvent(new et(r, t, e)), r = h, this.dispatchEvent(new et(r, t, e))
  7948. }, e.prototype.set = function (t, e, r) {
  7949. var n = this.values_ || (this.values_ = {});
  7950. if (r) n[t] = e; else {
  7951. var i = n[t];
  7952. n[t] = e, i !== e && this.notify(t, i)
  7953. }
  7954. }, e.prototype.setProperties = function (t, e) {
  7955. for (var r in t) this.set(r, t[r], e)
  7956. }, e.prototype.applyProperties = function (t) {
  7957. t.values_ && O(this.values_ || (this.values_ = {}), t.values_)
  7958. }, e.prototype.unset = function (t, e) {
  7959. if (this.values_ && t in this.values_) {
  7960. var r = this.values_[t];
  7961. delete this.values_[t], I(this.values_) && (this.values_ = null), e || this.notify(t, r)
  7962. }
  7963. }, e
  7964. }(Q), nt = {};
  7965. function it(t) {
  7966. return nt.hasOwnProperty(t) ? nt[t] : nt[t] = "change:" + t
  7967. }
  7968. var ot = rt, at = "add", st = "remove", lt = function () {
  7969. var t = function (e, r) {
  7970. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  7971. t.__proto__ = e
  7972. } || function (t, e) {
  7973. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  7974. })(e, r)
  7975. };
  7976. return function (e, r) {
  7977. function n() {
  7978. this.constructor = e
  7979. }
  7980. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  7981. }
  7982. }(), ut = "length", ct = function (t) {
  7983. function e(e, r, n) {
  7984. var i = t.call(this, e) || this;
  7985. return i.element = r, i.index = n, i
  7986. }
  7987. return lt(e, t), e
  7988. }(c), ht = function (t) {
  7989. function e(e, r) {
  7990. var n = t.call(this) || this, i = r || {};
  7991. if (n.unique_ = !!i.unique, n.array_ = e || [], n.unique_) for (var o = 0, a = n.array_.length; o < a; ++o) n.assertUnique_(n.array_[o], o);
  7992. return n.updateLength_(), n
  7993. }
  7994. return lt(e, t), e.prototype.clear = function () {
  7995. for (; this.getLength() > 0;) this.pop()
  7996. }, e.prototype.extend = function (t) {
  7997. for (var e = 0, r = t.length; e < r; ++e) this.push(t[e]);
  7998. return this
  7999. }, e.prototype.forEach = function (t) {
  8000. for (var e = this.array_, r = 0, n = e.length; r < n; ++r) t(e[r], r, e)
  8001. }, e.prototype.getArray = function () {
  8002. return this.array_
  8003. }, e.prototype.item = function (t) {
  8004. return this.array_[t]
  8005. }, e.prototype.getLength = function () {
  8006. return this.get(ut)
  8007. }, e.prototype.insertAt = function (t, e) {
  8008. this.unique_ && this.assertUnique_(e), this.array_.splice(t, 0, e), this.updateLength_(), this.dispatchEvent(new ct(at, e, t))
  8009. }, e.prototype.pop = function () {
  8010. return this.removeAt(this.getLength() - 1)
  8011. }, e.prototype.push = function (t) {
  8012. this.unique_ && this.assertUnique_(t);
  8013. var e = this.getLength();
  8014. return this.insertAt(e, t), this.getLength()
  8015. }, e.prototype.remove = function (t) {
  8016. for (var e = this.array_, r = 0, n = e.length; r < n; ++r) if (e[r] === t) return this.removeAt(r)
  8017. }, e.prototype.removeAt = function (t) {
  8018. var e = this.array_[t];
  8019. return this.array_.splice(t, 1), this.updateLength_(), this.dispatchEvent(new ct(st, e, t)), e
  8020. }, e.prototype.setAt = function (t, e) {
  8021. var r = this.getLength();
  8022. if (t < r) {
  8023. this.unique_ && this.assertUnique_(e, t);
  8024. var n = this.array_[t];
  8025. this.array_[t] = e, this.dispatchEvent(new ct(st, n, t)), this.dispatchEvent(new ct(at, e, t))
  8026. } else {
  8027. for (var i = r; i < t; ++i) this.insertAt(i, void 0);
  8028. this.insertAt(t, e)
  8029. }
  8030. }, e.prototype.updateLength_ = function () {
  8031. this.set(ut, this.array_.length)
  8032. }, e.prototype.assertUnique_ = function (t, e) {
  8033. for (var r = 0, n = this.array_.length; r < n; ++r) if (this.array_[r] === t && r !== e) throw new l(58)
  8034. }, e
  8035. }(ot);
  8036. function pt(t, e) {
  8037. if (!t) throw new l(e)
  8038. }
  8039. var ft = function () {
  8040. var t = function (e, r) {
  8041. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  8042. t.__proto__ = e
  8043. } || function (t, e) {
  8044. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  8045. })(e, r)
  8046. };
  8047. return function (e, r) {
  8048. function n() {
  8049. this.constructor = e
  8050. }
  8051. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  8052. }
  8053. }();
  8054. function dt(t) {
  8055. return "function" == typeof t ? t : (Array.isArray(t) ? e = t : (pt("function" == typeof t.getZIndex, 41), e = [t]), function () {
  8056. return e
  8057. });
  8058. var e
  8059. }
  8060. var gt = function (t) {
  8061. function e(e) {
  8062. var r = t.call(this) || this;
  8063. if (r.id_ = void 0, r.geometryName_ = "geometry", r.style_ = null, r.styleFunction_ = void 0, r.geometryChangeKey_ = null, r.addEventListener(it(r.geometryName_), r.handleGeometryChanged_), e) if ("function" == typeof e.getSimplifiedGeometry) {
  8064. var n = e;
  8065. r.setGeometry(n)
  8066. } else {
  8067. var i = e;
  8068. r.setProperties(i)
  8069. }
  8070. return r
  8071. }
  8072. return ft(e, t), e.prototype.clone = function () {
  8073. var t = new e(this.hasProperties() ? this.getProperties() : null);
  8074. t.setGeometryName(this.getGeometryName());
  8075. var r = this.getGeometry();
  8076. r && t.setGeometry(r.clone());
  8077. var n = this.getStyle();
  8078. return n && t.setStyle(n), t
  8079. }, e.prototype.getGeometry = function () {
  8080. return this.get(this.geometryName_)
  8081. }, e.prototype.getId = function () {
  8082. return this.id_
  8083. }, e.prototype.getGeometryName = function () {
  8084. return this.geometryName_
  8085. }, e.prototype.getStyle = function () {
  8086. return this.style_
  8087. }, e.prototype.getStyleFunction = function () {
  8088. return this.styleFunction_
  8089. }, e.prototype.handleGeometryChange_ = function () {
  8090. this.changed()
  8091. }, e.prototype.handleGeometryChanged_ = function () {
  8092. this.geometryChangeKey_ && (H(this.geometryChangeKey_), this.geometryChangeKey_ = null);
  8093. var t = this.getGeometry();
  8094. t && (this.geometryChangeKey_ = Z(t, F, this.handleGeometryChange_, this)), this.changed()
  8095. }, e.prototype.setGeometry = function (t) {
  8096. this.set(this.geometryName_, t)
  8097. }, e.prototype.setStyle = function (t) {
  8098. this.style_ = t, this.styleFunction_ = t ? dt(t) : void 0, this.changed()
  8099. }, e.prototype.setId = function (t) {
  8100. this.id_ = t, this.changed()
  8101. }, e.prototype.setGeometryName = function (t) {
  8102. this.removeEventListener(it(this.geometryName_), this.handleGeometryChanged_), this.geometryName_ = t, this.addEventListener(it(this.geometryName_), this.handleGeometryChanged_), this.handleGeometryChanged_()
  8103. }, e
  8104. }(ot), yt = "XY", mt = "XYZ", vt = "XYM", _t = "XYZM", bt = {
  8105. POINT: "Point",
  8106. LINE_STRING: "LineString",
  8107. LINEAR_RING: "LinearRing",
  8108. POLYGON: "Polygon",
  8109. MULTI_POINT: "MultiPoint",
  8110. MULTI_LINE_STRING: "MultiLineString",
  8111. MULTI_POLYGON: "MultiPolygon",
  8112. GEOMETRY_COLLECTION: "GeometryCollection",
  8113. CIRCLE: "Circle"
  8114. },
  8115. xt = {DEGREES: "degrees", FEET: "ft", METERS: "m", PIXELS: "pixels", TILE_PIXELS: "tile-pixels", USFEET: "us-ft"},
  8116. wt = {};
  8117. wt[xt.DEGREES] = 2 * Math.PI * 6370997 / 360, wt[xt.FEET] = .3048, wt[xt.METERS] = 1, wt[xt.USFEET] = 1200 / 3937;
  8118. var St = xt, Et = new Array(6);
  8119. function Tt() {
  8120. return [1, 0, 0, 1, 0, 0]
  8121. }
  8122. function Ct(t) {
  8123. return Pt(t, 1, 0, 0, 1, 0, 0)
  8124. }
  8125. function Ot(t, e) {
  8126. var r = t[0], n = t[1], i = t[2], o = t[3], a = t[4], s = t[5], l = e[0], u = e[1], c = e[2], h = e[3], p = e[4],
  8127. f = e[5];
  8128. return t[0] = r * l + i * u, t[1] = n * l + o * u, t[2] = r * c + i * h, t[3] = n * c + o * h, t[4] = r * p + i * f + a, t[5] = n * p + o * f + s, t
  8129. }
  8130. function Pt(t, e, r, n, i, o, a) {
  8131. return t[0] = e, t[1] = r, t[2] = n, t[3] = i, t[4] = o, t[5] = a, t
  8132. }
  8133. function Rt(t, e) {
  8134. return t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t
  8135. }
  8136. function It(t, e) {
  8137. var r = e[0], n = e[1];
  8138. return e[0] = t[0] * r + t[2] * n + t[4], e[1] = t[1] * r + t[3] * n + t[5], e
  8139. }
  8140. function Lt(t, e) {
  8141. var r = Math.cos(e), n = Math.sin(e);
  8142. return Ot(t, Pt(Et, r, n, -n, r, 0, 0))
  8143. }
  8144. function Mt(t, e, r) {
  8145. return Ot(t, Pt(Et, e, 0, 0, r, 0, 0))
  8146. }
  8147. function Ft(t, e, r) {
  8148. return Pt(t, e, 0, 0, r, 0, 0)
  8149. }
  8150. function At(t, e, r) {
  8151. return Ot(t, Pt(Et, 1, 0, 0, 1, e, r))
  8152. }
  8153. function kt(t, e, r, n, i, o, a, s) {
  8154. var l = Math.sin(o), u = Math.cos(o);
  8155. return t[0] = n * u, t[1] = i * l, t[2] = -n * l, t[3] = i * u, t[4] = a * n * u - s * n * l + e, t[5] = a * i * l + s * i * u + r, t
  8156. }
  8157. function jt(t, e) {
  8158. var r = Nt(e);
  8159. pt(0 !== r, 32);
  8160. var n = e[0], i = e[1], o = e[2], a = e[3], s = e[4], l = e[5];
  8161. return t[0] = a / r, t[1] = -i / r, t[2] = -o / r, t[3] = n / r, t[4] = (o * l - a * s) / r, t[5] = -(n * l - i * s) / r, t
  8162. }
  8163. function Nt(t) {
  8164. return t[0] * t[3] - t[1] * t[2]
  8165. }
  8166. function Dt(t) {
  8167. return "matrix(" + t.join(", ") + ")"
  8168. }
  8169. var Gt = "bottom-left", zt = "bottom-right", Ut = "top-left", Bt = "top-right", Vt = 0, Yt = 1, Wt = 2, qt = 4,
  8170. Xt = 8, Zt = 16;
  8171. function Kt(t) {
  8172. for (var e = ne(), r = 0, n = t.length; r < n; ++r) pe(e, t[r]);
  8173. return e
  8174. }
  8175. function Ht(t, e, r) {
  8176. return r ? (r[0] = t[0] - e, r[1] = t[1] - e, r[2] = t[2] + e, r[3] = t[3] + e, r) : [t[0] - e, t[1] - e, t[2] + e, t[3] + e]
  8177. }
  8178. function $t(t, e) {
  8179. return e ? (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e) : t.slice()
  8180. }
  8181. function Jt(t, e, r) {
  8182. var n, i;
  8183. return (n = e < t[0] ? t[0] - e : t[2] < e ? e - t[2] : 0) * n + (i = r < t[1] ? t[1] - r : t[3] < r ? r - t[3] : 0) * i
  8184. }
  8185. function Qt(t, e) {
  8186. return ee(t, e[0], e[1])
  8187. }
  8188. function te(t, e) {
  8189. return t[0] <= e[0] && e[2] <= t[2] && t[1] <= e[1] && e[3] <= t[3]
  8190. }
  8191. function ee(t, e, r) {
  8192. return t[0] <= e && e <= t[2] && t[1] <= r && r <= t[3]
  8193. }
  8194. function re(t, e) {
  8195. var r = t[0], n = t[1], i = t[2], o = t[3], a = e[0], s = e[1], l = Vt;
  8196. return a < r ? l |= Zt : a > i && (l |= qt), s < n ? l |= Xt : s > o && (l |= Wt), l === Vt && (l = Yt), l
  8197. }
  8198. function ne() {
  8199. return [1 / 0, 1 / 0, -1 / 0, -1 / 0]
  8200. }
  8201. function ie(t, e, r, n, i) {
  8202. return i ? (i[0] = t, i[1] = e, i[2] = r, i[3] = n, i) : [t, e, r, n]
  8203. }
  8204. function oe(t) {
  8205. return ie(1 / 0, 1 / 0, -1 / 0, -1 / 0, t)
  8206. }
  8207. function ae(t, e) {
  8208. var r = t[0], n = t[1];
  8209. return ie(r, n, r, n, e)
  8210. }
  8211. function se(t, e) {
  8212. return fe(oe(e), t)
  8213. }
  8214. function le(t, e, r, n, i) {
  8215. return de(oe(i), t, e, r, n)
  8216. }
  8217. function ue(t, e) {
  8218. return t[0] == e[0] && t[2] == e[2] && t[1] == e[1] && t[3] == e[3]
  8219. }
  8220. function ce(t, e, r) {
  8221. return Math.abs(t[0] - e[0]) < r && Math.abs(t[2] - e[2]) < r && Math.abs(t[1] - e[1]) < r && Math.abs(t[3] - e[3]) < r
  8222. }
  8223. function he(t, e) {
  8224. return e[0] < t[0] && (t[0] = e[0]), e[2] > t[2] && (t[2] = e[2]), e[1] < t[1] && (t[1] = e[1]), e[3] > t[3] && (t[3] = e[3]), t
  8225. }
  8226. function pe(t, e) {
  8227. e[0] < t[0] && (t[0] = e[0]), e[0] > t[2] && (t[2] = e[0]), e[1] < t[1] && (t[1] = e[1]), e[1] > t[3] && (t[3] = e[1])
  8228. }
  8229. function fe(t, e) {
  8230. for (var r = 0, n = e.length; r < n; ++r) pe(t, e[r]);
  8231. return t
  8232. }
  8233. function de(t, e, r, n, i) {
  8234. for (; r < n; r += i) ye(t, e[r], e[r + 1]);
  8235. return t
  8236. }
  8237. function ge(t, e) {
  8238. for (var r = 0, n = e.length; r < n; ++r) fe(t, e[r]);
  8239. return t
  8240. }
  8241. function ye(t, e, r) {
  8242. t[0] = Math.min(t[0], e), t[1] = Math.min(t[1], r), t[2] = Math.max(t[2], e), t[3] = Math.max(t[3], r)
  8243. }
  8244. function me(t, e) {
  8245. var r;
  8246. return (r = e(_e(t))) || (r = e(be(t))) || (r = e(Oe(t))) ? r : (r = e(Ce(t))) || !1
  8247. }
  8248. function ve(t) {
  8249. var e = 0;
  8250. return Ie(t) || (e = Pe(t) * Ee(t)), e
  8251. }
  8252. function _e(t) {
  8253. return [t[0], t[1]]
  8254. }
  8255. function be(t) {
  8256. return [t[2], t[1]]
  8257. }
  8258. function xe(t) {
  8259. return [(t[0] + t[2]) / 2, (t[1] + t[3]) / 2]
  8260. }
  8261. function we(t, e) {
  8262. var r;
  8263. return e === Gt ? r = _e(t) : e === zt ? r = be(t) : e === Ut ? r = Ce(t) : e === Bt ? r = Oe(t) : pt(!1, 13), r
  8264. }
  8265. function Se(t, e, r, n, i) {
  8266. var o = e * n[0] / 2, a = e * n[1] / 2, s = Math.cos(r), l = Math.sin(r), u = o * s, c = o * l, h = a * s,
  8267. p = a * l, f = t[0], d = t[1], g = f - u + p, y = f - u - p, m = f + u - p, v = f + u + p, _ = d - c - h,
  8268. b = d - c + h, x = d + c + h, w = d + c - h;
  8269. return ie(Math.min(g, y, m, v), Math.min(_, b, x, w), Math.max(g, y, m, v), Math.max(_, b, x, w), i)
  8270. }
  8271. function Ee(t) {
  8272. return t[3] - t[1]
  8273. }
  8274. function Te(t, e, r) {
  8275. var n = r || [1 / 0, 1 / 0, -1 / 0, -1 / 0];
  8276. return Re(t, e) ? (t[0] > e[0] ? n[0] = t[0] : n[0] = e[0], t[1] > e[1] ? n[1] = t[1] : n[1] = e[1], t[2] < e[2] ? n[2] = t[2] : n[2] = e[2], t[3] < e[3] ? n[3] = t[3] : n[3] = e[3]) : oe(n), n
  8277. }
  8278. function Ce(t) {
  8279. return [t[0], t[3]]
  8280. }
  8281. function Oe(t) {
  8282. return [t[2], t[3]]
  8283. }
  8284. function Pe(t) {
  8285. return t[2] - t[0]
  8286. }
  8287. function Re(t, e) {
  8288. return t[0] <= e[2] && t[2] >= e[0] && t[1] <= e[3] && t[3] >= e[1]
  8289. }
  8290. function Ie(t) {
  8291. return t[2] < t[0] || t[3] < t[1]
  8292. }
  8293. function Le(t, e) {
  8294. return e ? (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e) : t
  8295. }
  8296. function Me(t, e) {
  8297. var r = (t[2] - t[0]) / 2 * (e - 1), n = (t[3] - t[1]) / 2 * (e - 1);
  8298. t[0] -= r, t[2] += r, t[1] -= n, t[3] += n
  8299. }
  8300. function Fe(t, e, r) {
  8301. var n = !1, i = re(t, e), o = re(t, r);
  8302. if (i === Yt || o === Yt) n = !0; else {
  8303. var a = t[0], s = t[1], l = t[2], u = t[3], c = e[0], h = e[1], p = r[0], f = r[1], d = (f - h) / (p - c),
  8304. g = void 0, y = void 0;
  8305. o & Wt && !(i & Wt) && (n = (g = p - (f - u) / d) >= a && g <= l), n || !(o & qt) || i & qt || (n = (y = f - (p - l) * d) >= s && y <= u), n || !(o & Xt) || i & Xt || (n = (g = p - (f - s) / d) >= a && g <= l), n || !(o & Zt) || i & Zt || (n = (y = f - (p - a) * d) >= s && y <= u)
  8306. }
  8307. return n
  8308. }
  8309. function Ae(t, e, r, n) {
  8310. var i = [];
  8311. if (n > 1) for (var o = t[2] - t[0], a = t[3] - t[1], s = 0; s < n; ++s) i.push(t[0] + o * s / n, t[1], t[2], t[1] + a * s / n, t[2] - o * s / n, t[3], t[0], t[3] - a * s / n); else i = [t[0], t[1], t[2], t[1], t[2], t[3], t[0], t[3]];
  8312. e(i, i, 2);
  8313. for (var l = [], u = [], c = (s = 0, i.length); s < c; s += 2) l.push(i[s]), u.push(i[s + 1]);
  8314. return function (t, e, r) {
  8315. return ie(Math.min.apply(null, t), Math.min.apply(null, e), Math.max.apply(null, t), Math.max.apply(null, e), r)
  8316. }(l, u, r)
  8317. }
  8318. function ke(t, e) {
  8319. var r = e.getExtent(), n = xe(t);
  8320. if (e.canWrapX() && (n[0] < r[0] || n[0] >= r[2])) {
  8321. var i = Pe(r), o = Math.floor((n[0] - r[0]) / i) * i;
  8322. t[0] -= o, t[2] -= o
  8323. }
  8324. return t
  8325. }
  8326. var je = function () {
  8327. function t(t) {
  8328. this.code_ = t.code, this.units_ = t.units, this.extent_ = void 0 !== t.extent ? t.extent : null, this.worldExtent_ = void 0 !== t.worldExtent ? t.worldExtent : null, this.axisOrientation_ = void 0 !== t.axisOrientation ? t.axisOrientation : "enu", this.global_ = void 0 !== t.global && t.global, this.canWrapX_ = !(!this.global_ || !this.extent_), this.getPointResolutionFunc_ = t.getPointResolution, this.defaultTileGrid_ = null, this.metersPerUnit_ = t.metersPerUnit
  8329. }
  8330. return t.prototype.canWrapX = function () {
  8331. return this.canWrapX_
  8332. }, t.prototype.getCode = function () {
  8333. return this.code_
  8334. }, t.prototype.getExtent = function () {
  8335. return this.extent_
  8336. }, t.prototype.getUnits = function () {
  8337. return this.units_
  8338. }, t.prototype.getMetersPerUnit = function () {
  8339. return this.metersPerUnit_ || wt[this.units_]
  8340. }, t.prototype.getWorldExtent = function () {
  8341. return this.worldExtent_
  8342. }, t.prototype.getAxisOrientation = function () {
  8343. return this.axisOrientation_
  8344. }, t.prototype.isGlobal = function () {
  8345. return this.global_
  8346. }, t.prototype.setGlobal = function (t) {
  8347. this.global_ = t, this.canWrapX_ = !(!t || !this.extent_)
  8348. }, t.prototype.getDefaultTileGrid = function () {
  8349. return this.defaultTileGrid_
  8350. }, t.prototype.setDefaultTileGrid = function (t) {
  8351. this.defaultTileGrid_ = t
  8352. }, t.prototype.setExtent = function (t) {
  8353. this.extent_ = t, this.canWrapX_ = !(!this.global_ || !t)
  8354. }, t.prototype.setWorldExtent = function (t) {
  8355. this.worldExtent_ = t
  8356. }, t.prototype.setGetPointResolution = function (t) {
  8357. this.getPointResolutionFunc_ = t
  8358. }, t.prototype.getPointResolutionFunc = function () {
  8359. return this.getPointResolutionFunc_
  8360. }, t
  8361. }();
  8362. function Ne(t, e, r) {
  8363. return Math.min(Math.max(t, e), r)
  8364. }
  8365. var De = "cosh" in Math ? Math.cosh : function (t) {
  8366. var e = Math.exp(t);
  8367. return (e + 1 / e) / 2
  8368. }, Ge = "log2" in Math ? Math.log2 : function (t) {
  8369. return Math.log(t) * Math.LOG2E
  8370. };
  8371. function ze(t, e, r, n, i, o) {
  8372. var a = i - r, s = o - n;
  8373. if (0 !== a || 0 !== s) {
  8374. var l = ((t - r) * a + (e - n) * s) / (a * a + s * s);
  8375. l > 1 ? (r = i, n = o) : l > 0 && (r += a * l, n += s * l)
  8376. }
  8377. return Ue(t, e, r, n)
  8378. }
  8379. function Ue(t, e, r, n) {
  8380. var i = r - t, o = n - e;
  8381. return i * i + o * o
  8382. }
  8383. function Be(t) {
  8384. for (var e = t.length, r = 0; r < e; r++) {
  8385. for (var n = r, i = Math.abs(t[r][r]), o = r + 1; o < e; o++) {
  8386. var a = Math.abs(t[o][r]);
  8387. a > i && (i = a, n = o)
  8388. }
  8389. if (0 === i) return null;
  8390. var s = t[n];
  8391. t[n] = t[r], t[r] = s;
  8392. for (var l = r + 1; l < e; l++) for (var u = -t[l][r] / t[r][r], c = r; c < e + 1; c++) r == c ? t[l][c] = 0 : t[l][c] += u * t[r][c]
  8393. }
  8394. for (var h = new Array(e), p = e - 1; p >= 0; p--) {
  8395. h[p] = t[p][e] / t[p][p];
  8396. for (var f = p - 1; f >= 0; f--) t[f][e] -= t[f][p] * h[p]
  8397. }
  8398. return h
  8399. }
  8400. function Ve(t) {
  8401. return 180 * t / Math.PI
  8402. }
  8403. function Ye(t) {
  8404. return t * Math.PI / 180
  8405. }
  8406. function We(t, e) {
  8407. var r = t % e;
  8408. return r * e < 0 ? r + e : r
  8409. }
  8410. function qe(t, e, r) {
  8411. return t + r * (e - t)
  8412. }
  8413. var Xe = function () {
  8414. var t = function (e, r) {
  8415. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  8416. t.__proto__ = e
  8417. } || function (t, e) {
  8418. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  8419. })(e, r)
  8420. };
  8421. return function (e, r) {
  8422. function n() {
  8423. this.constructor = e
  8424. }
  8425. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  8426. }
  8427. }(), Ze = 6378137 * Math.PI, Ke = [-Ze, -Ze, Ze, Ze], He = [-180, -85, 180, 85],
  8428. $e = 6378137 * Math.log(Math.tan(Math.PI / 2)), Je = function (t) {
  8429. function e(e) {
  8430. return t.call(this, {
  8431. code: e,
  8432. units: St.METERS,
  8433. extent: Ke,
  8434. global: !0,
  8435. worldExtent: He,
  8436. getPointResolution: function (t, e) {
  8437. return t / De(e[1] / 6378137)
  8438. }
  8439. }) || this
  8440. }
  8441. return Xe(e, t), e
  8442. }(je),
  8443. Qe = [new Je("EPSG:3857"), new Je("EPSG:102100"), new Je("EPSG:102113"), new Je("EPSG:900913"), new Je("http://www.opengis.net/gml/srs/epsg.xml#3857")];
  8444. function tr(t, e, r) {
  8445. var n = t.length, i = r > 1 ? r : 2, o = e;
  8446. void 0 === o && (o = i > 2 ? t.slice() : new Array(n));
  8447. for (var a = 0; a < n; a += i) {
  8448. o[a] = Ze * t[a] / 180;
  8449. var s = 6378137 * Math.log(Math.tan(Math.PI * (+t[a + 1] + 90) / 360));
  8450. s > $e ? s = $e : s < -$e && (s = -$e), o[a + 1] = s
  8451. }
  8452. return o
  8453. }
  8454. function er(t, e, r) {
  8455. var n = t.length, i = r > 1 ? r : 2, o = e;
  8456. void 0 === o && (o = i > 2 ? t.slice() : new Array(n));
  8457. for (var a = 0; a < n; a += i) o[a] = 180 * t[a] / Ze, o[a + 1] = 360 * Math.atan(Math.exp(t[a + 1] / 6378137)) / Math.PI - 90;
  8458. return o
  8459. }
  8460. var rr = function () {
  8461. var t = function (e, r) {
  8462. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  8463. t.__proto__ = e
  8464. } || function (t, e) {
  8465. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  8466. })(e, r)
  8467. };
  8468. return function (e, r) {
  8469. function n() {
  8470. this.constructor = e
  8471. }
  8472. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  8473. }
  8474. }(), nr = [-180, -90, 180, 90], ir = 6378137 * Math.PI / 180, or = function (t) {
  8475. function e(e, r) {
  8476. return t.call(this, {
  8477. code: e,
  8478. units: St.DEGREES,
  8479. extent: nr,
  8480. axisOrientation: r,
  8481. global: !0,
  8482. metersPerUnit: ir,
  8483. worldExtent: nr
  8484. }) || this
  8485. }
  8486. return rr(e, t), e
  8487. }(je),
  8488. ar = [new or("CRS:84"), new or("EPSG:4326", "neu"), new or("urn:ogc:def:crs:OGC:1.3:CRS84"), new or("urn:ogc:def:crs:OGC:2:84"), new or("http://www.opengis.net/gml/srs/epsg.xml#4326", "neu")],
  8489. sr = {};
  8490. function lr() {
  8491. sr = {}
  8492. }
  8493. function ur(t) {
  8494. return sr[t] || sr[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/, "EPSG:$3")] || null
  8495. }
  8496. function cr(t, e) {
  8497. sr[t] = e
  8498. }
  8499. var hr = {};
  8500. function pr() {
  8501. hr = {}
  8502. }
  8503. function fr(t, e, r) {
  8504. var n = t.getCode(), i = e.getCode();
  8505. n in hr || (hr[n] = {}), hr[n][i] = r
  8506. }
  8507. function dr(t, e) {
  8508. var r;
  8509. return t in hr && e in hr[t] && (r = hr[t][e]), r
  8510. }
  8511. function gr(t, e, r) {
  8512. var n = r || 6371008.8, i = Ye(t[1]), o = Ye(e[1]), a = (o - i) / 2, s = Ye(e[0] - t[0]) / 2,
  8513. l = Math.sin(a) * Math.sin(a) + Math.sin(s) * Math.sin(s) * Math.cos(i) * Math.cos(o);
  8514. return 2 * n * Math.atan2(Math.sqrt(l), Math.sqrt(1 - l))
  8515. }
  8516. function yr(t, e) {
  8517. for (var r = 0, n = 0, i = t.length; n < i - 1; ++n) r += gr(t[n], t[n + 1], e);
  8518. return r
  8519. }
  8520. function mr(t, e) {
  8521. for (var r = 0, n = t.length, i = t[n - 1][0], o = t[n - 1][1], a = 0; a < n; a++) {
  8522. var s = t[a][0], l = t[a][1];
  8523. r += Ye(s - i) * (2 + Math.sin(Ye(o)) + Math.sin(Ye(l))), i = s, o = l
  8524. }
  8525. return r * e * e / 2
  8526. }
  8527. function vr(t, e, r, n) {
  8528. var i = n || 6371008.8, o = Ye(t[1]), a = Ye(t[0]), s = e / i,
  8529. l = Math.asin(Math.sin(o) * Math.cos(s) + Math.cos(o) * Math.sin(s) * Math.cos(r));
  8530. return [Ve(a + Math.atan2(Math.sin(r) * Math.sin(s) * Math.cos(o), Math.cos(s) - Math.sin(o) * Math.sin(l))), Ve(l)]
  8531. }
  8532. function _r(t, e, r) {
  8533. var n = void 0 !== r ? t.toFixed(r) : "" + t, i = n.indexOf(".");
  8534. return (i = -1 === i ? n.length : i) > e ? n : new Array(1 + e - i).join("0") + n
  8535. }
  8536. function br(t, e) {
  8537. for (var r = ("" + t).split("."), n = ("" + e).split("."), i = 0; i < Math.max(r.length, n.length); i++) {
  8538. var o = parseInt(r[i] || "0", 10), a = parseInt(n[i] || "0", 10);
  8539. if (o > a) return 1;
  8540. if (a > o) return -1
  8541. }
  8542. return 0
  8543. }
  8544. function xr(t, e) {
  8545. return t[0] += +e[0], t[1] += +e[1], t
  8546. }
  8547. function wr(t, e) {
  8548. var r = e.getRadius(), n = e.getCenter(), i = n[0], o = n[1], a = t[0] - i, s = t[1] - o;
  8549. 0 === a && 0 === s && (a = 1);
  8550. var l = Math.sqrt(a * a + s * s);
  8551. return [i + r * a / l, o + r * s / l]
  8552. }
  8553. function Sr(t, e) {
  8554. var r, n, i = t[0], o = t[1], a = e[0], s = e[1], l = a[0], u = a[1], c = s[0], h = s[1], p = c - l, f = h - u,
  8555. d = 0 === p && 0 === f ? 0 : (p * (i - l) + f * (o - u)) / (p * p + f * f || 0);
  8556. return d <= 0 ? (r = l, n = u) : d >= 1 ? (r = c, n = h) : (r = l + d * p, n = u + d * f), [r, n]
  8557. }
  8558. function Er(t, e, r) {
  8559. var n = We(e + 180, 360) - 180, i = Math.abs(3600 * n), o = r || 0, a = Math.pow(10, o), s = Math.floor(i / 3600),
  8560. l = Math.floor((i - 3600 * s) / 60), u = i - 3600 * s - 60 * l;
  8561. return (u = Math.ceil(u * a) / a) >= 60 && (u = 0, l += 1), l >= 60 && (l = 0, s += 1), s + "° " + _r(l, 2) + "′ " + _r(u, 2, o) + "″" + (0 == n ? "" : " " + t.charAt(n < 0 ? 1 : 0))
  8562. }
  8563. function Tr(t, e, r) {
  8564. return t ? e.replace("{x}", t[0].toFixed(r)).replace("{y}", t[1].toFixed(r)) : ""
  8565. }
  8566. function Cr(t, e) {
  8567. for (var r = !0, n = t.length - 1; n >= 0; --n) if (t[n] != e[n]) {
  8568. r = !1;
  8569. break
  8570. }
  8571. return r
  8572. }
  8573. function Or(t, e) {
  8574. var r = Math.cos(e), n = Math.sin(e), i = t[0] * r - t[1] * n, o = t[1] * r + t[0] * n;
  8575. return t[0] = i, t[1] = o, t
  8576. }
  8577. function Pr(t, e) {
  8578. return t[0] *= e, t[1] *= e, t
  8579. }
  8580. function Rr(t, e) {
  8581. var r = t[0] - e[0], n = t[1] - e[1];
  8582. return r * r + n * n
  8583. }
  8584. function Ir(t, e) {
  8585. return Math.sqrt(Rr(t, e))
  8586. }
  8587. function Lr(t, e) {
  8588. return Rr(t, Sr(t, e))
  8589. }
  8590. function Mr(t, e) {
  8591. return Tr(t, "{x}, {y}", e)
  8592. }
  8593. function Fr(t, e) {
  8594. if (e.canWrapX()) {
  8595. var r = Pe(e.getExtent()), n = Ar(t, e, r);
  8596. n && (t[0] -= n * r)
  8597. }
  8598. return t
  8599. }
  8600. function Ar(t, e, r) {
  8601. var n = e.getExtent(), i = 0;
  8602. if (e.canWrapX() && (t[0] < n[0] || t[0] > n[2])) {
  8603. var o = r || Pe(n);
  8604. i = Math.floor((t[0] - n[0]) / o)
  8605. }
  8606. return i
  8607. }
  8608. function kr(t, e, r) {
  8609. var n;
  8610. if (void 0 !== e) {
  8611. for (var i = 0, o = t.length; i < o; ++i) e[i] = t[i];
  8612. n = e
  8613. } else n = t.slice();
  8614. return n
  8615. }
  8616. function jr(t, e, r) {
  8617. if (void 0 !== e && t !== e) {
  8618. for (var n = 0, i = t.length; n < i; ++n) e[n] = t[n];
  8619. t = e
  8620. }
  8621. return t
  8622. }
  8623. function Nr(t) {
  8624. cr(t.getCode(), t), fr(t, t, kr)
  8625. }
  8626. function Dr(t) {
  8627. t.forEach(Nr)
  8628. }
  8629. function Gr(t) {
  8630. return "string" == typeof t ? ur(t) : t || null
  8631. }
  8632. function zr(t, e, r, n) {
  8633. var i, o = (t = Gr(t)).getPointResolutionFunc();
  8634. if (o) {
  8635. if (i = o(e, r), n && n !== t.getUnits()) (s = t.getMetersPerUnit()) && (i = i * s / wt[n])
  8636. } else {
  8637. var a = t.getUnits();
  8638. if (a == St.DEGREES && !n || n == St.DEGREES) i = e; else {
  8639. var s, l = Zr(t, Gr("EPSG:4326"));
  8640. if (l === jr && a !== St.DEGREES) i = e * t.getMetersPerUnit(); else {
  8641. var u = [r[0] - e / 2, r[1], r[0] + e / 2, r[1], r[0], r[1] - e / 2, r[0], r[1] + e / 2];
  8642. i = (gr((u = l(u, u, 2)).slice(0, 2), u.slice(2, 4)) + gr(u.slice(4, 6), u.slice(6, 8))) / 2
  8643. }
  8644. void 0 !== (s = n ? wt[n] : t.getMetersPerUnit()) && (i /= s)
  8645. }
  8646. }
  8647. return i
  8648. }
  8649. function Ur(t) {
  8650. Dr(t), t.forEach((function (e) {
  8651. t.forEach((function (t) {
  8652. e !== t && fr(e, t, kr)
  8653. }))
  8654. }))
  8655. }
  8656. function Br(t, e, r, n) {
  8657. t.forEach((function (t) {
  8658. e.forEach((function (e) {
  8659. fr(t, e, r), fr(e, t, n)
  8660. }))
  8661. }))
  8662. }
  8663. function Vr(t, e) {
  8664. return t ? "string" == typeof t ? Gr(t) : t : Gr(e)
  8665. }
  8666. function Yr(t) {
  8667. return function (e, r, n) {
  8668. for (var i = e.length, o = void 0 !== n ? n : 2, a = void 0 !== r ? r : new Array(i), s = 0; s < i; s += o) {
  8669. var l = t([e[s], e[s + 1]]);
  8670. a[s] = l[0], a[s + 1] = l[1];
  8671. for (var u = o - 1; u >= 2; --u) a[s + u] = e[s + u]
  8672. }
  8673. return a
  8674. }
  8675. }
  8676. function Wr(t, e, r, n) {
  8677. var i = Gr(t), o = Gr(e);
  8678. fr(i, o, Yr(r)), fr(o, i, Yr(n))
  8679. }
  8680. function qr(t, e) {
  8681. return Hr(t, "EPSG:4326", void 0 !== e ? e : "EPSG:3857")
  8682. }
  8683. function Xr(t, e) {
  8684. if (t === e) return !0;
  8685. var r = t.getUnits() === e.getUnits();
  8686. return (t.getCode() === e.getCode() || Zr(t, e) === kr) && r
  8687. }
  8688. function Zr(t, e) {
  8689. var r = dr(t.getCode(), e.getCode());
  8690. return r || (r = jr), r
  8691. }
  8692. function Kr(t, e) {
  8693. return Zr(Gr(t), Gr(e))
  8694. }
  8695. function Hr(t, e, r) {
  8696. return Kr(e, r)(t, void 0, t.length)
  8697. }
  8698. function $r(t, e, r, n) {
  8699. return Ae(t, Kr(e, r), void 0, n)
  8700. }
  8701. var Jr = null;
  8702. function Qr(t) {
  8703. Jr = Gr(t)
  8704. }
  8705. function tn() {
  8706. return Jr
  8707. }
  8708. function en(t, e) {
  8709. return Jr ? Hr(t, e, Jr) : t
  8710. }
  8711. function rn(t, e) {
  8712. return Jr ? Hr(t, Jr, e) : t
  8713. }
  8714. function nn(t, e) {
  8715. return Jr ? $r(t, e, Jr) : t
  8716. }
  8717. function on(t, e) {
  8718. return Jr ? $r(t, Jr, e) : t
  8719. }
  8720. function an(t, e, r) {
  8721. return function (n) {
  8722. var i, o, a = n[0], s = n[1];
  8723. if (t.canWrapX()) {
  8724. var l = t.getExtent(), u = Pe(l);
  8725. (o = Ar(n, t, u)) && (a -= o * u), a = Ne(a, l[0], l[2]), s = Ne(s, l[1], l[3]), i = r([a, s])
  8726. } else i = r(n);
  8727. return o && e.canWrapX() && (i[0] += o * Pe(e.getExtent())), i
  8728. }
  8729. }
  8730. function sn() {
  8731. Ur(Qe), Ur(ar), Br(ar, Qe, tr, er)
  8732. }
  8733. function ln(t, e, r, n, i, o) {
  8734. for (var a = o || [], s = 0, l = e; l < r; l += n) {
  8735. var u = t[l], c = t[l + 1];
  8736. a[s++] = i[0] * u + i[2] * c + i[4], a[s++] = i[1] * u + i[3] * c + i[5]
  8737. }
  8738. return o && a.length != s && (a.length = s), a
  8739. }
  8740. function un(t, e, r, n, i, o, a) {
  8741. for (var s = a || [], l = Math.cos(i), u = Math.sin(i), c = o[0], h = o[1], p = 0, f = e; f < r; f += n) {
  8742. var d = t[f] - c, g = t[f + 1] - h;
  8743. s[p++] = c + d * l - g * u, s[p++] = h + d * u + g * l;
  8744. for (var y = f + 2; y < f + n; ++y) s[p++] = t[y]
  8745. }
  8746. return a && s.length != p && (s.length = p), s
  8747. }
  8748. function cn(t, e, r, n, i, o, a, s) {
  8749. for (var l = s || [], u = a[0], c = a[1], h = 0, p = e; p < r; p += n) {
  8750. var f = t[p] - u, d = t[p + 1] - c;
  8751. l[h++] = u + i * f, l[h++] = c + o * d;
  8752. for (var g = p + 2; g < p + n; ++g) l[h++] = t[g]
  8753. }
  8754. return s && l.length != h && (l.length = h), l
  8755. }
  8756. function hn(t, e, r, n, i, o, a) {
  8757. for (var s = a || [], l = 0, u = e; u < r; u += n) {
  8758. s[l++] = t[u] + i, s[l++] = t[u + 1] + o;
  8759. for (var c = u + 2; c < u + n; ++c) s[l++] = t[c]
  8760. }
  8761. return a && s.length != l && (s.length = l), s
  8762. }
  8763. sn();
  8764. var pn = function () {
  8765. var t = function (e, r) {
  8766. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  8767. t.__proto__ = e
  8768. } || function (t, e) {
  8769. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  8770. })(e, r)
  8771. };
  8772. return function (e, r) {
  8773. function n() {
  8774. this.constructor = e
  8775. }
  8776. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  8777. }
  8778. }(), fn = [1, 0, 0, 1, 0, 0], dn = function (t) {
  8779. function e() {
  8780. var e = t.call(this) || this;
  8781. return e.extent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], e.extentRevision_ = -1, e.simplifiedGeometryMaxMinSquaredTolerance = 0, e.simplifiedGeometryRevision = 0, e.simplifyTransformedInternal = C((function (t, e, r) {
  8782. if (!r) return this.getSimplifiedGeometry(e);
  8783. var n = this.clone();
  8784. return n.applyTransform(r), n.getSimplifiedGeometry(e)
  8785. })), e
  8786. }
  8787. return pn(e, t), e.prototype.simplifyTransformed = function (t, e) {
  8788. return this.simplifyTransformedInternal(this.getRevision(), t, e)
  8789. }, e.prototype.clone = function () {
  8790. return n()
  8791. }, e.prototype.closestPointXY = function (t, e, r, i) {
  8792. return n()
  8793. }, e.prototype.containsXY = function (t, e) {
  8794. var r = this.getClosestPoint([t, e]);
  8795. return r[0] === t && r[1] === e
  8796. }, e.prototype.getClosestPoint = function (t, e) {
  8797. var r = e || [NaN, NaN];
  8798. return this.closestPointXY(t[0], t[1], r, 1 / 0), r
  8799. }, e.prototype.intersectsCoordinate = function (t) {
  8800. return this.containsXY(t[0], t[1])
  8801. }, e.prototype.computeExtent = function (t) {
  8802. return n()
  8803. }, e.prototype.getExtent = function (t) {
  8804. if (this.extentRevision_ != this.getRevision()) {
  8805. var e = this.computeExtent(this.extent_);
  8806. (isNaN(e[0]) || isNaN(e[1])) && oe(e), this.extentRevision_ = this.getRevision()
  8807. }
  8808. return Le(this.extent_, t)
  8809. }, e.prototype.rotate = function (t, e) {
  8810. n()
  8811. }, e.prototype.scale = function (t, e, r) {
  8812. n()
  8813. }, e.prototype.simplify = function (t) {
  8814. return this.getSimplifiedGeometry(t * t)
  8815. }, e.prototype.getSimplifiedGeometry = function (t) {
  8816. return n()
  8817. }, e.prototype.getType = function () {
  8818. return n()
  8819. }, e.prototype.applyTransform = function (t) {
  8820. n()
  8821. }, e.prototype.intersectsExtent = function (t) {
  8822. return n()
  8823. }, e.prototype.translate = function (t, e) {
  8824. n()
  8825. }, e.prototype.transform = function (t, e) {
  8826. var r = Gr(t), n = r.getUnits() == St.TILE_PIXELS ? function (t, n, i) {
  8827. var o = r.getExtent(), a = r.getWorldExtent(), s = Ee(a) / Ee(o);
  8828. return kt(fn, a[0], a[3], s, -s, 0, 0, 0), ln(t, 0, t.length, i, fn, n), Kr(r, e)(t, n, i)
  8829. } : Kr(r, e);
  8830. return this.applyTransform(n), this
  8831. }, e
  8832. }(ot), gn = function () {
  8833. var t = function (e, r) {
  8834. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  8835. t.__proto__ = e
  8836. } || function (t, e) {
  8837. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  8838. })(e, r)
  8839. };
  8840. return function (e, r) {
  8841. function n() {
  8842. this.constructor = e
  8843. }
  8844. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  8845. }
  8846. }();
  8847. function yn(t) {
  8848. var e;
  8849. return t == yt ? e = 2 : t == mt || t == vt ? e = 3 : t == _t && (e = 4), e
  8850. }
  8851. function mn(t, e, r) {
  8852. var n = t.getFlatCoordinates();
  8853. if (n) {
  8854. var i = t.getStride();
  8855. return ln(n, 0, n.length, i, e, r)
  8856. }
  8857. return null
  8858. }
  8859. var vn = function (t) {
  8860. function e() {
  8861. var e = t.call(this) || this;
  8862. return e.layout = yt, e.stride = 2, e.flatCoordinates = null, e
  8863. }
  8864. return gn(e, t), e.prototype.computeExtent = function (t) {
  8865. return le(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t)
  8866. }, e.prototype.getCoordinates = function () {
  8867. return n()
  8868. }, e.prototype.getFirstCoordinate = function () {
  8869. return this.flatCoordinates.slice(0, this.stride)
  8870. }, e.prototype.getFlatCoordinates = function () {
  8871. return this.flatCoordinates
  8872. }, e.prototype.getLastCoordinate = function () {
  8873. return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride)
  8874. }, e.prototype.getLayout = function () {
  8875. return this.layout
  8876. }, e.prototype.getSimplifiedGeometry = function (t) {
  8877. if (this.simplifiedGeometryRevision !== this.getRevision() && (this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = this.getRevision()), t < 0 || 0 !== this.simplifiedGeometryMaxMinSquaredTolerance && t <= this.simplifiedGeometryMaxMinSquaredTolerance) return this;
  8878. var e = this.getSimplifiedGeometryInternal(t);
  8879. return e.getFlatCoordinates().length < this.flatCoordinates.length ? e : (this.simplifiedGeometryMaxMinSquaredTolerance = t, this)
  8880. }, e.prototype.getSimplifiedGeometryInternal = function (t) {
  8881. return this
  8882. }, e.prototype.getStride = function () {
  8883. return this.stride
  8884. }, e.prototype.setFlatCoordinates = function (t, e) {
  8885. this.stride = yn(t), this.layout = t, this.flatCoordinates = e
  8886. }, e.prototype.setCoordinates = function (t, e) {
  8887. n()
  8888. }, e.prototype.setLayout = function (t, e, r) {
  8889. var n;
  8890. if (t) n = yn(t); else {
  8891. for (var i = 0; i < r; ++i) {
  8892. if (0 === e.length) return this.layout = yt, void (this.stride = 2);
  8893. e = e[0]
  8894. }
  8895. t = function (t) {
  8896. var e;
  8897. 2 == t ? e = yt : 3 == t ? e = mt : 4 == t && (e = _t);
  8898. return e
  8899. }(n = e.length)
  8900. }
  8901. this.layout = t, this.stride = n
  8902. }, e.prototype.applyTransform = function (t) {
  8903. this.flatCoordinates && (t(this.flatCoordinates, this.flatCoordinates, this.stride), this.changed())
  8904. }, e.prototype.rotate = function (t, e) {
  8905. var r = this.getFlatCoordinates();
  8906. if (r) {
  8907. var n = this.getStride();
  8908. un(r, 0, r.length, n, t, e, r), this.changed()
  8909. }
  8910. }, e.prototype.scale = function (t, e, r) {
  8911. var n = e;
  8912. void 0 === n && (n = t);
  8913. var i = r;
  8914. i || (i = xe(this.getExtent()));
  8915. var o = this.getFlatCoordinates();
  8916. if (o) {
  8917. var a = this.getStride();
  8918. cn(o, 0, o.length, a, t, n, i, o), this.changed()
  8919. }
  8920. }, e.prototype.translate = function (t, e) {
  8921. var r = this.getFlatCoordinates();
  8922. if (r) {
  8923. var n = this.getStride();
  8924. hn(r, 0, r.length, n, t, e, r), this.changed()
  8925. }
  8926. }, e
  8927. }(dn);
  8928. function _n(t, e, r, n, i, o, a) {
  8929. var s, l = t[e], u = t[e + 1], c = t[r] - l, h = t[r + 1] - u;
  8930. if (0 === c && 0 === h) s = e; else {
  8931. var p = ((i - l) * c + (o - u) * h) / (c * c + h * h);
  8932. if (p > 1) s = r; else {
  8933. if (p > 0) {
  8934. for (var f = 0; f < n; ++f) a[f] = qe(t[e + f], t[r + f], p);
  8935. return void (a.length = n)
  8936. }
  8937. s = e
  8938. }
  8939. }
  8940. for (f = 0; f < n; ++f) a[f] = t[s + f];
  8941. a.length = n
  8942. }
  8943. function bn(t, e, r, n, i) {
  8944. var o = t[e], a = t[e + 1];
  8945. for (e += n; e < r; e += n) {
  8946. var s = t[e], l = t[e + 1], u = Ue(o, a, s, l);
  8947. u > i && (i = u), o = s, a = l
  8948. }
  8949. return i
  8950. }
  8951. function xn(t, e, r, n, i) {
  8952. for (var o = 0, a = r.length; o < a; ++o) {
  8953. var s = r[o];
  8954. i = bn(t, e, s, n, i), e = s
  8955. }
  8956. return i
  8957. }
  8958. function wn(t, e, r, n, i) {
  8959. for (var o = 0, a = r.length; o < a; ++o) {
  8960. var s = r[o];
  8961. i = xn(t, e, s, n, i), e = s[s.length - 1]
  8962. }
  8963. return i
  8964. }
  8965. function Sn(t, e, r, n, i, o, a, s, l, u, c) {
  8966. if (e == r) return u;
  8967. var h, p;
  8968. if (0 === i) {
  8969. if ((p = Ue(a, s, t[e], t[e + 1])) < u) {
  8970. for (h = 0; h < n; ++h) l[h] = t[e + h];
  8971. return l.length = n, p
  8972. }
  8973. return u
  8974. }
  8975. for (var f = c || [NaN, NaN], d = e + n; d < r;) if (_n(t, d - n, d, n, a, s, f), (p = Ue(a, s, f[0], f[1])) < u) {
  8976. for (u = p, h = 0; h < n; ++h) l[h] = f[h];
  8977. l.length = n, d += n
  8978. } else d += n * Math.max((Math.sqrt(p) - Math.sqrt(u)) / i | 0, 1);
  8979. if (o && (_n(t, r - n, e, n, a, s, f), (p = Ue(a, s, f[0], f[1])) < u)) {
  8980. for (u = p, h = 0; h < n; ++h) l[h] = f[h];
  8981. l.length = n
  8982. }
  8983. return u
  8984. }
  8985. function En(t, e, r, n, i, o, a, s, l, u, c) {
  8986. for (var h = c || [NaN, NaN], p = 0, f = r.length; p < f; ++p) {
  8987. var d = r[p];
  8988. u = Sn(t, e, d, n, i, o, a, s, l, u, h), e = d
  8989. }
  8990. return u
  8991. }
  8992. function Tn(t, e, r, n, i, o, a, s, l, u, c) {
  8993. for (var h = c || [NaN, NaN], p = 0, f = r.length; p < f; ++p) {
  8994. var d = r[p];
  8995. u = En(t, e, d, n, i, o, a, s, l, u, h), e = d[d.length - 1]
  8996. }
  8997. return u
  8998. }
  8999. function Cn(t, e, r, n) {
  9000. for (var i = 0, o = r.length; i < o; ++i) t[e++] = r[i];
  9001. return e
  9002. }
  9003. function On(t, e, r, n) {
  9004. for (var i = 0, o = r.length; i < o; ++i) for (var a = r[i], s = 0; s < n; ++s) t[e++] = a[s];
  9005. return e
  9006. }
  9007. function Pn(t, e, r, n, i) {
  9008. for (var o = i || [], a = 0, s = 0, l = r.length; s < l; ++s) {
  9009. var u = On(t, e, r[s], n);
  9010. o[a++] = u, e = u
  9011. }
  9012. return o.length = a, o
  9013. }
  9014. function Rn(t, e, r, n, i) {
  9015. for (var o = i || [], a = 0, s = 0, l = r.length; s < l; ++s) {
  9016. var u = Pn(t, e, r[s], n, o[a]);
  9017. o[a++] = u, e = u[u.length - 1]
  9018. }
  9019. return o.length = a, o
  9020. }
  9021. function In(t, e, r, n, i, o, a) {
  9022. var s = (r - e) / n;
  9023. if (s < 3) {
  9024. for (; e < r; e += n) o[a++] = t[e], o[a++] = t[e + 1];
  9025. return a
  9026. }
  9027. var l = new Array(s);
  9028. l[0] = 1, l[s - 1] = 1;
  9029. for (var u = [e, r - n], c = 0; u.length > 0;) {
  9030. for (var h = u.pop(), p = u.pop(), f = 0, d = t[p], g = t[p + 1], y = t[h], m = t[h + 1], v = p + n; v < h; v += n) {
  9031. var _ = ze(t[v], t[v + 1], d, g, y, m);
  9032. _ > f && (c = v, f = _)
  9033. }
  9034. f > i && (l[(c - e) / n] = 1, p + n < c && u.push(p, c), c + n < h && u.push(c, h))
  9035. }
  9036. for (v = 0; v < s; ++v) l[v] && (o[a++] = t[e + v * n], o[a++] = t[e + v * n + 1]);
  9037. return a
  9038. }
  9039. function Ln(t, e, r, n, i, o, a, s) {
  9040. for (var l = 0, u = r.length; l < u; ++l) {
  9041. var c = r[l];
  9042. a = In(t, e, c, n, i, o, a), s.push(a), e = c
  9043. }
  9044. return a
  9045. }
  9046. function Mn(t, e, r, n, i, o, a) {
  9047. if (r <= e + n) {
  9048. for (; e < r; e += n) o[a++] = t[e], o[a++] = t[e + 1];
  9049. return a
  9050. }
  9051. var s = t[e], l = t[e + 1];
  9052. o[a++] = s, o[a++] = l;
  9053. var u = s, c = l;
  9054. for (e += n; e < r; e += n) Ue(s, l, u = t[e], c = t[e + 1]) > i && (o[a++] = u, o[a++] = c, s = u, l = c);
  9055. return u == s && c == l || (o[a++] = u, o[a++] = c), a
  9056. }
  9057. function Fn(t, e) {
  9058. return e * Math.round(t / e)
  9059. }
  9060. function An(t, e, r, n, i, o, a) {
  9061. if (e == r) return a;
  9062. var s, l, u = Fn(t[e], i), c = Fn(t[e + 1], i);
  9063. e += n, o[a++] = u, o[a++] = c;
  9064. do {
  9065. if (s = Fn(t[e], i), l = Fn(t[e + 1], i), (e += n) == r) return o[a++] = s, o[a++] = l, a
  9066. } while (s == u && l == c);
  9067. for (; e < r;) {
  9068. var h = Fn(t[e], i), p = Fn(t[e + 1], i);
  9069. if (e += n, h != s || p != l) {
  9070. var f = s - u, d = l - c, g = h - u, y = p - c;
  9071. f * y == d * g && (f < 0 && g < f || f == g || f > 0 && g > f) && (d < 0 && y < d || d == y || d > 0 && y > d) ? (s = h, l = p) : (o[a++] = s, o[a++] = l, u = s, c = l, s = h, l = p)
  9072. }
  9073. }
  9074. return o[a++] = s, o[a++] = l, a
  9075. }
  9076. function kn(t, e, r, n, i, o, a, s) {
  9077. for (var l = 0, u = r.length; l < u; ++l) {
  9078. var c = r[l];
  9079. a = An(t, e, c, n, i, o, a), s.push(a), e = c
  9080. }
  9081. return a
  9082. }
  9083. function jn(t, e, r, n, i, o, a, s) {
  9084. for (var l = 0, u = r.length; l < u; ++l) {
  9085. var c = r[l], h = [];
  9086. a = kn(t, e, c, n, i, o, a, h), s.push(h), e = c[c.length - 1]
  9087. }
  9088. return a
  9089. }
  9090. function Nn(t, e, r, n, i) {
  9091. for (var o = void 0 !== i ? i : [], a = 0, s = e; s < r; s += n) o[a++] = t.slice(s, s + n);
  9092. return o.length = a, o
  9093. }
  9094. function Dn(t, e, r, n, i) {
  9095. for (var o = void 0 !== i ? i : [], a = 0, s = 0, l = r.length; s < l; ++s) {
  9096. var u = r[s];
  9097. o[a++] = Nn(t, e, u, n, o[a]), e = u
  9098. }
  9099. return o.length = a, o
  9100. }
  9101. function Gn(t, e, r, n, i) {
  9102. for (var o = void 0 !== i ? i : [], a = 0, s = 0, l = r.length; s < l; ++s) {
  9103. var u = r[s];
  9104. o[a++] = Dn(t, e, u, n, o[a]), e = u[u.length - 1]
  9105. }
  9106. return o.length = a, o
  9107. }
  9108. function zn(t, e, r, n) {
  9109. for (var i = 0, o = t[r - n], a = t[r - n + 1]; e < r; e += n) {
  9110. var s = t[e], l = t[e + 1];
  9111. i += a * s - o * l, o = s, a = l
  9112. }
  9113. return i / 2
  9114. }
  9115. function Un(t, e, r, n) {
  9116. for (var i = 0, o = 0, a = r.length; o < a; ++o) {
  9117. var s = r[o];
  9118. i += zn(t, e, s, n), e = s
  9119. }
  9120. return i
  9121. }
  9122. function Bn(t, e, r, n) {
  9123. for (var i = 0, o = 0, a = r.length; o < a; ++o) {
  9124. var s = r[o];
  9125. i += Un(t, e, s, n), e = s[s.length - 1]
  9126. }
  9127. return i
  9128. }
  9129. var Vn = function () {
  9130. var t = function (e, r) {
  9131. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9132. t.__proto__ = e
  9133. } || function (t, e) {
  9134. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9135. })(e, r)
  9136. };
  9137. return function (e, r) {
  9138. function n() {
  9139. this.constructor = e
  9140. }
  9141. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9142. }
  9143. }(), Yn = function (t) {
  9144. function e(e, r) {
  9145. var n = t.call(this) || this;
  9146. return n.maxDelta_ = -1, n.maxDeltaRevision_ = -1, void 0 === r || Array.isArray(e[0]) ? n.setCoordinates(e, r) : n.setFlatCoordinates(r, e), n
  9147. }
  9148. return Vn(e, t), e.prototype.clone = function () {
  9149. return new e(this.flatCoordinates.slice(), this.layout)
  9150. }, e.prototype.closestPointXY = function (t, e, r, n) {
  9151. return n < Jt(this.getExtent(), t, e) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(bn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Sn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, !0, t, e, r, n))
  9152. }, e.prototype.getArea = function () {
  9153. return zn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
  9154. }, e.prototype.getCoordinates = function () {
  9155. return Nn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
  9156. }, e.prototype.getSimplifiedGeometryInternal = function (t) {
  9157. var r = [];
  9158. return r.length = In(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, r, 0), new e(r, yt)
  9159. }, e.prototype.getType = function () {
  9160. return bt.LINEAR_RING
  9161. }, e.prototype.intersectsExtent = function (t) {
  9162. return !1
  9163. }, e.prototype.setCoordinates = function (t, e) {
  9164. this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = On(this.flatCoordinates, 0, t, this.stride), this.changed()
  9165. }, e
  9166. }(vn), Wn = function () {
  9167. var t = function (e, r) {
  9168. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9169. t.__proto__ = e
  9170. } || function (t, e) {
  9171. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9172. })(e, r)
  9173. };
  9174. return function (e, r) {
  9175. function n() {
  9176. this.constructor = e
  9177. }
  9178. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9179. }
  9180. }(), qn = function (t) {
  9181. function e(e, r) {
  9182. var n = t.call(this) || this;
  9183. return n.setCoordinates(e, r), n
  9184. }
  9185. return Wn(e, t), e.prototype.clone = function () {
  9186. var t = new e(this.flatCoordinates.slice(), this.layout);
  9187. return t.applyProperties(this), t
  9188. }, e.prototype.closestPointXY = function (t, e, r, n) {
  9189. var i = this.flatCoordinates, o = Ue(t, e, i[0], i[1]);
  9190. if (o < n) {
  9191. for (var a = this.stride, s = 0; s < a; ++s) r[s] = i[s];
  9192. return r.length = a, o
  9193. }
  9194. return n
  9195. }, e.prototype.getCoordinates = function () {
  9196. return this.flatCoordinates ? this.flatCoordinates.slice() : []
  9197. }, e.prototype.computeExtent = function (t) {
  9198. return ae(this.flatCoordinates, t)
  9199. }, e.prototype.getType = function () {
  9200. return bt.POINT
  9201. }, e.prototype.intersectsExtent = function (t) {
  9202. return ee(t, this.flatCoordinates[0], this.flatCoordinates[1])
  9203. }, e.prototype.setCoordinates = function (t, e) {
  9204. this.setLayout(e, t, 0), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = Cn(this.flatCoordinates, 0, t, this.stride), this.changed()
  9205. }, e
  9206. }(vn);
  9207. function Xn(t, e, r, n, i) {
  9208. return !me(i, (function (i) {
  9209. return !Zn(t, e, r, n, i[0], i[1])
  9210. }))
  9211. }
  9212. function Zn(t, e, r, n, i, o) {
  9213. for (var a = 0, s = t[r - n], l = t[r - n + 1]; e < r; e += n) {
  9214. var u = t[e], c = t[e + 1];
  9215. l <= o ? c > o && (u - s) * (o - l) - (i - s) * (c - l) > 0 && a++ : c <= o && (u - s) * (o - l) - (i - s) * (c - l) < 0 && a--, s = u, l = c
  9216. }
  9217. return 0 !== a
  9218. }
  9219. function Kn(t, e, r, n, i, o) {
  9220. if (0 === r.length) return !1;
  9221. if (!Zn(t, e, r[0], n, i, o)) return !1;
  9222. for (var a = 1, s = r.length; a < s; ++a) if (Zn(t, r[a - 1], r[a], n, i, o)) return !1;
  9223. return !0
  9224. }
  9225. function Hn(t, e, r, n, i, o) {
  9226. if (0 === r.length) return !1;
  9227. for (var a = 0, s = r.length; a < s; ++a) {
  9228. var l = r[a];
  9229. if (Kn(t, e, l, n, i, o)) return !0;
  9230. e = l[l.length - 1]
  9231. }
  9232. return !1
  9233. }
  9234. function $n(t, e, r, n, i, o, a) {
  9235. for (var s, l, u, c, h, p, f, g = i[o + 1], y = [], m = 0, v = r.length; m < v; ++m) {
  9236. var _ = r[m];
  9237. for (c = t[_ - n], p = t[_ - n + 1], s = e; s < _; s += n) h = t[s], f = t[s + 1], (g <= p && f <= g || p <= g && g <= f) && (u = (g - p) / (f - p) * (h - c) + c, y.push(u)), c = h, p = f
  9238. }
  9239. var b = NaN, x = -1 / 0;
  9240. for (y.sort(d), c = y[0], s = 1, l = y.length; s < l; ++s) {
  9241. h = y[s];
  9242. var w = Math.abs(h - c);
  9243. w > x && Kn(t, e, r, n, u = (c + h) / 2, g) && (b = u, x = w), c = h
  9244. }
  9245. return isNaN(b) && (b = i[o]), a ? (a.push(b, g, x), a) : [b, g, x]
  9246. }
  9247. function Jn(t, e, r, n, i) {
  9248. for (var o = [], a = 0, s = r.length; a < s; ++a) {
  9249. var l = r[a];
  9250. o = $n(t, e, l, n, i, 2 * a, o), e = l[l.length - 1]
  9251. }
  9252. return o
  9253. }
  9254. function Qn(t, e, r, n, i) {
  9255. for (var o, a = [t[e], t[e + 1]], s = []; e + n < r; e += n) {
  9256. if (s[0] = t[e + n], s[1] = t[e + n + 1], o = i(a, s)) return o;
  9257. a[0] = s[0], a[1] = s[1]
  9258. }
  9259. return !1
  9260. }
  9261. function ti(t, e, r, n, i) {
  9262. var o = de([1 / 0, 1 / 0, -1 / 0, -1 / 0], t, e, r, n);
  9263. return !!Re(i, o) && (!!te(i, o) || (o[0] >= i[0] && o[2] <= i[2] || (o[1] >= i[1] && o[3] <= i[3] || Qn(t, e, r, n, (function (t, e) {
  9264. return Fe(i, t, e)
  9265. })))))
  9266. }
  9267. function ei(t, e, r, n, i) {
  9268. for (var o = 0, a = r.length; o < a; ++o) {
  9269. if (ti(t, e, r[o], n, i)) return !0;
  9270. e = r[o]
  9271. }
  9272. return !1
  9273. }
  9274. function ri(t, e, r, n, i) {
  9275. return !!ti(t, e, r, n, i) || (!!Zn(t, e, r, n, i[0], i[1]) || (!!Zn(t, e, r, n, i[0], i[3]) || (!!Zn(t, e, r, n, i[2], i[1]) || !!Zn(t, e, r, n, i[2], i[3]))))
  9276. }
  9277. function ni(t, e, r, n, i) {
  9278. if (!ri(t, e, r[0], n, i)) return !1;
  9279. if (1 === r.length) return !0;
  9280. for (var o = 1, a = r.length; o < a; ++o) if (Xn(t, r[o - 1], r[o], n, i) && !ti(t, r[o - 1], r[o], n, i)) return !1;
  9281. return !0
  9282. }
  9283. function ii(t, e, r, n, i) {
  9284. for (var o = 0, a = r.length; o < a; ++o) {
  9285. var s = r[o];
  9286. if (ni(t, e, s, n, i)) return !0;
  9287. e = s[s.length - 1]
  9288. }
  9289. return !1
  9290. }
  9291. function oi(t, e, r, n) {
  9292. for (; e < r - n;) {
  9293. for (var i = 0; i < n; ++i) {
  9294. var o = t[e + i];
  9295. t[e + i] = t[r - n + i], t[r - n + i] = o
  9296. }
  9297. e += n, r -= n
  9298. }
  9299. }
  9300. function ai(t, e, r, n) {
  9301. for (var i = 0, o = t[r - n], a = t[r - n + 1]; e < r; e += n) {
  9302. var s = t[e], l = t[e + 1];
  9303. i += (s - o) * (l + a), o = s, a = l
  9304. }
  9305. return 0 === i ? void 0 : i > 0
  9306. }
  9307. function si(t, e, r, n, i) {
  9308. for (var o = void 0 !== i && i, a = 0, s = r.length; a < s; ++a) {
  9309. var l = r[a], u = ai(t, e, l, n);
  9310. if (0 === a) {
  9311. if (o && u || !o && !u) return !1
  9312. } else if (o && !u || !o && u) return !1;
  9313. e = l
  9314. }
  9315. return !0
  9316. }
  9317. function li(t, e, r, n, i) {
  9318. for (var o = 0, a = r.length; o < a; ++o) {
  9319. var s = r[o];
  9320. if (!si(t, e, s, n, i)) return !1;
  9321. s.length && (e = s[s.length - 1])
  9322. }
  9323. return !0
  9324. }
  9325. function ui(t, e, r, n, i) {
  9326. for (var o = void 0 !== i && i, a = 0, s = r.length; a < s; ++a) {
  9327. var l = r[a], u = ai(t, e, l, n);
  9328. (0 === a ? o && u || !o && !u : o && !u || !o && u) && oi(t, e, l, n), e = l
  9329. }
  9330. return e
  9331. }
  9332. function ci(t, e, r, n, i) {
  9333. for (var o = 0, a = r.length; o < a; ++o) e = ui(t, e, r[o], n, i);
  9334. return e
  9335. }
  9336. var hi = function () {
  9337. var t = function (e, r) {
  9338. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9339. t.__proto__ = e
  9340. } || function (t, e) {
  9341. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9342. })(e, r)
  9343. };
  9344. return function (e, r) {
  9345. function n() {
  9346. this.constructor = e
  9347. }
  9348. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9349. }
  9350. }(), pi = function (t) {
  9351. function e(e, r, n) {
  9352. var i = t.call(this) || this;
  9353. return i.ends_ = [], i.flatInteriorPointRevision_ = -1, i.flatInteriorPoint_ = null, i.maxDelta_ = -1, i.maxDeltaRevision_ = -1, i.orientedRevision_ = -1, i.orientedFlatCoordinates_ = null, void 0 !== r && n ? (i.setFlatCoordinates(r, e), i.ends_ = n) : i.setCoordinates(e, r), i
  9354. }
  9355. return hi(e, t), e.prototype.appendLinearRing = function (t) {
  9356. this.flatCoordinates ? v(this.flatCoordinates, t.getFlatCoordinates()) : this.flatCoordinates = t.getFlatCoordinates().slice(), this.ends_.push(this.flatCoordinates.length), this.changed()
  9357. }, e.prototype.clone = function () {
  9358. var t = new e(this.flatCoordinates.slice(), this.layout, this.ends_.slice());
  9359. return t.applyProperties(this), t
  9360. }, e.prototype.closestPointXY = function (t, e, r, n) {
  9361. return n < Jt(this.getExtent(), t, e) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(xn(this.flatCoordinates, 0, this.ends_, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), En(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, !0, t, e, r, n))
  9362. }, e.prototype.containsXY = function (t, e) {
  9363. return Kn(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, t, e)
  9364. }, e.prototype.getArea = function () {
  9365. return Un(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride)
  9366. }, e.prototype.getCoordinates = function (t) {
  9367. var e;
  9368. return void 0 !== t ? ui(e = this.getOrientedFlatCoordinates().slice(), 0, this.ends_, this.stride, t) : e = this.flatCoordinates, Dn(e, 0, this.ends_, this.stride)
  9369. }, e.prototype.getEnds = function () {
  9370. return this.ends_
  9371. }, e.prototype.getFlatInteriorPoint = function () {
  9372. if (this.flatInteriorPointRevision_ != this.getRevision()) {
  9373. var t = xe(this.getExtent());
  9374. this.flatInteriorPoint_ = $n(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, t, 0), this.flatInteriorPointRevision_ = this.getRevision()
  9375. }
  9376. return this.flatInteriorPoint_
  9377. }, e.prototype.getInteriorPoint = function () {
  9378. return new qn(this.getFlatInteriorPoint(), vt)
  9379. }, e.prototype.getLinearRingCount = function () {
  9380. return this.ends_.length
  9381. }, e.prototype.getLinearRing = function (t) {
  9382. return t < 0 || this.ends_.length <= t ? null : new Yn(this.flatCoordinates.slice(0 === t ? 0 : this.ends_[t - 1], this.ends_[t]), this.layout)
  9383. }, e.prototype.getLinearRings = function () {
  9384. for (var t = this.layout, e = this.flatCoordinates, r = this.ends_, n = [], i = 0, o = 0, a = r.length; o < a; ++o) {
  9385. var s = r[o], l = new Yn(e.slice(i, s), t);
  9386. n.push(l), i = s
  9387. }
  9388. return n
  9389. }, e.prototype.getOrientedFlatCoordinates = function () {
  9390. if (this.orientedRevision_ != this.getRevision()) {
  9391. var t = this.flatCoordinates;
  9392. si(t, 0, this.ends_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = ui(this.orientedFlatCoordinates_, 0, this.ends_, this.stride)), this.orientedRevision_ = this.getRevision()
  9393. }
  9394. return this.orientedFlatCoordinates_
  9395. }, e.prototype.getSimplifiedGeometryInternal = function (t) {
  9396. var r = [], n = [];
  9397. return r.length = kn(this.flatCoordinates, 0, this.ends_, this.stride, Math.sqrt(t), r, 0, n), new e(r, yt, n)
  9398. }, e.prototype.getType = function () {
  9399. return bt.POLYGON
  9400. }, e.prototype.intersectsExtent = function (t) {
  9401. return ni(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, t)
  9402. }, e.prototype.setCoordinates = function (t, e) {
  9403. this.setLayout(e, t, 2), this.flatCoordinates || (this.flatCoordinates = []);
  9404. var r = Pn(this.flatCoordinates, 0, t, this.stride, this.ends_);
  9405. this.flatCoordinates.length = 0 === r.length ? 0 : r[r.length - 1], this.changed()
  9406. }, e
  9407. }(vn), fi = pi;
  9408. function di(t, e, r, n) {
  9409. for (var i = r || 32, o = [], a = 0; a < i; ++a) v(o, vr(t, e, 2 * Math.PI * a / i, n));
  9410. return o.push(o[0], o[1]), new pi(o, yt, [o.length])
  9411. }
  9412. function gi(t) {
  9413. var e = t[0], r = t[1], n = t[2], i = t[3], o = [e, r, e, i, n, i, n, r, e, r];
  9414. return new pi(o, yt, [o.length])
  9415. }
  9416. function yi(t, e, r) {
  9417. for (var n = e || 32, i = t.getStride(), o = t.getLayout(), a = t.getCenter(), s = i * (n + 1), l = new Array(s), u = 0; u < s; u += i) {
  9418. l[u] = 0, l[u + 1] = 0;
  9419. for (var c = 2; c < i; c++) l[u + c] = a[c]
  9420. }
  9421. var h = [l.length], p = new pi(l, o, h);
  9422. return mi(p, a, t.getRadius(), r), p
  9423. }
  9424. function mi(t, e, r, n) {
  9425. for (var i = t.getFlatCoordinates(), o = t.getStride(), a = i.length / o - 1, s = n || 0, l = 0; l <= a; ++l) {
  9426. var u = l * o, c = s + 2 * We(l, a) * Math.PI / a;
  9427. i[u] = e[0] + r * Math.cos(c), i[u + 1] = e[1] + r * Math.sin(c)
  9428. }
  9429. t.changed()
  9430. }
  9431. var vi = function () {
  9432. var t = function (e, r) {
  9433. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9434. t.__proto__ = e
  9435. } || function (t, e) {
  9436. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9437. })(e, r)
  9438. };
  9439. return function (e, r) {
  9440. function n() {
  9441. this.constructor = e
  9442. }
  9443. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9444. }
  9445. }(), _i = "accuracy", bi = "accuracyGeometry", xi = "altitude", wi = "altitudeAccuracy", Si = "heading",
  9446. Ei = "position", Ti = "projection", Ci = "speed", Oi = "tracking", Pi = "trackingOptions", Ri = function (t) {
  9447. function e(e) {
  9448. var r = t.call(this, A) || this;
  9449. return r.code = e.code, r.message = e.message, r
  9450. }
  9451. return vi(e, t), e
  9452. }(c), Ii = function (t) {
  9453. function e(e) {
  9454. var r = t.call(this) || this, n = e || {};
  9455. return r.position_ = null, r.transform_ = jr, r.watchId_ = void 0, r.addEventListener(it(Ti), r.handleProjectionChanged_), r.addEventListener(it(Oi), r.handleTrackingChanged_), void 0 !== n.projection && r.setProjection(n.projection), void 0 !== n.trackingOptions && r.setTrackingOptions(n.trackingOptions), r.setTracking(void 0 !== n.tracking && n.tracking), r
  9456. }
  9457. return vi(e, t), e.prototype.disposeInternal = function () {
  9458. this.setTracking(!1), t.prototype.disposeInternal.call(this)
  9459. }, e.prototype.handleProjectionChanged_ = function () {
  9460. var t = this.getProjection();
  9461. t && (this.transform_ = Zr(Gr("EPSG:4326"), t), this.position_ && this.set(Ei, this.transform_(this.position_)))
  9462. }, e.prototype.handleTrackingChanged_ = function () {
  9463. if ("geolocation" in navigator) {
  9464. var t = this.getTracking();
  9465. t && void 0 === this.watchId_ ? this.watchId_ = navigator.geolocation.watchPosition(this.positionChange_.bind(this), this.positionError_.bind(this), this.getTrackingOptions()) : t || void 0 === this.watchId_ || (navigator.geolocation.clearWatch(this.watchId_), this.watchId_ = void 0)
  9466. }
  9467. }, e.prototype.positionChange_ = function (t) {
  9468. var e = t.coords;
  9469. this.set(_i, e.accuracy), this.set(xi, null === e.altitude ? void 0 : e.altitude), this.set(wi, null === e.altitudeAccuracy ? void 0 : e.altitudeAccuracy), this.set(Si, null === e.heading ? void 0 : Ye(e.heading)), this.position_ ? (this.position_[0] = e.longitude, this.position_[1] = e.latitude) : this.position_ = [e.longitude, e.latitude];
  9470. var r = this.transform_(this.position_);
  9471. this.set(Ei, r), this.set(Ci, null === e.speed ? void 0 : e.speed);
  9472. var n = di(this.position_, e.accuracy);
  9473. n.applyTransform(this.transform_), this.set(bi, n), this.changed()
  9474. }, e.prototype.positionError_ = function (t) {
  9475. this.dispatchEvent(new Ri(t))
  9476. }, e.prototype.getAccuracy = function () {
  9477. return this.get(_i)
  9478. }, e.prototype.getAccuracyGeometry = function () {
  9479. return this.get(bi) || null
  9480. }, e.prototype.getAltitude = function () {
  9481. return this.get(xi)
  9482. }, e.prototype.getAltitudeAccuracy = function () {
  9483. return this.get(wi)
  9484. }, e.prototype.getHeading = function () {
  9485. return this.get(Si)
  9486. }, e.prototype.getPosition = function () {
  9487. return this.get(Ei)
  9488. }, e.prototype.getProjection = function () {
  9489. return this.get(Ti)
  9490. }, e.prototype.getSpeed = function () {
  9491. return this.get(Ci)
  9492. }, e.prototype.getTracking = function () {
  9493. return this.get(Oi)
  9494. }, e.prototype.getTrackingOptions = function () {
  9495. return this.get(Pi)
  9496. }, e.prototype.setProjection = function (t) {
  9497. this.set(Ti, Gr(t))
  9498. }, e.prototype.setTracking = function (t) {
  9499. this.set(Oi, t)
  9500. }, e.prototype.setTrackingOptions = function (t) {
  9501. this.set(Pi, t)
  9502. }, e
  9503. }(ot), Li = function () {
  9504. var t = function (e, r) {
  9505. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9506. t.__proto__ = e
  9507. } || function (t, e) {
  9508. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9509. })(e, r)
  9510. };
  9511. return function (e, r) {
  9512. function n() {
  9513. this.constructor = e
  9514. }
  9515. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9516. }
  9517. }(), Mi = function (t) {
  9518. function e(e, r, n, i) {
  9519. var o = t.call(this) || this;
  9520. return o.extent = e, o.pixelRatio_ = n, o.resolution = r, o.state = i, o
  9521. }
  9522. return Li(e, t), e.prototype.changed = function () {
  9523. this.dispatchEvent(F)
  9524. }, e.prototype.getExtent = function () {
  9525. return this.extent
  9526. }, e.prototype.getImage = function () {
  9527. return n()
  9528. }, e.prototype.getPixelRatio = function () {
  9529. return this.pixelRatio_
  9530. }, e.prototype.getResolution = function () {
  9531. return this.resolution
  9532. }, e.prototype.getState = function () {
  9533. return this.state
  9534. }, e.prototype.load = function () {
  9535. n()
  9536. }, e
  9537. }(M), Fi = 0, Ai = 1, ki = 2, ji = 3, Ni = 4,
  9538. Di = "undefined" != typeof navigator && void 0 !== navigator.userAgent ? navigator.userAgent.toLowerCase() : "",
  9539. Gi = -1 !== Di.indexOf("firefox"), zi = -1 !== Di.indexOf("safari") && -1 == Di.indexOf("chrom"),
  9540. Ui = -1 !== Di.indexOf("webkit") && -1 == Di.indexOf("edge"), Bi = -1 !== Di.indexOf("macintosh"),
  9541. Vi = "undefined" != typeof devicePixelRatio ? devicePixelRatio : 1,
  9542. Yi = "undefined" != typeof WorkerGlobalScope && "undefined" != typeof OffscreenCanvas && self instanceof WorkerGlobalScope,
  9543. Wi = "undefined" != typeof Image && Image.prototype.decode, qi = function () {
  9544. var t = !1;
  9545. try {
  9546. var e = Object.defineProperty({}, "passive", {
  9547. get: function () {
  9548. t = !0
  9549. }
  9550. });
  9551. window.addEventListener("_", null, e), window.removeEventListener("_", null, e)
  9552. } catch (t) {
  9553. }
  9554. return t
  9555. }(), Xi = function () {
  9556. var t = function (e, r) {
  9557. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9558. t.__proto__ = e
  9559. } || function (t, e) {
  9560. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9561. })(e, r)
  9562. };
  9563. return function (e, r) {
  9564. function n() {
  9565. this.constructor = e
  9566. }
  9567. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9568. }
  9569. }();
  9570. function Zi(t, e, r) {
  9571. var n = t;
  9572. if (n.src && Wi) {
  9573. var i = n.decode(), o = !0;
  9574. return i.then((function () {
  9575. o && e()
  9576. })).catch((function (t) {
  9577. o && ("EncodingError" === t.name && "Invalid image type." === t.message ? e() : r())
  9578. })), function () {
  9579. o = !1
  9580. }
  9581. }
  9582. var a = [K(n, Y, e), K(n, A, r)];
  9583. return function () {
  9584. a.forEach(H)
  9585. }
  9586. }
  9587. var Ki = function (t) {
  9588. function e(e, r, n, i, o, a) {
  9589. var s = t.call(this, e, r, n, Fi) || this;
  9590. return s.src_ = i, s.image_ = new Image, null !== o && (s.image_.crossOrigin = o), s.unlisten_ = null, s.state = Fi, s.imageLoadFunction_ = a, s
  9591. }
  9592. return Xi(e, t), e.prototype.getImage = function () {
  9593. return this.image_
  9594. }, e.prototype.handleImageError_ = function () {
  9595. this.state = ji, this.unlistenImage_(), this.changed()
  9596. }, e.prototype.handleImageLoad_ = function () {
  9597. void 0 === this.resolution && (this.resolution = Ee(this.extent) / this.image_.height), this.state = ki, this.unlistenImage_(), this.changed()
  9598. }, e.prototype.load = function () {
  9599. this.state != Fi && this.state != ji || (this.state = Ai, this.changed(), this.imageLoadFunction_(this, this.src_), this.unlisten_ = Zi(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this)))
  9600. }, e.prototype.setImage = function (t) {
  9601. this.image_ = t
  9602. }, e.prototype.unlistenImage_ = function () {
  9603. this.unlisten_ && (this.unlisten_(), this.unlisten_ = null)
  9604. }, e
  9605. }(Mi), Hi = function () {
  9606. var t = function (e, r) {
  9607. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9608. t.__proto__ = e
  9609. } || function (t, e) {
  9610. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9611. })(e, r)
  9612. };
  9613. return function (e, r) {
  9614. function n() {
  9615. this.constructor = e
  9616. }
  9617. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9618. }
  9619. }(), $i = function (t) {
  9620. function e(e, r, n, i, o) {
  9621. var a = this, s = void 0 !== o ? Fi : ki;
  9622. return (a = t.call(this, e, r, n, s) || this).loader_ = void 0 !== o ? o : null, a.canvas_ = i, a.error_ = null, a
  9623. }
  9624. return Hi(e, t), e.prototype.getError = function () {
  9625. return this.error_
  9626. }, e.prototype.handleLoad_ = function (t) {
  9627. t ? (this.error_ = t, this.state = ji) : this.state = ki, this.changed()
  9628. }, e.prototype.load = function () {
  9629. this.state == Fi && (this.state = Ai, this.changed(), this.loader_(this.handleLoad_.bind(this)))
  9630. }, e.prototype.getImage = function () {
  9631. return this.canvas_
  9632. }, e
  9633. }(Mi), Ji = 0, Qi = 1, to = 2, eo = 3, ro = 4;
  9634. function no(t) {
  9635. return Math.pow(t, 3)
  9636. }
  9637. function io(t) {
  9638. return 1 - no(1 - t)
  9639. }
  9640. function oo(t) {
  9641. return 3 * t * t - 2 * t * t * t
  9642. }
  9643. function ao(t) {
  9644. return t
  9645. }
  9646. var so = function () {
  9647. var t = function (e, r) {
  9648. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9649. t.__proto__ = e
  9650. } || function (t, e) {
  9651. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9652. })(e, r)
  9653. };
  9654. return function (e, r) {
  9655. function n() {
  9656. this.constructor = e
  9657. }
  9658. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9659. }
  9660. }(), lo = function (t) {
  9661. function e(e, r, n) {
  9662. var i = t.call(this) || this, o = n || {};
  9663. return i.tileCoord = e, i.state = r, i.interimTile = null, i.hifi = !0, i.key = "", i.transition_ = void 0 === o.transition ? 250 : o.transition, i.transitionStarts_ = {}, i
  9664. }
  9665. return so(e, t), e.prototype.changed = function () {
  9666. this.dispatchEvent(F)
  9667. }, e.prototype.release = function () {
  9668. }, e.prototype.getKey = function () {
  9669. return this.key + "/" + this.tileCoord
  9670. }, e.prototype.getInterimTile = function () {
  9671. if (!this.interimTile) return this;
  9672. var t = this.interimTile;
  9673. do {
  9674. if (t.getState() == to) return this.transition_ = 0, t;
  9675. t = t.interimTile
  9676. } while (t);
  9677. return this
  9678. }, e.prototype.refreshInterimChain = function () {
  9679. if (this.interimTile) {
  9680. var t = this.interimTile, e = this;
  9681. do {
  9682. if (t.getState() == to) {
  9683. t.interimTile = null;
  9684. break
  9685. }
  9686. t.getState() == Qi ? e = t : t.getState() == Ji ? e.interimTile = t.interimTile : e = t, t = e.interimTile
  9687. } while (t)
  9688. }
  9689. }, e.prototype.getTileCoord = function () {
  9690. return this.tileCoord
  9691. }, e.prototype.getState = function () {
  9692. return this.state
  9693. }, e.prototype.setState = function (t) {
  9694. if (this.state !== eo && this.state > t) throw new Error("Tile load sequence violation");
  9695. this.state = t, this.changed()
  9696. }, e.prototype.load = function () {
  9697. n()
  9698. }, e.prototype.getAlpha = function (t, e) {
  9699. if (!this.transition_) return 1;
  9700. var r = this.transitionStarts_[t];
  9701. if (r) {
  9702. if (-1 === r) return 1
  9703. } else r = e, this.transitionStarts_[t] = r;
  9704. var n = e - r + 1e3 / 60;
  9705. return n >= this.transition_ ? 1 : no(n / this.transition_)
  9706. }, e.prototype.inTransition = function (t) {
  9707. return !!this.transition_ && -1 !== this.transitionStarts_[t]
  9708. }, e.prototype.endTransition = function (t) {
  9709. this.transition_ && (this.transitionStarts_[t] = -1)
  9710. }, e
  9711. }(M);
  9712. function uo(t, e, r) {
  9713. var n = r && r.length ? r.shift() : Yi ? new OffscreenCanvas(t || 300, e || 300) : document.createElement("canvas");
  9714. return t && (n.width = t), e && (n.height = e), n.getContext("2d")
  9715. }
  9716. function co(t) {
  9717. var e = t.offsetWidth, r = getComputedStyle(t);
  9718. return e += parseInt(r.marginLeft, 10) + parseInt(r.marginRight, 10)
  9719. }
  9720. function ho(t) {
  9721. var e = t.offsetHeight, r = getComputedStyle(t);
  9722. return e += parseInt(r.marginTop, 10) + parseInt(r.marginBottom, 10)
  9723. }
  9724. function po(t, e) {
  9725. var r = e.parentNode;
  9726. r && r.replaceChild(t, e)
  9727. }
  9728. function fo(t) {
  9729. return t && t.parentNode ? t.parentNode.removeChild(t) : null
  9730. }
  9731. function go(t) {
  9732. for (; t.lastChild;) t.removeChild(t.lastChild)
  9733. }
  9734. function yo(t, e) {
  9735. for (var r = t.childNodes, n = 0; ; ++n) {
  9736. var i = r[n], o = e[n];
  9737. if (!i && !o) break;
  9738. i !== o && (i ? o ? t.insertBefore(o, i) : (t.removeChild(i), --n) : t.appendChild(o))
  9739. }
  9740. }
  9741. var mo = function () {
  9742. var t = function (e, r) {
  9743. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9744. t.__proto__ = e
  9745. } || function (t, e) {
  9746. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9747. })(e, r)
  9748. };
  9749. return function (e, r) {
  9750. function n() {
  9751. this.constructor = e
  9752. }
  9753. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9754. }
  9755. }();
  9756. var vo = function (t) {
  9757. function e(e, r, n, i, o, a) {
  9758. var s = t.call(this, e, r, a) || this;
  9759. return s.crossOrigin_ = i, s.src_ = n, s.key = n, s.image_ = new Image, null !== i && (s.image_.crossOrigin = i), s.unlisten_ = null, s.tileLoadFunction_ = o, s
  9760. }
  9761. return mo(e, t), e.prototype.getImage = function () {
  9762. return this.image_
  9763. }, e.prototype.handleImageError_ = function () {
  9764. var t;
  9765. this.state = eo, this.unlistenImage_(), this.image_ = ((t = uo(1, 1)).fillStyle = "rgba(0,0,0,0)", t.fillRect(0, 0, 1, 1), t.canvas), this.changed()
  9766. }, e.prototype.handleImageLoad_ = function () {
  9767. var t = this.image_;
  9768. t.naturalWidth && t.naturalHeight ? this.state = to : this.state = ro, this.unlistenImage_(), this.changed()
  9769. }, e.prototype.load = function () {
  9770. this.state == eo && (this.state = Ji, this.image_ = new Image, null !== this.crossOrigin_ && (this.image_.crossOrigin = this.crossOrigin_)), this.state == Ji && (this.state = Qi, this.changed(), this.tileLoadFunction_(this, this.src_), this.unlisten_ = Zi(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this)))
  9771. }, e.prototype.unlistenImage_ = function () {
  9772. this.unlisten_ && (this.unlisten_(), this.unlisten_ = null)
  9773. }, e
  9774. }(lo), _o = function () {
  9775. function t(t, e, r) {
  9776. this.decay_ = t, this.minVelocity_ = e, this.delay_ = r, this.points_ = [], this.angle_ = 0, this.initialVelocity_ = 0
  9777. }
  9778. return t.prototype.begin = function () {
  9779. this.points_.length = 0, this.angle_ = 0, this.initialVelocity_ = 0
  9780. }, t.prototype.update = function (t, e) {
  9781. this.points_.push(t, e, Date.now())
  9782. }, t.prototype.end = function () {
  9783. if (this.points_.length < 6) return !1;
  9784. var t = Date.now() - this.delay_, e = this.points_.length - 3;
  9785. if (this.points_[e + 2] < t) return !1;
  9786. for (var r = e - 3; r > 0 && this.points_[r + 2] > t;) r -= 3;
  9787. var n = this.points_[e + 2] - this.points_[r + 2];
  9788. if (n < 1e3 / 60) return !1;
  9789. var i = this.points_[e] - this.points_[r], o = this.points_[e + 1] - this.points_[r + 1];
  9790. return this.angle_ = Math.atan2(o, i), this.initialVelocity_ = Math.sqrt(i * i + o * o) / n, this.initialVelocity_ > this.minVelocity_
  9791. }, t.prototype.getDistance = function () {
  9792. return (this.minVelocity_ - this.initialVelocity_) / this.decay_
  9793. }, t.prototype.getAngle = function () {
  9794. return this.angle_
  9795. }, t
  9796. }(), bo = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i, xo = /^([a-z]*)$|^hsla?\(.*\)$/i;
  9797. function wo(t) {
  9798. return "string" == typeof t ? t : Ro(t)
  9799. }
  9800. function So(t) {
  9801. var e = document.createElement("div");
  9802. if (e.style.color = t, "" !== e.style.color) {
  9803. document.body.appendChild(e);
  9804. var r = getComputedStyle(e).color;
  9805. return document.body.removeChild(e), r
  9806. }
  9807. return ""
  9808. }
  9809. var Eo, To, Co = (Eo = {}, To = 0, function (t) {
  9810. var e;
  9811. if (Eo.hasOwnProperty(t)) e = Eo[t]; else {
  9812. if (To >= 1024) {
  9813. var r = 0;
  9814. for (var n in Eo) 0 == (3 & r++) && (delete Eo[n], --To)
  9815. }
  9816. e = function (t) {
  9817. var e, r, n, i, o;
  9818. if (xo.exec(t) && (t = So(t)), bo.exec(t)) {
  9819. var a = t.length - 1, s = void 0;
  9820. s = a <= 4 ? 1 : 2;
  9821. var l = 4 === a || 8 === a;
  9822. e = parseInt(t.substr(1 + 0 * s, s), 16), r = parseInt(t.substr(1 + 1 * s, s), 16), n = parseInt(t.substr(1 + 2 * s, s), 16), i = l ? parseInt(t.substr(1 + 3 * s, s), 16) : 255, 1 == s && (e = (e << 4) + e, r = (r << 4) + r, n = (n << 4) + n, l && (i = (i << 4) + i)), o = [e, r, n, i / 255]
  9823. } else 0 == t.indexOf("rgba(") ? Po(o = t.slice(5, -1).split(",").map(Number)) : 0 == t.indexOf("rgb(") ? ((o = t.slice(4, -1).split(",").map(Number)).push(1), Po(o)) : pt(!1, 14);
  9824. return o
  9825. }(t), Eo[t] = e, ++To
  9826. }
  9827. return e
  9828. });
  9829. function Oo(t) {
  9830. return Array.isArray(t) ? t : Co(t)
  9831. }
  9832. function Po(t) {
  9833. return t[0] = Ne(t[0] + .5 | 0, 0, 255), t[1] = Ne(t[1] + .5 | 0, 0, 255), t[2] = Ne(t[2] + .5 | 0, 0, 255), t[3] = Ne(t[3], 0, 1), t
  9834. }
  9835. function Ro(t) {
  9836. var e = t[0];
  9837. e != (0 | e) && (e = e + .5 | 0);
  9838. var r = t[1];
  9839. r != (0 | r) && (r = r + .5 | 0);
  9840. var n = t[2];
  9841. return n != (0 | n) && (n = n + .5 | 0), "rgba(" + e + "," + r + "," + n + "," + (void 0 === t[3] ? 1 : t[3]) + ")"
  9842. }
  9843. function Io(t) {
  9844. return xo.test(t) && (t = So(t)), bo.test(t) || 0 === t.indexOf("rgba(") || 0 === t.indexOf("rgb(")
  9845. }
  9846. var Lo = function () {
  9847. function t() {
  9848. this.cache_ = {}, this.cacheSize_ = 0, this.maxCacheSize_ = 32
  9849. }
  9850. return t.prototype.clear = function () {
  9851. this.cache_ = {}, this.cacheSize_ = 0
  9852. }, t.prototype.canExpireCache = function () {
  9853. return this.cacheSize_ > this.maxCacheSize_
  9854. }, t.prototype.expire = function () {
  9855. if (this.canExpireCache()) {
  9856. var t = 0;
  9857. for (var e in this.cache_) {
  9858. var r = this.cache_[e];
  9859. 0 != (3 & t++) || r.hasListener() || (delete this.cache_[e], --this.cacheSize_)
  9860. }
  9861. }
  9862. }, t.prototype.get = function (t, e, r) {
  9863. var n = Mo(t, e, r);
  9864. return n in this.cache_ ? this.cache_[n] : null
  9865. }, t.prototype.set = function (t, e, r, n) {
  9866. var i = Mo(t, e, r);
  9867. this.cache_[i] = n, ++this.cacheSize_
  9868. }, t.prototype.setSize = function (t) {
  9869. this.maxCacheSize_ = t, this.expire()
  9870. }, t
  9871. }();
  9872. function Mo(t, e, r) {
  9873. return e + ":" + t + ":" + (r ? wo(r) : "null")
  9874. }
  9875. var Fo = Lo, Ao = new Lo, ko = "opacity", jo = "visible", No = "extent", Do = "zIndex", Go = "maxResolution",
  9876. zo = "minResolution", Uo = "maxZoom", Bo = "minZoom", Vo = "source", Yo = function () {
  9877. var t = function (e, r) {
  9878. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9879. t.__proto__ = e
  9880. } || function (t, e) {
  9881. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9882. })(e, r)
  9883. };
  9884. return function (e, r) {
  9885. function n() {
  9886. this.constructor = e
  9887. }
  9888. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9889. }
  9890. }(), Wo = function (t) {
  9891. function e(e) {
  9892. var r = t.call(this) || this, n = O({}, e);
  9893. return n[ko] = void 0 !== e.opacity ? e.opacity : 1, pt("number" == typeof n[ko], 64), n[jo] = void 0 === e.visible || e.visible, n[Do] = e.zIndex, n[Go] = void 0 !== e.maxResolution ? e.maxResolution : 1 / 0, n[zo] = void 0 !== e.minResolution ? e.minResolution : 0, n[Bo] = void 0 !== e.minZoom ? e.minZoom : -1 / 0, n[Uo] = void 0 !== e.maxZoom ? e.maxZoom : 1 / 0, r.className_ = void 0 !== n.className ? e.className : "ol-layer", delete n.className, r.setProperties(n), r.state_ = null, r
  9894. }
  9895. return Yo(e, t), e.prototype.getClassName = function () {
  9896. return this.className_
  9897. }, e.prototype.getLayerState = function (t) {
  9898. var e = this.state_ || {layer: this, managed: void 0 === t || t}, r = this.getZIndex();
  9899. return e.opacity = Ne(Math.round(100 * this.getOpacity()) / 100, 0, 1), e.sourceState = this.getSourceState(), e.visible = this.getVisible(), e.extent = this.getExtent(), e.zIndex = void 0 !== r ? r : !1 === e.managed ? 1 / 0 : 0, e.maxResolution = this.getMaxResolution(), e.minResolution = Math.max(this.getMinResolution(), 0), e.minZoom = this.getMinZoom(), e.maxZoom = this.getMaxZoom(), this.state_ = e, e
  9900. }, e.prototype.getLayersArray = function (t) {
  9901. return n()
  9902. }, e.prototype.getLayerStatesArray = function (t) {
  9903. return n()
  9904. }, e.prototype.getExtent = function () {
  9905. return this.get(No)
  9906. }, e.prototype.getMaxResolution = function () {
  9907. return this.get(Go)
  9908. }, e.prototype.getMinResolution = function () {
  9909. return this.get(zo)
  9910. }, e.prototype.getMinZoom = function () {
  9911. return this.get(Bo)
  9912. }, e.prototype.getMaxZoom = function () {
  9913. return this.get(Uo)
  9914. }, e.prototype.getOpacity = function () {
  9915. return this.get(ko)
  9916. }, e.prototype.getSourceState = function () {
  9917. return n()
  9918. }, e.prototype.getVisible = function () {
  9919. return this.get(jo)
  9920. }, e.prototype.getZIndex = function () {
  9921. return this.get(Do)
  9922. }, e.prototype.setExtent = function (t) {
  9923. this.set(No, t)
  9924. }, e.prototype.setMaxResolution = function (t) {
  9925. this.set(Go, t)
  9926. }, e.prototype.setMinResolution = function (t) {
  9927. this.set(zo, t)
  9928. }, e.prototype.setMaxZoom = function (t) {
  9929. this.set(Uo, t)
  9930. }, e.prototype.setMinZoom = function (t) {
  9931. this.set(Bo, t)
  9932. }, e.prototype.setOpacity = function (t) {
  9933. pt("number" == typeof t, 64), this.set(ko, t)
  9934. }, e.prototype.setVisible = function (t) {
  9935. this.set(jo, t)
  9936. }, e.prototype.setZIndex = function (t) {
  9937. this.set(Do, t)
  9938. }, e.prototype.disposeInternal = function () {
  9939. this.state_ && (this.state_.layer = null, this.state_ = null), t.prototype.disposeInternal.call(this)
  9940. }, e
  9941. }(ot), qo = "prerender", Xo = "postrender", Zo = "precompose", Ko = "postcompose", Ho = "rendercomplete",
  9942. $o = "undefined", Jo = "loading", Qo = "ready", ta = "error", ea = function () {
  9943. var t = function (e, r) {
  9944. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  9945. t.__proto__ = e
  9946. } || function (t, e) {
  9947. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  9948. })(e, r)
  9949. };
  9950. return function (e, r) {
  9951. function n() {
  9952. this.constructor = e
  9953. }
  9954. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  9955. }
  9956. }();
  9957. function ra(t, e) {
  9958. if (!t.visible) return !1;
  9959. var r = e.resolution;
  9960. if (r < t.minResolution || r >= t.maxResolution) return !1;
  9961. var n = e.zoom;
  9962. return n > t.minZoom && n <= t.maxZoom
  9963. }
  9964. var na = function (t) {
  9965. function e(e) {
  9966. var r = this, n = O({}, e);
  9967. delete n.source, (r = t.call(this, n) || this).mapPrecomposeKey_ = null, r.mapRenderKey_ = null, r.sourceChangeKey_ = null, r.renderer_ = null, e.render && (r.render = e.render), e.map && r.setMap(e.map), r.addEventListener(it(Vo), r.handleSourcePropertyChange_);
  9968. var i = e.source ? e.source : null;
  9969. return r.setSource(i), r
  9970. }
  9971. return ea(e, t), e.prototype.getLayersArray = function (t) {
  9972. var e = t || [];
  9973. return e.push(this), e
  9974. }, e.prototype.getLayerStatesArray = function (t) {
  9975. var e = t || [];
  9976. return e.push(this.getLayerState()), e
  9977. }, e.prototype.getSource = function () {
  9978. return this.get(Vo) || null
  9979. }, e.prototype.getSourceState = function () {
  9980. var t = this.getSource();
  9981. return t ? t.getState() : $o
  9982. }, e.prototype.handleSourceChange_ = function () {
  9983. this.changed()
  9984. }, e.prototype.handleSourcePropertyChange_ = function () {
  9985. this.sourceChangeKey_ && (H(this.sourceChangeKey_), this.sourceChangeKey_ = null);
  9986. var t = this.getSource();
  9987. t && (this.sourceChangeKey_ = Z(t, F, this.handleSourceChange_, this)), this.changed()
  9988. }, e.prototype.getFeatures = function (t) {
  9989. return this.renderer_.getFeatures(t)
  9990. }, e.prototype.render = function (t, e) {
  9991. var r = this.getRenderer();
  9992. if (r.prepareFrame(t)) return r.renderFrame(t, e)
  9993. }, e.prototype.setMap = function (t) {
  9994. this.mapPrecomposeKey_ && (H(this.mapPrecomposeKey_), this.mapPrecomposeKey_ = null), t || this.changed(), this.mapRenderKey_ && (H(this.mapRenderKey_), this.mapRenderKey_ = null), t && (this.mapPrecomposeKey_ = Z(t, Zo, (function (t) {
  9995. var e = t.frameState.layerStatesArray, r = this.getLayerState(!1);
  9996. pt(!e.some((function (t) {
  9997. return t.layer === r.layer
  9998. })), 67), e.push(r)
  9999. }), this), this.mapRenderKey_ = Z(this, F, t.render, t), this.changed())
  10000. }, e.prototype.setSource = function (t) {
  10001. this.set(Vo, t)
  10002. }, e.prototype.getRenderer = function () {
  10003. return this.renderer_ || (this.renderer_ = this.createRenderer()), this.renderer_
  10004. }, e.prototype.hasRenderer = function () {
  10005. return !!this.renderer_
  10006. }, e.prototype.createRenderer = function () {
  10007. return null
  10008. }, e.prototype.disposeInternal = function () {
  10009. this.setSource(null), t.prototype.disposeInternal.call(this)
  10010. }, e
  10011. }(Wo), ia = function () {
  10012. var t = function (e, r) {
  10013. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10014. t.__proto__ = e
  10015. } || function (t, e) {
  10016. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10017. })(e, r)
  10018. };
  10019. return function (e, r) {
  10020. function n() {
  10021. this.constructor = e
  10022. }
  10023. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10024. }
  10025. }();
  10026. function oa(t, e) {
  10027. Ao.expire()
  10028. }
  10029. var aa = function (t) {
  10030. function e(e) {
  10031. var r = t.call(this) || this;
  10032. return r.map_ = e, r
  10033. }
  10034. return ia(e, t), e.prototype.dispatchRenderEvent = function (t, e) {
  10035. n()
  10036. }, e.prototype.calculateMatrices2D = function (t) {
  10037. var e = t.viewState, r = t.coordinateToPixelTransform, n = t.pixelToCoordinateTransform;
  10038. kt(r, t.size[0] / 2, t.size[1] / 2, 1 / e.resolution, -1 / e.resolution, -e.rotation, -e.center[0], -e.center[1]), jt(n, r)
  10039. }, e.prototype.forEachFeatureAtCoordinate = function (t, e, r, n, i, o, a, s) {
  10040. var l, u = e.viewState;
  10041. function c(t, e, r, n) {
  10042. return i.call(o, e, t ? r : null, n)
  10043. }
  10044. var h = u.projection, p = Fr(t.slice(), h), f = [[0, 0]];
  10045. if (h.canWrapX() && n) {
  10046. var d = Pe(h.getExtent());
  10047. f.push([-d, 0], [d, 0])
  10048. }
  10049. for (var g = e.layerStatesArray, y = g.length, m = [], v = [], _ = 0; _ < f.length; _++) for (var b = y - 1; b >= 0; --b) {
  10050. var x = g[b], w = x.layer;
  10051. if (w.hasRenderer() && ra(x, u) && a.call(s, w)) {
  10052. var S = w.getRenderer(), E = w.getSource();
  10053. if (S && E) {
  10054. var T = E.getWrapX() ? p : t, C = c.bind(null, x.managed);
  10055. v[0] = T[0] + f[_][0], v[1] = T[1] + f[_][1], l = S.forEachFeatureAtCoordinate(v, e, r, C, m)
  10056. }
  10057. if (l) return l
  10058. }
  10059. }
  10060. if (0 !== m.length) {
  10061. var O = 1 / m.length;
  10062. return m.forEach((function (t, e) {
  10063. return t.distanceSq += e * O
  10064. })), m.sort((function (t, e) {
  10065. return t.distanceSq - e.distanceSq
  10066. })), m.some((function (t) {
  10067. return l = t.callback(t.feature, t.layer, t.geometry)
  10068. })), l
  10069. }
  10070. }, e.prototype.forEachLayerAtPixel = function (t, e, r, i, o) {
  10071. return n()
  10072. }, e.prototype.hasFeatureAtCoordinate = function (t, e, r, n, i, o) {
  10073. return void 0 !== this.forEachFeatureAtCoordinate(t, e, r, n, S, this, i, o)
  10074. }, e.prototype.getMap = function () {
  10075. return this.map_
  10076. }, e.prototype.renderFrame = function (t) {
  10077. n()
  10078. }, e.prototype.scheduleExpireIconCache = function (t) {
  10079. Ao.canExpireCache() && t.postRenderFunctions.push(oa)
  10080. }, e
  10081. }(p), sa = function () {
  10082. var t = function (e, r) {
  10083. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10084. t.__proto__ = e
  10085. } || function (t, e) {
  10086. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10087. })(e, r)
  10088. };
  10089. return function (e, r) {
  10090. function n() {
  10091. this.constructor = e
  10092. }
  10093. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10094. }
  10095. }(), la = function (t) {
  10096. function e(e, r, n, i) {
  10097. var o = t.call(this, e) || this;
  10098. return o.inversePixelTransform = r, o.frameState = n, o.context = i, o
  10099. }
  10100. return sa(e, t), e
  10101. }(c),
  10102. ua = new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)", "(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)", "(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)", "(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?", "(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))", "(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))", "?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""), "i"),
  10103. ca = ["style", "variant", "weight", "size", "lineHeight", "family"], ha = function (t) {
  10104. var e = t.match(ua);
  10105. if (!e) return null;
  10106. for (var r = {
  10107. lineHeight: "normal",
  10108. size: "1.2em",
  10109. style: "normal",
  10110. weight: "normal",
  10111. variant: "normal"
  10112. }, n = 0, i = ca.length; n < i; ++n) {
  10113. var o = e[n + 1];
  10114. void 0 !== o && (r[ca[n]] = o)
  10115. }
  10116. return r.families = r.family.split(/,\s?/), r
  10117. }, pa = [], fa = [0, 0, 0, 0], da = new ot, ga = new M;
  10118. ga.setSize = function () {
  10119. console.warn("labelCache is deprecated.")
  10120. };
  10121. var ya, ma, va = null, _a = {}, ba = function () {
  10122. var t, e, r = ["monospace", "serif"], n = r.length, i = "wmytzilWMYTZIL@#/&?$%10";
  10123. function o(t, o, a) {
  10124. for (var s = !0, l = 0; l < n; ++l) {
  10125. var u = r[l];
  10126. if (e = Sa(t + " " + o + " 32px " + u, i), a != u) {
  10127. var c = Sa(t + " " + o + " 32px " + a + "," + u, i);
  10128. s = s && c != e
  10129. }
  10130. }
  10131. return !!s
  10132. }
  10133. function a() {
  10134. for (var e = !0, r = da.getKeys(), n = 0, i = r.length; n < i; ++n) {
  10135. var a = r[n];
  10136. da.get(a) < 100 && (o.apply(this, a.split("\n")) ? (P(_a), va = null, ya = void 0, da.set(a, 100)) : (da.set(a, da.get(a) + 1, !0), e = !1))
  10137. }
  10138. e && (clearInterval(t), t = void 0)
  10139. }
  10140. return function (e) {
  10141. var r = ha(e);
  10142. if (r) for (var n = r.families, i = 0, s = n.length; i < s; ++i) {
  10143. var l = n[i], u = r.style + "\n" + r.weight + "\n" + l;
  10144. void 0 === da.get(u) && (da.set(u, 100, !0), o(r.style, r.weight, l) || (da.set(u, 0, !0), void 0 === t && (t = setInterval(a, 32))))
  10145. }
  10146. }
  10147. }(), xa = function (t) {
  10148. var e = _a[t];
  10149. if (null == e) {
  10150. if (Yi) {
  10151. var r = ha(t), n = wa(t, "Žg");
  10152. e = (isNaN(Number(r.lineHeight)) ? 1.2 : Number(r.lineHeight)) * (n.actualBoundingBoxAscent + n.actualBoundingBoxDescent)
  10153. } else ma || ((ma = document.createElement("div")).innerHTML = "M", ma.style.margin = "0 !important", ma.style.padding = "0 !important", ma.style.position = "absolute !important", ma.style.left = "-99999px !important"), ma.style.font = t, document.body.appendChild(ma), e = ma.offsetHeight, document.body.removeChild(ma);
  10154. _a[t] = e
  10155. }
  10156. return e
  10157. };
  10158. function wa(t, e) {
  10159. return va || (va = uo(1, 1)), t != ya && (va.font = t, ya = va.font), va.measureText(e)
  10160. }
  10161. function Sa(t, e) {
  10162. return wa(t, e).width
  10163. }
  10164. function Ea(t, e, r) {
  10165. if (e in r) return r[e];
  10166. var n = Sa(t, e);
  10167. return r[e] = n, n
  10168. }
  10169. function Ta(t, e, r) {
  10170. for (var n = e.length, i = 0, o = 0; o < n; ++o) {
  10171. var a = Sa(t, e[o]);
  10172. i = Math.max(i, a), r.push(a)
  10173. }
  10174. return i
  10175. }
  10176. function Ca(t, e, r, n) {
  10177. 0 !== e && (t.translate(r, n), t.rotate(e), t.translate(-r, -n))
  10178. }
  10179. function Oa(t, e, r, n, i, o, a, s, l, u, c) {
  10180. t.save(), 1 !== r && (t.globalAlpha *= r), e && t.setTransform.apply(t, e), n.contextInstructions ? (t.translate(l, u), t.scale(c[0], c[1]), function (t, e) {
  10181. for (var r = t.contextInstructions, n = 0, i = r.length; n < i; n += 2) Array.isArray(r[n + 1]) ? e[r[n]].apply(e, r[n + 1]) : e[r[n]] = r[n + 1]
  10182. }(n, t)) : c[0] < 0 || c[1] < 0 ? (t.translate(l, u), t.scale(c[0], c[1]), t.drawImage(n, i, o, a, s, 0, 0, a, s)) : t.drawImage(n, i, o, a, s, l, u, a * c[0], s * c[1]), t.restore()
  10183. }
  10184. var Pa = null;
  10185. function Ra(t) {
  10186. return Yi ? Dt(t) : (Pa || (Pa = uo(1, 1).canvas), Pa.style.transform = Dt(t), Pa.style.transform)
  10187. }
  10188. var Ia = function () {
  10189. var t = function (e, r) {
  10190. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10191. t.__proto__ = e
  10192. } || function (t, e) {
  10193. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10194. })(e, r)
  10195. };
  10196. return function (e, r) {
  10197. function n() {
  10198. this.constructor = e
  10199. }
  10200. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10201. }
  10202. }(), La = function (t) {
  10203. function e(e) {
  10204. var r = t.call(this, e) || this;
  10205. r.fontChangeListenerKey_ = Z(da, h, e.redrawText.bind(e)), r.element_ = document.createElement("div");
  10206. var n = r.element_.style;
  10207. n.position = "absolute", n.width = "100%", n.height = "100%", n.zIndex = "0", r.element_.className = "ol-unselectable ol-layers";
  10208. var i = e.getViewport();
  10209. return i.insertBefore(r.element_, i.firstChild || null), r.children_ = [], r.renderedVisible_ = !0, r
  10210. }
  10211. return Ia(e, t), e.prototype.dispatchRenderEvent = function (t, e) {
  10212. var r = this.getMap();
  10213. if (r.hasListener(t)) {
  10214. var n = new la(t, void 0, e);
  10215. r.dispatchEvent(n)
  10216. }
  10217. }, e.prototype.disposeInternal = function () {
  10218. H(this.fontChangeListenerKey_), this.element_.parentNode.removeChild(this.element_), t.prototype.disposeInternal.call(this)
  10219. }, e.prototype.renderFrame = function (t) {
  10220. if (t) {
  10221. this.calculateMatrices2D(t), this.dispatchRenderEvent(Zo, t);
  10222. var e = t.layerStatesArray.sort((function (t, e) {
  10223. return t.zIndex - e.zIndex
  10224. })), r = t.viewState;
  10225. this.children_.length = 0;
  10226. for (var n = [], i = null, o = 0, a = e.length; o < a; ++o) {
  10227. var s = e[o];
  10228. if (t.layerIndex = o, ra(s, r) && (s.sourceState == Qo || s.sourceState == $o)) {
  10229. var l = s.layer, u = l.render(t, i);
  10230. u && (u !== i && (this.children_.push(u), i = u), "getDeclutter" in l && n.push(l))
  10231. }
  10232. }
  10233. for (o = n.length - 1; o >= 0; --o) n[o].renderDeclutter(t);
  10234. yo(this.element_, this.children_), this.dispatchRenderEvent(Ko, t), this.renderedVisible_ || (this.element_.style.display = "", this.renderedVisible_ = !0), this.scheduleExpireIconCache(t)
  10235. } else this.renderedVisible_ && (this.element_.style.display = "none", this.renderedVisible_ = !1)
  10236. }, e.prototype.forEachLayerAtPixel = function (t, e, r, n, i) {
  10237. for (var o = e.viewState, a = e.layerStatesArray, s = a.length - 1; s >= 0; --s) {
  10238. var l = a[s], u = l.layer;
  10239. if (u.hasRenderer() && ra(l, o) && i(u)) {
  10240. var c = u.getRenderer().getDataAtPixel(t, e, r);
  10241. if (c) {
  10242. var h = n(u, c);
  10243. if (h) return h
  10244. }
  10245. }
  10246. }
  10247. }, e
  10248. }(aa), Ma = function () {
  10249. var t = function (e, r) {
  10250. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10251. t.__proto__ = e
  10252. } || function (t, e) {
  10253. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10254. })(e, r)
  10255. };
  10256. return function (e, r) {
  10257. function n() {
  10258. this.constructor = e
  10259. }
  10260. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10261. }
  10262. }(), Fa = "layers", Aa = function (t) {
  10263. function e(e) {
  10264. var r = this, n = e || {}, i = O({}, n);
  10265. delete i.layers;
  10266. var o = n.layers;
  10267. return (r = t.call(this, i) || this).layersListenerKeys_ = [], r.listenerKeys_ = {}, r.addEventListener(it(Fa), r.handleLayersChanged_), o ? Array.isArray(o) ? o = new ht(o.slice(), {unique: !0}) : pt("function" == typeof o.getArray, 43) : o = new ht(void 0, {unique: !0}), r.setLayers(o), r
  10268. }
  10269. return Ma(e, t), e.prototype.handleLayerChange_ = function () {
  10270. this.changed()
  10271. }, e.prototype.handleLayersChanged_ = function () {
  10272. this.layersListenerKeys_.forEach(H), this.layersListenerKeys_.length = 0;
  10273. var t = this.getLayers();
  10274. for (var e in this.layersListenerKeys_.push(Z(t, at, this.handleLayersAdd_, this), Z(t, st, this.handleLayersRemove_, this)), this.listenerKeys_) this.listenerKeys_[e].forEach(H);
  10275. P(this.listenerKeys_);
  10276. for (var r = t.getArray(), n = 0, i = r.length; n < i; n++) {
  10277. var a = r[n];
  10278. this.listenerKeys_[o(a)] = [Z(a, h, this.handleLayerChange_, this), Z(a, F, this.handleLayerChange_, this)]
  10279. }
  10280. this.changed()
  10281. }, e.prototype.handleLayersAdd_ = function (t) {
  10282. var e = t.element;
  10283. this.listenerKeys_[o(e)] = [Z(e, h, this.handleLayerChange_, this), Z(e, F, this.handleLayerChange_, this)], this.changed()
  10284. }, e.prototype.handleLayersRemove_ = function (t) {
  10285. var e = o(t.element);
  10286. this.listenerKeys_[e].forEach(H), delete this.listenerKeys_[e], this.changed()
  10287. }, e.prototype.getLayers = function () {
  10288. return this.get(Fa)
  10289. }, e.prototype.setLayers = function (t) {
  10290. this.set(Fa, t)
  10291. }, e.prototype.getLayersArray = function (t) {
  10292. var e = void 0 !== t ? t : [];
  10293. return this.getLayers().forEach((function (t) {
  10294. t.getLayersArray(e)
  10295. })), e
  10296. }, e.prototype.getLayerStatesArray = function (t) {
  10297. var e = void 0 !== t ? t : [], r = e.length;
  10298. this.getLayers().forEach((function (t) {
  10299. t.getLayerStatesArray(e)
  10300. }));
  10301. for (var n = this.getLayerState(), i = r, o = e.length; i < o; i++) {
  10302. var a = e[i];
  10303. a.opacity *= n.opacity, a.visible = a.visible && n.visible, a.maxResolution = Math.min(a.maxResolution, n.maxResolution), a.minResolution = Math.max(a.minResolution, n.minResolution), a.minZoom = Math.max(a.minZoom, n.minZoom), a.maxZoom = Math.min(a.maxZoom, n.maxZoom), void 0 !== n.extent && (void 0 !== a.extent ? a.extent = Te(a.extent, n.extent) : a.extent = n.extent)
  10304. }
  10305. return e
  10306. }, e.prototype.getSourceState = function () {
  10307. return Qo
  10308. }, e
  10309. }(Wo), ka = function () {
  10310. var t = function (e, r) {
  10311. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10312. t.__proto__ = e
  10313. } || function (t, e) {
  10314. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10315. })(e, r)
  10316. };
  10317. return function (e, r) {
  10318. function n() {
  10319. this.constructor = e
  10320. }
  10321. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10322. }
  10323. }(), ja = function (t) {
  10324. function e(e, r, n) {
  10325. var i = t.call(this, e) || this;
  10326. return i.map = r, i.frameState = void 0 !== n ? n : null, i
  10327. }
  10328. return ka(e, t), e
  10329. }(c), Na = function () {
  10330. var t = function (e, r) {
  10331. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10332. t.__proto__ = e
  10333. } || function (t, e) {
  10334. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10335. })(e, r)
  10336. };
  10337. return function (e, r) {
  10338. function n() {
  10339. this.constructor = e
  10340. }
  10341. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10342. }
  10343. }(), Da = function (t) {
  10344. function e(e, r, n, i, o) {
  10345. var a = t.call(this, e, r, o) || this;
  10346. return a.originalEvent = n, a.pixel_ = null, a.coordinate_ = null, a.dragging = void 0 !== i && i, a
  10347. }
  10348. return Na(e, t), Object.defineProperty(e.prototype, "pixel", {
  10349. get: function () {
  10350. return this.pixel_ || (this.pixel_ = this.map.getEventPixel(this.originalEvent)), this.pixel_
  10351. }, set: function (t) {
  10352. this.pixel_ = t
  10353. }, enumerable: !1, configurable: !0
  10354. }), Object.defineProperty(e.prototype, "coordinate", {
  10355. get: function () {
  10356. return this.coordinate_ || (this.coordinate_ = this.map.getCoordinateFromPixel(this.pixel)), this.coordinate_
  10357. }, set: function (t) {
  10358. this.coordinate_ = t
  10359. }, enumerable: !1, configurable: !0
  10360. }), e.prototype.preventDefault = function () {
  10361. t.prototype.preventDefault.call(this), this.originalEvent.preventDefault()
  10362. }, e.prototype.stopPropagation = function () {
  10363. t.prototype.stopPropagation.call(this), this.originalEvent.stopPropagation()
  10364. }, e
  10365. }(ja), Ga = {
  10366. SINGLECLICK: "singleclick",
  10367. CLICK: N,
  10368. DBLCLICK: D,
  10369. POINTERDRAG: "pointerdrag",
  10370. POINTERMOVE: "pointermove",
  10371. POINTERDOWN: "pointerdown",
  10372. POINTERUP: "pointerup",
  10373. POINTEROVER: "pointerover",
  10374. POINTEROUT: "pointerout",
  10375. POINTERENTER: "pointerenter",
  10376. POINTERLEAVE: "pointerleave",
  10377. POINTERCANCEL: "pointercancel"
  10378. }, za = "pointermove", Ua = "pointerdown", Ba = "pointerup", Va = "pointerout", Ya = function () {
  10379. var t = function (e, r) {
  10380. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10381. t.__proto__ = e
  10382. } || function (t, e) {
  10383. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10384. })(e, r)
  10385. };
  10386. return function (e, r) {
  10387. function n() {
  10388. this.constructor = e
  10389. }
  10390. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10391. }
  10392. }(), Wa = function (t) {
  10393. function e(e, r) {
  10394. var n = t.call(this, e) || this;
  10395. n.map_ = e, n.clickTimeoutId_, n.emulateClicks_ = !1, n.dragging_ = !1, n.dragListenerKeys_ = [], n.moveTolerance_ = r ? r * Vi : Vi, n.down_ = null;
  10396. var i = n.map_.getViewport();
  10397. return n.activePointers_ = 0, n.trackedTouches_ = {}, n.element_ = i, n.pointerdownListenerKey_ = Z(i, Ua, n.handlePointerDown_, n), n.originalPointerMoveEvent_, n.relayedListenerKey_ = Z(i, za, n.relayEvent_, n), n.boundHandleTouchMove_ = n.handleTouchMove_.bind(n), n.element_.addEventListener(q, n.boundHandleTouchMove_, !!qi && {passive: !1}), n
  10398. }
  10399. return Ya(e, t), e.prototype.emulateClick_ = function (t) {
  10400. var e = new Da(Ga.CLICK, this.map_, t);
  10401. this.dispatchEvent(e), void 0 !== this.clickTimeoutId_ ? (clearTimeout(this.clickTimeoutId_), this.clickTimeoutId_ = void 0, e = new Da(Ga.DBLCLICK, this.map_, t), this.dispatchEvent(e)) : this.clickTimeoutId_ = setTimeout(function () {
  10402. this.clickTimeoutId_ = void 0;
  10403. var e = new Da(Ga.SINGLECLICK, this.map_, t);
  10404. this.dispatchEvent(e)
  10405. }.bind(this), 250)
  10406. }, e.prototype.updateActivePointers_ = function (t) {
  10407. var e = t;
  10408. e.type == Ga.POINTERUP || e.type == Ga.POINTERCANCEL ? delete this.trackedTouches_[e.pointerId] : e.type == Ga.POINTERDOWN && (this.trackedTouches_[e.pointerId] = !0), this.activePointers_ = Object.keys(this.trackedTouches_).length
  10409. }, e.prototype.handlePointerUp_ = function (t) {
  10410. this.updateActivePointers_(t);
  10411. var e = new Da(Ga.POINTERUP, this.map_, t);
  10412. this.dispatchEvent(e), this.emulateClicks_ && !e.propagationStopped && !this.dragging_ && this.isMouseActionButton_(t) && this.emulateClick_(this.down_), 0 === this.activePointers_ && (this.dragListenerKeys_.forEach(H), this.dragListenerKeys_.length = 0, this.dragging_ = !1, this.down_ = null)
  10413. }, e.prototype.isMouseActionButton_ = function (t) {
  10414. return 0 === t.button
  10415. }, e.prototype.handlePointerDown_ = function (t) {
  10416. this.emulateClicks_ = 0 === this.activePointers_, this.updateActivePointers_(t);
  10417. var e = new Da(Ga.POINTERDOWN, this.map_, t);
  10418. if (this.dispatchEvent(e), this.down_ = t, 0 === this.dragListenerKeys_.length) {
  10419. var r = this.map_.getOwnerDocument();
  10420. this.dragListenerKeys_.push(Z(r, Ga.POINTERMOVE, this.handlePointerMove_, this), Z(r, Ga.POINTERUP, this.handlePointerUp_, this), Z(this.element_, Ga.POINTERCANCEL, this.handlePointerUp_, this)), this.element_.getRootNode && this.element_.getRootNode() !== r && this.dragListenerKeys_.push(Z(this.element_.getRootNode(), Ga.POINTERUP, this.handlePointerUp_, this))
  10421. }
  10422. }, e.prototype.handlePointerMove_ = function (t) {
  10423. if (this.isMoving_(t)) {
  10424. this.dragging_ = !0;
  10425. var e = new Da(Ga.POINTERDRAG, this.map_, t, this.dragging_);
  10426. this.dispatchEvent(e)
  10427. }
  10428. }, e.prototype.relayEvent_ = function (t) {
  10429. this.originalPointerMoveEvent_ = t;
  10430. var e = !(!this.down_ || !this.isMoving_(t));
  10431. this.dispatchEvent(new Da(t.type, this.map_, t, e))
  10432. }, e.prototype.handleTouchMove_ = function (t) {
  10433. this.originalPointerMoveEvent_ && !this.originalPointerMoveEvent_.defaultPrevented || t.preventDefault()
  10434. }, e.prototype.isMoving_ = function (t) {
  10435. return this.dragging_ || Math.abs(t.clientX - this.down_.clientX) > this.moveTolerance_ || Math.abs(t.clientY - this.down_.clientY) > this.moveTolerance_
  10436. }, e.prototype.disposeInternal = function () {
  10437. this.relayedListenerKey_ && (H(this.relayedListenerKey_), this.relayedListenerKey_ = null), this.element_.removeEventListener(q, this.boundHandleTouchMove_), this.pointerdownListenerKey_ && (H(this.pointerdownListenerKey_), this.pointerdownListenerKey_ = null), this.dragListenerKeys_.forEach(H), this.dragListenerKeys_.length = 0, this.element_ = null, t.prototype.disposeInternal.call(this)
  10438. }, e
  10439. }(M), qa = "postrender", Xa = "movestart", Za = "moveend", Ka = "layergroup", Ha = "size", $a = "target",
  10440. Ja = "view", Qa = function () {
  10441. function t(t, e) {
  10442. this.priorityFunction_ = t, this.keyFunction_ = e, this.elements_ = [], this.priorities_ = [], this.queuedElements_ = {}
  10443. }
  10444. return t.prototype.clear = function () {
  10445. this.elements_.length = 0, this.priorities_.length = 0, P(this.queuedElements_)
  10446. }, t.prototype.dequeue = function () {
  10447. var t = this.elements_, e = this.priorities_, r = t[0];
  10448. 1 == t.length ? (t.length = 0, e.length = 0) : (t[0] = t.pop(), e[0] = e.pop(), this.siftUp_(0));
  10449. var n = this.keyFunction_(r);
  10450. return delete this.queuedElements_[n], r
  10451. }, t.prototype.enqueue = function (t) {
  10452. pt(!(this.keyFunction_(t) in this.queuedElements_), 31);
  10453. var e = this.priorityFunction_(t);
  10454. return e != 1 / 0 && (this.elements_.push(t), this.priorities_.push(e), this.queuedElements_[this.keyFunction_(t)] = !0, this.siftDown_(0, this.elements_.length - 1), !0)
  10455. }, t.prototype.getCount = function () {
  10456. return this.elements_.length
  10457. }, t.prototype.getLeftChildIndex_ = function (t) {
  10458. return 2 * t + 1
  10459. }, t.prototype.getRightChildIndex_ = function (t) {
  10460. return 2 * t + 2
  10461. }, t.prototype.getParentIndex_ = function (t) {
  10462. return t - 1 >> 1
  10463. }, t.prototype.heapify_ = function () {
  10464. var t;
  10465. for (t = (this.elements_.length >> 1) - 1; t >= 0; t--) this.siftUp_(t)
  10466. }, t.prototype.isEmpty = function () {
  10467. return 0 === this.elements_.length
  10468. }, t.prototype.isKeyQueued = function (t) {
  10469. return t in this.queuedElements_
  10470. }, t.prototype.isQueued = function (t) {
  10471. return this.isKeyQueued(this.keyFunction_(t))
  10472. }, t.prototype.siftUp_ = function (t) {
  10473. for (var e = this.elements_, r = this.priorities_, n = e.length, i = e[t], o = r[t], a = t; t < n >> 1;) {
  10474. var s = this.getLeftChildIndex_(t), l = this.getRightChildIndex_(t), u = l < n && r[l] < r[s] ? l : s;
  10475. e[t] = e[u], r[t] = r[u], t = u
  10476. }
  10477. e[t] = i, r[t] = o, this.siftDown_(a, t)
  10478. }, t.prototype.siftDown_ = function (t, e) {
  10479. for (var r = this.elements_, n = this.priorities_, i = r[e], o = n[e]; e > t;) {
  10480. var a = this.getParentIndex_(e);
  10481. if (!(n[a] > o)) break;
  10482. r[e] = r[a], n[e] = n[a], e = a
  10483. }
  10484. r[e] = i, n[e] = o
  10485. }, t.prototype.reprioritize = function () {
  10486. var t, e, r, n = this.priorityFunction_, i = this.elements_, o = this.priorities_, a = 0, s = i.length;
  10487. for (e = 0; e < s; ++e) (r = n(t = i[e])) == 1 / 0 ? delete this.queuedElements_[this.keyFunction_(t)] : (o[a] = r, i[a++] = t);
  10488. i.length = a, o.length = a, this.heapify_()
  10489. }, t
  10490. }(), ts = function () {
  10491. var t = function (e, r) {
  10492. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10493. t.__proto__ = e
  10494. } || function (t, e) {
  10495. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10496. })(e, r)
  10497. };
  10498. return function (e, r) {
  10499. function n() {
  10500. this.constructor = e
  10501. }
  10502. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10503. }
  10504. }(), es = function (t) {
  10505. function e(e, r) {
  10506. var n = t.call(this, (function (t) {
  10507. return e.apply(null, t)
  10508. }), (function (t) {
  10509. return t[0].getKey()
  10510. })) || this;
  10511. return n.boundHandleTileChange_ = n.handleTileChange.bind(n), n.tileChangeCallback_ = r, n.tilesLoading_ = 0, n.tilesLoadingKeys_ = {}, n
  10512. }
  10513. return ts(e, t), e.prototype.enqueue = function (e) {
  10514. var r = t.prototype.enqueue.call(this, e);
  10515. r && e[0].addEventListener(F, this.boundHandleTileChange_);
  10516. return r
  10517. }, e.prototype.getTilesLoading = function () {
  10518. return this.tilesLoading_
  10519. }, e.prototype.handleTileChange = function (t) {
  10520. var e = t.target, r = e.getState();
  10521. if (e.hifi && r === to || r === eo || r === ro) {
  10522. e.removeEventListener(F, this.boundHandleTileChange_);
  10523. var n = e.getKey();
  10524. n in this.tilesLoadingKeys_ && (delete this.tilesLoadingKeys_[n], --this.tilesLoading_), this.tileChangeCallback_()
  10525. }
  10526. }, e.prototype.loadMoreTiles = function (t, e) {
  10527. for (var r, n, i = 0; this.tilesLoading_ < t && i < e && this.getCount() > 0;) n = (r = this.dequeue()[0]).getKey(), r.getState() !== Ji || n in this.tilesLoadingKeys_ || (this.tilesLoadingKeys_[n] = !0, ++this.tilesLoading_, ++i, r.load())
  10528. }, e
  10529. }(Qa);
  10530. function rs(t, e, r, n, i) {
  10531. if (!t || !(r in t.wantedTiles)) return 1 / 0;
  10532. if (!t.wantedTiles[r][e.getKey()]) return 1 / 0;
  10533. var o = t.viewState.center, a = n[0] - o[0], s = n[1] - o[1];
  10534. return 65536 * Math.log(i) + Math.sqrt(a * a + s * s) / i
  10535. }
  10536. var ns = 0, is = 1, os = "center", as = "resolution", ss = "rotation";
  10537. function ls(t, e, r) {
  10538. return function (n, i, o, a, s) {
  10539. if (n) {
  10540. var l = e ? 0 : o[0] * i, u = e ? 0 : o[1] * i, c = s ? s[0] : 0, h = s ? s[1] : 0, p = t[0] + l / 2 + c,
  10541. f = t[2] - l / 2 + c, d = t[1] + u / 2 + h, g = t[3] - u / 2 + h;
  10542. p > f && (f = p = (f + p) / 2), d > g && (g = d = (g + d) / 2);
  10543. var y = Ne(n[0], p, f), m = Ne(n[1], d, g), v = 30 * i;
  10544. return a && r && (y += -v * Math.log(1 + Math.max(0, p - n[0]) / v) + v * Math.log(1 + Math.max(0, n[0] - f) / v), m += -v * Math.log(1 + Math.max(0, d - n[1]) / v) + v * Math.log(1 + Math.max(0, n[1] - g) / v)), [y, m]
  10545. }
  10546. }
  10547. }
  10548. function us(t) {
  10549. return t
  10550. }
  10551. function cs(t, e, r, n) {
  10552. var i = Pe(e) / r[0], o = Ee(e) / r[1];
  10553. return n ? Math.min(t, Math.max(i, o)) : Math.min(t, Math.min(i, o))
  10554. }
  10555. function hs(t, e, r) {
  10556. var n = Math.min(t, e);
  10557. return n *= Math.log(1 + 50 * Math.max(0, t / e - 1)) / 50 + 1, r && (n = Math.max(n, r), n /= Math.log(1 + 50 * Math.max(0, r / t - 1)) / 50 + 1), Ne(n, r / 2, 2 * e)
  10558. }
  10559. function ps(t, e, r, n) {
  10560. return function (i, o, a, s) {
  10561. if (void 0 !== i) {
  10562. var l = t[0], u = t[t.length - 1], c = r ? cs(l, r, a, n) : l;
  10563. if (s) return void 0 === e || e ? hs(i, c, u) : Ne(i, u, c);
  10564. var h = Math.min(c, i), p = Math.floor(y(t, h, o));
  10565. return t[p] > c && p < t.length - 1 ? t[p + 1] : t[p]
  10566. }
  10567. }
  10568. }
  10569. function fs(t, e, r, n, i, o) {
  10570. return function (a, s, l, u) {
  10571. if (void 0 !== a) {
  10572. var c = i ? cs(e, i, l, o) : e, h = void 0 !== r ? r : 0;
  10573. if (u) return void 0 === n || n ? hs(a, c, h) : Ne(a, h, c);
  10574. var p = Math.ceil(Math.log(e / c) / Math.log(t) - 1e-9), f = -s * (.5 - 1e-9) + .5, d = Math.min(c, a),
  10575. g = Math.floor(Math.log(e / d) / Math.log(t) + f), y = Math.max(p, g);
  10576. return Ne(e / Math.pow(t, y), h, c)
  10577. }
  10578. }
  10579. }
  10580. function ds(t, e, r, n, i) {
  10581. return function (o, a, s, l) {
  10582. if (void 0 !== o) {
  10583. var u = n ? cs(t, n, s, i) : t;
  10584. return (void 0 === r || r) && l ? hs(o, u, e) : Ne(o, e, u)
  10585. }
  10586. }
  10587. }
  10588. function gs(t) {
  10589. return void 0 !== t ? 0 : void 0
  10590. }
  10591. function ys(t) {
  10592. return void 0 !== t ? t : void 0
  10593. }
  10594. function ms(t) {
  10595. var e = 2 * Math.PI / t;
  10596. return function (t, r) {
  10597. return r ? t : void 0 !== t ? t = Math.floor(t / e + .5) * e : void 0
  10598. }
  10599. }
  10600. function vs(t) {
  10601. var e = t || Ye(5);
  10602. return function (t, r) {
  10603. return r ? t : void 0 !== t ? Math.abs(t) <= e ? 0 : t : void 0
  10604. }
  10605. }
  10606. var _s = function () {
  10607. var t = function (e, r) {
  10608. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  10609. t.__proto__ = e
  10610. } || function (t, e) {
  10611. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  10612. })(e, r)
  10613. };
  10614. return function (e, r) {
  10615. function n() {
  10616. this.constructor = e
  10617. }
  10618. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  10619. }
  10620. }();
  10621. function bs(t, e) {
  10622. setTimeout((function () {
  10623. t(e)
  10624. }), 0)
  10625. }
  10626. function xs(t) {
  10627. if (void 0 !== t.extent) {
  10628. var e = void 0 === t.smoothExtentConstraint || t.smoothExtentConstraint;
  10629. return ls(t.extent, t.constrainOnlyCenter, e)
  10630. }
  10631. var r = Vr(t.projection, "EPSG:3857");
  10632. if (!0 !== t.multiWorld && r.isGlobal()) {
  10633. var n = r.getExtent().slice();
  10634. return n[0] = -1 / 0, n[2] = 1 / 0, ls(n, !1, !1)
  10635. }
  10636. return us
  10637. }
  10638. function ws(t) {
  10639. var e, r, n, i = void 0 !== t.minZoom ? t.minZoom : 0, o = void 0 !== t.maxZoom ? t.maxZoom : 28,
  10640. a = void 0 !== t.zoomFactor ? t.zoomFactor : 2, s = void 0 !== t.multiWorld && t.multiWorld,
  10641. l = void 0 === t.smoothResolutionConstraint || t.smoothResolutionConstraint,
  10642. u = void 0 !== t.showFullExtent && t.showFullExtent, c = Vr(t.projection, "EPSG:3857"), h = c.getExtent(),
  10643. p = t.constrainOnlyCenter, f = t.extent;
  10644. if (s || f || !c.isGlobal() || (p = !1, f = h), void 0 !== t.resolutions) {
  10645. var d = t.resolutions;
  10646. r = d[i], n = void 0 !== d[o] ? d[o] : d[d.length - 1], e = t.constrainResolution ? ps(d, l, !p && f, u) : ds(r, n, l, !p && f, u)
  10647. } else {
  10648. var g = (h ? Math.max(Pe(h), Ee(h)) : 360 * wt[St.DEGREES] / c.getMetersPerUnit()) / 256 / Math.pow(2, 0),
  10649. y = g / Math.pow(2, 28);
  10650. void 0 !== (r = t.maxResolution) ? i = 0 : r = g / Math.pow(a, i), void 0 === (n = t.minResolution) && (n = void 0 !== t.maxZoom ? void 0 !== t.maxResolution ? r / Math.pow(a, o) : g / Math.pow(a, o) : y), o = i + Math.floor(Math.log(r / n) / Math.log(a)), n = r / Math.pow(a, o - i), e = t.constrainResolution ? fs(a, r, n, l, !p && f, u) : ds(r, n, l, !p && f, u)
  10651. }
  10652. return {constraint: e, maxResolution: r, minResolution: n, minZoom: i, zoomFactor: a}
  10653. }
  10654. function Ss(t) {
  10655. if (void 0 === t.enableRotation || t.enableRotation) {
  10656. var e = t.constrainRotation;
  10657. return void 0 === e || !0 === e ? vs() : !1 === e ? ys : "number" == typeof e ? ms(e) : ys
  10658. }
  10659. return gs
  10660. }
  10661. function Es(t) {
  10662. return !(t.sourceCenter && t.targetCenter && !Cr(t.sourceCenter, t.targetCenter)) && (t.sourceResolution === t.targetResolution && t.sourceRotation === t.targetRotation)
  10663. }
  10664. function Ts(t, e, r, n, i) {
  10665. var o = Math.cos(-i), a = Math.sin(-i), s = t[0] * o - t[1] * a, l = t[1] * o + t[0] * a;
  10666. return [(s += (e[0] / 2 - r[0]) * n) * o - (l += (r[1] - e[1] / 2) * n) * (a = -a), l * o + s * a]
  10667. }
  10668. var Cs = function (t) {
  10669. function e(e) {
  10670. var r = t.call(this) || this, n = O({}, e);
  10671. return r.hints_ = [0, 0], r.animations_ = [], r.updateAnimationKey_, r.projection_ = Vr(n.projection, "EPSG:3857"), r.viewportSize_ = [100, 100], r.targetCenter_ = null, r.targetResolution_, r.targetRotation_, r.cancelAnchor_ = void 0, n.center && (n.center = rn(n.center, r.projection_)), n.extent && (n.extent = on(n.extent, r.projection_)), r.applyOptions_(n), r
  10672. }
  10673. return _s(e, t), e.prototype.applyOptions_ = function (t) {
  10674. var e = ws(t);
  10675. this.maxResolution_ = e.maxResolution, this.minResolution_ = e.minResolution, this.zoomFactor_ = e.zoomFactor, this.resolutions_ = t.resolutions, this.padding = t.padding, this.minZoom_ = e.minZoom;
  10676. var r = xs(t), n = e.constraint, i = Ss(t);
  10677. this.constraints_ = {
  10678. center: r,
  10679. resolution: n,
  10680. rotation: i
  10681. }, this.setRotation(void 0 !== t.rotation ? t.rotation : 0), this.setCenterInternal(void 0 !== t.center ? t.center : null), void 0 !== t.resolution ? this.setResolution(t.resolution) : void 0 !== t.zoom && this.setZoom(t.zoom), this.setProperties({}), this.options_ = t
  10682. }, e.prototype.getUpdatedOptions_ = function (t) {
  10683. var e = O({}, this.options_);
  10684. return void 0 !== e.resolution ? e.resolution = this.getResolution() : e.zoom = this.getZoom(), e.center = this.getCenterInternal(), e.rotation = this.getRotation(), O({}, e, t)
  10685. }, e.prototype.animate = function (t) {
  10686. this.isDef() && !this.getAnimating() && this.resolveConstraints(0);
  10687. for (var e = new Array(arguments.length), r = 0; r < e.length; ++r) {
  10688. var n = arguments[r];
  10689. n.center && ((n = O({}, n)).center = rn(n.center, this.getProjection())), n.anchor && ((n = O({}, n)).anchor = rn(n.anchor, this.getProjection())), e[r] = n
  10690. }
  10691. this.animateInternal.apply(this, e)
  10692. }, e.prototype.animateInternal = function (t) {
  10693. var e, r = arguments.length;
  10694. if (r > 1 && "function" == typeof arguments[r - 1] && (e = arguments[r - 1], --r), !this.isDef()) {
  10695. var n = arguments[r - 1];
  10696. return n.center && this.setCenterInternal(n.center), void 0 !== n.zoom && this.setZoom(n.zoom), void 0 !== n.rotation && this.setRotation(n.rotation), void (e && bs(e, !0))
  10697. }
  10698. for (var i = Date.now(), o = this.targetCenter_.slice(), a = this.targetResolution_, s = this.targetRotation_, l = [], u = 0; u < r; ++u) {
  10699. var c = arguments[u], h = {
  10700. start: i,
  10701. complete: !1,
  10702. anchor: c.anchor,
  10703. duration: void 0 !== c.duration ? c.duration : 1e3,
  10704. easing: c.easing || oo,
  10705. callback: e
  10706. };
  10707. if (c.center && (h.sourceCenter = o, h.targetCenter = c.center.slice(), o = h.targetCenter), void 0 !== c.zoom ? (h.sourceResolution = a, h.targetResolution = this.getResolutionForZoom(c.zoom), a = h.targetResolution) : c.resolution && (h.sourceResolution = a, h.targetResolution = c.resolution, a = h.targetResolution), void 0 !== c.rotation) {
  10708. h.sourceRotation = s;
  10709. var p = We(c.rotation - s + Math.PI, 2 * Math.PI) - Math.PI;
  10710. h.targetRotation = s + p, s = h.targetRotation
  10711. }
  10712. Es(h) ? h.complete = !0 : i += h.duration, l.push(h)
  10713. }
  10714. this.animations_.push(l), this.setHint(ns, 1), this.updateAnimations_()
  10715. }, e.prototype.getAnimating = function () {
  10716. return this.hints_[ns] > 0
  10717. }, e.prototype.getInteracting = function () {
  10718. return this.hints_[is] > 0
  10719. }, e.prototype.cancelAnimations = function () {
  10720. var t;
  10721. this.setHint(ns, -this.hints_[ns]);
  10722. for (var e = 0, r = this.animations_.length; e < r; ++e) {
  10723. var n = this.animations_[e];
  10724. if (n[0].callback && bs(n[0].callback, !1), !t) for (var i = 0, o = n.length; i < o; ++i) {
  10725. var a = n[i];
  10726. if (!a.complete) {
  10727. t = a.anchor;
  10728. break
  10729. }
  10730. }
  10731. }
  10732. this.animations_.length = 0, this.cancelAnchor_ = t
  10733. }, e.prototype.updateAnimations_ = function () {
  10734. if (void 0 !== this.updateAnimationKey_ && (cancelAnimationFrame(this.updateAnimationKey_), this.updateAnimationKey_ = void 0), this.getAnimating()) {
  10735. for (var t = Date.now(), e = !1, r = this.animations_.length - 1; r >= 0; --r) {
  10736. for (var n = this.animations_[r], i = !0, o = 0, a = n.length; o < a; ++o) {
  10737. var s = n[o];
  10738. if (!s.complete) {
  10739. var l = t - s.start, u = s.duration > 0 ? l / s.duration : 1;
  10740. u >= 1 ? (s.complete = !0, u = 1) : i = !1;
  10741. var c = s.easing(u);
  10742. if (s.sourceCenter) {
  10743. var h = s.sourceCenter[0], p = s.sourceCenter[1], f = h + c * (s.targetCenter[0] - h),
  10744. d = p + c * (s.targetCenter[1] - p);
  10745. this.targetCenter_ = [f, d]
  10746. }
  10747. if (s.sourceResolution && s.targetResolution) {
  10748. var g = 1 === c ? s.targetResolution : s.sourceResolution + c * (s.targetResolution - s.sourceResolution);
  10749. if (s.anchor) {
  10750. var y = this.getViewportSize_(this.getRotation()), m = this.constraints_.resolution(g, 0, y, !0);
  10751. this.targetCenter_ = this.calculateCenterZoom(m, s.anchor)
  10752. }
  10753. this.targetResolution_ = g, this.applyTargetState_(!0)
  10754. }
  10755. if (void 0 !== s.sourceRotation && void 0 !== s.targetRotation) {
  10756. var v = 1 === c ? We(s.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : s.sourceRotation + c * (s.targetRotation - s.sourceRotation);
  10757. if (s.anchor) {
  10758. var _ = this.constraints_.rotation(v, !0);
  10759. this.targetCenter_ = this.calculateCenterRotate(_, s.anchor)
  10760. }
  10761. this.targetRotation_ = v
  10762. }
  10763. if (this.applyTargetState_(!0), e = !0, !s.complete) break
  10764. }
  10765. }
  10766. if (i) {
  10767. this.animations_[r] = null, this.setHint(ns, -1);
  10768. var b = n[0].callback;
  10769. b && bs(b, !0)
  10770. }
  10771. }
  10772. this.animations_ = this.animations_.filter(Boolean), e && void 0 === this.updateAnimationKey_ && (this.updateAnimationKey_ = requestAnimationFrame(this.updateAnimations_.bind(this)))
  10773. }
  10774. }, e.prototype.calculateCenterRotate = function (t, e) {
  10775. var r, n = this.getCenterInternal();
  10776. return void 0 !== n && (Or(r = [n[0] - e[0], n[1] - e[1]], t - this.getRotation()), xr(r, e)), r
  10777. }, e.prototype.calculateCenterZoom = function (t, e) {
  10778. var r, n = this.getCenterInternal(), i = this.getResolution();
  10779. void 0 !== n && void 0 !== i && (r = [e[0] - t * (e[0] - n[0]) / i, e[1] - t * (e[1] - n[1]) / i]);
  10780. return r
  10781. }, e.prototype.getViewportSize_ = function (t) {
  10782. var e = this.viewportSize_;
  10783. if (t) {
  10784. var r = e[0], n = e[1];
  10785. return [Math.abs(r * Math.cos(t)) + Math.abs(n * Math.sin(t)), Math.abs(r * Math.sin(t)) + Math.abs(n * Math.cos(t))]
  10786. }
  10787. return e
  10788. }, e.prototype.setViewportSize = function (t) {
  10789. this.viewportSize_ = Array.isArray(t) ? t.slice() : [100, 100], this.getAnimating() || this.resolveConstraints(0)
  10790. }, e.prototype.getCenter = function () {
  10791. var t = this.getCenterInternal();
  10792. return t ? en(t, this.getProjection()) : t
  10793. }, e.prototype.getCenterInternal = function () {
  10794. return this.get(os)
  10795. }, e.prototype.getConstraints = function () {
  10796. return this.constraints_
  10797. }, e.prototype.getConstrainResolution = function () {
  10798. return this.options_.constrainResolution
  10799. }, e.prototype.getHints = function (t) {
  10800. return void 0 !== t ? (t[0] = this.hints_[0], t[1] = this.hints_[1], t) : this.hints_.slice()
  10801. }, e.prototype.calculateExtent = function (t) {
  10802. return nn(this.calculateExtentInternal(t), this.getProjection())
  10803. }, e.prototype.calculateExtentInternal = function (t) {
  10804. var e = t || this.getViewportSize_(), r = this.getCenterInternal();
  10805. pt(r, 1);
  10806. var n = this.getResolution();
  10807. pt(void 0 !== n, 2);
  10808. var i = this.getRotation();
  10809. return pt(void 0 !== i, 3), Se(r, n, i, e)
  10810. }, e.prototype.getMaxResolution = function () {
  10811. return this.maxResolution_
  10812. }, e.prototype.getMinResolution = function () {
  10813. return this.minResolution_
  10814. }, e.prototype.getMaxZoom = function () {
  10815. return this.getZoomForResolution(this.minResolution_)
  10816. }, e.prototype.setMaxZoom = function (t) {
  10817. this.applyOptions_(this.getUpdatedOptions_({maxZoom: t}))
  10818. }, e.prototype.getMinZoom = function () {
  10819. return this.getZoomForResolution(this.maxResolution_)
  10820. }, e.prototype.setMinZoom = function (t) {
  10821. this.applyOptions_(this.getUpdatedOptions_({minZoom: t}))
  10822. }, e.prototype.setConstrainResolution = function (t) {
  10823. this.applyOptions_(this.getUpdatedOptions_({constrainResolution: t}))
  10824. }, e.prototype.getProjection = function () {
  10825. return this.projection_
  10826. }, e.prototype.getResolution = function () {
  10827. return this.get(as)
  10828. }, e.prototype.getResolutions = function () {
  10829. return this.resolutions_
  10830. }, e.prototype.getResolutionForExtent = function (t, e) {
  10831. return this.getResolutionForExtentInternal(on(t, this.getProjection()), e)
  10832. }, e.prototype.getResolutionForExtentInternal = function (t, e) {
  10833. var r = e || this.getViewportSize_(), n = Pe(t) / r[0], i = Ee(t) / r[1];
  10834. return Math.max(n, i)
  10835. }, e.prototype.getResolutionForValueFunction = function (t) {
  10836. var e = t || 2, r = this.getConstrainedResolution(this.maxResolution_), n = this.minResolution_,
  10837. i = Math.log(r / n) / Math.log(e);
  10838. return function (t) {
  10839. return r / Math.pow(e, t * i)
  10840. }
  10841. }, e.prototype.getRotation = function () {
  10842. return this.get(ss)
  10843. }, e.prototype.getValueForResolutionFunction = function (t) {
  10844. var e = Math.log(t || 2), r = this.getConstrainedResolution(this.maxResolution_), n = this.minResolution_,
  10845. i = Math.log(r / n) / e;
  10846. return function (t) {
  10847. return Math.log(r / t) / e / i
  10848. }
  10849. }, e.prototype.getViewportSizeMinusPadding_ = function (t) {
  10850. var e = this.getViewportSize_(t), r = this.padding;
  10851. return r && (e = [e[0] - r[1] - r[3], e[1] - r[0] - r[2]]), e
  10852. }, e.prototype.getState = function () {
  10853. var t = this.getProjection(), e = this.getResolution(), r = this.getRotation(), n = this.getCenterInternal(),
  10854. i = this.padding;
  10855. if (i) {
  10856. var o = this.getViewportSizeMinusPadding_();
  10857. n = Ts(n, this.getViewportSize_(), [o[0] / 2 + i[3], o[1] / 2 + i[0]], e, r)
  10858. }
  10859. return {
  10860. center: n.slice(0),
  10861. projection: void 0 !== t ? t : null,
  10862. resolution: e,
  10863. rotation: r,
  10864. zoom: this.getZoom()
  10865. }
  10866. }, e.prototype.getZoom = function () {
  10867. var t, e = this.getResolution();
  10868. return void 0 !== e && (t = this.getZoomForResolution(e)), t
  10869. }, e.prototype.getZoomForResolution = function (t) {
  10870. var e, r, n = this.minZoom_ || 0;
  10871. if (this.resolutions_) {
  10872. var i = y(this.resolutions_, t, 1);
  10873. n = i, e = this.resolutions_[i], r = i == this.resolutions_.length - 1 ? 2 : e / this.resolutions_[i + 1]
  10874. } else e = this.maxResolution_, r = this.zoomFactor_;
  10875. return n + Math.log(e / t) / Math.log(r)
  10876. }, e.prototype.getResolutionForZoom = function (t) {
  10877. if (this.resolutions_) {
  10878. if (this.resolutions_.length <= 1) return 0;
  10879. var e = Ne(Math.floor(t), 0, this.resolutions_.length - 2),
  10880. r = this.resolutions_[e] / this.resolutions_[e + 1];
  10881. return this.resolutions_[e] / Math.pow(r, Ne(t - e, 0, 1))
  10882. }
  10883. return this.maxResolution_ / Math.pow(this.zoomFactor_, t - this.minZoom_)
  10884. }, e.prototype.fit = function (t, e) {
  10885. var r;
  10886. if (pt(Array.isArray(t) || "function" == typeof t.getSimplifiedGeometry, 24), Array.isArray(t)) pt(!Ie(t), 25), r = gi(n = on(t, this.getProjection())); else if (t.getType() === bt.CIRCLE) {
  10887. var n;
  10888. (r = gi(n = on(t.getExtent(), this.getProjection()))).rotate(this.getRotation(), xe(n))
  10889. } else {
  10890. var i = tn();
  10891. r = i ? t.clone().transform(i, this.getProjection()) : t
  10892. }
  10893. this.fitInternal(r, e)
  10894. }, e.prototype.fitInternal = function (t, e) {
  10895. var r = e || {}, n = r.size;
  10896. n || (n = this.getViewportSizeMinusPadding_());
  10897. var i, o = void 0 !== r.padding ? r.padding : [0, 0, 0, 0], a = void 0 !== r.nearest && r.nearest;
  10898. i = void 0 !== r.minResolution ? r.minResolution : void 0 !== r.maxZoom ? this.getResolutionForZoom(r.maxZoom) : 0;
  10899. for (var s = t.getFlatCoordinates(), l = this.getRotation(), u = Math.cos(-l), c = Math.sin(-l), h = 1 / 0, p = 1 / 0, f = -1 / 0, d = -1 / 0, g = t.getStride(), y = 0, m = s.length; y < m; y += g) {
  10900. var v = s[y] * u - s[y + 1] * c, _ = s[y] * c + s[y + 1] * u;
  10901. h = Math.min(h, v), p = Math.min(p, _), f = Math.max(f, v), d = Math.max(d, _)
  10902. }
  10903. var b = this.getResolutionForExtentInternal([h, p, f, d], [n[0] - o[1] - o[3], n[1] - o[0] - o[2]]);
  10904. b = isNaN(b) ? i : Math.max(b, i), b = this.getConstrainedResolution(b, a ? 0 : 1), c = -c;
  10905. var x = (h + f) / 2, w = (p + d) / 2, S = (x += (o[1] - o[3]) / 2 * b) * u - (w += (o[0] - o[2]) / 2 * b) * c,
  10906. E = w * u + x * c, C = this.getConstrainedCenter([S, E], b), O = r.callback ? r.callback : T;
  10907. void 0 !== r.duration ? this.animateInternal({
  10908. resolution: b,
  10909. center: C,
  10910. duration: r.duration,
  10911. easing: r.easing
  10912. }, O) : (this.targetResolution_ = b, this.targetCenter_ = C, this.applyTargetState_(!1, !0), bs(O, !0))
  10913. }, e.prototype.centerOn = function (t, e, r) {
  10914. this.centerOnInternal(rn(t, this.getProjection()), e, r)
  10915. }, e.prototype.centerOnInternal = function (t, e, r) {
  10916. this.setCenterInternal(Ts(t, e, r, this.getResolution(), this.getRotation()))
  10917. }, e.prototype.calculateCenterShift = function (t, e, r, n) {
  10918. var i, o = this.padding;
  10919. if (o && t) {
  10920. var a = this.getViewportSizeMinusPadding_(-r), s = Ts(t, n, [a[0] / 2 + o[3], a[1] / 2 + o[0]], e, r);
  10921. i = [t[0] - s[0], t[1] - s[1]]
  10922. }
  10923. return i
  10924. }, e.prototype.isDef = function () {
  10925. return !!this.getCenterInternal() && void 0 !== this.getResolution()
  10926. }, e.prototype.adjustCenter = function (t) {
  10927. var e = en(this.targetCenter_, this.getProjection());
  10928. this.setCenter([e[0] + t[0], e[1] + t[1]])
  10929. }, e.prototype.adjustCenterInternal = function (t) {
  10930. var e = this.targetCenter_;
  10931. this.setCenterInternal([e[0] + t[0], e[1] + t[1]])
  10932. }, e.prototype.adjustResolution = function (t, e) {
  10933. var r = e && rn(e, this.getProjection());
  10934. this.adjustResolutionInternal(t, r)
  10935. }, e.prototype.adjustResolutionInternal = function (t, e) {
  10936. var r = this.getAnimating() || this.getInteracting(), n = this.getViewportSize_(this.getRotation()),
  10937. i = this.constraints_.resolution(this.targetResolution_ * t, 0, n, r);
  10938. e && (this.targetCenter_ = this.calculateCenterZoom(i, e)), this.targetResolution_ *= t, this.applyTargetState_()
  10939. }, e.prototype.adjustZoom = function (t, e) {
  10940. this.adjustResolution(Math.pow(this.zoomFactor_, -t), e)
  10941. }, e.prototype.adjustRotation = function (t, e) {
  10942. e && (e = rn(e, this.getProjection())), this.adjustRotationInternal(t, e)
  10943. }, e.prototype.adjustRotationInternal = function (t, e) {
  10944. var r = this.getAnimating() || this.getInteracting(),
  10945. n = this.constraints_.rotation(this.targetRotation_ + t, r);
  10946. e && (this.targetCenter_ = this.calculateCenterRotate(n, e)), this.targetRotation_ += t, this.applyTargetState_()
  10947. }, e.prototype.setCenter = function (t) {
  10948. this.setCenterInternal(rn(t, this.getProjection()))
  10949. }, e.prototype.setCenterInternal = function (t) {
  10950. this.targetCenter_ = t, this.applyTargetState_()
  10951. }, e.prototype.setHint = function (t, e) {
  10952. return this.hints_[t] += e, this.changed(), this.hints_[t]
  10953. }, e.prototype.setResolution = function (t) {
  10954. this.targetResolution_ = t, this.applyTargetState_()
  10955. }, e.prototype.setRotation = function (t) {
  10956. this.targetRotation_ = t, this.applyTargetState_()
  10957. }, e.prototype.setZoom = function (t) {
  10958. this.setResolution(this.getResolutionForZoom(t))
  10959. }, e.prototype.applyTargetState_ = function (t, e) {
  10960. var r = this.getAnimating() || this.getInteracting() || e,
  10961. n = this.constraints_.rotation(this.targetRotation_, r), i = this.getViewportSize_(n),
  10962. o = this.constraints_.resolution(this.targetResolution_, 0, i, r),
  10963. a = this.constraints_.center(this.targetCenter_, o, i, r, this.calculateCenterShift(this.targetCenter_, o, n, i));
  10964. this.get(ss) !== n && this.set(ss, n), this.get(as) !== o && this.set(as, o), this.get(os) && Cr(this.get(os), a) || this.set(os, a), this.getAnimating() && !t && this.cancelAnimations(), this.cancelAnchor_ = void 0
  10965. }, e.prototype.resolveConstraints = function (t, e, r) {
  10966. var n = void 0 !== t ? t : 200, i = e || 0, o = this.constraints_.rotation(this.targetRotation_),
  10967. a = this.getViewportSize_(o), s = this.constraints_.resolution(this.targetResolution_, i, a),
  10968. l = this.constraints_.center(this.targetCenter_, s, a, !1, this.calculateCenterShift(this.targetCenter_, s, o, a));
  10969. if (0 === n && !this.cancelAnchor_) return this.targetResolution_ = s, this.targetRotation_ = o, this.targetCenter_ = l, void this.applyTargetState_();
  10970. var u = r || (0 === n ? this.cancelAnchor_ : void 0);
  10971. this.cancelAnchor_ = void 0, this.getResolution() === s && this.getRotation() === o && this.getCenterInternal() && Cr(this.getCenterInternal(), l) || (this.getAnimating() && this.cancelAnimations(), this.animateInternal({
  10972. rotation: o,
  10973. center: l,
  10974. resolution: s,
  10975. duration: n,
  10976. easing: io,
  10977. anchor: u
  10978. }))
  10979. }, e.prototype.beginInteraction = function () {
  10980. this.resolveConstraints(0), this.setHint(is, 1)
  10981. }, e.prototype.endInteraction = function (t, e, r) {
  10982. var n = r && rn(r, this.getProjection());
  10983. this.endInteractionInternal(t, e, n)
  10984. }, e.prototype.endInteractionInternal = function (t, e, r) {
  10985. this.setHint(is, -1), this.resolveConstraints(t, e, r)
  10986. }, e.prototype.getConstrainedCenter = function (t, e) {
  10987. var r = this.getViewportSize_(this.getRotation());
  10988. return this.constraints_.center(t, e || this.getResolution(), r)
  10989. }, e.prototype.getConstrainedZoom = function (t, e) {
  10990. var r = this.getResolutionForZoom(t);
  10991. return this.getZoomForResolution(this.getConstrainedResolution(r, e))
  10992. }, e.prototype.getConstrainedResolution = function (t, e) {
  10993. var r = e || 0, n = this.getViewportSize_(this.getRotation());
  10994. return this.constraints_.resolution(t, r, n)
  10995. }, e
  10996. }(ot);
  10997. function Os(t, e, r) {
  10998. return void 0 === r && (r = [0, 0]), r[0] = t[0] + 2 * e, r[1] = t[1] + 2 * e, r
  10999. }
  11000. function Ps(t) {
  11001. return t[0] > 0 && t[1] > 0
  11002. }
  11003. function Rs(t, e, r) {
  11004. return void 0 === r && (r = [0, 0]), r[0] = t[0] * e + .5 | 0, r[1] = t[1] * e + .5 | 0, r
  11005. }
  11006. function Is(t, e) {
  11007. return Array.isArray(t) ? t : (void 0 === e ? e = [t, t] : (e[0] = t, e[1] = t), e)
  11008. }
  11009. var Ls = function () {
  11010. var t = function (e, r) {
  11011. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11012. t.__proto__ = e
  11013. } || function (t, e) {
  11014. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11015. })(e, r)
  11016. };
  11017. return function (e, r) {
  11018. function n() {
  11019. this.constructor = e
  11020. }
  11021. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11022. }
  11023. }();
  11024. var Ms = function (t) {
  11025. function e(e) {
  11026. var r = t.call(this) || this, n = function (t) {
  11027. var e = null;
  11028. void 0 !== t.keyboardEventTarget && (e = "string" == typeof t.keyboardEventTarget ? document.getElementById(t.keyboardEventTarget) : t.keyboardEventTarget);
  11029. var r, n, i, o = {},
  11030. a = t.layers && "function" == typeof t.layers.getLayers ? t.layers : new Aa({layers: t.layers});
  11031. o[Ka] = a, o[$a] = t.target, o[Ja] = void 0 !== t.view ? t.view : new Cs, void 0 !== t.controls && (Array.isArray(t.controls) ? r = new ht(t.controls.slice()) : (pt("function" == typeof t.controls.getArray, 47), r = t.controls));
  11032. void 0 !== t.interactions && (Array.isArray(t.interactions) ? n = new ht(t.interactions.slice()) : (pt("function" == typeof t.interactions.getArray, 48), n = t.interactions));
  11033. void 0 !== t.overlays ? Array.isArray(t.overlays) ? i = new ht(t.overlays.slice()) : (pt("function" == typeof t.overlays.getArray, 49), i = t.overlays) : i = new ht;
  11034. return {controls: r, interactions: n, keyboardEventTarget: e, overlays: i, values: o}
  11035. }(e);
  11036. return r.boundHandleBrowserEvent_ = r.handleBrowserEvent.bind(r), r.maxTilesLoading_ = void 0 !== e.maxTilesLoading ? e.maxTilesLoading : 16, r.pixelRatio_ = void 0 !== e.pixelRatio ? e.pixelRatio : Vi, r.postRenderTimeoutHandle_, r.animationDelayKey_, r.animationDelay_ = function () {
  11037. this.animationDelayKey_ = void 0, this.renderFrame_(Date.now())
  11038. }.bind(r), r.coordinateToPixelTransform_ = [1, 0, 0, 1, 0, 0], r.pixelToCoordinateTransform_ = [1, 0, 0, 1, 0, 0], r.frameIndex_ = 0, r.frameState_ = null, r.previousExtent_ = null, r.viewPropertyListenerKey_ = null, r.viewChangeListenerKey_ = null, r.layerGroupPropertyListenerKeys_ = null, r.viewport_ = document.createElement("div"), r.viewport_.className = "ol-viewport" + ("ontouchstart" in window ? " ol-touch" : ""), r.viewport_.style.position = "relative", r.viewport_.style.overflow = "hidden", r.viewport_.style.width = "100%", r.viewport_.style.height = "100%", r.overlayContainer_ = document.createElement("div"), r.overlayContainer_.style.position = "absolute", r.overlayContainer_.style.zIndex = "0", r.overlayContainer_.style.width = "100%", r.overlayContainer_.style.height = "100%", r.overlayContainer_.style.pointerEvents = "none", r.overlayContainer_.className = "ol-overlaycontainer", r.viewport_.appendChild(r.overlayContainer_), r.overlayContainerStopEvent_ = document.createElement("div"), r.overlayContainerStopEvent_.style.position = "absolute", r.overlayContainerStopEvent_.style.zIndex = "0", r.overlayContainerStopEvent_.style.width = "100%", r.overlayContainerStopEvent_.style.height = "100%", r.overlayContainerStopEvent_.style.pointerEvents = "none", r.overlayContainerStopEvent_.className = "ol-overlaycontainer-stopevent", r.viewport_.appendChild(r.overlayContainerStopEvent_), r.mapBrowserEventHandler_ = null, r.moveTolerance_ = e.moveTolerance, r.keyboardEventTarget_ = n.keyboardEventTarget, r.keyHandlerKeys_ = null, r.controls = n.controls || new ht, r.interactions = n.interactions || new ht, r.overlays_ = n.overlays, r.overlayIdIndex_ = {}, r.renderer_ = null, r.handleResize_, r.postRenderFunctions_ = [], r.tileQueue_ = new es(r.getTilePriority.bind(r), r.handleTileChange_.bind(r)), r.addEventListener(it(Ka), r.handleLayerGroupChanged_), r.addEventListener(it(Ja), r.handleViewChanged_), r.addEventListener(it(Ha), r.handleSizeChanged_), r.addEventListener(it($a), r.handleTargetChanged_), r.setProperties(n.values), r.controls.forEach(function (t) {
  11039. t.setMap(this)
  11040. }.bind(r)), r.controls.addEventListener(at, function (t) {
  11041. t.element.setMap(this)
  11042. }.bind(r)), r.controls.addEventListener(st, function (t) {
  11043. t.element.setMap(null)
  11044. }.bind(r)), r.interactions.forEach(function (t) {
  11045. t.setMap(this)
  11046. }.bind(r)), r.interactions.addEventListener(at, function (t) {
  11047. t.element.setMap(this)
  11048. }.bind(r)), r.interactions.addEventListener(st, function (t) {
  11049. t.element.setMap(null)
  11050. }.bind(r)), r.overlays_.forEach(r.addOverlayInternal_.bind(r)), r.overlays_.addEventListener(at, function (t) {
  11051. this.addOverlayInternal_(t.element)
  11052. }.bind(r)), r.overlays_.addEventListener(st, function (t) {
  11053. var e = t.element.getId();
  11054. void 0 !== e && delete this.overlayIdIndex_[e.toString()], t.element.setMap(null)
  11055. }.bind(r)), r
  11056. }
  11057. return Ls(e, t), e.prototype.createRenderer = function () {
  11058. throw new Error("Use a map type that has a createRenderer method")
  11059. }, e.prototype.addControl = function (t) {
  11060. this.getControls().push(t)
  11061. }, e.prototype.addInteraction = function (t) {
  11062. this.getInteractions().push(t)
  11063. }, e.prototype.addLayer = function (t) {
  11064. this.getLayerGroup().getLayers().push(t)
  11065. }, e.prototype.addOverlay = function (t) {
  11066. this.getOverlays().push(t)
  11067. }, e.prototype.addOverlayInternal_ = function (t) {
  11068. var e = t.getId();
  11069. void 0 !== e && (this.overlayIdIndex_[e.toString()] = t), t.setMap(this)
  11070. }, e.prototype.disposeInternal = function () {
  11071. this.setTarget(null), t.prototype.disposeInternal.call(this)
  11072. }, e.prototype.forEachFeatureAtPixel = function (t, e, r) {
  11073. if (this.frameState_) {
  11074. var n = this.getCoordinateFromPixelInternal(t),
  11075. i = void 0 !== (r = void 0 !== r ? r : {}).hitTolerance ? r.hitTolerance : 0,
  11076. o = void 0 !== r.layerFilter ? r.layerFilter : S, a = !1 !== r.checkWrapped;
  11077. return this.renderer_.forEachFeatureAtCoordinate(n, this.frameState_, i, a, e, null, o, null)
  11078. }
  11079. }, e.prototype.getFeaturesAtPixel = function (t, e) {
  11080. var r = [];
  11081. return this.forEachFeatureAtPixel(t, (function (t) {
  11082. r.push(t)
  11083. }), e), r
  11084. }, e.prototype.forEachLayerAtPixel = function (t, e, r) {
  11085. if (this.frameState_) {
  11086. var n = r || {}, i = void 0 !== n.hitTolerance ? n.hitTolerance : 0, o = n.layerFilter || S;
  11087. return this.renderer_.forEachLayerAtPixel(t, this.frameState_, i, e, o)
  11088. }
  11089. }, e.prototype.hasFeatureAtPixel = function (t, e) {
  11090. if (!this.frameState_) return !1;
  11091. var r = this.getCoordinateFromPixelInternal(t),
  11092. n = void 0 !== (e = void 0 !== e ? e : {}).layerFilter ? e.layerFilter : S,
  11093. i = void 0 !== e.hitTolerance ? e.hitTolerance : 0, o = !1 !== e.checkWrapped;
  11094. return this.renderer_.hasFeatureAtCoordinate(r, this.frameState_, i, o, n, null)
  11095. }, e.prototype.getEventCoordinate = function (t) {
  11096. return this.getCoordinateFromPixel(this.getEventPixel(t))
  11097. }, e.prototype.getEventCoordinateInternal = function (t) {
  11098. return this.getCoordinateFromPixelInternal(this.getEventPixel(t))
  11099. }, e.prototype.getEventPixel = function (t) {
  11100. var e = this.viewport_.getBoundingClientRect(), r = "changedTouches" in t ? t.changedTouches[0] : t;
  11101. return [r.clientX - e.left, r.clientY - e.top]
  11102. }, e.prototype.getTarget = function () {
  11103. return this.get($a)
  11104. }, e.prototype.getTargetElement = function () {
  11105. var t = this.getTarget();
  11106. return void 0 !== t ? "string" == typeof t ? document.getElementById(t) : t : null
  11107. }, e.prototype.getCoordinateFromPixel = function (t) {
  11108. return en(this.getCoordinateFromPixelInternal(t), this.getView().getProjection())
  11109. }, e.prototype.getCoordinateFromPixelInternal = function (t) {
  11110. var e = this.frameState_;
  11111. return e ? It(e.pixelToCoordinateTransform, t.slice()) : null
  11112. }, e.prototype.getControls = function () {
  11113. return this.controls
  11114. }, e.prototype.getOverlays = function () {
  11115. return this.overlays_
  11116. }, e.prototype.getOverlayById = function (t) {
  11117. var e = this.overlayIdIndex_[t.toString()];
  11118. return void 0 !== e ? e : null
  11119. }, e.prototype.getInteractions = function () {
  11120. return this.interactions
  11121. }, e.prototype.getLayerGroup = function () {
  11122. return this.get(Ka)
  11123. }, e.prototype.getLayers = function () {
  11124. return this.getLayerGroup().getLayers()
  11125. }, e.prototype.getLoading = function () {
  11126. for (var t = this.getLayerGroup().getLayerStatesArray(), e = 0, r = t.length; e < r; ++e) {
  11127. var n = t[e].layer.getSource();
  11128. if (n && n.loading) return !0
  11129. }
  11130. return !1
  11131. }, e.prototype.getPixelFromCoordinate = function (t) {
  11132. var e = rn(t, this.getView().getProjection());
  11133. return this.getPixelFromCoordinateInternal(e)
  11134. }, e.prototype.getPixelFromCoordinateInternal = function (t) {
  11135. var e = this.frameState_;
  11136. return e ? It(e.coordinateToPixelTransform, t.slice(0, 2)) : null
  11137. }, e.prototype.getRenderer = function () {
  11138. return this.renderer_
  11139. }, e.prototype.getSize = function () {
  11140. return this.get(Ha)
  11141. }, e.prototype.getView = function () {
  11142. return this.get(Ja)
  11143. }, e.prototype.getViewport = function () {
  11144. return this.viewport_
  11145. }, e.prototype.getOverlayContainer = function () {
  11146. return this.overlayContainer_
  11147. }, e.prototype.getOverlayContainerStopEvent = function () {
  11148. return this.overlayContainerStopEvent_
  11149. }, e.prototype.getOwnerDocument = function () {
  11150. return this.getTargetElement() ? this.getTargetElement().ownerDocument : document
  11151. }, e.prototype.getTilePriority = function (t, e, r, n) {
  11152. return rs(this.frameState_, t, e, r, n)
  11153. }, e.prototype.handleBrowserEvent = function (t, e) {
  11154. var r = e || t.type, n = new Da(r, this, t);
  11155. this.handleMapBrowserEvent(n)
  11156. }, e.prototype.handleMapBrowserEvent = function (t) {
  11157. if (this.frameState_) {
  11158. var e = t.originalEvent, r = e.type;
  11159. if (r === Ua || r === X || r === B) {
  11160. var n = this.getOwnerDocument(), i = this.viewport_.getRootNode ? this.viewport_.getRootNode() : n,
  11161. o = "host" in i ? i.elementFromPoint(e.clientX, e.clientY) : e.target;
  11162. if (this.overlayContainerStopEvent_.contains(o) || !(i === n ? n.documentElement : i).contains(o)) return
  11163. }
  11164. if (t.frameState = this.frameState_, !1 !== this.dispatchEvent(t)) for (var a = this.getInteractions().getArray().slice(), s = a.length - 1; s >= 0; s--) {
  11165. var l = a[s];
  11166. if (l.getMap() === this && l.getActive() && this.getTargetElement()) if (!l.handleEvent(t) || t.propagationStopped) break
  11167. }
  11168. }
  11169. }, e.prototype.handlePostRender = function () {
  11170. var t = this.frameState_, e = this.tileQueue_;
  11171. if (!e.isEmpty()) {
  11172. var r = this.maxTilesLoading_, n = r;
  11173. if (t) {
  11174. var i = t.viewHints;
  11175. if (i[ns] || i[is]) {
  11176. var o = !Wi && Date.now() - t.time > 8;
  11177. r = o ? 0 : 8, n = o ? 0 : 2
  11178. }
  11179. }
  11180. e.getTilesLoading() < r && (e.reprioritize(), e.loadMoreTiles(r, n))
  11181. }
  11182. !t || !this.hasListener(Ho) || t.animate || this.tileQueue_.getTilesLoading() || this.getLoading() || this.renderer_.dispatchRenderEvent(Ho, t);
  11183. for (var a = this.postRenderFunctions_, s = 0, l = a.length; s < l; ++s) a[s](this, t);
  11184. a.length = 0
  11185. }, e.prototype.handleSizeChanged_ = function () {
  11186. this.getView() && !this.getView().getAnimating() && this.getView().resolveConstraints(0), this.render()
  11187. }, e.prototype.handleTargetChanged_ = function () {
  11188. var t;
  11189. if (this.getTarget() && (t = this.getTargetElement()), this.mapBrowserEventHandler_) {
  11190. for (var e = 0, r = this.keyHandlerKeys_.length; e < r; ++e) H(this.keyHandlerKeys_[e]);
  11191. this.keyHandlerKeys_ = null, this.viewport_.removeEventListener(j, this.boundHandleBrowserEvent_), this.viewport_.removeEventListener(X, this.boundHandleBrowserEvent_), void 0 !== this.handleResize_ && (removeEventListener(W, this.handleResize_, !1), this.handleResize_ = void 0), this.mapBrowserEventHandler_.dispose(), this.mapBrowserEventHandler_ = null, fo(this.viewport_)
  11192. }
  11193. if (t) {
  11194. for (var n in t.appendChild(this.viewport_), this.renderer_ || (this.renderer_ = this.createRenderer()), this.mapBrowserEventHandler_ = new Wa(this, this.moveTolerance_), Ga) this.mapBrowserEventHandler_.addEventListener(Ga[n], this.handleMapBrowserEvent.bind(this));
  11195. this.viewport_.addEventListener(j, this.boundHandleBrowserEvent_, !1), this.viewport_.addEventListener(X, this.boundHandleBrowserEvent_, !!qi && {passive: !1});
  11196. var i = this.keyboardEventTarget_ ? this.keyboardEventTarget_ : t;
  11197. this.keyHandlerKeys_ = [Z(i, B, this.handleBrowserEvent, this), Z(i, V, this.handleBrowserEvent, this)], this.handleResize_ || (this.handleResize_ = this.updateSize.bind(this), window.addEventListener(W, this.handleResize_, !1))
  11198. } else this.renderer_ && (clearTimeout(this.postRenderTimeoutHandle_), this.postRenderTimeoutHandle_ = void 0, this.postRenderFunctions_.length = 0, this.renderer_.dispose(), this.renderer_ = null), this.animationDelayKey_ && (cancelAnimationFrame(this.animationDelayKey_), this.animationDelayKey_ = void 0);
  11199. this.updateSize()
  11200. }, e.prototype.handleTileChange_ = function () {
  11201. this.render()
  11202. }, e.prototype.handleViewPropertyChanged_ = function () {
  11203. this.render()
  11204. }, e.prototype.handleViewChanged_ = function () {
  11205. this.viewPropertyListenerKey_ && (H(this.viewPropertyListenerKey_), this.viewPropertyListenerKey_ = null), this.viewChangeListenerKey_ && (H(this.viewChangeListenerKey_), this.viewChangeListenerKey_ = null);
  11206. var t = this.getView();
  11207. t && (this.updateViewportSize_(), this.viewPropertyListenerKey_ = Z(t, h, this.handleViewPropertyChanged_, this), this.viewChangeListenerKey_ = Z(t, F, this.handleViewPropertyChanged_, this), t.resolveConstraints(0)), this.render()
  11208. }, e.prototype.handleLayerGroupChanged_ = function () {
  11209. this.layerGroupPropertyListenerKeys_ && (this.layerGroupPropertyListenerKeys_.forEach(H), this.layerGroupPropertyListenerKeys_ = null);
  11210. var t = this.getLayerGroup();
  11211. t && (this.layerGroupPropertyListenerKeys_ = [Z(t, h, this.render, this), Z(t, F, this.render, this)]), this.render()
  11212. }, e.prototype.isRendered = function () {
  11213. return !!this.frameState_
  11214. }, e.prototype.renderSync = function () {
  11215. this.animationDelayKey_ && cancelAnimationFrame(this.animationDelayKey_), this.animationDelay_()
  11216. }, e.prototype.redrawText = function () {
  11217. for (var t = this.getLayerGroup().getLayerStatesArray(), e = 0, r = t.length; e < r; ++e) {
  11218. var n = t[e].layer;
  11219. n.hasRenderer() && n.getRenderer().handleFontsChanged()
  11220. }
  11221. }, e.prototype.render = function () {
  11222. this.renderer_ && void 0 === this.animationDelayKey_ && (this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_))
  11223. }, e.prototype.removeControl = function (t) {
  11224. return this.getControls().remove(t)
  11225. }, e.prototype.removeInteraction = function (t) {
  11226. return this.getInteractions().remove(t)
  11227. }, e.prototype.removeLayer = function (t) {
  11228. return this.getLayerGroup().getLayers().remove(t)
  11229. }, e.prototype.removeOverlay = function (t) {
  11230. return this.getOverlays().remove(t)
  11231. }, e.prototype.renderFrame_ = function (t) {
  11232. var e = this, r = this.getSize(), n = this.getView(), i = this.frameState_, o = null;
  11233. if (void 0 !== r && Ps(r) && n && n.isDef()) {
  11234. var a = n.getHints(this.frameState_ ? this.frameState_.viewHints : void 0), s = n.getState();
  11235. o = {
  11236. animate: !1,
  11237. coordinateToPixelTransform: this.coordinateToPixelTransform_,
  11238. declutterTree: null,
  11239. extent: Se(s.center, s.resolution, s.rotation, r),
  11240. index: this.frameIndex_++,
  11241. layerIndex: 0,
  11242. layerStatesArray: this.getLayerGroup().getLayerStatesArray(),
  11243. pixelRatio: this.pixelRatio_,
  11244. pixelToCoordinateTransform: this.pixelToCoordinateTransform_,
  11245. postRenderFunctions: [],
  11246. size: r,
  11247. tileQueue: this.tileQueue_,
  11248. time: t,
  11249. usedTiles: {},
  11250. viewState: s,
  11251. viewHints: a,
  11252. wantedTiles: {}
  11253. }
  11254. }
  11255. if (this.frameState_ = o, this.renderer_.renderFrame(o), o) {
  11256. if (o.animate && this.render(), Array.prototype.push.apply(this.postRenderFunctions_, o.postRenderFunctions), i) (!this.previousExtent_ || !Ie(this.previousExtent_) && !ue(o.extent, this.previousExtent_)) && (this.dispatchEvent(new ja(Xa, this, i)), this.previousExtent_ = oe(this.previousExtent_));
  11257. this.previousExtent_ && !o.viewHints[ns] && !o.viewHints[is] && !ue(o.extent, this.previousExtent_) && (this.dispatchEvent(new ja(Za, this, o)), $t(o.extent, this.previousExtent_))
  11258. }
  11259. this.dispatchEvent(new ja(qa, this, o)), this.postRenderTimeoutHandle_ || (this.postRenderTimeoutHandle_ = setTimeout((function () {
  11260. e.postRenderTimeoutHandle_ = void 0, e.handlePostRender()
  11261. }), 0))
  11262. }, e.prototype.setLayerGroup = function (t) {
  11263. this.set(Ka, t)
  11264. }, e.prototype.setSize = function (t) {
  11265. this.set(Ha, t)
  11266. }, e.prototype.setTarget = function (t) {
  11267. this.set($a, t)
  11268. }, e.prototype.setView = function (t) {
  11269. this.set(Ja, t)
  11270. }, e.prototype.updateSize = function () {
  11271. var t = this.getTargetElement();
  11272. if (t) {
  11273. var e = getComputedStyle(t);
  11274. this.setSize([t.offsetWidth - parseFloat(e.borderLeftWidth) - parseFloat(e.paddingLeft) - parseFloat(e.paddingRight) - parseFloat(e.borderRightWidth), t.offsetHeight - parseFloat(e.borderTopWidth) - parseFloat(e.paddingTop) - parseFloat(e.paddingBottom) - parseFloat(e.borderBottomWidth)])
  11275. } else this.setSize(void 0);
  11276. this.updateViewportSize_()
  11277. }, e.prototype.updateViewportSize_ = function () {
  11278. var t = this.getView();
  11279. if (t) {
  11280. var e = void 0, r = getComputedStyle(this.viewport_);
  11281. r.width && r.height && (e = [parseInt(r.width, 10), parseInt(r.height, 10)]), t.setViewportSize(e)
  11282. }
  11283. }, e
  11284. }(ot), Fs = function () {
  11285. var t = function (e, r) {
  11286. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11287. t.__proto__ = e
  11288. } || function (t, e) {
  11289. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11290. })(e, r)
  11291. };
  11292. return function (e, r) {
  11293. function n() {
  11294. this.constructor = e
  11295. }
  11296. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11297. }
  11298. }(), As = function (t) {
  11299. function e(e) {
  11300. var r = t.call(this) || this, n = e.element;
  11301. return !n || e.target || n.style.pointerEvents || (n.style.pointerEvents = "auto"), r.element = n || null, r.target_ = null, r.map_ = null, r.listenerKeys = [], e.render && (r.render = e.render), e.target && r.setTarget(e.target), r
  11302. }
  11303. return Fs(e, t), e.prototype.disposeInternal = function () {
  11304. fo(this.element), t.prototype.disposeInternal.call(this)
  11305. }, e.prototype.getMap = function () {
  11306. return this.map_
  11307. }, e.prototype.setMap = function (t) {
  11308. this.map_ && fo(this.element);
  11309. for (var e = 0, r = this.listenerKeys.length; e < r; ++e) H(this.listenerKeys[e]);
  11310. (this.listenerKeys.length = 0, this.map_ = t, this.map_) && ((this.target_ ? this.target_ : t.getOverlayContainerStopEvent()).appendChild(this.element), this.render !== T && this.listenerKeys.push(Z(t, qa, this.render, this)), t.render())
  11311. }, e.prototype.render = function (t) {
  11312. }, e.prototype.setTarget = function (t) {
  11313. this.target_ = "string" == typeof t ? document.getElementById(t) : t
  11314. }, e
  11315. }(ot), ks = function () {
  11316. var t = function (e, r) {
  11317. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11318. t.__proto__ = e
  11319. } || function (t, e) {
  11320. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11321. })(e, r)
  11322. };
  11323. return function (e, r) {
  11324. function n() {
  11325. this.constructor = e
  11326. }
  11327. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11328. }
  11329. }(), js = function (t) {
  11330. function e(e) {
  11331. var r = this, n = e || {};
  11332. (r = t.call(this, {
  11333. element: document.createElement("div"),
  11334. render: n.render,
  11335. target: n.target
  11336. }) || this).ulElement_ = document.createElement("ul"), r.collapsed_ = void 0 === n.collapsed || n.collapsed, r.userCollapsed_ = r.collapsed_, r.overrideCollapsible_ = void 0 !== n.collapsible, r.collapsible_ = void 0 === n.collapsible || n.collapsible, r.collapsible_ || (r.collapsed_ = !1);
  11337. var i = void 0 !== n.className ? n.className : "ol-attribution",
  11338. o = void 0 !== n.tipLabel ? n.tipLabel : "Attributions",
  11339. a = void 0 !== n.expandClassName ? n.expandClassName : i + "-expand",
  11340. s = void 0 !== n.collapseLabel ? n.collapseLabel : "»",
  11341. l = void 0 !== n.collapseClassName ? n.collapseClassName : i + "-collpase";
  11342. "string" == typeof s ? (r.collapseLabel_ = document.createElement("span"), r.collapseLabel_.textContent = s, r.collapseLabel_.className = l) : r.collapseLabel_ = s;
  11343. var u = void 0 !== n.label ? n.label : "i";
  11344. "string" == typeof u ? (r.label_ = document.createElement("span"), r.label_.textContent = u, r.label_.className = a) : r.label_ = u;
  11345. var c = r.collapsible_ && !r.collapsed_ ? r.collapseLabel_ : r.label_, h = document.createElement("button");
  11346. h.setAttribute("type", "button"), h.title = o, h.appendChild(c), h.addEventListener(N, r.handleClick_.bind(r), !1);
  11347. var p = i + " ol-unselectable ol-control" + (r.collapsed_ && r.collapsible_ ? " ol-collapsed" : "") + (r.collapsible_ ? "" : " ol-uncollapsible"),
  11348. f = r.element;
  11349. return f.className = p, f.appendChild(r.ulElement_), f.appendChild(h), r.renderedAttributions_ = [], r.renderedVisible_ = !0, r
  11350. }
  11351. return ks(e, t), e.prototype.collectSourceAttributions_ = function (t) {
  11352. for (var e = {}, r = [], n = !0, i = t.layerStatesArray, o = 0, a = i.length; o < a; ++o) {
  11353. var s = i[o];
  11354. if (ra(s, t.viewState)) {
  11355. var l = s.layer.getSource();
  11356. if (l) {
  11357. var u = l.getAttributions();
  11358. if (u) {
  11359. var c = u(t);
  11360. if (c) if (n = n && !1 !== l.getAttributionsCollapsible(), Array.isArray(c)) for (var h = 0, p = c.length; h < p; ++h) c[h] in e || (r.push(c[h]), e[c[h]] = !0); else c in e || (r.push(c), e[c] = !0)
  11361. }
  11362. }
  11363. }
  11364. }
  11365. return this.overrideCollapsible_ || this.setCollapsible(n), r
  11366. }, e.prototype.updateElement_ = function (t) {
  11367. if (t) {
  11368. var e = this.collectSourceAttributions_(t), r = e.length > 0;
  11369. if (this.renderedVisible_ != r && (this.element.style.display = r ? "" : "none", this.renderedVisible_ = r), !b(e, this.renderedAttributions_)) {
  11370. go(this.ulElement_);
  11371. for (var n = 0, i = e.length; n < i; ++n) {
  11372. var o = document.createElement("li");
  11373. o.innerHTML = e[n], this.ulElement_.appendChild(o)
  11374. }
  11375. this.renderedAttributions_ = e
  11376. }
  11377. } else this.renderedVisible_ && (this.element.style.display = "none", this.renderedVisible_ = !1)
  11378. }, e.prototype.handleClick_ = function (t) {
  11379. t.preventDefault(), this.handleToggle_(), this.userCollapsed_ = this.collapsed_
  11380. }, e.prototype.handleToggle_ = function () {
  11381. this.element.classList.toggle("ol-collapsed"), this.collapsed_ ? po(this.collapseLabel_, this.label_) : po(this.label_, this.collapseLabel_), this.collapsed_ = !this.collapsed_
  11382. }, e.prototype.getCollapsible = function () {
  11383. return this.collapsible_
  11384. }, e.prototype.setCollapsible = function (t) {
  11385. this.collapsible_ !== t && (this.collapsible_ = t, this.element.classList.toggle("ol-uncollapsible"), this.userCollapsed_ && this.handleToggle_())
  11386. }, e.prototype.setCollapsed = function (t) {
  11387. this.userCollapsed_ = t, this.collapsible_ && this.collapsed_ !== t && this.handleToggle_()
  11388. }, e.prototype.getCollapsed = function () {
  11389. return this.collapsed_
  11390. }, e.prototype.render = function (t) {
  11391. this.updateElement_(t.frameState)
  11392. }, e
  11393. }(As), Ns = function () {
  11394. var t = function (e, r) {
  11395. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11396. t.__proto__ = e
  11397. } || function (t, e) {
  11398. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11399. })(e, r)
  11400. };
  11401. return function (e, r) {
  11402. function n() {
  11403. this.constructor = e
  11404. }
  11405. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11406. }
  11407. }(), Ds = function (t) {
  11408. function e(e) {
  11409. var r = this, n = e || {};
  11410. r = t.call(this, {element: document.createElement("div"), render: n.render, target: n.target}) || this;
  11411. var i = void 0 !== n.className ? n.className : "ol-rotate", o = void 0 !== n.label ? n.label : "⇧",
  11412. a = void 0 !== n.compassClassName ? n.compassClassName : "ol-compass";
  11413. r.label_ = null, "string" == typeof o ? (r.label_ = document.createElement("span"), r.label_.className = a, r.label_.textContent = o) : (r.label_ = o, r.label_.classList.add(a));
  11414. var s = n.tipLabel ? n.tipLabel : "Reset rotation", l = document.createElement("button");
  11415. l.className = i + "-reset", l.setAttribute("type", "button"), l.title = s, l.appendChild(r.label_), l.addEventListener(N, r.handleClick_.bind(r), !1);
  11416. var u = i + " ol-unselectable ol-control", c = r.element;
  11417. return c.className = u, c.appendChild(l), r.callResetNorth_ = n.resetNorth ? n.resetNorth : void 0, r.duration_ = void 0 !== n.duration ? n.duration : 250, r.autoHide_ = void 0 === n.autoHide || n.autoHide, r.rotation_ = void 0, r.autoHide_ && r.element.classList.add("ol-hidden"), r
  11418. }
  11419. return Ns(e, t), e.prototype.handleClick_ = function (t) {
  11420. t.preventDefault(), void 0 !== this.callResetNorth_ ? this.callResetNorth_() : this.resetNorth_()
  11421. }, e.prototype.resetNorth_ = function () {
  11422. var t = this.getMap().getView();
  11423. if (t) {
  11424. var e = t.getRotation();
  11425. void 0 !== e && (this.duration_ > 0 && e % (2 * Math.PI) != 0 ? t.animate({
  11426. rotation: 0,
  11427. duration: this.duration_,
  11428. easing: io
  11429. }) : t.setRotation(0))
  11430. }
  11431. }, e.prototype.render = function (t) {
  11432. var e = t.frameState;
  11433. if (e) {
  11434. var r = e.viewState.rotation;
  11435. if (r != this.rotation_) {
  11436. var n = "rotate(" + r + "rad)";
  11437. if (this.autoHide_) {
  11438. var i = this.element.classList.contains("ol-hidden");
  11439. i || 0 !== r ? i && 0 !== r && this.element.classList.remove("ol-hidden") : this.element.classList.add("ol-hidden")
  11440. }
  11441. this.label_.style.transform = n
  11442. }
  11443. this.rotation_ = r
  11444. }
  11445. }, e
  11446. }(As), Gs = function () {
  11447. var t = function (e, r) {
  11448. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11449. t.__proto__ = e
  11450. } || function (t, e) {
  11451. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11452. })(e, r)
  11453. };
  11454. return function (e, r) {
  11455. function n() {
  11456. this.constructor = e
  11457. }
  11458. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11459. }
  11460. }(), zs = function (t) {
  11461. function e(e) {
  11462. var r = this, n = e || {};
  11463. r = t.call(this, {element: document.createElement("div"), target: n.target}) || this;
  11464. var i = void 0 !== n.className ? n.className : "ol-zoom", o = void 0 !== n.delta ? n.delta : 1,
  11465. a = void 0 !== n.zoomInClassName ? n.zoomInClassName : i + "-in",
  11466. s = void 0 !== n.zoomOutClassName ? n.zoomOutClassName : i + "-out",
  11467. l = void 0 !== n.zoomInLabel ? n.zoomInLabel : "+", u = void 0 !== n.zoomOutLabel ? n.zoomOutLabel : "−",
  11468. c = void 0 !== n.zoomInTipLabel ? n.zoomInTipLabel : "Zoom in",
  11469. h = void 0 !== n.zoomOutTipLabel ? n.zoomOutTipLabel : "Zoom out", p = document.createElement("button");
  11470. p.className = a, p.setAttribute("type", "button"), p.title = c, p.appendChild("string" == typeof l ? document.createTextNode(l) : l), p.addEventListener(N, r.handleClick_.bind(r, o), !1);
  11471. var f = document.createElement("button");
  11472. f.className = s, f.setAttribute("type", "button"), f.title = h, f.appendChild("string" == typeof u ? document.createTextNode(u) : u), f.addEventListener(N, r.handleClick_.bind(r, -o), !1);
  11473. var d = i + " ol-unselectable ol-control", g = r.element;
  11474. return g.className = d, g.appendChild(p), g.appendChild(f), r.duration_ = void 0 !== n.duration ? n.duration : 250, r
  11475. }
  11476. return Gs(e, t), e.prototype.handleClick_ = function (t, e) {
  11477. e.preventDefault(), this.zoomByDelta_(t)
  11478. }, e.prototype.zoomByDelta_ = function (t) {
  11479. var e = this.getMap().getView();
  11480. if (e) {
  11481. var r = e.getZoom();
  11482. if (void 0 !== r) {
  11483. var n = e.getConstrainedZoom(r + t);
  11484. this.duration_ > 0 ? (e.getAnimating() && e.cancelAnimations(), e.animate({
  11485. zoom: n,
  11486. duration: this.duration_,
  11487. easing: io
  11488. })) : e.setZoom(n)
  11489. }
  11490. }
  11491. }, e
  11492. }(As);
  11493. function Us(t) {
  11494. var e = t || {}, r = new ht;
  11495. return (void 0 === e.zoom || e.zoom) && r.push(new zs(e.zoomOptions)), (void 0 === e.rotate || e.rotate) && r.push(new Ds(e.rotateOptions)), (void 0 === e.attribution || e.attribution) && r.push(new js(e.attributionOptions)), r
  11496. }
  11497. var Bs = "active", Vs = function () {
  11498. var t = function (e, r) {
  11499. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11500. t.__proto__ = e
  11501. } || function (t, e) {
  11502. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11503. })(e, r)
  11504. };
  11505. return function (e, r) {
  11506. function n() {
  11507. this.constructor = e
  11508. }
  11509. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11510. }
  11511. }();
  11512. function Ys(t, e, r) {
  11513. var n = t.getCenterInternal();
  11514. if (n) {
  11515. var i = [n[0] + e[0], n[1] + e[1]];
  11516. t.animateInternal({duration: void 0 !== r ? r : 250, easing: ao, center: t.getConstrainedCenter(i)})
  11517. }
  11518. }
  11519. function Ws(t, e, r, n) {
  11520. var i = t.getZoom();
  11521. if (void 0 !== i) {
  11522. var o = t.getConstrainedZoom(i + e), a = t.getResolutionForZoom(o);
  11523. t.getAnimating() && t.cancelAnimations(), t.animate({
  11524. resolution: a,
  11525. anchor: r,
  11526. duration: void 0 !== n ? n : 250,
  11527. easing: io
  11528. })
  11529. }
  11530. }
  11531. var qs = function (t) {
  11532. function e(e) {
  11533. var r = t.call(this) || this;
  11534. return e && e.handleEvent && (r.handleEvent = e.handleEvent), r.map_ = null, r.setActive(!0), r
  11535. }
  11536. return Vs(e, t), e.prototype.getActive = function () {
  11537. return this.get(Bs)
  11538. }, e.prototype.getMap = function () {
  11539. return this.map_
  11540. }, e.prototype.handleEvent = function (t) {
  11541. return !0
  11542. }, e.prototype.setActive = function (t) {
  11543. this.set(Bs, t)
  11544. }, e.prototype.setMap = function (t) {
  11545. this.map_ = t
  11546. }, e
  11547. }(ot), Xs = function () {
  11548. var t = function (e, r) {
  11549. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11550. t.__proto__ = e
  11551. } || function (t, e) {
  11552. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11553. })(e, r)
  11554. };
  11555. return function (e, r) {
  11556. function n() {
  11557. this.constructor = e
  11558. }
  11559. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11560. }
  11561. }(), Zs = function (t) {
  11562. function e(e) {
  11563. var r = t.call(this) || this, n = e || {};
  11564. return r.delta_ = n.delta ? n.delta : 1, r.duration_ = void 0 !== n.duration ? n.duration : 250, r
  11565. }
  11566. return Xs(e, t), e.prototype.handleEvent = function (t) {
  11567. var e = !1;
  11568. if (t.type == Ga.DBLCLICK) {
  11569. var r = t.originalEvent, n = t.map, i = t.coordinate, o = r.shiftKey ? -this.delta_ : this.delta_;
  11570. Ws(n.getView(), o, i, this.duration_), r.preventDefault(), e = !0
  11571. }
  11572. return !e
  11573. }, e
  11574. }(qs), Ks = function () {
  11575. var t = function (e, r) {
  11576. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11577. t.__proto__ = e
  11578. } || function (t, e) {
  11579. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11580. })(e, r)
  11581. };
  11582. return function (e, r) {
  11583. function n() {
  11584. this.constructor = e
  11585. }
  11586. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11587. }
  11588. }();
  11589. function Hs(t) {
  11590. for (var e = t.length, r = 0, n = 0, i = 0; i < e; i++) r += t[i].clientX, n += t[i].clientY;
  11591. return [r / e, n / e]
  11592. }
  11593. var $s = function (t) {
  11594. function e(e) {
  11595. var r = this, n = e || {};
  11596. return r = t.call(this, n) || this, n.handleDownEvent && (r.handleDownEvent = n.handleDownEvent), n.handleDragEvent && (r.handleDragEvent = n.handleDragEvent), n.handleMoveEvent && (r.handleMoveEvent = n.handleMoveEvent), n.handleUpEvent && (r.handleUpEvent = n.handleUpEvent), n.stopDown && (r.stopDown = n.stopDown), r.handlingDownUpSequence = !1, r.trackedPointers_ = {}, r.targetPointers = [], r
  11597. }
  11598. return Ks(e, t), e.prototype.getPointerCount = function () {
  11599. return this.targetPointers.length
  11600. }, e.prototype.handleDownEvent = function (t) {
  11601. return !1
  11602. }, e.prototype.handleDragEvent = function (t) {
  11603. }, e.prototype.handleEvent = function (t) {
  11604. if (!t.originalEvent) return !0;
  11605. var e = !1;
  11606. if (this.updateTrackedPointers_(t), this.handlingDownUpSequence) {
  11607. if (t.type == Ga.POINTERDRAG) this.handleDragEvent(t), t.originalEvent.preventDefault(); else if (t.type == Ga.POINTERUP) {
  11608. var r = this.handleUpEvent(t);
  11609. this.handlingDownUpSequence = r && this.targetPointers.length > 0
  11610. }
  11611. } else if (t.type == Ga.POINTERDOWN) {
  11612. var n = this.handleDownEvent(t);
  11613. this.handlingDownUpSequence = n, e = this.stopDown(n)
  11614. } else t.type == Ga.POINTERMOVE && this.handleMoveEvent(t);
  11615. return !e
  11616. }, e.prototype.handleMoveEvent = function (t) {
  11617. }, e.prototype.handleUpEvent = function (t) {
  11618. return !1
  11619. }, e.prototype.stopDown = function (t) {
  11620. return t
  11621. }, e.prototype.updateTrackedPointers_ = function (t) {
  11622. if (function (t) {
  11623. var e = t.type;
  11624. return e === Ga.POINTERDOWN || e === Ga.POINTERDRAG || e === Ga.POINTERUP
  11625. }(t)) {
  11626. var e = t.originalEvent, r = e.pointerId.toString();
  11627. t.type == Ga.POINTERUP ? delete this.trackedPointers_[r] : (t.type == Ga.POINTERDOWN || r in this.trackedPointers_) && (this.trackedPointers_[r] = e), this.targetPointers = R(this.trackedPointers_)
  11628. }
  11629. }, e
  11630. }(qs);
  11631. function Js(t) {
  11632. var e = arguments;
  11633. return function (t) {
  11634. for (var r = !0, n = 0, i = e.length; n < i && (r = r && e[n](t)); ++n) ;
  11635. return r
  11636. }
  11637. }
  11638. var Qs = function (t) {
  11639. var e = t.originalEvent;
  11640. return e.altKey && !(e.metaKey || e.ctrlKey) && !e.shiftKey
  11641. }, tl = function (t) {
  11642. var e = t.originalEvent;
  11643. return e.altKey && !(e.metaKey || e.ctrlKey) && e.shiftKey
  11644. }, el = function (t) {
  11645. return t.target.getTargetElement().contains(document.activeElement)
  11646. }, rl = function (t) {
  11647. return !t.map.getTargetElement().hasAttribute("tabindex") || el(t)
  11648. }, nl = S, il = function (t) {
  11649. var e = t.originalEvent;
  11650. return 0 == e.button && !(Ui && Bi && e.ctrlKey)
  11651. }, ol = E, al = function (t) {
  11652. return t.type == Ga.SINGLECLICK
  11653. }, sl = function (t) {
  11654. var e = t.originalEvent;
  11655. return !e.altKey && !(e.metaKey || e.ctrlKey) && !e.shiftKey
  11656. }, ll = function (t) {
  11657. var e = t.originalEvent;
  11658. return !e.altKey && !(e.metaKey || e.ctrlKey) && e.shiftKey
  11659. }, ul = function (t) {
  11660. var e = t.originalEvent.target.tagName;
  11661. return "INPUT" !== e && "SELECT" !== e && "TEXTAREA" !== e
  11662. }, cl = function (t) {
  11663. var e = t.originalEvent;
  11664. return pt(void 0 !== e, 56), "mouse" == e.pointerType
  11665. }, hl = function (t) {
  11666. var e = t.originalEvent;
  11667. return pt(void 0 !== e, 56), e.isPrimary && 0 === e.button
  11668. }, pl = function () {
  11669. var t = function (e, r) {
  11670. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11671. t.__proto__ = e
  11672. } || function (t, e) {
  11673. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11674. })(e, r)
  11675. };
  11676. return function (e, r) {
  11677. function n() {
  11678. this.constructor = e
  11679. }
  11680. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11681. }
  11682. }(), fl = function (t) {
  11683. function e(e) {
  11684. var r = t.call(this, {stopDown: E}) || this, n = e || {};
  11685. r.kinetic_ = n.kinetic, r.lastCentroid = null, r.lastPointersCount_, r.panning_ = !1;
  11686. var i = n.condition ? n.condition : Js(sl, hl);
  11687. return r.condition_ = n.onFocusOnly ? Js(rl, i) : i, r.noKinetic_ = !1, r
  11688. }
  11689. return pl(e, t), e.prototype.handleDragEvent = function (t) {
  11690. this.panning_ || (this.panning_ = !0, this.getMap().getView().beginInteraction());
  11691. var e = this.targetPointers, r = Hs(e);
  11692. if (e.length == this.lastPointersCount_) {
  11693. if (this.kinetic_ && this.kinetic_.update(r[0], r[1]), this.lastCentroid) {
  11694. var n = [this.lastCentroid[0] - r[0], r[1] - this.lastCentroid[1]], i = t.map.getView();
  11695. Pr(n, i.getResolution()), Or(n, i.getRotation()), i.adjustCenterInternal(n)
  11696. }
  11697. } else this.kinetic_ && this.kinetic_.begin();
  11698. this.lastCentroid = r, this.lastPointersCount_ = e.length, t.originalEvent.preventDefault()
  11699. }, e.prototype.handleUpEvent = function (t) {
  11700. var e = t.map, r = e.getView();
  11701. if (0 === this.targetPointers.length) {
  11702. if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {
  11703. var n = this.kinetic_.getDistance(), i = this.kinetic_.getAngle(), o = r.getCenterInternal(),
  11704. a = e.getPixelFromCoordinateInternal(o),
  11705. s = e.getCoordinateFromPixelInternal([a[0] - n * Math.cos(i), a[1] - n * Math.sin(i)]);
  11706. r.animateInternal({center: r.getConstrainedCenter(s), duration: 500, easing: io})
  11707. }
  11708. return this.panning_ && (this.panning_ = !1, r.endInteraction()), !1
  11709. }
  11710. return this.kinetic_ && this.kinetic_.begin(), this.lastCentroid = null, !0
  11711. }, e.prototype.handleDownEvent = function (t) {
  11712. if (this.targetPointers.length > 0 && this.condition_(t)) {
  11713. var e = t.map.getView();
  11714. return this.lastCentroid = null, e.getAnimating() && e.cancelAnimations(), this.kinetic_ && this.kinetic_.begin(), this.noKinetic_ = this.targetPointers.length > 1, !0
  11715. }
  11716. return !1
  11717. }, e
  11718. }($s), dl = function () {
  11719. var t = function (e, r) {
  11720. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11721. t.__proto__ = e
  11722. } || function (t, e) {
  11723. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11724. })(e, r)
  11725. };
  11726. return function (e, r) {
  11727. function n() {
  11728. this.constructor = e
  11729. }
  11730. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11731. }
  11732. }(), gl = function (t) {
  11733. function e(e) {
  11734. var r = this, n = e || {};
  11735. return (r = t.call(this, {stopDown: E}) || this).condition_ = n.condition ? n.condition : tl, r.lastAngle_ = void 0, r.duration_ = void 0 !== n.duration ? n.duration : 250, r
  11736. }
  11737. return dl(e, t), e.prototype.handleDragEvent = function (t) {
  11738. if (cl(t)) {
  11739. var e = t.map, r = e.getView();
  11740. if (r.getConstraints().rotation !== gs) {
  11741. var n = e.getSize(), i = t.pixel, o = Math.atan2(n[1] / 2 - i[1], i[0] - n[0] / 2);
  11742. if (void 0 !== this.lastAngle_) {
  11743. var a = o - this.lastAngle_;
  11744. r.adjustRotationInternal(-a)
  11745. }
  11746. this.lastAngle_ = o
  11747. }
  11748. }
  11749. }, e.prototype.handleUpEvent = function (t) {
  11750. return !cl(t) || (t.map.getView().endInteraction(this.duration_), !1)
  11751. }, e.prototype.handleDownEvent = function (t) {
  11752. return !!cl(t) && (!(!il(t) || !this.condition_(t)) && (t.map.getView().beginInteraction(), this.lastAngle_ = void 0, !0))
  11753. }, e
  11754. }($s), yl = function () {
  11755. var t = function (e, r) {
  11756. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11757. t.__proto__ = e
  11758. } || function (t, e) {
  11759. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11760. })(e, r)
  11761. };
  11762. return function (e, r) {
  11763. function n() {
  11764. this.constructor = e
  11765. }
  11766. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11767. }
  11768. }(), ml = function (t) {
  11769. function e(e) {
  11770. var r = t.call(this) || this;
  11771. return r.geometry_ = null, r.element_ = document.createElement("div"), r.element_.style.position = "absolute", r.element_.style.pointerEvents = "auto", r.element_.className = "ol-box " + e, r.map_ = null, r.startPixel_ = null, r.endPixel_ = null, r
  11772. }
  11773. return yl(e, t), e.prototype.disposeInternal = function () {
  11774. this.setMap(null)
  11775. }, e.prototype.render_ = function () {
  11776. var t = this.startPixel_, e = this.endPixel_, r = this.element_.style;
  11777. r.left = Math.min(t[0], e[0]) + "px", r.top = Math.min(t[1], e[1]) + "px", r.width = Math.abs(e[0] - t[0]) + "px", r.height = Math.abs(e[1] - t[1]) + "px"
  11778. }, e.prototype.setMap = function (t) {
  11779. if (this.map_) {
  11780. this.map_.getOverlayContainer().removeChild(this.element_);
  11781. var e = this.element_.style;
  11782. e.left = "inherit", e.top = "inherit", e.width = "inherit", e.height = "inherit"
  11783. }
  11784. this.map_ = t, this.map_ && this.map_.getOverlayContainer().appendChild(this.element_)
  11785. }, e.prototype.setPixels = function (t, e) {
  11786. this.startPixel_ = t, this.endPixel_ = e, this.createOrUpdateGeometry(), this.render_()
  11787. }, e.prototype.createOrUpdateGeometry = function () {
  11788. var t = this.startPixel_, e = this.endPixel_,
  11789. r = [t, [t[0], e[1]], e, [e[0], t[1]]].map(this.map_.getCoordinateFromPixelInternal, this.map_);
  11790. r[4] = r[0].slice(), this.geometry_ ? this.geometry_.setCoordinates([r]) : this.geometry_ = new fi([r])
  11791. }, e.prototype.getGeometry = function () {
  11792. return this.geometry_
  11793. }, e
  11794. }(p), vl = function () {
  11795. var t = function (e, r) {
  11796. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11797. t.__proto__ = e
  11798. } || function (t, e) {
  11799. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11800. })(e, r)
  11801. };
  11802. return function (e, r) {
  11803. function n() {
  11804. this.constructor = e
  11805. }
  11806. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11807. }
  11808. }(), _l = "boxstart", bl = "boxdrag", xl = "boxend", wl = "boxcancel", Sl = function (t) {
  11809. function e(e, r, n) {
  11810. var i = t.call(this, e) || this;
  11811. return i.coordinate = r, i.mapBrowserEvent = n, i
  11812. }
  11813. return vl(e, t), e
  11814. }(c), El = function (t) {
  11815. function e(e) {
  11816. var r = t.call(this) || this, n = e || {};
  11817. return r.box_ = new ml(n.className || "ol-dragbox"), r.minArea_ = void 0 !== n.minArea ? n.minArea : 64, n.onBoxEnd && (r.onBoxEnd = n.onBoxEnd), r.startPixel_ = null, r.condition_ = n.condition ? n.condition : il, r.boxEndCondition_ = n.boxEndCondition ? n.boxEndCondition : r.defaultBoxEndCondition, r
  11818. }
  11819. return vl(e, t), e.prototype.defaultBoxEndCondition = function (t, e, r) {
  11820. var n = r[0] - e[0], i = r[1] - e[1];
  11821. return n * n + i * i >= this.minArea_
  11822. }, e.prototype.getGeometry = function () {
  11823. return this.box_.getGeometry()
  11824. }, e.prototype.handleDragEvent = function (t) {
  11825. this.box_.setPixels(this.startPixel_, t.pixel), this.dispatchEvent(new Sl(bl, t.coordinate, t))
  11826. }, e.prototype.handleUpEvent = function (t) {
  11827. this.box_.setMap(null);
  11828. var e = this.boxEndCondition_(t, this.startPixel_, t.pixel);
  11829. return e && this.onBoxEnd(t), this.dispatchEvent(new Sl(e ? xl : wl, t.coordinate, t)), !1
  11830. }, e.prototype.handleDownEvent = function (t) {
  11831. return !!this.condition_(t) && (this.startPixel_ = t.pixel, this.box_.setMap(t.map), this.box_.setPixels(this.startPixel_, this.startPixel_), this.dispatchEvent(new Sl(_l, t.coordinate, t)), !0)
  11832. }, e.prototype.onBoxEnd = function (t) {
  11833. }, e
  11834. }($s), Tl = function () {
  11835. var t = function (e, r) {
  11836. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11837. t.__proto__ = e
  11838. } || function (t, e) {
  11839. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11840. })(e, r)
  11841. };
  11842. return function (e, r) {
  11843. function n() {
  11844. this.constructor = e
  11845. }
  11846. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11847. }
  11848. }(), Cl = function (t) {
  11849. function e(e) {
  11850. var r = this, n = e || {}, i = n.condition ? n.condition : ll;
  11851. return (r = t.call(this, {
  11852. condition: i,
  11853. className: n.className || "ol-dragzoom",
  11854. minArea: n.minArea
  11855. }) || this).duration_ = void 0 !== n.duration ? n.duration : 200, r.out_ = void 0 !== n.out && n.out, r
  11856. }
  11857. return Tl(e, t), e.prototype.onBoxEnd = function (t) {
  11858. var e = this.getMap(), r = e.getView(), n = e.getSize(), i = this.getGeometry().getExtent();
  11859. if (this.out_) {
  11860. var o = r.calculateExtentInternal(n),
  11861. a = se([e.getPixelFromCoordinateInternal(_e(i)), e.getPixelFromCoordinateInternal(Oe(i))]);
  11862. Me(o, 1 / r.getResolutionForExtentInternal(a, n)), i = o
  11863. }
  11864. var s = r.getConstrainedResolution(r.getResolutionForExtentInternal(i, n)),
  11865. l = r.getConstrainedCenter(xe(i), s);
  11866. r.animateInternal({resolution: s, center: l, duration: this.duration_, easing: io})
  11867. }, e
  11868. }(El), Ol = 37, Pl = 38, Rl = 39, Il = 40, Ll = function () {
  11869. var t = function (e, r) {
  11870. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11871. t.__proto__ = e
  11872. } || function (t, e) {
  11873. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11874. })(e, r)
  11875. };
  11876. return function (e, r) {
  11877. function n() {
  11878. this.constructor = e
  11879. }
  11880. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11881. }
  11882. }(), Ml = function (t) {
  11883. function e(e) {
  11884. var r = t.call(this) || this, n = e || {};
  11885. return r.defaultCondition_ = function (t) {
  11886. return sl(t) && ul(t)
  11887. }, r.condition_ = void 0 !== n.condition ? n.condition : r.defaultCondition_, r.duration_ = void 0 !== n.duration ? n.duration : 100, r.pixelDelta_ = void 0 !== n.pixelDelta ? n.pixelDelta : 128, r
  11888. }
  11889. return Ll(e, t), e.prototype.handleEvent = function (t) {
  11890. var e = !1;
  11891. if (t.type == B) {
  11892. var r = t.originalEvent, n = r.keyCode;
  11893. if (this.condition_(t) && (n == Il || n == Ol || n == Rl || n == Pl)) {
  11894. var i = t.map.getView(), o = i.getResolution() * this.pixelDelta_, a = 0, s = 0;
  11895. n == Il ? s = -o : n == Ol ? a = -o : n == Rl ? a = o : s = o;
  11896. var l = [a, s];
  11897. Or(l, i.getRotation()), Ys(i, l, this.duration_), r.preventDefault(), e = !0
  11898. }
  11899. }
  11900. return !e
  11901. }, e
  11902. }(qs), Fl = function () {
  11903. var t = function (e, r) {
  11904. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11905. t.__proto__ = e
  11906. } || function (t, e) {
  11907. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11908. })(e, r)
  11909. };
  11910. return function (e, r) {
  11911. function n() {
  11912. this.constructor = e
  11913. }
  11914. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11915. }
  11916. }(), Al = function (t) {
  11917. function e(e) {
  11918. var r = t.call(this) || this, n = e || {};
  11919. return r.condition_ = n.condition ? n.condition : ul, r.delta_ = n.delta ? n.delta : 1, r.duration_ = void 0 !== n.duration ? n.duration : 100, r
  11920. }
  11921. return Fl(e, t), e.prototype.handleEvent = function (t) {
  11922. var e = !1;
  11923. if (t.type == B || t.type == V) {
  11924. var r = t.originalEvent, n = r.charCode;
  11925. if (this.condition_(t) && (n == "+".charCodeAt(0) || n == "-".charCodeAt(0))) {
  11926. var i = t.map, o = n == "+".charCodeAt(0) ? this.delta_ : -this.delta_;
  11927. Ws(i.getView(), o, void 0, this.duration_), r.preventDefault(), e = !0
  11928. }
  11929. }
  11930. return !e
  11931. }, e
  11932. }(qs), kl = function () {
  11933. var t = function (e, r) {
  11934. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11935. t.__proto__ = e
  11936. } || function (t, e) {
  11937. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11938. })(e, r)
  11939. };
  11940. return function (e, r) {
  11941. function n() {
  11942. this.constructor = e
  11943. }
  11944. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11945. }
  11946. }(), jl = "trackpad", Nl = "wheel", Dl = function (t) {
  11947. function e(e) {
  11948. var r = this, n = e || {};
  11949. (r = t.call(this, n) || this).totalDelta_ = 0, r.lastDelta_ = 0, r.maxDelta_ = void 0 !== n.maxDelta ? n.maxDelta : 1, r.duration_ = void 0 !== n.duration ? n.duration : 250, r.timeout_ = void 0 !== n.timeout ? n.timeout : 80, r.useAnchor_ = void 0 === n.useAnchor || n.useAnchor, r.constrainResolution_ = void 0 !== n.constrainResolution && n.constrainResolution;
  11950. var i = n.condition ? n.condition : nl;
  11951. return r.condition_ = n.onFocusOnly ? Js(rl, i) : i, r.lastAnchor_ = null, r.startTime_ = void 0, r.timeoutId_, r.mode_ = void 0, r.trackpadEventGap_ = 400, r.trackpadTimeoutId_, r.deltaPerZoom_ = 300, r
  11952. }
  11953. return kl(e, t), e.prototype.endInteraction_ = function () {
  11954. this.trackpadTimeoutId_ = void 0, this.getMap().getView().endInteraction(void 0, this.lastDelta_ ? this.lastDelta_ > 0 ? 1 : -1 : 0, this.lastAnchor_)
  11955. }, e.prototype.handleEvent = function (t) {
  11956. if (!this.condition_(t)) return !0;
  11957. if (t.type !== X) return !0;
  11958. var e, r = t.map, n = t.originalEvent;
  11959. if (n.preventDefault(), this.useAnchor_ && (this.lastAnchor_ = t.coordinate), t.type == X && (e = n.deltaY, Gi && n.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (e /= Vi), n.deltaMode === WheelEvent.DOM_DELTA_LINE && (e *= 40)), 0 === e) return !1;
  11960. this.lastDelta_ = e;
  11961. var i = Date.now();
  11962. void 0 === this.startTime_ && (this.startTime_ = i), (!this.mode_ || i - this.startTime_ > this.trackpadEventGap_) && (this.mode_ = Math.abs(e) < 4 ? jl : Nl);
  11963. var o = r.getView();
  11964. if (this.mode_ === jl && !o.getConstrainResolution() && !this.constrainResolution_) return this.trackpadTimeoutId_ ? clearTimeout(this.trackpadTimeoutId_) : (o.getAnimating() && o.cancelAnimations(), o.beginInteraction()), this.trackpadTimeoutId_ = setTimeout(this.endInteraction_.bind(this), this.timeout_), o.adjustZoom(-e / this.deltaPerZoom_, this.lastAnchor_), this.startTime_ = i, !1;
  11965. this.totalDelta_ += e;
  11966. var a = Math.max(this.timeout_ - (i - this.startTime_), 0);
  11967. return clearTimeout(this.timeoutId_), this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, r), a), !1
  11968. }, e.prototype.handleWheelZoom_ = function (t) {
  11969. var e = t.getView();
  11970. e.getAnimating() && e.cancelAnimations();
  11971. var r = -Ne(this.totalDelta_, -this.maxDelta_ * this.deltaPerZoom_, this.maxDelta_ * this.deltaPerZoom_) / this.deltaPerZoom_;
  11972. (e.getConstrainResolution() || this.constrainResolution_) && (r = r ? r > 0 ? 1 : -1 : 0), Ws(e, r, this.lastAnchor_, this.duration_), this.mode_ = void 0, this.totalDelta_ = 0, this.lastAnchor_ = null, this.startTime_ = void 0, this.timeoutId_ = void 0
  11973. }, e.prototype.setMouseAnchor = function (t) {
  11974. this.useAnchor_ = t, t || (this.lastAnchor_ = null)
  11975. }, e
  11976. }(qs), Gl = function () {
  11977. var t = function (e, r) {
  11978. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  11979. t.__proto__ = e
  11980. } || function (t, e) {
  11981. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  11982. })(e, r)
  11983. };
  11984. return function (e, r) {
  11985. function n() {
  11986. this.constructor = e
  11987. }
  11988. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  11989. }
  11990. }(), zl = function (t) {
  11991. function e(e) {
  11992. var r = this, n = e || {}, i = n;
  11993. return i.stopDown || (i.stopDown = E), (r = t.call(this, i) || this).anchor_ = null, r.lastAngle_ = void 0, r.rotating_ = !1, r.rotationDelta_ = 0, r.threshold_ = void 0 !== n.threshold ? n.threshold : .3, r.duration_ = void 0 !== n.duration ? n.duration : 250, r
  11994. }
  11995. return Gl(e, t), e.prototype.handleDragEvent = function (t) {
  11996. var e = 0, r = this.targetPointers[0], n = this.targetPointers[1],
  11997. i = Math.atan2(n.clientY - r.clientY, n.clientX - r.clientX);
  11998. if (void 0 !== this.lastAngle_) {
  11999. var o = i - this.lastAngle_;
  12000. this.rotationDelta_ += o, !this.rotating_ && Math.abs(this.rotationDelta_) > this.threshold_ && (this.rotating_ = !0), e = o
  12001. }
  12002. this.lastAngle_ = i;
  12003. var a = t.map, s = a.getView();
  12004. if (s.getConstraints().rotation !== gs) {
  12005. var l = a.getViewport().getBoundingClientRect(), u = Hs(this.targetPointers);
  12006. u[0] -= l.left, u[1] -= l.top, this.anchor_ = a.getCoordinateFromPixelInternal(u), this.rotating_ && (a.render(), s.adjustRotationInternal(e, this.anchor_))
  12007. }
  12008. }, e.prototype.handleUpEvent = function (t) {
  12009. return !(this.targetPointers.length < 2) || (t.map.getView().endInteraction(this.duration_), !1)
  12010. }, e.prototype.handleDownEvent = function (t) {
  12011. if (this.targetPointers.length >= 2) {
  12012. var e = t.map;
  12013. return this.anchor_ = null, this.lastAngle_ = void 0, this.rotating_ = !1, this.rotationDelta_ = 0, this.handlingDownUpSequence || e.getView().beginInteraction(), !0
  12014. }
  12015. return !1
  12016. }, e
  12017. }($s), Ul = function () {
  12018. var t = function (e, r) {
  12019. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  12020. t.__proto__ = e
  12021. } || function (t, e) {
  12022. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  12023. })(e, r)
  12024. };
  12025. return function (e, r) {
  12026. function n() {
  12027. this.constructor = e
  12028. }
  12029. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  12030. }
  12031. }(), Bl = function (t) {
  12032. function e(e) {
  12033. var r = this, n = e || {}, i = n;
  12034. return i.stopDown || (i.stopDown = E), (r = t.call(this, i) || this).anchor_ = null, r.duration_ = void 0 !== n.duration ? n.duration : 400, r.lastDistance_ = void 0, r.lastScaleDelta_ = 1, r
  12035. }
  12036. return Ul(e, t), e.prototype.handleDragEvent = function (t) {
  12037. var e = 1, r = this.targetPointers[0], n = this.targetPointers[1], i = r.clientX - n.clientX,
  12038. o = r.clientY - n.clientY, a = Math.sqrt(i * i + o * o);
  12039. void 0 !== this.lastDistance_ && (e = this.lastDistance_ / a), this.lastDistance_ = a;
  12040. var s = t.map, l = s.getView();
  12041. 1 != e && (this.lastScaleDelta_ = e);
  12042. var u = s.getViewport().getBoundingClientRect(), c = Hs(this.targetPointers);
  12043. c[0] -= u.left, c[1] -= u.top, this.anchor_ = s.getCoordinateFromPixelInternal(c), s.render(), l.adjustResolutionInternal(e, this.anchor_)
  12044. }, e.prototype.handleUpEvent = function (t) {
  12045. if (this.targetPointers.length < 2) {
  12046. var e = t.map.getView(), r = this.lastScaleDelta_ > 1 ? 1 : -1;
  12047. return e.endInteraction(this.duration_, r), !1
  12048. }
  12049. return !0
  12050. }, e.prototype.handleDownEvent = function (t) {
  12051. if (this.targetPointers.length >= 2) {
  12052. var e = t.map;
  12053. return this.anchor_ = null, this.lastDistance_ = void 0, this.lastScaleDelta_ = 1, this.handlingDownUpSequence || e.getView().beginInteraction(), !0
  12054. }
  12055. return !1
  12056. }, e
  12057. }($s);
  12058. function Vl(t) {
  12059. var e = t || {}, r = new ht, n = new _o(-.005, .05, 100);
  12060. return (void 0 === e.altShiftDragRotate || e.altShiftDragRotate) && r.push(new gl), (void 0 === e.doubleClickZoom || e.doubleClickZoom) && r.push(new Zs({
  12061. delta: e.zoomDelta,
  12062. duration: e.zoomDuration
  12063. })), (void 0 === e.dragPan || e.dragPan) && r.push(new fl({
  12064. onFocusOnly: e.onFocusOnly,
  12065. kinetic: n
  12066. })), (void 0 === e.pinchRotate || e.pinchRotate) && r.push(new zl), (void 0 === e.pinchZoom || e.pinchZoom) && r.push(new Bl({duration: e.zoomDuration})), (void 0 === e.keyboard || e.keyboard) && (r.push(new Ml), r.push(new Al({
  12067. delta: e.zoomDelta,
  12068. duration: e.zoomDuration
  12069. }))), (void 0 === e.mouseWheelZoom || e.mouseWheelZoom) && r.push(new Dl({
  12070. onFocusOnly: e.onFocusOnly,
  12071. duration: e.zoomDuration
  12072. })), (void 0 === e.shiftDragZoom || e.shiftDragZoom) && r.push(new Cl({duration: e.zoomDuration})), r
  12073. }
  12074. var Yl = function () {
  12075. var t = function (e, r) {
  12076. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  12077. t.__proto__ = e
  12078. } || function (t, e) {
  12079. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  12080. })(e, r)
  12081. };
  12082. return function (e, r) {
  12083. function n() {
  12084. this.constructor = e
  12085. }
  12086. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  12087. }
  12088. }(), Wl = function (t) {
  12089. function e(e) {
  12090. return (e = O({}, e)).controls || (e.controls = Us()), e.interactions || (e.interactions = Vl({onFocusOnly: !0})), t.call(this, e) || this
  12091. }
  12092. return Yl(e, t), e.prototype.createRenderer = function () {
  12093. return new La(this)
  12094. }, e
  12095. }(Ms), ql = "bottom-left", Xl = "bottom-center", Zl = "bottom-right", Kl = "center-left", Hl = "center-center",
  12096. $l = "center-right", Jl = "top-left", Ql = "top-center", tu = "top-right", eu = function () {
  12097. var t = function (e, r) {
  12098. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  12099. t.__proto__ = e
  12100. } || function (t, e) {
  12101. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  12102. })(e, r)
  12103. };
  12104. return function (e, r) {
  12105. function n() {
  12106. this.constructor = e
  12107. }
  12108. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  12109. }
  12110. }(), ru = "element", nu = "map", iu = "offset", ou = "position", au = "positioning", su = function (t) {
  12111. function e(e) {
  12112. var r = t.call(this) || this;
  12113. r.options = e, r.id = e.id, r.insertFirst = void 0 === e.insertFirst || e.insertFirst, r.stopEvent = void 0 === e.stopEvent || e.stopEvent, r.element = document.createElement("div"), r.element.className = void 0 !== e.className ? e.className : "ol-overlay-container ol-selectable", r.element.style.position = "absolute", r.element.style.pointerEvents = "auto";
  12114. var n = e.autoPan;
  12115. return n && "object" != typeof n && (n = {
  12116. animation: e.autoPanAnimation,
  12117. margin: e.autoPanMargin
  12118. }), r.autoPan = n || !1, r.rendered = {
  12119. transform_: "",
  12120. visible: !0
  12121. }, r.mapPostrenderListenerKey = null, r.addEventListener(it(ru), r.handleElementChanged), r.addEventListener(it(nu), r.handleMapChanged), r.addEventListener(it(iu), r.handleOffsetChanged), r.addEventListener(it(ou), r.handlePositionChanged), r.addEventListener(it(au), r.handlePositioningChanged), void 0 !== e.element && r.setElement(e.element), r.setOffset(void 0 !== e.offset ? e.offset : [0, 0]), r.setPositioning(void 0 !== e.positioning ? e.positioning : Jl), void 0 !== e.position && r.setPosition(e.position), r
  12122. }
  12123. return eu(e, t), e.prototype.getElement = function () {
  12124. return this.get(ru)
  12125. }, e.prototype.getId = function () {
  12126. return this.id
  12127. }, e.prototype.getMap = function () {
  12128. return this.get(nu)
  12129. }, e.prototype.getOffset = function () {
  12130. return this.get(iu)
  12131. }, e.prototype.getPosition = function () {
  12132. return this.get(ou)
  12133. }, e.prototype.getPositioning = function () {
  12134. return this.get(au)
  12135. }, e.prototype.handleElementChanged = function () {
  12136. go(this.element);
  12137. var t = this.getElement();
  12138. t && this.element.appendChild(t)
  12139. }, e.prototype.handleMapChanged = function () {
  12140. this.mapPostrenderListenerKey && (fo(this.element), H(this.mapPostrenderListenerKey), this.mapPostrenderListenerKey = null);
  12141. var t = this.getMap();
  12142. if (t) {
  12143. this.mapPostrenderListenerKey = Z(t, qa, this.render, this), this.updatePixelPosition();
  12144. var e = this.stopEvent ? t.getOverlayContainerStopEvent() : t.getOverlayContainer();
  12145. this.insertFirst ? e.insertBefore(this.element, e.childNodes[0] || null) : e.appendChild(this.element), this.performAutoPan()
  12146. }
  12147. }, e.prototype.render = function () {
  12148. this.updatePixelPosition()
  12149. }, e.prototype.handleOffsetChanged = function () {
  12150. this.updatePixelPosition()
  12151. }, e.prototype.handlePositionChanged = function () {
  12152. this.updatePixelPosition(), this.performAutoPan()
  12153. }, e.prototype.handlePositioningChanged = function () {
  12154. this.updatePixelPosition()
  12155. }, e.prototype.setElement = function (t) {
  12156. this.set(ru, t)
  12157. }, e.prototype.setMap = function (t) {
  12158. this.set(nu, t)
  12159. }, e.prototype.setOffset = function (t) {
  12160. this.set(iu, t)
  12161. }, e.prototype.setPosition = function (t) {
  12162. this.set(ou, t)
  12163. }, e.prototype.performAutoPan = function () {
  12164. this.autoPan && this.panIntoView(this.autoPan)
  12165. }, e.prototype.panIntoView = function (t) {
  12166. var e = this.getMap();
  12167. if (e && e.getTargetElement() && this.get(ou)) {
  12168. var r = this.getRect(e.getTargetElement(), e.getSize()), n = this.getElement(),
  12169. i = this.getRect(n, [co(n), ho(n)]), o = t || {}, a = void 0 === o.margin ? 20 : o.margin;
  12170. if (!te(r, i)) {
  12171. var s = i[0] - r[0], l = r[2] - i[2], u = i[1] - r[1], c = r[3] - i[3], h = [0, 0];
  12172. if (s < 0 ? h[0] = s - a : l < 0 && (h[0] = Math.abs(l) + a), u < 0 ? h[1] = u - a : c < 0 && (h[1] = Math.abs(c) + a), 0 !== h[0] || 0 !== h[1]) {
  12173. var p = e.getView().getCenterInternal(), f = e.getPixelFromCoordinateInternal(p);
  12174. if (!f) return;
  12175. var d = [f[0] + h[0], f[1] + h[1]], g = o.animation || {};
  12176. e.getView().animateInternal({
  12177. center: e.getCoordinateFromPixelInternal(d),
  12178. duration: g.duration,
  12179. easing: g.easing
  12180. })
  12181. }
  12182. }
  12183. }
  12184. }, e.prototype.getRect = function (t, e) {
  12185. var r = t.getBoundingClientRect(), n = r.left + window.pageXOffset, i = r.top + window.pageYOffset;
  12186. return [n, i, n + e[0], i + e[1]]
  12187. }, e.prototype.setPositioning = function (t) {
  12188. this.set(au, t)
  12189. }, e.prototype.setVisible = function (t) {
  12190. this.rendered.visible !== t && (this.element.style.display = t ? "" : "none", this.rendered.visible = t)
  12191. }, e.prototype.updatePixelPosition = function () {
  12192. var t = this.getMap(), e = this.getPosition();
  12193. if (t && t.isRendered() && e) {
  12194. var r = t.getPixelFromCoordinate(e), n = t.getSize();
  12195. this.updateRenderedPosition(r, n)
  12196. } else this.setVisible(!1)
  12197. }, e.prototype.updateRenderedPosition = function (t, e) {
  12198. var r = this.element.style, n = this.getOffset(), i = this.getPositioning();
  12199. this.setVisible(!0);
  12200. var o = Math.round(t[0] + n[0]) + "px", a = Math.round(t[1] + n[1]) + "px", s = "0%", l = "0%";
  12201. i == Zl || i == $l || i == tu ? s = "-100%" : i != Xl && i != Hl && i != Ql || (s = "-50%"), i == ql || i == Xl || i == Zl ? l = "-100%" : i != Kl && i != Hl && i != $l || (l = "-50%");
  12202. var u = "translate(" + s + ", " + l + ") translate(" + o + ", " + a + ")";
  12203. this.rendered.transform_ != u && (this.rendered.transform_ = u, r.transform = u, r.msTransform = u)
  12204. }, e.prototype.getOptions = function () {
  12205. return this.options
  12206. }, e
  12207. }(ot), lu = function () {
  12208. function t(t) {
  12209. this.highWaterMark = void 0 !== t ? t : 2048, this.count_ = 0, this.entries_ = {}, this.oldest_ = null, this.newest_ = null
  12210. }
  12211. return t.prototype.canExpireCache = function () {
  12212. return this.highWaterMark > 0 && this.getCount() > this.highWaterMark
  12213. }, t.prototype.clear = function () {
  12214. this.count_ = 0, this.entries_ = {}, this.oldest_ = null, this.newest_ = null
  12215. }, t.prototype.containsKey = function (t) {
  12216. return this.entries_.hasOwnProperty(t)
  12217. }, t.prototype.forEach = function (t) {
  12218. for (var e = this.oldest_; e;) t(e.value_, e.key_, this), e = e.newer
  12219. }, t.prototype.get = function (t, e) {
  12220. var r = this.entries_[t];
  12221. return pt(void 0 !== r, 15), r === this.newest_ || (r === this.oldest_ ? (this.oldest_ = this.oldest_.newer, this.oldest_.older = null) : (r.newer.older = r.older, r.older.newer = r.newer), r.newer = null, r.older = this.newest_, this.newest_.newer = r, this.newest_ = r), r.value_
  12222. }, t.prototype.remove = function (t) {
  12223. var e = this.entries_[t];
  12224. return pt(void 0 !== e, 15), e === this.newest_ ? (this.newest_ = e.older, this.newest_ && (this.newest_.newer = null)) : e === this.oldest_ ? (this.oldest_ = e.newer, this.oldest_ && (this.oldest_.older = null)) : (e.newer.older = e.older, e.older.newer = e.newer), delete this.entries_[t], --this.count_, e.value_
  12225. }, t.prototype.getCount = function () {
  12226. return this.count_
  12227. }, t.prototype.getKeys = function () {
  12228. var t, e = new Array(this.count_), r = 0;
  12229. for (t = this.newest_; t; t = t.older) e[r++] = t.key_;
  12230. return e
  12231. }, t.prototype.getValues = function () {
  12232. var t, e = new Array(this.count_), r = 0;
  12233. for (t = this.newest_; t; t = t.older) e[r++] = t.value_;
  12234. return e
  12235. }, t.prototype.peekLast = function () {
  12236. return this.oldest_.value_
  12237. }, t.prototype.peekLastKey = function () {
  12238. return this.oldest_.key_
  12239. }, t.prototype.peekFirstKey = function () {
  12240. return this.newest_.key_
  12241. }, t.prototype.pop = function () {
  12242. var t = this.oldest_;
  12243. return delete this.entries_[t.key_], t.newer && (t.newer.older = null), this.oldest_ = t.newer, this.oldest_ || (this.newest_ = null), --this.count_, t.value_
  12244. }, t.prototype.replace = function (t, e) {
  12245. this.get(t), this.entries_[t].value_ = e
  12246. }, t.prototype.set = function (t, e) {
  12247. pt(!(t in this.entries_), 16);
  12248. var r = {key_: t, newer: null, older: this.newest_, value_: e};
  12249. this.newest_ ? this.newest_.newer = r : this.oldest_ = r, this.newest_ = r, this.entries_[t] = r, ++this.count_
  12250. }, t.prototype.setSize = function (t) {
  12251. this.highWaterMark = t
  12252. }, t
  12253. }();
  12254. function uu(t, e, r, n) {
  12255. return void 0 !== n ? (n[0] = t, n[1] = e, n[2] = r, n) : [t, e, r]
  12256. }
  12257. function cu(t, e, r) {
  12258. return t + "/" + e + "/" + r
  12259. }
  12260. function hu(t) {
  12261. return cu(t[0], t[1], t[2])
  12262. }
  12263. function pu(t) {
  12264. return t.split("/").map(Number)
  12265. }
  12266. function fu(t) {
  12267. return (t[1] << t[0]) + t[2]
  12268. }
  12269. function du(t, e) {
  12270. var r = t[0], n = t[1], i = t[2];
  12271. if (e.getMinZoom() > r || r > e.getMaxZoom()) return !1;
  12272. var o = e.getFullTileRange(r);
  12273. return !o || o.containsXY(n, i)
  12274. }
  12275. var gu = function () {
  12276. var t = function (e, r) {
  12277. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  12278. t.__proto__ = e
  12279. } || function (t, e) {
  12280. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  12281. })(e, r)
  12282. };
  12283. return function (e, r) {
  12284. function n() {
  12285. this.constructor = e
  12286. }
  12287. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  12288. }
  12289. }(), yu = function (t) {
  12290. function e() {
  12291. return null !== t && t.apply(this, arguments) || this
  12292. }
  12293. return gu(e, t), e.prototype.expireCache = function (t) {
  12294. for (; this.canExpireCache();) {
  12295. if (this.peekLast().getKey() in t) break;
  12296. this.pop().release()
  12297. }
  12298. }, e.prototype.pruneExceptNewestZ = function () {
  12299. if (0 !== this.getCount()) {
  12300. var t = pu(this.peekFirstKey())[0];
  12301. this.forEach(function (e) {
  12302. e.tileCoord[0] !== t && (this.remove(hu(e.tileCoord)), e.release())
  12303. }.bind(this))
  12304. }
  12305. }, e
  12306. }(lu), mu = function () {
  12307. function t(t, e, r, n) {
  12308. this.minX = t, this.maxX = e, this.minY = r, this.maxY = n
  12309. }
  12310. return t.prototype.contains = function (t) {
  12311. return this.containsXY(t[1], t[2])
  12312. }, t.prototype.containsTileRange = function (t) {
  12313. return this.minX <= t.minX && t.maxX <= this.maxX && this.minY <= t.minY && t.maxY <= this.maxY
  12314. }, t.prototype.containsXY = function (t, e) {
  12315. return this.minX <= t && t <= this.maxX && this.minY <= e && e <= this.maxY
  12316. }, t.prototype.equals = function (t) {
  12317. return this.minX == t.minX && this.minY == t.minY && this.maxX == t.maxX && this.maxY == t.maxY
  12318. }, t.prototype.extend = function (t) {
  12319. t.minX < this.minX && (this.minX = t.minX), t.maxX > this.maxX && (this.maxX = t.maxX), t.minY < this.minY && (this.minY = t.minY), t.maxY > this.maxY && (this.maxY = t.maxY)
  12320. }, t.prototype.getHeight = function () {
  12321. return this.maxY - this.minY + 1
  12322. }, t.prototype.getSize = function () {
  12323. return [this.getWidth(), this.getHeight()]
  12324. }, t.prototype.getWidth = function () {
  12325. return this.maxX - this.minX + 1
  12326. }, t.prototype.intersects = function (t) {
  12327. return this.minX <= t.maxX && this.maxX >= t.minX && this.minY <= t.maxY && this.maxY >= t.minY
  12328. }, t
  12329. }();
  12330. function vu(t, e, r, n, i) {
  12331. return void 0 !== i ? (i.minX = t, i.maxX = e, i.minY = r, i.maxY = n, i) : new mu(t, e, r, n)
  12332. }
  12333. var _u = mu, bu = function () {
  12334. var t = function (e, r) {
  12335. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  12336. t.__proto__ = e
  12337. } || function (t, e) {
  12338. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  12339. })(e, r)
  12340. };
  12341. return function (e, r) {
  12342. function n() {
  12343. this.constructor = e
  12344. }
  12345. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  12346. }
  12347. }(), xu = [], wu = function (t) {
  12348. function e(e, r, n, i) {
  12349. var o = t.call(this, e, r, {transition: 0}) || this;
  12350. return o.context_ = {}, o.executorGroups = {}, o.declutterExecutorGroups = {}, o.loadingSourceTiles = 0, o.errorSourceTileKeys = {}, o.hitDetectionImageData = {}, o.replayState_ = {}, o.sourceTiles = null, o.wantedResolution, o.getSourceTiles = i.bind(void 0, o), o.sourceZ = -1, o.hifi = !1, o.wrappedTileCoord = n, o
  12351. }
  12352. return bu(e, t), e.prototype.getContext = function (t) {
  12353. var e = o(t);
  12354. return e in this.context_ || (this.context_[e] = uo(1, 1, xu)), this.context_[e]
  12355. }, e.prototype.hasContext = function (t) {
  12356. return o(t) in this.context_
  12357. }, e.prototype.getImage = function (t) {
  12358. return this.hasContext(t) ? this.getContext(t).canvas : null
  12359. }, e.prototype.getReplayState = function (t) {
  12360. var e = o(t);
  12361. return e in this.replayState_ || (this.replayState_[e] = {
  12362. dirty: !1,
  12363. renderedRenderOrder: null,
  12364. renderedResolution: NaN,
  12365. renderedRevision: -1,
  12366. renderedTileResolution: NaN,
  12367. renderedTileRevision: -1,
  12368. renderedZ: -1,
  12369. renderedTileZ: -1
  12370. }), this.replayState_[e]
  12371. }, e.prototype.load = function () {
  12372. this.getSourceTiles()
  12373. }, e.prototype.release = function () {
  12374. for (var e in this.context_) xu.push(this.context_[e].canvas), delete this.context_[e];
  12375. t.prototype.release.call(this)
  12376. }, e
  12377. }(lo), Su = function () {
  12378. var t = function (e, r) {
  12379. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  12380. t.__proto__ = e
  12381. } || function (t, e) {
  12382. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  12383. })(e, r)
  12384. };
  12385. return function (e, r) {
  12386. function n() {
  12387. this.constructor = e
  12388. }
  12389. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  12390. }
  12391. }(), Eu = function (t) {
  12392. function e(e, r, n, i, o, a) {
  12393. var s = t.call(this, e, r, a) || this;
  12394. return s.extent = null, s.format_ = i, s.features_ = null, s.loader_, s.projection = null, s.resolution, s.tileLoadFunction_ = o, s.url_ = n, s.key = n, s
  12395. }
  12396. return Su(e, t), e.prototype.getFormat = function () {
  12397. return this.format_
  12398. }, e.prototype.getFeatures = function () {
  12399. return this.features_
  12400. }, e.prototype.load = function () {
  12401. this.state == Ji && (this.setState(Qi), this.tileLoadFunction_(this, this.url_), this.loader_ && this.loader_(this.extent, this.resolution, this.projection))
  12402. }, e.prototype.onLoad = function (t, e) {
  12403. this.setFeatures(t)
  12404. }, e.prototype.onError = function () {
  12405. this.setState(eo)
  12406. }, e.prototype.setFeatures = function (t) {
  12407. this.features_ = t, this.setState(to)
  12408. }, e.prototype.setLoader = function (t) {
  12409. this.loader_ = t
  12410. }, e
  12411. }(lo);
  12412. function Tu(t) {
  12413. return Array.isArray(t) ? Ro(t) : t
  12414. }
  12415. var Cu = "arraybuffer", Ou = "json", Pu = "text", Ru = "xml", Iu = !1;
  12416. function Lu(t, e, r, n, i, o, a) {
  12417. var s = new XMLHttpRequest;
  12418. s.open("GET", "function" == typeof t ? t(r, n, i) : t, !0), e.getType() == Cu && (s.responseType = "arraybuffer"), s.withCredentials = Iu, s.onload = function (t) {
  12419. if (!s.status || s.status >= 200 && s.status < 300) {
  12420. var n = e.getType(), l = void 0;
  12421. n == Ou || n == Pu ? l = s.responseText : n == Ru ? (l = s.responseXML) || (l = (new DOMParser).parseFromString(s.responseText, "application/xml")) : n == Cu && (l = s.response), l ? o(e.readFeatures(l, {
  12422. extent: r,
  12423. featureProjection: i
  12424. }), e.readProjection(l)) : a()
  12425. } else a()
  12426. }, s.onerror = a, s.send()
  12427. }
  12428. function Mu(t, e) {
  12429. return function (r, n, i, o, a) {
  12430. var s = this;
  12431. Lu(t, e, r, n, i, (function (t, e) {
  12432. void 0 !== o && o(t), s.addFeatures(t)
  12433. }), a || T)
  12434. }
  12435. }
  12436. function Fu(t, e) {
  12437. return [[-1 / 0, -1 / 0, 1 / 0, 1 / 0]]
  12438. }
  12439. function Au(t, e, r, n) {
  12440. var i = document.createElement("script"), a = "olc_" + o(e);
  12441. function s() {
  12442. delete window[a], i.parentNode.removeChild(i)
  12443. }
  12444. i.async = !0, i.src = t + (-1 == t.indexOf("?") ? "?" : "&") + (n || "callback") + "=" + a;
  12445. var l = setTimeout((function () {
  12446. s(), r && r()
  12447. }), 1e4);
  12448. window[a] = function (t) {
  12449. clearTimeout(l), s(), e(t)
  12450. }, document.getElementsByTagName("head")[0].appendChild(i)
  12451. }
  12452. var ku = function () {
  12453. function t() {
  12454. }
  12455. return t.prototype.drawCustom = function (t, e, r) {
  12456. }, t.prototype.drawGeometry = function (t) {
  12457. }, t.prototype.setStyle = function (t) {
  12458. }, t.prototype.drawCircle = function (t, e) {
  12459. }, t.prototype.drawFeature = function (t, e) {
  12460. }, t.prototype.drawGeometryCollection = function (t, e) {
  12461. }, t.prototype.drawLineString = function (t, e) {
  12462. }, t.prototype.drawMultiLineString = function (t, e) {
  12463. }, t.prototype.drawMultiPoint = function (t, e) {
  12464. }, t.prototype.drawMultiPolygon = function (t, e) {
  12465. }, t.prototype.drawPoint = function (t, e) {
  12466. }, t.prototype.drawPolygon = function (t, e) {
  12467. }, t.prototype.drawText = function (t, e) {
  12468. }, t.prototype.setFillStrokeStyle = function (t, e) {
  12469. }, t.prototype.setImageStyle = function (t, e) {
  12470. }, t.prototype.setTextStyle = function (t, e) {
  12471. }, t
  12472. }(), ju = function () {
  12473. var t = function (e, r) {
  12474. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  12475. t.__proto__ = e
  12476. } || function (t, e) {
  12477. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  12478. })(e, r)
  12479. };
  12480. return function (e, r) {
  12481. function n() {
  12482. this.constructor = e
  12483. }
  12484. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  12485. }
  12486. }(), Nu = function (t) {
  12487. function e(e, r, n, i, o, a, s) {
  12488. var l = t.call(this) || this;
  12489. return l.context_ = e, l.pixelRatio_ = r, l.extent_ = n, l.transform_ = i, l.viewRotation_ = o, l.squaredTolerance_ = a, l.userTransform_ = s, l.contextFillState_ = null, l.contextStrokeState_ = null, l.contextTextState_ = null, l.fillState_ = null, l.strokeState_ = null, l.image_ = null, l.imageAnchorX_ = 0, l.imageAnchorY_ = 0, l.imageHeight_ = 0, l.imageOpacity_ = 0, l.imageOriginX_ = 0, l.imageOriginY_ = 0, l.imageRotateWithView_ = !1, l.imageRotation_ = 0, l.imageScale_ = [0, 0], l.imageWidth_ = 0, l.text_ = "", l.textOffsetX_ = 0, l.textOffsetY_ = 0, l.textRotateWithView_ = !1, l.textRotation_ = 0, l.textScale_ = [0, 0], l.textFillState_ = null, l.textStrokeState_ = null, l.textState_ = null, l.pixelCoordinates_ = [], l.tmpLocalTransform_ = [1, 0, 0, 1, 0, 0], l
  12490. }
  12491. return ju(e, t), e.prototype.drawImages_ = function (t, e, r, n) {
  12492. if (this.image_) {
  12493. var i = ln(t, e, r, 2, this.transform_, this.pixelCoordinates_), o = this.context_,
  12494. a = this.tmpLocalTransform_, s = o.globalAlpha;
  12495. 1 != this.imageOpacity_ && (o.globalAlpha = s * this.imageOpacity_);
  12496. var l = this.imageRotation_;
  12497. this.imageRotateWithView_ && (l += this.viewRotation_);
  12498. for (var u = 0, c = i.length; u < c; u += 2) {
  12499. var h = i[u] - this.imageAnchorX_, p = i[u + 1] - this.imageAnchorY_;
  12500. if (0 !== l || 1 != this.imageScale_[0] || 1 != this.imageScale_[1]) {
  12501. var f = h + this.imageAnchorX_, d = p + this.imageAnchorY_;
  12502. kt(a, f, d, 1, 1, l, -f, -d), o.setTransform.apply(o, a), o.translate(f, d), o.scale(this.imageScale_[0], this.imageScale_[1]), o.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, -this.imageAnchorX_, -this.imageAnchorY_, this.imageWidth_, this.imageHeight_), o.setTransform(1, 0, 0, 1, 0, 0)
  12503. } else o.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, h, p, this.imageWidth_, this.imageHeight_)
  12504. }
  12505. 1 != this.imageOpacity_ && (o.globalAlpha = s)
  12506. }
  12507. }, e.prototype.drawText_ = function (t, e, r, n) {
  12508. if (this.textState_ && "" !== this.text_) {
  12509. this.textFillState_ && this.setContextFillState_(this.textFillState_), this.textStrokeState_ && this.setContextStrokeState_(this.textStrokeState_), this.setContextTextState_(this.textState_);
  12510. var i = ln(t, e, r, n, this.transform_, this.pixelCoordinates_), o = this.context_, a = this.textRotation_;
  12511. for (this.textRotateWithView_ && (a += this.viewRotation_); e < r; e += n) {
  12512. var s = i[e] + this.textOffsetX_, l = i[e + 1] + this.textOffsetY_;
  12513. if (0 !== a || 1 != this.textScale_[0] || 1 != this.textScale_[1]) {
  12514. var u = kt(this.tmpLocalTransform_, s, l, 1, 1, a, -s, -l);
  12515. o.setTransform.apply(o, u), o.translate(s, l), o.scale(this.textScale_[0], this.textScale_[1]), this.textStrokeState_ && o.strokeText(this.text_, 0, 0), this.textFillState_ && o.fillText(this.text_, 0, 0), o.setTransform(1, 0, 0, 1, 0, 0)
  12516. } else this.textStrokeState_ && o.strokeText(this.text_, s, l), this.textFillState_ && o.fillText(this.text_, s, l)
  12517. }
  12518. }
  12519. }, e.prototype.moveToLineTo_ = function (t, e, r, n, i) {
  12520. var o = this.context_, a = ln(t, e, r, n, this.transform_, this.pixelCoordinates_);
  12521. o.moveTo(a[0], a[1]);
  12522. var s = a.length;
  12523. i && (s -= 2);
  12524. for (var l = 2; l < s; l += 2) o.lineTo(a[l], a[l + 1]);
  12525. return i && o.closePath(), r
  12526. }, e.prototype.drawRings_ = function (t, e, r, n) {
  12527. for (var i = 0, o = r.length; i < o; ++i) e = this.moveToLineTo_(t, e, r[i], n, !0);
  12528. return e
  12529. }, e.prototype.drawCircle = function (t) {
  12530. if (Re(this.extent_, t.getExtent())) {
  12531. if (this.fillState_ || this.strokeState_) {
  12532. this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
  12533. var e = mn(t, this.transform_, this.pixelCoordinates_), r = e[2] - e[0], n = e[3] - e[1],
  12534. i = Math.sqrt(r * r + n * n), o = this.context_;
  12535. o.beginPath(), o.arc(e[0], e[1], i, 0, 2 * Math.PI), this.fillState_ && o.fill(), this.strokeState_ && o.stroke()
  12536. }
  12537. "" !== this.text_ && this.drawText_(t.getCenter(), 0, 2, 2)
  12538. }
  12539. }, e.prototype.setStyle = function (t) {
  12540. this.setFillStrokeStyle(t.getFill(), t.getStroke()), this.setImageStyle(t.getImage()), this.setTextStyle(t.getText())
  12541. }, e.prototype.setTransform = function (t) {
  12542. this.transform_ = t
  12543. }, e.prototype.drawGeometry = function (t) {
  12544. switch (t.getType()) {
  12545. case bt.POINT:
  12546. this.drawPoint(t);
  12547. break;
  12548. case bt.LINE_STRING:
  12549. this.drawLineString(t);
  12550. break;
  12551. case bt.POLYGON:
  12552. this.drawPolygon(t);
  12553. break;
  12554. case bt.MULTI_POINT:
  12555. this.drawMultiPoint(t);
  12556. break;
  12557. case bt.MULTI_LINE_STRING:
  12558. this.drawMultiLineString(t);
  12559. break;
  12560. case bt.MULTI_POLYGON:
  12561. this.drawMultiPolygon(t);
  12562. break;
  12563. case bt.GEOMETRY_COLLECTION:
  12564. this.drawGeometryCollection(t);
  12565. break;
  12566. case bt.CIRCLE:
  12567. this.drawCircle(t)
  12568. }
  12569. }, e.prototype.drawFeature = function (t, e) {
  12570. var r = e.getGeometryFunction()(t);
  12571. r && Re(this.extent_, r.getExtent()) && (this.setStyle(e), this.drawGeometry(r))
  12572. }, e.prototype.drawGeometryCollection = function (t) {
  12573. for (var e = t.getGeometriesArray(), r = 0, n = e.length; r < n; ++r) this.drawGeometry(e[r])
  12574. }, e.prototype.drawPoint = function (t) {
  12575. this.squaredTolerance_ && (t = t.simplifyTransformed(this.squaredTolerance_, this.userTransform_));
  12576. var e = t.getFlatCoordinates(), r = t.getStride();
  12577. this.image_ && this.drawImages_(e, 0, e.length, r), "" !== this.text_ && this.drawText_(e, 0, e.length, r)
  12578. }, e.prototype.drawMultiPoint = function (t) {
  12579. this.squaredTolerance_ && (t = t.simplifyTransformed(this.squaredTolerance_, this.userTransform_));
  12580. var e = t.getFlatCoordinates(), r = t.getStride();
  12581. this.image_ && this.drawImages_(e, 0, e.length, r), "" !== this.text_ && this.drawText_(e, 0, e.length, r)
  12582. }, e.prototype.drawLineString = function (t) {
  12583. if (this.squaredTolerance_ && (t = t.simplifyTransformed(this.squaredTolerance_, this.userTransform_)), Re(this.extent_, t.getExtent())) {
  12584. if (this.strokeState_) {
  12585. this.setContextStrokeState_(this.strokeState_);
  12586. var e = this.context_, r = t.getFlatCoordinates();
  12587. e.beginPath(), this.moveToLineTo_(r, 0, r.length, t.getStride(), !1), e.stroke()
  12588. }
  12589. if ("" !== this.text_) {
  12590. var n = t.getFlatMidpoint();
  12591. this.drawText_(n, 0, 2, 2)
  12592. }
  12593. }
  12594. }, e.prototype.drawMultiLineString = function (t) {
  12595. this.squaredTolerance_ && (t = t.simplifyTransformed(this.squaredTolerance_, this.userTransform_));
  12596. var e = t.getExtent();
  12597. if (Re(this.extent_, e)) {
  12598. if (this.strokeState_) {
  12599. this.setContextStrokeState_(this.strokeState_);
  12600. var r = this.context_, n = t.getFlatCoordinates(), i = 0, o = t.getEnds(), a = t.getStride();
  12601. r.beginPath();
  12602. for (var s = 0, l = o.length; s < l; ++s) i = this.moveToLineTo_(n, i, o[s], a, !1);
  12603. r.stroke()
  12604. }
  12605. if ("" !== this.text_) {
  12606. var u = t.getFlatMidpoints();
  12607. this.drawText_(u, 0, u.length, 2)
  12608. }
  12609. }
  12610. }, e.prototype.drawPolygon = function (t) {
  12611. if (this.squaredTolerance_ && (t = t.simplifyTransformed(this.squaredTolerance_, this.userTransform_)), Re(this.extent_, t.getExtent())) {
  12612. if (this.strokeState_ || this.fillState_) {
  12613. this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
  12614. var e = this.context_;
  12615. e.beginPath(), this.drawRings_(t.getOrientedFlatCoordinates(), 0, t.getEnds(), t.getStride()), this.fillState_ && e.fill(), this.strokeState_ && e.stroke()
  12616. }
  12617. if ("" !== this.text_) {
  12618. var r = t.getFlatInteriorPoint();
  12619. this.drawText_(r, 0, 2, 2)
  12620. }
  12621. }
  12622. }, e.prototype.drawMultiPolygon = function (t) {
  12623. if (this.squaredTolerance_ && (t = t.simplifyTransformed(this.squaredTolerance_, this.userTransform_)), Re(this.extent_, t.getExtent())) {
  12624. if (this.strokeState_ || this.fillState_) {
  12625. this.fillState_ && this.setContextFillState_(this.fillState_), this.strokeState_ && this.setContextStrokeState_(this.strokeState_);
  12626. var e = this.context_, r = t.getOrientedFlatCoordinates(), n = 0, i = t.getEndss(), o = t.getStride();
  12627. e.beginPath();
  12628. for (var a = 0, s = i.length; a < s; ++a) {
  12629. var l = i[a];
  12630. n = this.drawRings_(r, n, l, o)
  12631. }
  12632. this.fillState_ && e.fill(), this.strokeState_ && e.stroke()
  12633. }
  12634. if ("" !== this.text_) {
  12635. var u = t.getFlatInteriorPoints();
  12636. this.drawText_(u, 0, u.length, 2)
  12637. }
  12638. }
  12639. }, e.prototype.setContextFillState_ = function (t) {
  12640. var e = this.context_, r = this.contextFillState_;
  12641. r ? r.fillStyle != t.fillStyle && (r.fillStyle = t.fillStyle, e.fillStyle = t.fillStyle) : (e.fillStyle = t.fillStyle, this.contextFillState_ = {fillStyle: t.fillStyle})
  12642. }, e.prototype.setContextStrokeState_ = function (t) {
  12643. var e = this.context_, r = this.contextStrokeState_;
  12644. r ? (r.lineCap != t.lineCap && (r.lineCap = t.lineCap, e.lineCap = t.lineCap), e.setLineDash && (b(r.lineDash, t.lineDash) || e.setLineDash(r.lineDash = t.lineDash), r.lineDashOffset != t.lineDashOffset && (r.lineDashOffset = t.lineDashOffset, e.lineDashOffset = t.lineDashOffset)), r.lineJoin != t.lineJoin && (r.lineJoin = t.lineJoin, e.lineJoin = t.lineJoin), r.lineWidth != t.lineWidth && (r.lineWidth = t.lineWidth, e.lineWidth = t.lineWidth), r.miterLimit != t.miterLimit && (r.miterLimit = t.miterLimit, e.miterLimit = t.miterLimit), r.strokeStyle != t.strokeStyle && (r.strokeStyle = t.strokeStyle, e.strokeStyle = t.strokeStyle)) : (e.lineCap = t.lineCap, e.setLineDash && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.lineJoin = t.lineJoin, e.lineWidth = t.lineWidth, e.miterLimit = t.miterLimit, e.strokeStyle = t.strokeStyle, this.contextStrokeState_ = {
  12645. lineCap: t.lineCap,
  12646. lineDash: t.lineDash,
  12647. lineDashOffset: t.lineDashOffset,
  12648. lineJoin: t.lineJoin,
  12649. lineWidth: t.lineWidth,
  12650. miterLimit: t.miterLimit,
  12651. strokeStyle: t.strokeStyle
  12652. })
  12653. }, e.prototype.setContextTextState_ = function (t) {
  12654. var e = this.context_, r = this.contextTextState_, n = t.textAlign ? t.textAlign : "center";
  12655. r ? (r.font != t.font && (r.font = t.font, e.font = t.font), r.textAlign != n && (r.textAlign = n, e.textAlign = n), r.textBaseline != t.textBaseline && (r.textBaseline = t.textBaseline, e.textBaseline = t.textBaseline)) : (e.font = t.font, e.textAlign = n, e.textBaseline = t.textBaseline, this.contextTextState_ = {
  12656. font: t.font,
  12657. textAlign: n,
  12658. textBaseline: t.textBaseline
  12659. })
  12660. }, e.prototype.setFillStrokeStyle = function (t, e) {
  12661. if (t) {
  12662. var r = t.getColor();
  12663. this.fillState_ = {fillStyle: Tu(r || "#000")}
  12664. } else this.fillState_ = null;
  12665. if (e) {
  12666. var n = e.getColor(), i = e.getLineCap(), o = e.getLineDash(), a = e.getLineDashOffset(), s = e.getLineJoin(),
  12667. l = e.getWidth(), u = e.getMiterLimit();
  12668. this.strokeState_ = {
  12669. lineCap: void 0 !== i ? i : "round",
  12670. lineDash: o || pa,
  12671. lineDashOffset: a || 0,
  12672. lineJoin: void 0 !== s ? s : "round",
  12673. lineWidth: this.pixelRatio_ * (void 0 !== l ? l : 1),
  12674. miterLimit: void 0 !== u ? u : 10,
  12675. strokeStyle: Tu(n || "#000")
  12676. }
  12677. } else this.strokeState_ = null
  12678. }, e.prototype.setImageStyle = function (t) {
  12679. if (t) {
  12680. var e = t.getSize();
  12681. if (e) {
  12682. var r = t.getAnchor(), n = t.getImage(1), i = t.getOrigin(), o = t.getScaleArray();
  12683. this.imageAnchorX_ = r[0], this.imageAnchorY_ = r[1], this.imageHeight_ = e[1], this.image_ = n, this.imageOpacity_ = t.getOpacity(), this.imageOriginX_ = i[0], this.imageOriginY_ = i[1], this.imageRotateWithView_ = t.getRotateWithView(), this.imageRotation_ = t.getRotation(), this.imageScale_ = [this.pixelRatio_ * o[0], this.pixelRatio_ * o[1]], this.imageWidth_ = e[0]
  12684. } else this.image_ = null
  12685. } else this.image_ = null
  12686. }, e.prototype.setTextStyle = function (t) {
  12687. if (t) {
  12688. var e = t.getFill();
  12689. if (e) {
  12690. var r = e.getColor();
  12691. this.textFillState_ = {fillStyle: Tu(r || "#000")}
  12692. } else this.textFillState_ = null;
  12693. var n = t.getStroke();
  12694. if (n) {
  12695. var i = n.getColor(), o = n.getLineCap(), a = n.getLineDash(), s = n.getLineDashOffset(),
  12696. l = n.getLineJoin(), u = n.getWidth(), c = n.getMiterLimit();
  12697. this.textStrokeState_ = {
  12698. lineCap: void 0 !== o ? o : "round",
  12699. lineDash: a || pa,
  12700. lineDashOffset: s || 0,
  12701. lineJoin: void 0 !== l ? l : "round",
  12702. lineWidth: void 0 !== u ? u : 1,
  12703. miterLimit: void 0 !== c ? c : 10,
  12704. strokeStyle: Tu(i || "#000")
  12705. }
  12706. } else this.textStrokeState_ = null;
  12707. var h = t.getFont(), p = t.getOffsetX(), f = t.getOffsetY(), d = t.getRotateWithView(), g = t.getRotation(),
  12708. y = t.getScaleArray(), m = t.getText(), v = t.getTextAlign(), _ = t.getTextBaseline();
  12709. this.textState_ = {
  12710. font: void 0 !== h ? h : "10px sans-serif",
  12711. textAlign: void 0 !== v ? v : "center",
  12712. textBaseline: void 0 !== _ ? _ : "middle"
  12713. }, this.text_ = void 0 !== m ? m : "", this.textOffsetX_ = void 0 !== p ? this.pixelRatio_ * p : 0, this.textOffsetY_ = void 0 !== f ? this.pixelRatio_ * f : 0, this.textRotateWithView_ = void 0 !== d && d, this.textRotation_ = void 0 !== g ? g : 0, this.textScale_ = [this.pixelRatio_ * y[0], this.pixelRatio_ * y[1]]
  12714. } else this.text_ = ""
  12715. }, e
  12716. }(ku), Du = "Circle", Gu = "Default", zu = "Image", Uu = "LineString", Bu = "Polygon", Vu = "Text", Yu = {
  12717. Point: function (t, e, r, n, i) {
  12718. var o, a = r.getImage(), s = r.getText();
  12719. i && (t = i, o = a && s && s.getText() ? {} : void 0);
  12720. if (a) {
  12721. if (a.getImageState() != ki) return;
  12722. var l = t.getBuilder(r.getZIndex(), zu);
  12723. l.setImageStyle(a, o), l.drawPoint(e, n)
  12724. }
  12725. if (s && s.getText()) {
  12726. var u = t.getBuilder(r.getZIndex(), Vu);
  12727. u.setTextStyle(s, o), u.drawText(e, n)
  12728. }
  12729. }, LineString: function (t, e, r, n, i) {
  12730. var o = r.getStroke();
  12731. if (o) {
  12732. var a = t.getBuilder(r.getZIndex(), Uu);
  12733. a.setFillStrokeStyle(null, o), a.drawLineString(e, n)
  12734. }
  12735. var s = r.getText();
  12736. if (s && s.getText()) {
  12737. var l = (i || t).getBuilder(r.getZIndex(), Vu);
  12738. l.setTextStyle(s), l.drawText(e, n)
  12739. }
  12740. }, Polygon: function (t, e, r, n, i) {
  12741. var o = r.getFill(), a = r.getStroke();
  12742. if (o || a) {
  12743. var s = t.getBuilder(r.getZIndex(), Bu);
  12744. s.setFillStrokeStyle(o, a), s.drawPolygon(e, n)
  12745. }
  12746. var l = r.getText();
  12747. if (l && l.getText()) {
  12748. var u = (i || t).getBuilder(r.getZIndex(), Vu);
  12749. u.setTextStyle(l), u.drawText(e, n)
  12750. }
  12751. }, MultiPoint: function (t, e, r, n, i) {
  12752. var o, a = r.getImage(), s = r.getText();
  12753. i && (t = i, o = a && s && s.getText() ? {} : void 0);
  12754. if (a) {
  12755. if (a.getImageState() != ki) return;
  12756. var l = t.getBuilder(r.getZIndex(), zu);
  12757. l.setImageStyle(a, o), l.drawMultiPoint(e, n)
  12758. }
  12759. if (s && s.getText()) {
  12760. var u = (i || t).getBuilder(r.getZIndex(), Vu);
  12761. u.setTextStyle(s, o), u.drawText(e, n)
  12762. }
  12763. }, MultiLineString: function (t, e, r, n, i) {
  12764. var o = r.getStroke();
  12765. if (o) {
  12766. var a = t.getBuilder(r.getZIndex(), Uu);
  12767. a.setFillStrokeStyle(null, o), a.drawMultiLineString(e, n)
  12768. }
  12769. var s = r.getText();
  12770. if (s && s.getText()) {
  12771. var l = (i || t).getBuilder(r.getZIndex(), Vu);
  12772. l.setTextStyle(s), l.drawText(e, n)
  12773. }
  12774. }, MultiPolygon: function (t, e, r, n, i) {
  12775. var o = r.getFill(), a = r.getStroke();
  12776. if (a || o) {
  12777. var s = t.getBuilder(r.getZIndex(), Bu);
  12778. s.setFillStrokeStyle(o, a), s.drawMultiPolygon(e, n)
  12779. }
  12780. var l = r.getText();
  12781. if (l && l.getText()) {
  12782. var u = (i || t).getBuilder(r.getZIndex(), Vu);
  12783. u.setTextStyle(l), u.drawText(e, n)
  12784. }
  12785. }, GeometryCollection: function (t, e, r, n, i) {
  12786. var o, a, s = e.getGeometriesArray();
  12787. for (o = 0, a = s.length; o < a; ++o) {
  12788. (0, Yu[s[o].getType()])(t, s[o], r, n, i)
  12789. }
  12790. }, Circle: function (t, e, r, n, i) {
  12791. var o = r.getFill(), a = r.getStroke();
  12792. if (o || a) {
  12793. var s = t.getBuilder(r.getZIndex(), Du);
  12794. s.setFillStrokeStyle(o, a), s.drawCircle(e, n)
  12795. }
  12796. var l = r.getText();
  12797. if (l && l.getText()) {
  12798. var u = (i || t).getBuilder(r.getZIndex(), Vu);
  12799. u.setTextStyle(l), u.drawText(e, n)
  12800. }
  12801. }
  12802. };
  12803. function Wu(t, e) {
  12804. return parseInt(o(t), 10) - parseInt(o(e), 10)
  12805. }
  12806. function qu(t, e) {
  12807. var r = Xu(t, e);
  12808. return r * r
  12809. }
  12810. function Xu(t, e) {
  12811. return .5 * t / e
  12812. }
  12813. function Zu(t, e, r, n, i, o, a) {
  12814. var s = !1, l = r.getImage();
  12815. if (l) {
  12816. var u = l.getImageState();
  12817. u == ki || u == ji ? l.unlistenImageChange(i) : (u == Fi && l.load(), u = l.getImageState(), l.listenImageChange(i), s = !0)
  12818. }
  12819. return function (t, e, r, n, i, o) {
  12820. var a = r.getGeometryFunction()(e);
  12821. if (!a) return;
  12822. var s = a.simplifyTransformed(n, i);
  12823. if (r.getRenderer()) !function t(e, r, n, i) {
  12824. if (r.getType() == bt.GEOMETRY_COLLECTION) {
  12825. for (var o = r.getGeometries(), a = 0, s = o.length; a < s; ++a) t(e, o[a], n, i);
  12826. return
  12827. }
  12828. e.getBuilder(n.getZIndex(), Gu).drawCustom(r, i, n.getRenderer())
  12829. }(t, s, r, e); else {
  12830. (0, Yu[s.getType()])(t, s, r, e, o)
  12831. }
  12832. }(t, e, r, n, o, a), s
  12833. }
  12834. function Ku(t) {
  12835. var e, r = t.frameState, n = Ot(t.inversePixelTransform.slice(), r.coordinateToPixelTransform),
  12836. i = qu(r.viewState.resolution, r.pixelRatio), o = tn();
  12837. return o && (e = Zr(o, r.viewState.projection)), new Nu(t.context, r.pixelRatio, r.extent, n, r.viewState.rotation, i, e)
  12838. }
  12839. var Hu, $u = {imageSmoothingEnabled: !1, msImageSmoothingEnabled: !1};
  12840. function Ju(t, e, r, n, i) {
  12841. t.beginPath(), t.moveTo(0, 0), t.lineTo(e, r), t.lineTo(n, i), t.closePath(), t.save(), t.clip(), t.fillRect(0, 0, Math.max(e, n) + 1, Math.max(r, i)), t.restore()
  12842. }
  12843. function Qu(t, e) {
  12844. return Math.abs(t[4 * e] - 210) > 2 || Math.abs(t[4 * e + 3] - 191.25) > 2
  12845. }
  12846. function tc(t, e, r, n) {
  12847. var i = Hr(r, e, t), o = zr(e, n, r), a = e.getMetersPerUnit();
  12848. void 0 !== a && (o *= a);
  12849. var s = t.getMetersPerUnit();
  12850. void 0 !== s && (o /= s);
  12851. var l = t.getExtent();
  12852. if (!l || Qt(l, i)) {
  12853. var u = zr(t, o, i) / o;
  12854. isFinite(u) && u > 0 && (o /= u)
  12855. }
  12856. return o
  12857. }
  12858. function ec(t, e, r, n) {
  12859. var i = xe(r), o = tc(t, e, i, n);
  12860. return (!isFinite(o) || o <= 0) && me(r, (function (r) {
  12861. return o = tc(t, e, r, n), isFinite(o) && o > 0
  12862. })), o
  12863. }
  12864. function rc(t, e, r, n, i, o, a, s, l, u, c, h) {
  12865. var p = uo(Math.round(r * t), Math.round(r * e));
  12866. if (O(p, h), 0 === l.length) return p.canvas;
  12867. function f(t) {
  12868. return Math.round(t * r) / r
  12869. }
  12870. p.scale(r, r), p.globalCompositeOperation = "lighter";
  12871. var d = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
  12872. l.forEach((function (t, e, r) {
  12873. he(d, t.extent)
  12874. }));
  12875. var g = Pe(d), y = Ee(d), m = uo(Math.round(r * g / n), Math.round(r * y / n));
  12876. O(m, h);
  12877. var v = r / n;
  12878. l.forEach((function (t, e, r) {
  12879. var n = t.extent[0] - d[0], i = -(t.extent[3] - d[3]), o = Pe(t.extent), a = Ee(t.extent);
  12880. t.image.width > 0 && t.image.height > 0 && m.drawImage(t.image, u, u, t.image.width - 2 * u, t.image.height - 2 * u, n * v, i * v, o * v, a * v)
  12881. }));
  12882. var _ = Ce(a);
  12883. return s.getTriangles().forEach((function (t, e, i) {
  12884. var a = t.source, s = t.target, l = a[0][0], u = a[0][1], c = a[1][0], g = a[1][1], y = a[2][0], v = a[2][1],
  12885. b = f((s[0][0] - _[0]) / o), x = f(-(s[0][1] - _[1]) / o), w = f((s[1][0] - _[0]) / o),
  12886. S = f(-(s[1][1] - _[1]) / o), E = f((s[2][0] - _[0]) / o), T = f(-(s[2][1] - _[1]) / o), C = l, O = u;
  12887. l = 0, u = 0;
  12888. var P = Be([[c -= C, g -= O, 0, 0, w - b], [y -= C, v -= O, 0, 0, E - b], [0, 0, c, g, S - x], [0, 0, y, v, T - x]]);
  12889. if (P) {
  12890. if (p.save(), p.beginPath(), function () {
  12891. if (void 0 === Hu) {
  12892. var t = document.createElement("canvas").getContext("2d");
  12893. t.globalCompositeOperation = "lighter", t.fillStyle = "rgba(210, 0, 0, 0.75)", Ju(t, 4, 5, 4, 0), Ju(t, 4, 5, 0, 5);
  12894. var e = t.getImageData(0, 0, 3, 3).data;
  12895. Hu = Qu(e, 0) || Qu(e, 4) || Qu(e, 8)
  12896. }
  12897. return Hu
  12898. }() || h === $u) {
  12899. p.moveTo(w, S);
  12900. for (var R = b - w, I = x - S, L = 0; L < 4; L++) p.lineTo(w + f((L + 1) * R / 4), S + f(L * I / 3)), 3 != L && p.lineTo(w + f((L + 1) * R / 4), S + f((L + 1) * I / 3));
  12901. p.lineTo(E, T)
  12902. } else p.moveTo(w, S), p.lineTo(b, x), p.lineTo(E, T);
  12903. p.clip(), p.transform(P[0], P[2], P[1], P[3], b, x), p.translate(d[0] - C, d[3] - O), p.scale(n / r, -n / r), p.drawImage(m.canvas, 0, 0), p.restore()
  12904. }
  12905. })), c && (p.save(), p.globalCompositeOperation = "source-over", p.strokeStyle = "black", p.lineWidth = 1, s.getTriangles().forEach((function (t, e, r) {
  12906. var n = t.target, i = (n[0][0] - _[0]) / o, a = -(n[0][1] - _[1]) / o, s = (n[1][0] - _[0]) / o,
  12907. l = -(n[1][1] - _[1]) / o, u = (n[2][0] - _[0]) / o, c = -(n[2][1] - _[1]) / o;
  12908. p.beginPath(), p.moveTo(s, l), p.lineTo(i, a), p.lineTo(u, c), p.closePath(), p.stroke()
  12909. })), p.restore()), p.canvas
  12910. }
  12911. var nc = [0, 0, 0], ic = function () {
  12912. function t(t) {
  12913. var e;
  12914. if (this.minZoom = void 0 !== t.minZoom ? t.minZoom : 0, this.resolutions_ = t.resolutions, pt(w(this.resolutions_, (function (t, e) {
  12915. return e - t
  12916. }), !0), 17), !t.origins) for (var r = 0, n = this.resolutions_.length - 1; r < n; ++r) if (e) {
  12917. if (this.resolutions_[r] / this.resolutions_[r + 1] !== e) {
  12918. e = void 0;
  12919. break
  12920. }
  12921. } else e = this.resolutions_[r] / this.resolutions_[r + 1];
  12922. this.zoomFactor_ = e, this.maxZoom = this.resolutions_.length - 1, this.origin_ = void 0 !== t.origin ? t.origin : null, this.origins_ = null, void 0 !== t.origins && (this.origins_ = t.origins, pt(this.origins_.length == this.resolutions_.length, 20));
  12923. var i = t.extent;
  12924. void 0 === i || this.origin_ || this.origins_ || (this.origin_ = Ce(i)), pt(!this.origin_ && this.origins_ || this.origin_ && !this.origins_, 18), this.tileSizes_ = null, void 0 !== t.tileSizes && (this.tileSizes_ = t.tileSizes, pt(this.tileSizes_.length == this.resolutions_.length, 19)), this.tileSize_ = void 0 !== t.tileSize ? t.tileSize : this.tileSizes_ ? null : 256, pt(!this.tileSize_ && this.tileSizes_ || this.tileSize_ && !this.tileSizes_, 22), this.extent_ = void 0 !== i ? i : null, this.fullTileRanges_ = null, this.tmpSize_ = [0, 0], void 0 !== t.sizes ? this.fullTileRanges_ = t.sizes.map((function (t, e) {
  12925. var r = new _u(Math.min(0, t[0]), Math.max(t[0] - 1, -1), Math.min(0, t[1]), Math.max(t[1] - 1, -1));
  12926. if (i) {
  12927. var n = this.getTileRangeForExtentAndZ(i, e);
  12928. r.minX = Math.max(n.minX, r.minX), r.maxX = Math.min(n.maxX, r.maxX), r.minY = Math.max(n.minY, r.minY), r.maxY = Math.min(n.maxY, r.maxY)
  12929. }
  12930. return r
  12931. }), this) : i && this.calculateTileRanges_(i)
  12932. }
  12933. return t.prototype.forEachTileCoord = function (t, e, r) {
  12934. for (var n = this.getTileRangeForExtentAndZ(t, e), i = n.minX, o = n.maxX; i <= o; ++i) for (var a = n.minY, s = n.maxY; a <= s; ++a) r([e, i, a])
  12935. }, t.prototype.forEachTileCoordParentTileRange = function (t, e, r, n) {
  12936. var i, o, a = null, s = t[0] - 1;
  12937. for (2 === this.zoomFactor_ ? (i = t[1], o = t[2]) : a = this.getTileCoordExtent(t, n); s >= this.minZoom;) {
  12938. if (e(s, 2 === this.zoomFactor_ ? vu(i = Math.floor(i / 2), i, o = Math.floor(o / 2), o, r) : this.getTileRangeForExtentAndZ(a, s, r))) return !0;
  12939. --s
  12940. }
  12941. return !1
  12942. }, t.prototype.getExtent = function () {
  12943. return this.extent_
  12944. }, t.prototype.getMaxZoom = function () {
  12945. return this.maxZoom
  12946. }, t.prototype.getMinZoom = function () {
  12947. return this.minZoom
  12948. }, t.prototype.getOrigin = function (t) {
  12949. return this.origin_ ? this.origin_ : this.origins_[t]
  12950. }, t.prototype.getResolution = function (t) {
  12951. return this.resolutions_[t]
  12952. }, t.prototype.getResolutions = function () {
  12953. return this.resolutions_
  12954. }, t.prototype.getTileCoordChildTileRange = function (t, e, r) {
  12955. if (t[0] < this.maxZoom) {
  12956. if (2 === this.zoomFactor_) {
  12957. var n = 2 * t[1], i = 2 * t[2];
  12958. return vu(n, n + 1, i, i + 1, e)
  12959. }
  12960. var o = this.getTileCoordExtent(t, r);
  12961. return this.getTileRangeForExtentAndZ(o, t[0] + 1, e)
  12962. }
  12963. return null
  12964. }, t.prototype.getTileRangeExtent = function (t, e, r) {
  12965. var n = this.getOrigin(t), i = this.getResolution(t), o = Is(this.getTileSize(t), this.tmpSize_),
  12966. a = n[0] + e.minX * o[0] * i, s = n[0] + (e.maxX + 1) * o[0] * i;
  12967. return ie(a, n[1] + e.minY * o[1] * i, s, n[1] + (e.maxY + 1) * o[1] * i, r)
  12968. }, t.prototype.getTileRangeForExtentAndZ = function (t, e, r) {
  12969. var n = nc;
  12970. this.getTileCoordForXYAndZ_(t[0], t[3], e, !1, n);
  12971. var i = n[1], o = n[2];
  12972. return this.getTileCoordForXYAndZ_(t[2], t[1], e, !0, n), vu(i, n[1], o, n[2], r)
  12973. }, t.prototype.getTileCoordCenter = function (t) {
  12974. var e = this.getOrigin(t[0]), r = this.getResolution(t[0]), n = Is(this.getTileSize(t[0]), this.tmpSize_);
  12975. return [e[0] + (t[1] + .5) * n[0] * r, e[1] - (t[2] + .5) * n[1] * r]
  12976. }, t.prototype.getTileCoordExtent = function (t, e) {
  12977. var r = this.getOrigin(t[0]), n = this.getResolution(t[0]), i = Is(this.getTileSize(t[0]), this.tmpSize_),
  12978. o = r[0] + t[1] * i[0] * n, a = r[1] - (t[2] + 1) * i[1] * n;
  12979. return ie(o, a, o + i[0] * n, a + i[1] * n, e)
  12980. }, t.prototype.getTileCoordForCoordAndResolution = function (t, e, r) {
  12981. return this.getTileCoordForXYAndResolution_(t[0], t[1], e, !1, r)
  12982. }, t.prototype.getTileCoordForXYAndResolution_ = function (t, e, r, n, i) {
  12983. var o = this.getZForResolution(r), a = r / this.getResolution(o), s = this.getOrigin(o),
  12984. l = Is(this.getTileSize(o), this.tmpSize_), u = n ? .5 : 0, c = n ? .5 : 0,
  12985. h = Math.floor((t - s[0]) / r + u), p = Math.floor((s[1] - e) / r + c), f = a * h / l[0], d = a * p / l[1];
  12986. return n ? (f = Math.ceil(f) - 1, d = Math.ceil(d) - 1) : (f = Math.floor(f), d = Math.floor(d)), uu(o, f, d, i)
  12987. }, t.prototype.getTileCoordForXYAndZ_ = function (t, e, r, n, i) {
  12988. var o = this.getOrigin(r), a = this.getResolution(r), s = Is(this.getTileSize(r), this.tmpSize_),
  12989. l = n ? .5 : 0, u = n ? .5 : 0, c = Math.floor((t - o[0]) / a + l), h = Math.floor((o[1] - e) / a + u),
  12990. p = c / s[0], f = h / s[1];
  12991. return n ? (p = Math.ceil(p) - 1, f = Math.ceil(f) - 1) : (p = Math.floor(p), f = Math.floor(f)), uu(r, p, f, i)
  12992. }, t.prototype.getTileCoordForCoordAndZ = function (t, e, r) {
  12993. return this.getTileCoordForXYAndZ_(t[0], t[1], e, !1, r)
  12994. }, t.prototype.getTileCoordResolution = function (t) {
  12995. return this.resolutions_[t[0]]
  12996. }, t.prototype.getTileSize = function (t) {
  12997. return this.tileSize_ ? this.tileSize_ : this.tileSizes_[t]
  12998. }, t.prototype.getFullTileRange = function (t) {
  12999. return this.fullTileRanges_ ? this.fullTileRanges_[t] : this.extent_ ? this.getTileRangeForExtentAndZ(this.extent_, t) : null
  13000. }, t.prototype.getZForResolution = function (t, e) {
  13001. return Ne(y(this.resolutions_, t, e || 0), this.minZoom, this.maxZoom)
  13002. }, t.prototype.calculateTileRanges_ = function (t) {
  13003. for (var e = this.resolutions_.length, r = new Array(e), n = this.minZoom; n < e; ++n) r[n] = this.getTileRangeForExtentAndZ(t, n);
  13004. this.fullTileRanges_ = r
  13005. }, t
  13006. }();
  13007. function oc(t) {
  13008. var e = t.getDefaultTileGrid();
  13009. return e || (e = cc(t), t.setDefaultTileGrid(e)), e
  13010. }
  13011. function ac(t, e, r) {
  13012. var n = e[0], i = t.getTileCoordCenter(e), o = hc(r);
  13013. if (Qt(o, i)) return e;
  13014. var a = Pe(o), s = Math.ceil((o[0] - i[0]) / a);
  13015. return i[0] += a * s, t.getTileCoordForCoordAndZ(i, n)
  13016. }
  13017. function sc(t, e, r, n) {
  13018. var i = void 0 !== n ? n : Ut, o = uc(t, e, r);
  13019. return new ic({extent: t, origin: we(t, i), resolutions: o, tileSize: r})
  13020. }
  13021. function lc(t) {
  13022. var e = t || {}, r = e.extent || Gr("EPSG:3857").getExtent(), n = {
  13023. extent: r,
  13024. minZoom: e.minZoom,
  13025. tileSize: e.tileSize,
  13026. resolutions: uc(r, e.maxZoom, e.tileSize, e.maxResolution)
  13027. };
  13028. return new ic(n)
  13029. }
  13030. function uc(t, e, r, n) {
  13031. for (var i = void 0 !== e ? e : 42, o = Ee(t), a = Pe(t), s = Is(void 0 !== r ? r : 256), l = n > 0 ? n : Math.max(a / s[0], o / s[1]), u = i + 1, c = new Array(u), h = 0; h < u; ++h) c[h] = l / Math.pow(2, h);
  13032. return c
  13033. }
  13034. function cc(t, e, r, n) {
  13035. return sc(hc(t), e, r, n)
  13036. }
  13037. function hc(t) {
  13038. var e = (t = Gr(t)).getExtent();
  13039. if (!e) {
  13040. var r = 180 * wt[St.DEGREES] / t.getMetersPerUnit();
  13041. e = ie(-r, -r, r, r)
  13042. }
  13043. return e
  13044. }
  13045. function pc(t, e) {
  13046. var r = /\{z\}/g, n = /\{x\}/g, i = /\{y\}/g, o = /\{-y\}/g;
  13047. return function (a, s, l) {
  13048. return a ? t.replace(r, a[0].toString()).replace(n, a[1].toString()).replace(i, a[2].toString()).replace(o, (function () {
  13049. var t = a[0], r = e.getFullTileRange(t);
  13050. return pt(r, 55), (r.getHeight() - a[2] - 1).toString()
  13051. })) : void 0
  13052. }
  13053. }
  13054. function fc(t, e) {
  13055. for (var r = t.length, n = new Array(r), i = 0; i < r; ++i) n[i] = pc(t[i], e);
  13056. return dc(n)
  13057. }
  13058. function dc(t) {
  13059. return 1 === t.length ? t[0] : function (e, r, n) {
  13060. if (e) {
  13061. var i = We(fu(e), t.length);
  13062. return t[i](e, r, n)
  13063. }
  13064. }
  13065. }
  13066. function gc(t, e, r) {
  13067. }
  13068. function yc(t) {
  13069. var e = [], r = /\{([a-z])-([a-z])\}/.exec(t);
  13070. if (r) {
  13071. var n = r[1].charCodeAt(0), i = r[2].charCodeAt(0), o = void 0;
  13072. for (o = n; o <= i; ++o) e.push(t.replace(r[0], String.fromCharCode(o)));
  13073. return e
  13074. }
  13075. if (r = /\{(\d+)-(\d+)\}/.exec(t)) {
  13076. for (var a = parseInt(r[2], 10), s = parseInt(r[1], 10); s <= a; s++) e.push(t.replace(r[0], s.toString()));
  13077. return e
  13078. }
  13079. return e.push(t), e
  13080. }
  13081. function mc(t, e) {
  13082. var r = [];
  13083. Object.keys(e).forEach((function (t) {
  13084. null !== e[t] && void 0 !== e[t] && r.push(t + "=" + encodeURIComponent(e[t]))
  13085. }));
  13086. var n = r.join("&");
  13087. return (t = -1 === (t = t.replace(/[?&]$/, "")).indexOf("?") ? t + "?" : t + "&") + n
  13088. }
  13089. var vc, _c = ["experimental-webgl", "webgl", "webkit-3d", "moz-webgl"];
  13090. function bc(t, e) {
  13091. for (var r = _c.length, n = 0; n < r; ++n) try {
  13092. var i = t.getContext(_c[n], e);
  13093. if (i) return i
  13094. } catch (t) {
  13095. }
  13096. return null
  13097. }
  13098. function xc() {
  13099. if (!vc) {
  13100. var t = bc(document.createElement("canvas"));
  13101. t && (vc = t.getSupportedExtensions())
  13102. }
  13103. return vc
  13104. }
  13105. var wc = "http://www.w3.org/2001/XMLSchema-instance";
  13106. function Sc(t, e) {
  13107. return Xc().createElementNS(t, e)
  13108. }
  13109. function Ec(t, e) {
  13110. return Tc(t, e, []).join("")
  13111. }
  13112. function Tc(t, e, r) {
  13113. if (t.nodeType == Node.CDATA_SECTION_NODE || t.nodeType == Node.TEXT_NODE) e ? r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g, "")) : r.push(t.nodeValue); else {
  13114. var n = void 0;
  13115. for (n = t.firstChild; n; n = n.nextSibling) Tc(n, e, r)
  13116. }
  13117. return r
  13118. }
  13119. function Cc(t) {
  13120. return "documentElement" in t
  13121. }
  13122. function Oc(t, e, r) {
  13123. return t.getAttributeNS(e, r) || ""
  13124. }
  13125. function Pc(t) {
  13126. return (new DOMParser).parseFromString(t, "application/xml")
  13127. }
  13128. function Rc(t, e) {
  13129. return function (r, n) {
  13130. var i = t.call(void 0 !== e ? e : this, r, n);
  13131. void 0 !== i && v(n[n.length - 1], i)
  13132. }
  13133. }
  13134. function Ic(t, e) {
  13135. return function (r, n) {
  13136. var i = t.call(void 0 !== e ? e : this, r, n);
  13137. void 0 !== i && n[n.length - 1].push(i)
  13138. }
  13139. }
  13140. function Lc(t, e) {
  13141. return function (r, n) {
  13142. var i = t.call(void 0 !== e ? e : this, r, n);
  13143. void 0 !== i && (n[n.length - 1] = i)
  13144. }
  13145. }
  13146. function Mc(t, e, r) {
  13147. return function (n, i) {
  13148. var o = t.call(void 0 !== r ? r : this, n, i);
  13149. if (void 0 !== o) {
  13150. var a = i[i.length - 1], s = void 0 !== e ? e : n.localName, l = void 0;
  13151. s in a ? l = a[s] : (l = [], a[s] = l), l.push(o)
  13152. }
  13153. }
  13154. }
  13155. function Fc(t, e, r) {
  13156. return function (n, i) {
  13157. var o = t.call(void 0 !== r ? r : this, n, i);
  13158. void 0 !== o && (i[i.length - 1][void 0 !== e ? e : n.localName] = o)
  13159. }
  13160. }
  13161. function Ac(t, e) {
  13162. return function (r, n, i) {
  13163. t.call(void 0 !== e ? e : this, r, n, i), i[i.length - 1].node.appendChild(r)
  13164. }
  13165. }
  13166. function kc(t, e) {
  13167. var r, n;
  13168. return function (e, i, o) {
  13169. if (void 0 === r) {
  13170. r = {};
  13171. var a = {};
  13172. a[e.localName] = t, r[e.namespaceURI] = a, n = jc(e.localName)
  13173. }
  13174. Bc(r, n, i, o)
  13175. }
  13176. }
  13177. function jc(t, e) {
  13178. var r = t;
  13179. return function (t, n, i) {
  13180. var o = n[n.length - 1].node, a = r;
  13181. return void 0 === a && (a = i), Sc(void 0 !== e ? e : o.namespaceURI, a)
  13182. }
  13183. }
  13184. var Nc = jc();
  13185. function Dc(t, e) {
  13186. for (var r = e.length, n = new Array(r), i = 0; i < r; ++i) n[i] = t[e[i]];
  13187. return n
  13188. }
  13189. function Gc(t, e, r) {
  13190. var n, i, o = void 0 !== r ? r : {};
  13191. for (n = 0, i = t.length; n < i; ++n) o[t[n]] = e;
  13192. return o
  13193. }
  13194. function zc(t, e, r, n) {
  13195. var i;
  13196. for (i = e.firstElementChild; i; i = i.nextElementSibling) {
  13197. var o = t[i.namespaceURI];
  13198. if (void 0 !== o) {
  13199. var a = o[i.localName];
  13200. void 0 !== a && a.call(n, i, r)
  13201. }
  13202. }
  13203. }
  13204. function Uc(t, e, r, n, i) {
  13205. return n.push(t), zc(e, r, n, i), n.pop()
  13206. }
  13207. function Bc(t, e, r, n, i, o) {
  13208. for (var a, s, l = (void 0 !== i ? i : r).length, u = 0; u < l; ++u) void 0 !== (a = r[u]) && void 0 !== (s = e.call(void 0 !== o ? o : this, a, n, void 0 !== i ? i[u] : void 0)) && t[s.namespaceURI][s.localName].call(o, s, a, n)
  13209. }
  13210. function Vc(t, e, r, n, i, o, a) {
  13211. return i.push(t), Bc(e, r, n, i, o, a), i.pop()
  13212. }
  13213. var Yc = void 0;
  13214. function Wc() {
  13215. return void 0 === Yc && "undefined" != typeof XMLSerializer && (Yc = new XMLSerializer), Yc
  13216. }
  13217. var qc = void 0;
  13218. function Xc() {
  13219. return void 0 === qc && "undefined" != typeof document && (qc = document.implementation.createDocument("", "", null)), qc
  13220. }
  13221. var Zc = new Blob(['var e=self;e.onmessage=function(s){console.log("version worker received message:",s.data),e.postMessage("version: ".concat("latest"))};'], {type: "application/javascript"});
  13222. URL.createObjectURL(Zc);
  13223. var Kc = new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'], {type: "application/javascript"}),
  13224. Hc = URL.createObjectURL(Kc);
  13225. var $c = 35044;
  13226. function Jc(t) {
  13227. switch (t) {
  13228. case 34962:
  13229. return Float32Array;
  13230. case 34963:
  13231. return Uint32Array;
  13232. default:
  13233. return Float32Array
  13234. }
  13235. }
  13236. var Qc = function () {
  13237. function t(t, e) {
  13238. this.array = null, this.type = t, pt(34962 === t || 34963 === t, 62), this.usage = void 0 !== e ? e : $c
  13239. }
  13240. return t.prototype.ofSize = function (t) {
  13241. this.array = new (Jc(this.type))(t)
  13242. }, t.prototype.fromArray = function (t) {
  13243. this.array = Jc(this.type).from(t)
  13244. }, t.prototype.fromArrayBuffer = function (t) {
  13245. this.array = new (Jc(this.type))(t)
  13246. }, t.prototype.getType = function () {
  13247. return this.type
  13248. }, t.prototype.getArray = function () {
  13249. return this.array
  13250. }, t.prototype.getUsage = function () {
  13251. return this.usage
  13252. }, t.prototype.getSize = function () {
  13253. return this.array ? this.array.length : 0
  13254. }, t
  13255. }(), th = "webglcontextlost", eh = "webglcontextrestored", rh = function () {
  13256. function t(t) {
  13257. this.gl_ = t.webGlContext;
  13258. var e = this.gl_;
  13259. this.scaleRatio_ = t.scaleRatio || 1, this.renderTargetTexture_ = e.createTexture(), this.renderTargetTextureSize_ = null, this.frameBuffer_ = e.createFramebuffer();
  13260. var r = e.createShader(e.VERTEX_SHADER);
  13261. e.shaderSource(r, t.vertexShader || "\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"), e.compileShader(r);
  13262. var n = e.createShader(e.FRAGMENT_SHADER);
  13263. e.shaderSource(n, t.fragmentShader || "\n precision mediump float;\n \n uniform sampler2D u_image;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n"), e.compileShader(n), this.renderTargetProgram_ = e.createProgram(), e.attachShader(this.renderTargetProgram_, r), e.attachShader(this.renderTargetProgram_, n), e.linkProgram(this.renderTargetProgram_), this.renderTargetVerticesBuffer_ = e.createBuffer();
  13264. e.bindBuffer(e.ARRAY_BUFFER, this.renderTargetVerticesBuffer_), e.bufferData(e.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1]), e.STATIC_DRAW), this.renderTargetAttribLocation_ = e.getAttribLocation(this.renderTargetProgram_, "a_position"), this.renderTargetUniformLocation_ = e.getUniformLocation(this.renderTargetProgram_, "u_screenSize"), this.renderTargetTextureLocation_ = e.getUniformLocation(this.renderTargetProgram_, "u_image"), this.uniforms_ = [], t.uniforms && Object.keys(t.uniforms).forEach(function (r) {
  13265. this.uniforms_.push({value: t.uniforms[r], location: e.getUniformLocation(this.renderTargetProgram_, r)})
  13266. }.bind(this))
  13267. }
  13268. return t.prototype.getGL = function () {
  13269. return this.gl_
  13270. }, t.prototype.init = function (t) {
  13271. var e = this.getGL(), r = [e.drawingBufferWidth * this.scaleRatio_, e.drawingBufferHeight * this.scaleRatio_];
  13272. if (e.bindFramebuffer(e.FRAMEBUFFER, this.getFrameBuffer()), e.viewport(0, 0, r[0], r[1]), !this.renderTargetTextureSize_ || this.renderTargetTextureSize_[0] !== r[0] || this.renderTargetTextureSize_[1] !== r[1]) {
  13273. this.renderTargetTextureSize_ = r;
  13274. var n = e.RGBA, i = e.RGBA, o = e.UNSIGNED_BYTE;
  13275. e.bindTexture(e.TEXTURE_2D, this.renderTargetTexture_), e.texImage2D(e.TEXTURE_2D, 0, n, r[0], r[1], 0, i, o, null), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, this.renderTargetTexture_, 0)
  13276. }
  13277. }, t.prototype.apply = function (t, e) {
  13278. var r = this.getGL(), n = t.size;
  13279. r.bindFramebuffer(r.FRAMEBUFFER, e ? e.getFrameBuffer() : null), r.activeTexture(r.TEXTURE0), r.bindTexture(r.TEXTURE_2D, this.renderTargetTexture_), r.clearColor(0, 0, 0, 0), r.clear(r.COLOR_BUFFER_BIT), r.enable(r.BLEND), r.blendFunc(r.ONE, r.ONE_MINUS_SRC_ALPHA), r.viewport(0, 0, r.drawingBufferWidth, r.drawingBufferHeight), r.bindBuffer(r.ARRAY_BUFFER, this.renderTargetVerticesBuffer_), r.useProgram(this.renderTargetProgram_), r.enableVertexAttribArray(this.renderTargetAttribLocation_), r.vertexAttribPointer(this.renderTargetAttribLocation_, 2, r.FLOAT, !1, 0, 0), r.uniform2f(this.renderTargetUniformLocation_, n[0], n[1]), r.uniform1i(this.renderTargetTextureLocation_, 0), this.applyUniforms(t), r.drawArrays(r.TRIANGLES, 0, 6)
  13280. }, t.prototype.getFrameBuffer = function () {
  13281. return this.frameBuffer_
  13282. }, t.prototype.applyUniforms = function (t) {
  13283. var e, r = this.getGL(), n = 1;
  13284. this.uniforms_.forEach((function (i) {
  13285. if ((e = "function" == typeof i.value ? i.value(t) : i.value) instanceof HTMLCanvasElement || e instanceof ImageData) i.texture || (i.texture = r.createTexture()), r.activeTexture(r["TEXTURE" + n]), r.bindTexture(r.TEXTURE_2D, i.texture), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), e instanceof ImageData ? r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, r.RGBA, e.width, e.height, 0, r.UNSIGNED_BYTE, new Uint8Array(e.data)) : r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, r.RGBA, r.UNSIGNED_BYTE, e), r.uniform1i(i.location, n++); else if (Array.isArray(e)) switch (e.length) {
  13286. case 2:
  13287. return void r.uniform2f(i.location, e[0], e[1]);
  13288. case 3:
  13289. return void r.uniform3f(i.location, e[0], e[1], e[2]);
  13290. case 4:
  13291. return void r.uniform4f(i.location, e[0], e[1], e[2], e[3]);
  13292. default:
  13293. return
  13294. } else "number" == typeof e && r.uniform1f(i.location, e)
  13295. }))
  13296. }, t
  13297. }();
  13298. function nh() {
  13299. return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  13300. }
  13301. function ih(t, e) {
  13302. return t[0] = e[0], t[1] = e[1], t[4] = e[2], t[5] = e[3], t[12] = e[4], t[13] = e[5], t
  13303. }
  13304. var oh = function () {
  13305. var t = function (e, r) {
  13306. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  13307. t.__proto__ = e
  13308. } || function (t, e) {
  13309. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  13310. })(e, r)
  13311. };
  13312. return function (e, r) {
  13313. function n() {
  13314. this.constructor = e
  13315. }
  13316. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  13317. }
  13318. }(), ah = "u_projectionMatrix", sh = "u_offsetScaleMatrix", lh = "u_offsetRotateMatrix", uh = "u_time",
  13319. ch = "u_zoom", hh = "u_resolution",
  13320. ph = {UNSIGNED_BYTE: 5121, UNSIGNED_SHORT: 5123, UNSIGNED_INT: 5125, FLOAT: 5126};
  13321. function fh(t) {
  13322. for (var e = 0, r = 0; r < t.length; r++) {
  13323. var n = t[r];
  13324. e += n.size * dh(n.type)
  13325. }
  13326. return e
  13327. }
  13328. function dh(t) {
  13329. switch (t) {
  13330. case ph.UNSIGNED_BYTE:
  13331. return Uint8Array.BYTES_PER_ELEMENT;
  13332. case ph.UNSIGNED_SHORT:
  13333. return Uint16Array.BYTES_PER_ELEMENT;
  13334. case ph.UNSIGNED_INT:
  13335. return Uint32Array.BYTES_PER_ELEMENT;
  13336. case ph.FLOAT:
  13337. default:
  13338. return Float32Array.BYTES_PER_ELEMENT
  13339. }
  13340. }
  13341. var gh = function (t) {
  13342. function e(e) {
  13343. var r = t.call(this) || this, n = e || {};
  13344. r.boundHandleWebGLContextLost_ = r.handleWebGLContextLost.bind(r), r.boundHandleWebGLContextRestored_ = r.handleWebGLContextRestored.bind(r), r.canvas_ = document.createElement("canvas"), r.canvas_.style.position = "absolute", r.canvas_.style.left = "0", r.gl_ = bc(r.canvas_);
  13345. var i = r.getGL();
  13346. if (r.bufferCache_ = {}, r.currentProgram_ = null, pt(g(xc(), "OES_element_index_uint"), 63), i.getExtension("OES_element_index_uint"), r.canvas_.addEventListener(th, r.boundHandleWebGLContextLost_), r.canvas_.addEventListener(eh, r.boundHandleWebGLContextRestored_), r.offsetRotateMatrix_ = [1, 0, 0, 1, 0, 0], r.offsetScaleMatrix_ = [1, 0, 0, 1, 0, 0], r.tmpMat4_ = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], r.uniformLocations_ = {}, r.attribLocations_ = {}, r.uniforms_ = [], n.uniforms) for (var o in n.uniforms) r.uniforms_.push({
  13347. name: o,
  13348. value: n.uniforms[o]
  13349. });
  13350. return r.postProcessPasses_ = n.postProcesses ? n.postProcesses.map((function (t) {
  13351. return new rh({
  13352. webGlContext: i,
  13353. scaleRatio: t.scaleRatio,
  13354. vertexShader: t.vertexShader,
  13355. fragmentShader: t.fragmentShader,
  13356. uniforms: t.uniforms
  13357. })
  13358. })) : [new rh({webGlContext: i})], r.shaderCompileErrors_ = null, r.startTime_ = Date.now(), r
  13359. }
  13360. return oh(e, t), e.prototype.bindBuffer = function (t) {
  13361. var e = this.getGL(), r = o(t), n = this.bufferCache_[r];
  13362. n || (n = {buffer: t, webGlBuffer: e.createBuffer()}, this.bufferCache_[r] = n);
  13363. e.bindBuffer(t.getType(), n.webGlBuffer)
  13364. }, e.prototype.flushBufferData = function (t) {
  13365. var e = this.getGL();
  13366. this.bindBuffer(t), e.bufferData(t.getType(), t.getArray(), t.getUsage())
  13367. }, e.prototype.deleteBuffer = function (t) {
  13368. var e = this.getGL(), r = o(t), n = this.bufferCache_[r];
  13369. e.isContextLost() || e.deleteBuffer(n.buffer), delete this.bufferCache_[r]
  13370. }, e.prototype.disposeInternal = function () {
  13371. this.canvas_.removeEventListener(th, this.boundHandleWebGLContextLost_), this.canvas_.removeEventListener(eh, this.boundHandleWebGLContextRestored_)
  13372. }, e.prototype.prepareDraw = function (t) {
  13373. var e = this.getGL(), r = this.getCanvas(), n = t.size, i = t.pixelRatio;
  13374. r.width = n[0] * i, r.height = n[1] * i, r.style.width = n[0] + "px", r.style.height = n[1] + "px", e.useProgram(this.currentProgram_);
  13375. for (var o = this.postProcessPasses_.length - 1; o >= 0; o--) this.postProcessPasses_[o].init(t);
  13376. e.bindTexture(e.TEXTURE_2D, null), e.clearColor(0, 0, 0, 0), e.clear(e.COLOR_BUFFER_BIT), e.enable(e.BLEND), e.blendFunc(e.ONE, e.ONE_MINUS_SRC_ALPHA), e.useProgram(this.currentProgram_), this.applyFrameState(t), this.applyUniforms(t)
  13377. }, e.prototype.prepareDrawToRenderTarget = function (t, e, r) {
  13378. var n = this.getGL(), i = e.getSize();
  13379. n.bindFramebuffer(n.FRAMEBUFFER, e.getFramebuffer()), n.viewport(0, 0, i[0], i[1]), n.bindTexture(n.TEXTURE_2D, e.getTexture()), n.clearColor(0, 0, 0, 0), n.clear(n.COLOR_BUFFER_BIT), n.enable(n.BLEND), n.blendFunc(n.ONE, r ? n.ZERO : n.ONE_MINUS_SRC_ALPHA), n.useProgram(this.currentProgram_), this.applyFrameState(t), this.applyUniforms(t)
  13380. }, e.prototype.drawElements = function (t, e) {
  13381. var r = this.getGL(), n = r.UNSIGNED_INT, i = e - t, o = 4 * t;
  13382. r.drawElements(r.TRIANGLES, i, n, o)
  13383. }, e.prototype.finalizeDraw = function (t) {
  13384. for (var e = 0; e < this.postProcessPasses_.length; e++) this.postProcessPasses_[e].apply(t, this.postProcessPasses_[e + 1] || null)
  13385. }, e.prototype.getCanvas = function () {
  13386. return this.canvas_
  13387. }, e.prototype.getGL = function () {
  13388. return this.gl_
  13389. }, e.prototype.applyFrameState = function (t) {
  13390. var e = t.size, r = t.viewState.rotation, n = Ct(this.offsetScaleMatrix_);
  13391. Mt(n, 2 / e[0], 2 / e[1]);
  13392. var i = Ct(this.offsetRotateMatrix_);
  13393. 0 !== r && Lt(i, -r), this.setUniformMatrixValue(sh, ih(this.tmpMat4_, n)), this.setUniformMatrixValue(lh, ih(this.tmpMat4_, i)), this.setUniformFloatValue(uh, .001 * (Date.now() - this.startTime_)), this.setUniformFloatValue(ch, t.viewState.zoom), this.setUniformFloatValue(hh, t.viewState.resolution)
  13394. }, e.prototype.applyUniforms = function (t) {
  13395. var e, r = this.getGL(), n = 0;
  13396. this.uniforms_.forEach(function (i) {
  13397. if ((e = "function" == typeof i.value ? i.value(t) : i.value) instanceof HTMLCanvasElement || e instanceof HTMLImageElement || e instanceof ImageData) i.texture || (i.prevValue = void 0, i.texture = r.createTexture()), r.activeTexture(r["TEXTURE" + n]), r.bindTexture(r.TEXTURE_2D, i.texture), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_MIN_FILTER, r.LINEAR), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_S, r.CLAMP_TO_EDGE), r.texParameteri(r.TEXTURE_2D, r.TEXTURE_WRAP_T, r.CLAMP_TO_EDGE), (!(e instanceof HTMLImageElement) || e.complete) && i.prevValue !== e && (i.prevValue = e, r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, r.RGBA, r.UNSIGNED_BYTE, e)), r.uniform1i(this.getUniformLocation(i.name), n++); else if (Array.isArray(e) && 6 === e.length) this.setUniformMatrixValue(i.name, ih(this.tmpMat4_, e)); else if (Array.isArray(e) && e.length <= 4) switch (e.length) {
  13398. case 2:
  13399. return void r.uniform2f(this.getUniformLocation(i.name), e[0], e[1]);
  13400. case 3:
  13401. return void r.uniform3f(this.getUniformLocation(i.name), e[0], e[1], e[2]);
  13402. case 4:
  13403. return void r.uniform4f(this.getUniformLocation(i.name), e[0], e[1], e[2], e[3]);
  13404. default:
  13405. return
  13406. } else "number" == typeof e && r.uniform1f(this.getUniformLocation(i.name), e)
  13407. }.bind(this))
  13408. }, e.prototype.useProgram = function (t) {
  13409. return t != this.currentProgram_ && (this.getGL().useProgram(t), this.currentProgram_ = t, this.uniformLocations_ = {}, this.attribLocations_ = {}, !0)
  13410. }, e.prototype.compileShader = function (t, e) {
  13411. var r = this.getGL(), n = r.createShader(e);
  13412. return r.shaderSource(n, t), r.compileShader(n), n
  13413. }, e.prototype.getProgram = function (t, e) {
  13414. var r = this.getGL(), n = this.compileShader(t, r.FRAGMENT_SHADER), i = this.compileShader(e, r.VERTEX_SHADER);
  13415. this.shaderCompileErrors_ = null, r.getShaderInfoLog(n) && (this.shaderCompileErrors_ = "Fragment shader compilation failed:\n" + r.getShaderInfoLog(n)), r.getShaderInfoLog(i) && (this.shaderCompileErrors_ = (this.shaderCompileErrors_ || "") + "Vertex shader compilation failed:\n" + r.getShaderInfoLog(i));
  13416. var o = r.createProgram();
  13417. return r.attachShader(o, n), r.attachShader(o, i), r.linkProgram(o), o
  13418. }, e.prototype.getShaderCompileErrors = function () {
  13419. return this.shaderCompileErrors_
  13420. }, e.prototype.getUniformLocation = function (t) {
  13421. return void 0 === this.uniformLocations_[t] && (this.uniformLocations_[t] = this.getGL().getUniformLocation(this.currentProgram_, t)), this.uniformLocations_[t]
  13422. }, e.prototype.getAttributeLocation = function (t) {
  13423. return void 0 === this.attribLocations_[t] && (this.attribLocations_[t] = this.getGL().getAttribLocation(this.currentProgram_, t)), this.attribLocations_[t]
  13424. }, e.prototype.makeProjectionTransform = function (t, e) {
  13425. var r = t.size, n = t.viewState.rotation, i = t.viewState.resolution, o = t.viewState.center;
  13426. return Ct(e), kt(e, 0, 0, 2 / (i * r[0]), 2 / (i * r[1]), -n, -o[0], -o[1]), e
  13427. }, e.prototype.setUniformFloatValue = function (t, e) {
  13428. this.getGL().uniform1f(this.getUniformLocation(t), e)
  13429. }, e.prototype.setUniformMatrixValue = function (t, e) {
  13430. this.getGL().uniformMatrix4fv(this.getUniformLocation(t), !1, e)
  13431. }, e.prototype.enableAttributeArray_ = function (t, e, r, n, i) {
  13432. var o = this.getAttributeLocation(t);
  13433. o < 0 || (this.getGL().enableVertexAttribArray(o), this.getGL().vertexAttribPointer(o, e, r, !1, n, i))
  13434. }, e.prototype.enableAttributes = function (t) {
  13435. for (var e = fh(t), r = 0, n = 0; n < t.length; n++) {
  13436. var i = t[n];
  13437. this.enableAttributeArray_(i.name, i.size, i.type || 5126, e, r), r += i.size * dh(i.type)
  13438. }
  13439. }, e.prototype.handleWebGLContextLost = function () {
  13440. P(this.bufferCache_), this.currentProgram_ = null
  13441. }, e.prototype.handleWebGLContextRestored = function () {
  13442. }, e.prototype.createTexture = function (t, e, r) {
  13443. var n = this.getGL(), i = r || n.createTexture(), o = n.RGBA, a = n.RGBA, s = n.UNSIGNED_BYTE;
  13444. return n.bindTexture(n.TEXTURE_2D, i), e ? n.texImage2D(n.TEXTURE_2D, 0, o, a, s, e) : n.texImage2D(n.TEXTURE_2D, 0, o, t[0], t[1], 0, a, s, null), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_MIN_FILTER, n.LINEAR), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_S, n.CLAMP_TO_EDGE), n.texParameteri(n.TEXTURE_2D, n.TEXTURE_WRAP_T, n.CLAMP_TO_EDGE), i
  13445. }, e
  13446. }(p), yh = new Uint8Array(4), mh = function () {
  13447. function t(t, e) {
  13448. this.helper_ = t;
  13449. var r = t.getGL();
  13450. this.texture_ = r.createTexture(), this.framebuffer_ = r.createFramebuffer(), this.size_ = e || [1, 1], this.data_ = new Uint8Array(0), this.dataCacheDirty_ = !0, this.updateSize_()
  13451. }
  13452. return t.prototype.setSize = function (t) {
  13453. b(t, this.size_) || (this.size_[0] = t[0], this.size_[1] = t[1], this.updateSize_())
  13454. }, t.prototype.getSize = function () {
  13455. return this.size_
  13456. }, t.prototype.clearCachedData = function () {
  13457. this.dataCacheDirty_ = !0
  13458. }, t.prototype.readAll = function () {
  13459. if (this.dataCacheDirty_) {
  13460. var t = this.size_, e = this.helper_.getGL();
  13461. e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer_), e.readPixels(0, 0, t[0], t[1], e.RGBA, e.UNSIGNED_BYTE, this.data_), this.dataCacheDirty_ = !1
  13462. }
  13463. return this.data_
  13464. }, t.prototype.readPixel = function (t, e) {
  13465. if (t < 0 || e < 0 || t > this.size_[0] || e >= this.size_[1]) return yh[0] = 0, yh[1] = 0, yh[2] = 0, yh[3] = 0, yh;
  13466. this.readAll();
  13467. var r = Math.floor(t) + (this.size_[1] - Math.floor(e) - 1) * this.size_[0];
  13468. return yh[0] = this.data_[4 * r], yh[1] = this.data_[4 * r + 1], yh[2] = this.data_[4 * r + 2], yh[3] = this.data_[4 * r + 3], yh
  13469. }, t.prototype.getTexture = function () {
  13470. return this.texture_
  13471. }, t.prototype.getFramebuffer = function () {
  13472. return this.framebuffer_
  13473. }, t.prototype.updateSize_ = function () {
  13474. var t = this.size_, e = this.helper_.getGL();
  13475. this.texture_ = this.helper_.createTexture(t, null, this.texture_), e.bindFramebuffer(e.FRAMEBUFFER, this.framebuffer_), e.viewport(0, 0, t[0], t[1]), e.framebufferTexture2D(e.FRAMEBUFFER, e.COLOR_ATTACHMENT0, e.TEXTURE_2D, this.texture_, 0), this.data_ = new Uint8Array(t[0] * t[1] * 4)
  13476. }, t
  13477. }(), vh = 1, _h = 2, bh = 4, xh = 8, wh = 16, Sh = 31, Eh = {};
  13478. function Th(t) {
  13479. if ("number" == typeof t) return vh;
  13480. if ("boolean" == typeof t) return xh;
  13481. if ("string" == typeof t) return Io(t) ? bh | _h : _h;
  13482. if (!Array.isArray(t)) throw new Error("Unhandled value type: " + JSON.stringify(t));
  13483. var e = t;
  13484. if (e.every((function (t) {
  13485. return "number" == typeof t
  13486. }))) return 3 === e.length || 4 === e.length ? bh | wh : wh;
  13487. if ("string" != typeof e[0]) throw new Error("Expected an expression operator but received: " + JSON.stringify(e));
  13488. var r = Eh[e[0]];
  13489. if (void 0 === r) throw new Error("Unrecognized expression operator: " + JSON.stringify(e));
  13490. return r.getReturnType(e.slice(1))
  13491. }
  13492. function Ch(t) {
  13493. return Math.log2(t) % 1 == 0
  13494. }
  13495. function Oh(t) {
  13496. var e = t.toString();
  13497. return -1 === e.indexOf(".") ? e + ".0" : e
  13498. }
  13499. function Ph(t) {
  13500. if (t.length < 2 || t.length > 4) throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");
  13501. return "vec" + t.length + "(" + t.map(Oh).join(", ") + ")"
  13502. }
  13503. function Rh(t) {
  13504. var e = Oo(t).slice();
  13505. return e.length < 4 && e.push(1), Ph(e.map((function (t, e) {
  13506. return e < 3 ? t / 255 : t
  13507. })))
  13508. }
  13509. function Ih(t, e) {
  13510. return void 0 === t.stringLiteralsMap[e] && (t.stringLiteralsMap[e] = Object.keys(t.stringLiteralsMap).length), t.stringLiteralsMap[e]
  13511. }
  13512. function Lh(t, e) {
  13513. return Oh(Ih(t, e))
  13514. }
  13515. function Mh(t, e, r) {
  13516. if (Array.isArray(e) && "string" == typeof e[0]) {
  13517. var n = Eh[e[0]];
  13518. if (void 0 === n) throw new Error("Unrecognized expression operator: " + JSON.stringify(e));
  13519. return n.toGlsl(t, e.slice(1), r)
  13520. }
  13521. var i = Th(e);
  13522. return (i & vh) > 0 ? Oh(e) : (i & xh) > 0 ? e.toString() : (i & _h) > 0 && (void 0 === r || r == _h) ? Lh(t, e.toString()) : (i & bh) > 0 && (void 0 === r || r == bh) ? Rh(e) : (i & wh) > 0 ? Ph(e) : void 0
  13523. }
  13524. function Fh(t) {
  13525. if (!(Th(t) & vh)) throw new Error("A numeric value was expected, got " + JSON.stringify(t) + " instead")
  13526. }
  13527. function Ah(t) {
  13528. for (var e = 0; e < t.length; e++) Fh(t[e])
  13529. }
  13530. function kh(t) {
  13531. if (!(Th(t) & _h)) throw new Error("A string value was expected, got " + JSON.stringify(t) + " instead")
  13532. }
  13533. function jh(t) {
  13534. if (!(Th(t) & xh)) throw new Error("A boolean value was expected, got " + JSON.stringify(t) + " instead")
  13535. }
  13536. function Nh(t, e) {
  13537. if (t.length !== e) throw new Error("Exactly " + e + " arguments were expected, got " + t.length + " instead")
  13538. }
  13539. function Dh(t, e) {
  13540. if (t.length < e) throw new Error("At least " + e + " arguments were expected, got " + t.length + " instead")
  13541. }
  13542. function Gh(t, e) {
  13543. if (t.length > e) throw new Error("At most " + e + " arguments were expected, got " + t.length + " instead")
  13544. }
  13545. function zh(t) {
  13546. if (t.length % 2 != 0) throw new Error("An even amount of arguments was expected, got " + t + " instead")
  13547. }
  13548. function Uh(t, e) {
  13549. if (!Ch(e)) throw new Error("Could not infer only one type from the following expression: " + JSON.stringify(t))
  13550. }
  13551. function Bh(t) {
  13552. return {
  13553. getReturnType: function (t) {
  13554. return xh
  13555. }, toGlsl: function (e, r) {
  13556. Nh(r, 2);
  13557. for (var n = Sh, i = 0; i < r.length; i++) n &= Th(r[i]);
  13558. if (0 === n) throw new Error("All arguments should be of compatible type, got " + JSON.stringify(r) + " instead");
  13559. return "(" + Mh(e, r[0], n) + " " + t + " " + Mh(e, r[1], n) + ")"
  13560. }
  13561. }
  13562. }
  13563. function Vh(t) {
  13564. return {
  13565. getReturnType: function (t) {
  13566. return xh
  13567. }, toGlsl: function (e, r) {
  13568. Dh(r, 2);
  13569. for (var n = 0; n < r.length; n++) jh(r[n]);
  13570. return "(" + r.map((function (t) {
  13571. return Mh(e, t)
  13572. })).join(" " + t + " ") + ")"
  13573. }
  13574. }
  13575. }
  13576. Eh.get = {
  13577. getReturnType: function (t) {
  13578. return Sh
  13579. }, toGlsl: function (t, e) {
  13580. Nh(e, 1), kh(e[0]);
  13581. var r = e[0].toString();
  13582. return -1 === t.attributes.indexOf(r) && t.attributes.push(r), (t.inFragmentShader ? "v_" : "a_") + r
  13583. }
  13584. }, Eh.var = {
  13585. getReturnType: function (t) {
  13586. return Sh
  13587. }, toGlsl: function (t, e) {
  13588. Nh(e, 1), kh(e[0]);
  13589. var r = e[0].toString();
  13590. return -1 === t.variables.indexOf(r) && t.variables.push(r), "u_" + r
  13591. }
  13592. }, Eh.time = {
  13593. getReturnType: function (t) {
  13594. return vh
  13595. }, toGlsl: function (t, e) {
  13596. return Nh(e, 0), "u_time"
  13597. }
  13598. }, Eh.zoom = {
  13599. getReturnType: function (t) {
  13600. return vh
  13601. }, toGlsl: function (t, e) {
  13602. return Nh(e, 0), "u_zoom"
  13603. }
  13604. }, Eh.resolution = {
  13605. getReturnType: function (t) {
  13606. return vh
  13607. }, toGlsl: function (t, e) {
  13608. return Nh(e, 0), "u_resolution"
  13609. }
  13610. }, Eh["*"] = {
  13611. getReturnType: function (t) {
  13612. return vh
  13613. }, toGlsl: function (t, e) {
  13614. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " * " + Mh(t, e[1]) + ")"
  13615. }
  13616. }, Eh["/"] = {
  13617. getReturnType: function (t) {
  13618. return vh
  13619. }, toGlsl: function (t, e) {
  13620. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " / " + Mh(t, e[1]) + ")"
  13621. }
  13622. }, Eh["+"] = {
  13623. getReturnType: function (t) {
  13624. return vh
  13625. }, toGlsl: function (t, e) {
  13626. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " + " + Mh(t, e[1]) + ")"
  13627. }
  13628. }, Eh["-"] = {
  13629. getReturnType: function (t) {
  13630. return vh
  13631. }, toGlsl: function (t, e) {
  13632. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " - " + Mh(t, e[1]) + ")"
  13633. }
  13634. }, Eh.clamp = {
  13635. getReturnType: function (t) {
  13636. return vh
  13637. }, toGlsl: function (t, e) {
  13638. Nh(e, 3), Ah(e);
  13639. var r = Mh(t, e[1]), n = Mh(t, e[2]);
  13640. return "clamp(" + Mh(t, e[0]) + ", " + r + ", " + n + ")"
  13641. }
  13642. }, Eh["%"] = {
  13643. getReturnType: function (t) {
  13644. return vh
  13645. }, toGlsl: function (t, e) {
  13646. return Nh(e, 2), Ah(e), "mod(" + Mh(t, e[0]) + ", " + Mh(t, e[1]) + ")"
  13647. }
  13648. }, Eh["^"] = {
  13649. getReturnType: function (t) {
  13650. return vh
  13651. }, toGlsl: function (t, e) {
  13652. return Nh(e, 2), Ah(e), "pow(" + Mh(t, e[0]) + ", " + Mh(t, e[1]) + ")"
  13653. }
  13654. }, Eh[">"] = {
  13655. getReturnType: function (t) {
  13656. return xh
  13657. }, toGlsl: function (t, e) {
  13658. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " > " + Mh(t, e[1]) + ")"
  13659. }
  13660. }, Eh[">="] = {
  13661. getReturnType: function (t) {
  13662. return xh
  13663. }, toGlsl: function (t, e) {
  13664. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " >= " + Mh(t, e[1]) + ")"
  13665. }
  13666. }, Eh["<"] = {
  13667. getReturnType: function (t) {
  13668. return xh
  13669. }, toGlsl: function (t, e) {
  13670. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " < " + Mh(t, e[1]) + ")"
  13671. }
  13672. }, Eh["<="] = {
  13673. getReturnType: function (t) {
  13674. return xh
  13675. }, toGlsl: function (t, e) {
  13676. return Nh(e, 2), Ah(e), "(" + Mh(t, e[0]) + " <= " + Mh(t, e[1]) + ")"
  13677. }
  13678. }, Eh["=="] = Bh("=="), Eh["!="] = Bh("!="), Eh["!"] = {
  13679. getReturnType: function (t) {
  13680. return xh
  13681. }, toGlsl: function (t, e) {
  13682. return Nh(e, 1), jh(e[0]), "(!" + Mh(t, e[0]) + ")"
  13683. }
  13684. }, Eh.all = Vh("&&"), Eh.any = Vh("||"), Eh.between = {
  13685. getReturnType: function (t) {
  13686. return xh
  13687. }, toGlsl: function (t, e) {
  13688. Nh(e, 3), Ah(e);
  13689. var r = Mh(t, e[1]), n = Mh(t, e[2]), i = Mh(t, e[0]);
  13690. return "(" + i + " >= " + r + " && " + i + " <= " + n + ")"
  13691. }
  13692. }, Eh.array = {
  13693. getReturnType: function (t) {
  13694. return wh
  13695. }, toGlsl: function (t, e) {
  13696. Dh(e, 2), Gh(e, 4), Ah(e);
  13697. var r = e.map((function (e) {
  13698. return Mh(t, e, vh)
  13699. }));
  13700. return "vec" + e.length + "(" + r.join(", ") + ")"
  13701. }
  13702. }, Eh.color = {
  13703. getReturnType: function (t) {
  13704. return bh
  13705. }, toGlsl: function (t, e) {
  13706. Dh(e, 3), Gh(e, 4), Ah(e);
  13707. var r = e;
  13708. 3 === e.length && r.push(1);
  13709. var n = e.map((function (e, r) {
  13710. return Mh(t, e, vh) + (r < 3 ? " / 255.0" : "")
  13711. }));
  13712. return "vec" + e.length + "(" + n.join(", ") + ")"
  13713. }
  13714. }, Eh.interpolate = {
  13715. getReturnType: function (t) {
  13716. for (var e = bh | vh, r = 3; r < t.length; r += 2) e &= Th(t[r]);
  13717. return e
  13718. }, toGlsl: function (t, e, r) {
  13719. zh(e), Dh(e, 6);
  13720. var n, i = e[0];
  13721. switch (i[0]) {
  13722. case"linear":
  13723. n = 1;
  13724. break;
  13725. case"exponential":
  13726. n = i[1];
  13727. break;
  13728. default:
  13729. n = null
  13730. }
  13731. if (!n) throw new Error('Invalid interpolation type for "interpolate" operator, received: ' + JSON.stringify(i));
  13732. var o = void 0 !== r ? r : Sh, a = Eh.interpolate.getReturnType(e) & o;
  13733. Uh(e, a);
  13734. for (var s = Mh(t, e[1]), l = null, u = 2; u < e.length - 2; u += 2) {
  13735. var c = Mh(t, e[u]), h = Mh(t, e[u + 1], a), p = Mh(t, e[u + 2]);
  13736. l = "mix(" + (l || h) + ", " + Mh(t, e[u + 3], a) + ", pow(clamp((" + s + " - " + c + ") / (" + p + " - " + c + "), 0.0, 1.0), " + Oh(n) + "))"
  13737. }
  13738. return l
  13739. }
  13740. }, Eh.match = {
  13741. getReturnType: function (t) {
  13742. for (var e = Sh, r = 2; r < t.length; r += 2) e &= Th(t[r]);
  13743. return e &= Th(t[t.length - 1])
  13744. }, toGlsl: function (t, e, r) {
  13745. zh(e), Dh(e, 4);
  13746. var n = void 0 !== r ? r : Sh, i = Eh.match.getReturnType(e) & n;
  13747. Uh(e, i);
  13748. for (var o = Mh(t, e[0]), a = Mh(t, e[e.length - 1], i), s = null, l = e.length - 3; l >= 1; l -= 2) {
  13749. s = "(" + o + " == " + Mh(t, e[l]) + " ? " + Mh(t, e[l + 1], i) + " : " + (s || a) + ")"
  13750. }
  13751. return s
  13752. }
  13753. }, Eh.case = {
  13754. getReturnType: function (t) {
  13755. for (var e = Sh, r = 1; r < t.length; r += 2) e &= Th(t[r]);
  13756. return e &= Th(t[t.length - 1])
  13757. }, toGlsl: function (t, e, r) {
  13758. !function (t) {
  13759. if (t.length % 2 == 0) throw new Error("An odd amount of arguments was expected, got " + t + " instead")
  13760. }(e), Dh(e, 3);
  13761. var n = void 0 !== r ? r : Sh, i = Eh.case.getReturnType(e) & n;
  13762. Uh(e, i);
  13763. for (var o = 0; o < e.length - 1; o += 2) jh(e[o]);
  13764. var a = Mh(t, e[e.length - 1], i), s = null;
  13765. for (o = e.length - 3; o >= 0; o -= 2) {
  13766. s = "(" + Mh(t, e[o]) + " ? " + Mh(t, e[o + 1], i) + " : " + (s || a) + ")"
  13767. }
  13768. return s
  13769. }
  13770. };
  13771. var Yh = function () {
  13772. function t() {
  13773. this.uniforms = [], this.attributes = [], this.varyings = [], this.sizeExpression = "vec2(1.0)", this.rotationExpression = "0.0", this.offsetExpression = "vec2(0.0)", this.colorExpression = "vec4(1.0)", this.texCoordExpression = "vec4(0.0, 0.0, 1.0, 1.0)", this.discardExpression = "false", this.rotateWithView = !1
  13774. }
  13775. return t.prototype.addUniform = function (t) {
  13776. return this.uniforms.push(t), this
  13777. }, t.prototype.addAttribute = function (t) {
  13778. return this.attributes.push(t), this
  13779. }, t.prototype.addVarying = function (t, e, r) {
  13780. return this.varyings.push({name: t, type: e, expression: r}), this
  13781. }, t.prototype.setSizeExpression = function (t) {
  13782. return this.sizeExpression = t, this
  13783. }, t.prototype.setRotationExpression = function (t) {
  13784. return this.rotationExpression = t, this
  13785. }, t.prototype.setSymbolOffsetExpression = function (t) {
  13786. return this.offsetExpression = t, this
  13787. }, t.prototype.setColorExpression = function (t) {
  13788. return this.colorExpression = t, this
  13789. }, t.prototype.setTextureCoordinateExpression = function (t) {
  13790. return this.texCoordExpression = t, this
  13791. }, t.prototype.setFragmentDiscardExpression = function (t) {
  13792. return this.discardExpression = t, this
  13793. }, t.prototype.setSymbolRotateWithView = function (t) {
  13794. return this.rotateWithView = t, this
  13795. }, t.prototype.getSizeExpression = function () {
  13796. return this.sizeExpression
  13797. }, t.prototype.getOffsetExpression = function () {
  13798. return this.offsetExpression
  13799. }, t.prototype.getColorExpression = function () {
  13800. return this.colorExpression
  13801. }, t.prototype.getTextureCoordinateExpression = function () {
  13802. return this.texCoordExpression
  13803. }, t.prototype.getFragmentDiscardExpression = function () {
  13804. return this.discardExpression
  13805. }, t.prototype.getSymbolVertexShader = function (t) {
  13806. var e = this.rotateWithView ? "u_offsetScaleMatrix * u_offsetRotateMatrix" : "u_offsetScaleMatrix",
  13807. r = this.attributes, n = this.varyings;
  13808. return t && (r = r.concat("vec4 a_hitColor"), n = n.concat({
  13809. name: "v_hitColor",
  13810. type: "vec4",
  13811. expression: "a_hitColor"
  13812. })), "precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n" + this.uniforms.map((function (t) {
  13813. return "uniform " + t + ";"
  13814. })).join("\n") + "\nattribute vec2 a_position;\nattribute float a_index;\n" + r.map((function (t) {
  13815. return "attribute " + t + ";"
  13816. })).join("\n") + "\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n" + n.map((function (t) {
  13817. return "varying " + t.type + " " + t.name + ";"
  13818. })).join("\n") + "\nvoid main(void) {\n mat4 offsetMatrix = " + e + ";\n vec2 halfSize = " + this.sizeExpression + " * 0.5;\n vec2 offset = " + this.offsetExpression + ";\n float angle = " + this.rotationExpression + ";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = " + this.texCoordExpression + ";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n" + n.map((function (t) {
  13819. return " " + t.name + " = " + t.expression + ";"
  13820. })).join("\n") + "\n}"
  13821. }, t.prototype.getSymbolFragmentShader = function (t) {
  13822. var e = t ? " if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;" : "", r = this.varyings;
  13823. return t && (r = r.concat({
  13824. name: "v_hitColor",
  13825. type: "vec4",
  13826. expression: "a_hitColor"
  13827. })), "precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n" + this.uniforms.map((function (t) {
  13828. return "uniform " + t + ";"
  13829. })).join("\n") + "\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n" + r.map((function (t) {
  13830. return "varying " + t.type + " " + t.name + ";"
  13831. })).join("\n") + "\nvoid main(void) {\n if (" + this.discardExpression + ") { discard; }\n gl_FragColor = " + this.colorExpression + ";\n gl_FragColor.rgb *= gl_FragColor.a;\n" + e + "\n}"
  13832. }, t
  13833. }();
  13834. function Wh(t) {
  13835. var e = t.symbol, r = void 0 !== e.size ? e.size : 1, n = e.color || "white", i = e.textureCoord || [0, 0, 1, 1],
  13836. o = e.offset || [0, 0], a = void 0 !== e.opacity ? e.opacity : 1, s = void 0 !== e.rotation ? e.rotation : 0,
  13837. l = {inFragmentShader: !1, variables: [], attributes: [], stringLiteralsMap: {}}, u = Mh(l, r, wh | vh),
  13838. c = Mh(l, o, wh), h = Mh(l, i, wh), p = Mh(l, s, vh),
  13839. f = {inFragmentShader: !0, variables: l.variables, attributes: [], stringLiteralsMap: l.stringLiteralsMap},
  13840. d = Mh(f, n, bh), g = Mh(f, a, vh), y = "1.0", m = "vec2(" + Mh(f, r, wh | vh) + ").x";
  13841. switch (e.symbolType) {
  13842. case"square":
  13843. case"image":
  13844. break;
  13845. case"circle":
  13846. y = "(1.0-smoothstep(1.-4./" + m + ",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";
  13847. break;
  13848. case"triangle":
  13849. var v = "(v_quadCoord*2.-1.)", _ = "(atan(" + v + ".x," + v + ".y))";
  13850. y = "(1.0-smoothstep(.5-3./" + m + ",.5,cos(floor(.5+" + _ + "/2.094395102)*2.094395102-" + _ + ")*length(" + v + ")))";
  13851. break;
  13852. default:
  13853. throw new Error("Unexpected symbol type: " + e.symbolType)
  13854. }
  13855. var b = (new Yh).setSizeExpression("vec2(" + u + ")").setRotationExpression(p).setSymbolOffsetExpression(c).setTextureCoordinateExpression(h).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4(" + d + ".rgb, " + d + ".a * " + g + " * " + y + ")");
  13856. if (t.filter) {
  13857. var x = Mh(f, t.filter, xh);
  13858. b.setFragmentDiscardExpression("!" + x)
  13859. }
  13860. var w = {};
  13861. if (f.variables.forEach((function (e) {
  13862. b.addUniform("float u_" + e), w["u_" + e] = function () {
  13863. if (!t.variables || void 0 === t.variables[e]) throw new Error("The following variable is missing from the style: " + e);
  13864. var r = t.variables[e];
  13865. return "string" == typeof r && (r = Ih(l, r)), void 0 !== r ? r : -9999999
  13866. }
  13867. })), "image" === e.symbolType && e.src) {
  13868. var S = new Image;
  13869. S.src = e.src, b.addUniform("sampler2D u_texture").setColorExpression(b.getColorExpression() + " * texture2D(u_texture, v_texCoord)"), w.u_texture = S
  13870. }
  13871. return f.attributes.forEach((function (t) {
  13872. -1 === l.attributes.indexOf(t) && l.attributes.push(t), b.addVarying("v_" + t, "float", "a_" + t)
  13873. })), l.attributes.forEach((function (t) {
  13874. b.addAttribute("float a_" + t)
  13875. })), {
  13876. builder: b, attributes: l.attributes.map((function (t) {
  13877. return {
  13878. name: t, callback: function (e, r) {
  13879. var n = r[t];
  13880. return "string" == typeof n && (n = Ih(l, n)), void 0 !== n ? n : -9999999
  13881. }
  13882. }
  13883. })), uniforms: w
  13884. }
  13885. }
  13886. var qh = function () {
  13887. var t = function (e, r) {
  13888. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  13889. t.__proto__ = e
  13890. } || function (t, e) {
  13891. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  13892. })(e, r)
  13893. };
  13894. return function (e, r) {
  13895. function n() {
  13896. this.constructor = e
  13897. }
  13898. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  13899. }
  13900. }(), Xh = function (t) {
  13901. function e(e) {
  13902. var r = t.call(this, {
  13903. extent: e.extent,
  13904. origin: e.origin,
  13905. origins: e.origins,
  13906. resolutions: e.resolutions,
  13907. tileSize: e.tileSize,
  13908. tileSizes: e.tileSizes,
  13909. sizes: e.sizes
  13910. }) || this;
  13911. return r.matrixIds_ = e.matrixIds, r
  13912. }
  13913. return qh(e, t), e.prototype.getMatrixId = function (t) {
  13914. return this.matrixIds_[t]
  13915. }, e.prototype.getMatrixIds = function () {
  13916. return this.matrixIds_
  13917. }, e
  13918. }(ic), Zh = Xh;
  13919. function Kh(t, e, r) {
  13920. var n = [], i = [], o = [], a = [], s = [], l = void 0 !== r ? r : [], u = Gr(t.SupportedCRS),
  13921. c = u.getMetersPerUnit(), h = "ne" == u.getAxisOrientation().substr(0, 2);
  13922. return t.TileMatrix.sort((function (t, e) {
  13923. return e.ScaleDenominator - t.ScaleDenominator
  13924. })), t.TileMatrix.forEach((function (e) {
  13925. if (!(l.length > 0) || _(l, (function (r) {
  13926. return e.Identifier == r.TileMatrix || -1 === e.Identifier.indexOf(":") && t.Identifier + ":" + e.Identifier === r.TileMatrix
  13927. }))) {
  13928. i.push(e.Identifier);
  13929. var r = 28e-5 * e.ScaleDenominator / c, u = e.TileWidth, p = e.TileHeight;
  13930. h ? o.push([e.TopLeftCorner[1], e.TopLeftCorner[0]]) : o.push(e.TopLeftCorner), n.push(r), a.push(u == p ? u : [u, p]), s.push([e.MatrixWidth, e.MatrixHeight])
  13931. }
  13932. })), new Xh({extent: e, origins: o, resolutions: n, matrixIds: i, tileSizes: a, sizes: s})
  13933. }
  13934. var Hh = function () {
  13935. function t(t) {
  13936. this.opacity_ = t.opacity, this.rotateWithView_ = t.rotateWithView, this.rotation_ = t.rotation, this.scale_ = t.scale, this.scaleArray_ = Is(t.scale), this.displacement_ = t.displacement
  13937. }
  13938. return t.prototype.clone = function () {
  13939. var e = this.getScale();
  13940. return new t({
  13941. opacity: this.getOpacity(),
  13942. scale: Array.isArray(e) ? e.slice() : e,
  13943. rotation: this.getRotation(),
  13944. rotateWithView: this.getRotateWithView(),
  13945. displacement: this.getDisplacement().slice()
  13946. })
  13947. }, t.prototype.getOpacity = function () {
  13948. return this.opacity_
  13949. }, t.prototype.getRotateWithView = function () {
  13950. return this.rotateWithView_
  13951. }, t.prototype.getRotation = function () {
  13952. return this.rotation_
  13953. }, t.prototype.getScale = function () {
  13954. return this.scale_
  13955. }, t.prototype.getScaleArray = function () {
  13956. return this.scaleArray_
  13957. }, t.prototype.getDisplacement = function () {
  13958. return this.displacement_
  13959. }, t.prototype.getAnchor = function () {
  13960. return n()
  13961. }, t.prototype.getImage = function (t) {
  13962. return n()
  13963. }, t.prototype.getHitDetectionImage = function () {
  13964. return n()
  13965. }, t.prototype.getPixelRatio = function (t) {
  13966. return 1
  13967. }, t.prototype.getImageState = function () {
  13968. return n()
  13969. }, t.prototype.getImageSize = function () {
  13970. return n()
  13971. }, t.prototype.getHitDetectionImageSize = function () {
  13972. return n()
  13973. }, t.prototype.getOrigin = function () {
  13974. return n()
  13975. }, t.prototype.getSize = function () {
  13976. return n()
  13977. }, t.prototype.setOpacity = function (t) {
  13978. this.opacity_ = t
  13979. }, t.prototype.setRotateWithView = function (t) {
  13980. this.rotateWithView_ = t
  13981. }, t.prototype.setRotation = function (t) {
  13982. this.rotation_ = t
  13983. }, t.prototype.setScale = function (t) {
  13984. this.scale_ = t, this.scaleArray_ = Is(t)
  13985. }, t.prototype.listenImageChange = function (t) {
  13986. n()
  13987. }, t.prototype.load = function () {
  13988. n()
  13989. }, t.prototype.unlistenImageChange = function (t) {
  13990. n()
  13991. }, t
  13992. }(), $h = function () {
  13993. var t = function (e, r) {
  13994. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  13995. t.__proto__ = e
  13996. } || function (t, e) {
  13997. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  13998. })(e, r)
  13999. };
  14000. return function (e, r) {
  14001. function n() {
  14002. this.constructor = e
  14003. }
  14004. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14005. }
  14006. }(), Jh = function (t) {
  14007. function e(e) {
  14008. var r = this, n = void 0 !== e.rotateWithView && e.rotateWithView;
  14009. return (r = t.call(this, {
  14010. opacity: 1,
  14011. rotateWithView: n,
  14012. rotation: void 0 !== e.rotation ? e.rotation : 0,
  14013. scale: void 0 !== e.scale ? e.scale : 1,
  14014. displacement: void 0 !== e.displacement ? e.displacement : [0, 0]
  14015. }) || this).canvas_ = {}, r.hitDetectionCanvas_ = null, r.fill_ = void 0 !== e.fill ? e.fill : null, r.origin_ = [0, 0], r.points_ = e.points, r.radius_ = void 0 !== e.radius ? e.radius : e.radius1, r.radius2_ = e.radius2, r.angle_ = void 0 !== e.angle ? e.angle : 0, r.stroke_ = void 0 !== e.stroke ? e.stroke : null, r.anchor_ = null, r.size_ = null, r.imageSize_ = null, r.hitDetectionImageSize_ = null, r.render(), r
  14016. }
  14017. return $h(e, t), e.prototype.clone = function () {
  14018. var t = this.getScale(), r = new e({
  14019. fill: this.getFill() ? this.getFill().clone() : void 0,
  14020. points: this.getPoints(),
  14021. radius: this.getRadius(),
  14022. radius2: this.getRadius2(),
  14023. angle: this.getAngle(),
  14024. stroke: this.getStroke() ? this.getStroke().clone() : void 0,
  14025. rotation: this.getRotation(),
  14026. rotateWithView: this.getRotateWithView(),
  14027. scale: Array.isArray(t) ? t.slice() : t,
  14028. displacement: this.getDisplacement().slice()
  14029. });
  14030. return r.setOpacity(this.getOpacity()), r
  14031. }, e.prototype.getAnchor = function () {
  14032. return this.anchor_
  14033. }, e.prototype.getAngle = function () {
  14034. return this.angle_
  14035. }, e.prototype.getFill = function () {
  14036. return this.fill_
  14037. }, e.prototype.getHitDetectionImage = function () {
  14038. if (!this.hitDetectionCanvas_) {
  14039. var t = this.createRenderOptions();
  14040. this.createHitDetectionCanvas_(t)
  14041. }
  14042. return this.hitDetectionCanvas_
  14043. }, e.prototype.getImage = function (t) {
  14044. if (!this.canvas_[t || 1]) {
  14045. var e = this.createRenderOptions(), r = uo(e.size * t || 1, e.size * t || 1);
  14046. this.draw_(e, r, 0, 0, t || 1), this.canvas_[t || 1] = r.canvas
  14047. }
  14048. return this.canvas_[t || 1]
  14049. }, e.prototype.getPixelRatio = function (t) {
  14050. return t
  14051. }, e.prototype.getImageSize = function () {
  14052. return this.imageSize_
  14053. }, e.prototype.getHitDetectionImageSize = function () {
  14054. return this.hitDetectionImageSize_
  14055. }, e.prototype.getImageState = function () {
  14056. return ki
  14057. }, e.prototype.getOrigin = function () {
  14058. return this.origin_
  14059. }, e.prototype.getPoints = function () {
  14060. return this.points_
  14061. }, e.prototype.getRadius = function () {
  14062. return this.radius_
  14063. }, e.prototype.getRadius2 = function () {
  14064. return this.radius2_
  14065. }, e.prototype.getSize = function () {
  14066. return this.size_
  14067. }, e.prototype.getStroke = function () {
  14068. return this.stroke_
  14069. }, e.prototype.listenImageChange = function (t) {
  14070. }, e.prototype.load = function () {
  14071. }, e.prototype.unlistenImageChange = function (t) {
  14072. }, e.prototype.createRenderOptions = function () {
  14073. var t, e = "round", r = "round", n = 0, i = null, o = 0, a = 0;
  14074. return this.stroke_ && (null === (t = this.stroke_.getColor()) && (t = "#000"), t = Tu(t), void 0 === (a = this.stroke_.getWidth()) && (a = 1), i = this.stroke_.getLineDash(), o = this.stroke_.getLineDashOffset(), void 0 === (r = this.stroke_.getLineJoin()) && (r = "round"), void 0 === (e = this.stroke_.getLineCap()) && (e = "round"), void 0 === (n = this.stroke_.getMiterLimit()) && (n = 10)), {
  14075. strokeStyle: t,
  14076. strokeWidth: a,
  14077. size: 2 * (this.radius_ + a) + 1,
  14078. lineCap: e,
  14079. lineDash: i,
  14080. lineDashOffset: o,
  14081. lineJoin: r,
  14082. miterLimit: n
  14083. }
  14084. }, e.prototype.render = function () {
  14085. var t = this.createRenderOptions(), e = uo(t.size, t.size);
  14086. this.draw_(t, e, 0, 0, 1), this.canvas_ = {}, this.canvas_[1] = e.canvas;
  14087. var r = e.canvas.width, n = r, i = this.getDisplacement();
  14088. this.hitDetectionImageSize_ = [t.size, t.size], this.createHitDetectionCanvas_(t), this.anchor_ = [r / 2 - i[0], r / 2 + i[1]], this.size_ = [r, r], this.imageSize_ = [n, n]
  14089. }, e.prototype.draw_ = function (t, e, r, n, i) {
  14090. var o, a, s;
  14091. e.setTransform(i, 0, 0, i, 0, 0), e.translate(r, n), e.beginPath();
  14092. var l = this.points_;
  14093. if (l === 1 / 0) e.arc(t.size / 2, t.size / 2, this.radius_, 0, 2 * Math.PI, !0); else {
  14094. var u = void 0 !== this.radius2_ ? this.radius2_ : this.radius_;
  14095. for (u !== this.radius_ && (l *= 2), o = 0; o <= l; o++) a = 2 * o * Math.PI / l - Math.PI / 2 + this.angle_, s = o % 2 == 0 ? this.radius_ : u, e.lineTo(t.size / 2 + s * Math.cos(a), t.size / 2 + s * Math.sin(a))
  14096. }
  14097. if (this.fill_) {
  14098. var c = this.fill_.getColor();
  14099. null === c && (c = "#000"), e.fillStyle = Tu(c), e.fill()
  14100. }
  14101. this.stroke_ && (e.strokeStyle = t.strokeStyle, e.lineWidth = t.strokeWidth, e.setLineDash && t.lineDash && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.lineCap = t.lineCap, e.lineJoin = t.lineJoin, e.miterLimit = t.miterLimit, e.stroke()), e.closePath()
  14102. }, e.prototype.createHitDetectionCanvas_ = function (t) {
  14103. if (this.hitDetectionCanvas_ = this.getImage(1), this.fill_) {
  14104. var e = this.fill_.getColor(), r = 0;
  14105. if ("string" == typeof e && (e = Oo(e)), null === e ? r = 1 : Array.isArray(e) && (r = 4 === e.length ? e[3] : 1), 0 === r) {
  14106. var n = uo(t.size, t.size);
  14107. this.hitDetectionCanvas_ = n.canvas, this.drawHitDetectionCanvas_(t, n, 0, 0)
  14108. }
  14109. }
  14110. }, e.prototype.drawHitDetectionCanvas_ = function (t, e, r, n) {
  14111. e.translate(r, n), e.beginPath();
  14112. var i = this.points_;
  14113. if (i === 1 / 0) e.arc(t.size / 2, t.size / 2, this.radius_, 0, 2 * Math.PI, !0); else {
  14114. var o = void 0 !== this.radius2_ ? this.radius2_ : this.radius_;
  14115. o !== this.radius_ && (i *= 2);
  14116. var a = void 0, s = void 0, l = void 0;
  14117. for (a = 0; a <= i; a++) l = 2 * a * Math.PI / i - Math.PI / 2 + this.angle_, s = a % 2 == 0 ? this.radius_ : o, e.lineTo(t.size / 2 + s * Math.cos(l), t.size / 2 + s * Math.sin(l))
  14118. }
  14119. e.fillStyle = "#000", e.fill(), this.stroke_ && (e.strokeStyle = t.strokeStyle, e.lineWidth = t.strokeWidth, t.lineDash && (e.setLineDash(t.lineDash), e.lineDashOffset = t.lineDashOffset), e.stroke()), e.closePath()
  14120. }, e
  14121. }(Hh), Qh = function () {
  14122. var t = function (e, r) {
  14123. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  14124. t.__proto__ = e
  14125. } || function (t, e) {
  14126. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  14127. })(e, r)
  14128. };
  14129. return function (e, r) {
  14130. function n() {
  14131. this.constructor = e
  14132. }
  14133. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14134. }
  14135. }(), tp = function (t) {
  14136. function e(e) {
  14137. var r = e || {};
  14138. return t.call(this, {
  14139. points: 1 / 0,
  14140. fill: r.fill,
  14141. radius: r.radius,
  14142. stroke: r.stroke,
  14143. scale: void 0 !== r.scale ? r.scale : 1,
  14144. rotation: void 0 !== r.rotation ? r.rotation : 0,
  14145. rotateWithView: void 0 !== r.rotateWithView && r.rotateWithView,
  14146. displacement: void 0 !== r.displacement ? r.displacement : [0, 0]
  14147. }) || this
  14148. }
  14149. return Qh(e, t), e.prototype.clone = function () {
  14150. var t = this.getScale(), r = new e({
  14151. fill: this.getFill() ? this.getFill().clone() : void 0,
  14152. stroke: this.getStroke() ? this.getStroke().clone() : void 0,
  14153. radius: this.getRadius(),
  14154. scale: Array.isArray(t) ? t.slice() : t,
  14155. rotation: this.getRotation(),
  14156. rotateWithView: this.getRotateWithView(),
  14157. displacement: this.getDisplacement().slice()
  14158. });
  14159. return r.setOpacity(this.getOpacity()), r
  14160. }, e.prototype.setRadius = function (t) {
  14161. this.radius_ = t, this.render()
  14162. }, e
  14163. }(Jh), ep = function () {
  14164. function t(t) {
  14165. var e = t || {};
  14166. this.color_ = void 0 !== e.color ? e.color : null
  14167. }
  14168. return t.prototype.clone = function () {
  14169. var e = this.getColor();
  14170. return new t({color: Array.isArray(e) ? e.slice() : e || void 0})
  14171. }, t.prototype.getColor = function () {
  14172. return this.color_
  14173. }, t.prototype.setColor = function (t) {
  14174. this.color_ = t
  14175. }, t
  14176. }(), rp = "fraction", np = "pixels", ip = "bottom-left", op = "bottom-right", ap = "top-left", sp = "top-right",
  14177. lp = function () {
  14178. var t = function (e, r) {
  14179. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  14180. t.__proto__ = e
  14181. } || function (t, e) {
  14182. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  14183. })(e, r)
  14184. };
  14185. return function (e, r) {
  14186. function n() {
  14187. this.constructor = e
  14188. }
  14189. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14190. }
  14191. }(), up = null, cp = function (t) {
  14192. function e(e, r, n, i, o, a) {
  14193. var s = t.call(this) || this;
  14194. return s.hitDetectionImage_ = null, s.image_ = e || new Image, null !== i && (s.image_.crossOrigin = i), s.canvas_ = {}, s.color_ = a, s.unlisten_ = null, s.imageState_ = o, s.size_ = n, s.src_ = r, s.tainted_, s
  14195. }
  14196. return lp(e, t), e.prototype.isTainted_ = function () {
  14197. if (void 0 === this.tainted_ && this.imageState_ === ki) {
  14198. up || (up = uo(1, 1)), up.drawImage(this.image_, 0, 0);
  14199. try {
  14200. up.getImageData(0, 0, 1, 1), this.tainted_ = !1
  14201. } catch (t) {
  14202. up = null, this.tainted_ = !0
  14203. }
  14204. }
  14205. return !0 === this.tainted_
  14206. }, e.prototype.dispatchChangeEvent_ = function () {
  14207. this.dispatchEvent(F)
  14208. }, e.prototype.handleImageError_ = function () {
  14209. this.imageState_ = ji, this.unlistenImage_(), this.dispatchChangeEvent_()
  14210. }, e.prototype.handleImageLoad_ = function () {
  14211. this.imageState_ = ki, this.size_ ? (this.image_.width = this.size_[0], this.image_.height = this.size_[1]) : this.size_ = [this.image_.width, this.image_.height], this.unlistenImage_(), this.dispatchChangeEvent_()
  14212. }, e.prototype.getImage = function (t) {
  14213. return this.replaceColor_(t), this.canvas_[t] ? this.canvas_[t] : this.image_
  14214. }, e.prototype.getPixelRatio = function (t) {
  14215. return this.replaceColor_(t), this.canvas_[t] ? t : 1
  14216. }, e.prototype.getImageState = function () {
  14217. return this.imageState_
  14218. }, e.prototype.getHitDetectionImage = function () {
  14219. if (!this.hitDetectionImage_) if (this.isTainted_()) {
  14220. var t = this.size_[0], e = this.size_[1], r = uo(t, e);
  14221. r.fillRect(0, 0, t, e), this.hitDetectionImage_ = r.canvas
  14222. } else this.hitDetectionImage_ = this.image_;
  14223. return this.hitDetectionImage_
  14224. }, e.prototype.getSize = function () {
  14225. return this.size_
  14226. }, e.prototype.getSrc = function () {
  14227. return this.src_
  14228. }, e.prototype.load = function () {
  14229. if (this.imageState_ == Fi) {
  14230. this.imageState_ = Ai;
  14231. try {
  14232. this.image_.src = this.src_
  14233. } catch (t) {
  14234. this.handleImageError_()
  14235. }
  14236. this.unlisten_ = Zi(this.image_, this.handleImageLoad_.bind(this), this.handleImageError_.bind(this))
  14237. }
  14238. }, e.prototype.replaceColor_ = function (t) {
  14239. if (this.color_ && !this.canvas_[t]) {
  14240. var e = document.createElement("canvas");
  14241. this.canvas_[t] = e, e.width = Math.ceil(this.image_.width * t), e.height = Math.ceil(this.image_.height * t);
  14242. var r = e.getContext("2d");
  14243. if (r.scale(t, t), r.drawImage(this.image_, 0, 0), r.globalCompositeOperation = "multiply", "multiply" === r.globalCompositeOperation || this.isTainted_()) r.fillStyle = wo(this.color_), r.fillRect(0, 0, e.width, e.height), r.globalCompositeOperation = "destination-in", r.drawImage(this.image_, 0, 0); else {
  14244. for (var n = r.getImageData(0, 0, e.width, e.height), i = n.data, o = this.color_[0] / 255, a = this.color_[1] / 255, s = this.color_[2] / 255, l = this.color_[3], u = 0, c = i.length; u < c; u += 4) i[u] *= o, i[u + 1] *= a, i[u + 2] *= s, i[u + 3] *= l;
  14245. r.putImageData(n, 0, 0)
  14246. }
  14247. }
  14248. }, e.prototype.unlistenImage_ = function () {
  14249. this.unlisten_ && (this.unlisten_(), this.unlisten_ = null)
  14250. }, e
  14251. }(M);
  14252. function hp(t, e, r, n, i, o) {
  14253. var a = Ao.get(e, n, o);
  14254. return a || (a = new cp(t, e, r, n, i, o), Ao.set(e, n, o, a)), a
  14255. }
  14256. var pp = cp, fp = function () {
  14257. var t = function (e, r) {
  14258. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  14259. t.__proto__ = e
  14260. } || function (t, e) {
  14261. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  14262. })(e, r)
  14263. };
  14264. return function (e, r) {
  14265. function n() {
  14266. this.constructor = e
  14267. }
  14268. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14269. }
  14270. }(), dp = function (t) {
  14271. function e(e) {
  14272. var r = this, n = e || {}, i = void 0 !== n.opacity ? n.opacity : 1, a = void 0 !== n.rotation ? n.rotation : 0,
  14273. s = void 0 !== n.scale ? n.scale : 1, l = void 0 !== n.rotateWithView && n.rotateWithView;
  14274. (r = t.call(this, {
  14275. opacity: i,
  14276. rotation: a,
  14277. scale: s,
  14278. displacement: void 0 !== n.displacement ? n.displacement : [0, 0],
  14279. rotateWithView: l
  14280. }) || this).anchor_ = void 0 !== n.anchor ? n.anchor : [.5, .5], r.normalizedAnchor_ = null, r.anchorOrigin_ = void 0 !== n.anchorOrigin ? n.anchorOrigin : ap, r.anchorXUnits_ = void 0 !== n.anchorXUnits ? n.anchorXUnits : rp, r.anchorYUnits_ = void 0 !== n.anchorYUnits ? n.anchorYUnits : rp, r.crossOrigin_ = void 0 !== n.crossOrigin ? n.crossOrigin : null;
  14281. var u = void 0 !== n.img ? n.img : null, c = void 0 !== n.imgSize ? n.imgSize : null, h = n.src;
  14282. pt(!(void 0 !== h && u), 4), pt(!u || u && c, 5), void 0 !== h && 0 !== h.length || !u || (h = u.src || o(u)), pt(void 0 !== h && h.length > 0, 6);
  14283. var p = void 0 !== n.src ? Fi : ki;
  14284. return r.color_ = void 0 !== n.color ? Oo(n.color) : null, r.iconImage_ = hp(u, h, c, r.crossOrigin_, p, r.color_), r.offset_ = void 0 !== n.offset ? n.offset : [0, 0], r.offsetOrigin_ = void 0 !== n.offsetOrigin ? n.offsetOrigin : ap, r.origin_ = null, r.size_ = void 0 !== n.size ? n.size : null, r
  14285. }
  14286. return fp(e, t), e.prototype.clone = function () {
  14287. var t = this.getScale();
  14288. return new e({
  14289. anchor: this.anchor_.slice(),
  14290. anchorOrigin: this.anchorOrigin_,
  14291. anchorXUnits: this.anchorXUnits_,
  14292. anchorYUnits: this.anchorYUnits_,
  14293. crossOrigin: this.crossOrigin_,
  14294. color: this.color_ && this.color_.slice ? this.color_.slice() : this.color_ || void 0,
  14295. src: this.getSrc(),
  14296. offset: this.offset_.slice(),
  14297. offsetOrigin: this.offsetOrigin_,
  14298. size: null !== this.size_ ? this.size_.slice() : void 0,
  14299. opacity: this.getOpacity(),
  14300. scale: Array.isArray(t) ? t.slice() : t,
  14301. rotation: this.getRotation(),
  14302. rotateWithView: this.getRotateWithView()
  14303. })
  14304. }, e.prototype.getAnchor = function () {
  14305. if (this.normalizedAnchor_) return this.normalizedAnchor_;
  14306. var t = this.anchor_, e = this.getSize();
  14307. if (this.anchorXUnits_ == rp || this.anchorYUnits_ == rp) {
  14308. if (!e) return null;
  14309. t = this.anchor_.slice(), this.anchorXUnits_ == rp && (t[0] *= e[0]), this.anchorYUnits_ == rp && (t[1] *= e[1])
  14310. }
  14311. if (this.anchorOrigin_ != ap) {
  14312. if (!e) return null;
  14313. t === this.anchor_ && (t = this.anchor_.slice()), this.anchorOrigin_ != sp && this.anchorOrigin_ != op || (t[0] = -t[0] + e[0]), this.anchorOrigin_ != ip && this.anchorOrigin_ != op || (t[1] = -t[1] + e[1])
  14314. }
  14315. return this.normalizedAnchor_ = t, this.normalizedAnchor_
  14316. }, e.prototype.setAnchor = function (t) {
  14317. this.anchor_ = t, this.normalizedAnchor_ = null
  14318. }, e.prototype.getColor = function () {
  14319. return this.color_
  14320. }, e.prototype.getImage = function (t) {
  14321. return this.iconImage_.getImage(t)
  14322. }, e.prototype.getPixelRatio = function (t) {
  14323. return this.iconImage_.getPixelRatio(t)
  14324. }, e.prototype.getImageSize = function () {
  14325. return this.iconImage_.getSize()
  14326. }, e.prototype.getHitDetectionImageSize = function () {
  14327. return this.getImageSize()
  14328. }, e.prototype.getImageState = function () {
  14329. return this.iconImage_.getImageState()
  14330. }, e.prototype.getHitDetectionImage = function () {
  14331. return this.iconImage_.getHitDetectionImage()
  14332. }, e.prototype.getOrigin = function () {
  14333. if (this.origin_) return this.origin_;
  14334. var t = this.offset_, e = this.getDisplacement();
  14335. if (this.offsetOrigin_ != ap) {
  14336. var r = this.getSize(), n = this.iconImage_.getSize();
  14337. if (!r || !n) return null;
  14338. t = t.slice(), this.offsetOrigin_ != sp && this.offsetOrigin_ != op || (t[0] = n[0] - r[0] - t[0]), this.offsetOrigin_ != ip && this.offsetOrigin_ != op || (t[1] = n[1] - r[1] - t[1])
  14339. }
  14340. return t[0] += e[0], t[1] += e[1], this.origin_ = t, this.origin_
  14341. }, e.prototype.getSrc = function () {
  14342. return this.iconImage_.getSrc()
  14343. }, e.prototype.getSize = function () {
  14344. return this.size_ ? this.size_ : this.iconImage_.getSize()
  14345. }, e.prototype.listenImageChange = function (t) {
  14346. this.iconImage_.addEventListener(F, t)
  14347. }, e.prototype.load = function () {
  14348. this.iconImage_.load()
  14349. }, e.prototype.unlistenImageChange = function (t) {
  14350. this.iconImage_.removeEventListener(F, t)
  14351. }, e
  14352. }(Hh), gp = function () {
  14353. function t(t) {
  14354. var e = t || {};
  14355. this.color_ = void 0 !== e.color ? e.color : null, this.lineCap_ = e.lineCap, this.lineDash_ = void 0 !== e.lineDash ? e.lineDash : null, this.lineDashOffset_ = e.lineDashOffset, this.lineJoin_ = e.lineJoin, this.miterLimit_ = e.miterLimit, this.width_ = e.width
  14356. }
  14357. return t.prototype.clone = function () {
  14358. var e = this.getColor();
  14359. return new t({
  14360. color: Array.isArray(e) ? e.slice() : e || void 0,
  14361. lineCap: this.getLineCap(),
  14362. lineDash: this.getLineDash() ? this.getLineDash().slice() : void 0,
  14363. lineDashOffset: this.getLineDashOffset(),
  14364. lineJoin: this.getLineJoin(),
  14365. miterLimit: this.getMiterLimit(),
  14366. width: this.getWidth()
  14367. })
  14368. }, t.prototype.getColor = function () {
  14369. return this.color_
  14370. }, t.prototype.getLineCap = function () {
  14371. return this.lineCap_
  14372. }, t.prototype.getLineDash = function () {
  14373. return this.lineDash_
  14374. }, t.prototype.getLineDashOffset = function () {
  14375. return this.lineDashOffset_
  14376. }, t.prototype.getLineJoin = function () {
  14377. return this.lineJoin_
  14378. }, t.prototype.getMiterLimit = function () {
  14379. return this.miterLimit_
  14380. }, t.prototype.getWidth = function () {
  14381. return this.width_
  14382. }, t.prototype.setColor = function (t) {
  14383. this.color_ = t
  14384. }, t.prototype.setLineCap = function (t) {
  14385. this.lineCap_ = t
  14386. }, t.prototype.setLineDash = function (t) {
  14387. this.lineDash_ = t
  14388. }, t.prototype.setLineDashOffset = function (t) {
  14389. this.lineDashOffset_ = t
  14390. }, t.prototype.setLineJoin = function (t) {
  14391. this.lineJoin_ = t
  14392. }, t.prototype.setMiterLimit = function (t) {
  14393. this.miterLimit_ = t
  14394. }, t.prototype.setWidth = function (t) {
  14395. this.width_ = t
  14396. }, t
  14397. }(), yp = function () {
  14398. function t(t) {
  14399. var e = t || {};
  14400. this.geometry_ = null, this.geometryFunction_ = xp, void 0 !== e.geometry && this.setGeometry(e.geometry), this.fill_ = void 0 !== e.fill ? e.fill : null, this.image_ = void 0 !== e.image ? e.image : null, this.renderer_ = void 0 !== e.renderer ? e.renderer : null, this.stroke_ = void 0 !== e.stroke ? e.stroke : null, this.text_ = void 0 !== e.text ? e.text : null, this.zIndex_ = e.zIndex
  14401. }
  14402. return t.prototype.clone = function () {
  14403. var e = this.getGeometry();
  14404. return e && "object" == typeof e && (e = e.clone()), new t({
  14405. geometry: e,
  14406. fill: this.getFill() ? this.getFill().clone() : void 0,
  14407. image: this.getImage() ? this.getImage().clone() : void 0,
  14408. stroke: this.getStroke() ? this.getStroke().clone() : void 0,
  14409. text: this.getText() ? this.getText().clone() : void 0,
  14410. zIndex: this.getZIndex()
  14411. })
  14412. }, t.prototype.getRenderer = function () {
  14413. return this.renderer_
  14414. }, t.prototype.setRenderer = function (t) {
  14415. this.renderer_ = t
  14416. }, t.prototype.getGeometry = function () {
  14417. return this.geometry_
  14418. }, t.prototype.getGeometryFunction = function () {
  14419. return this.geometryFunction_
  14420. }, t.prototype.getFill = function () {
  14421. return this.fill_
  14422. }, t.prototype.setFill = function (t) {
  14423. this.fill_ = t
  14424. }, t.prototype.getImage = function () {
  14425. return this.image_
  14426. }, t.prototype.setImage = function (t) {
  14427. this.image_ = t
  14428. }, t.prototype.getStroke = function () {
  14429. return this.stroke_
  14430. }, t.prototype.setStroke = function (t) {
  14431. this.stroke_ = t
  14432. }, t.prototype.getText = function () {
  14433. return this.text_
  14434. }, t.prototype.setText = function (t) {
  14435. this.text_ = t
  14436. }, t.prototype.getZIndex = function () {
  14437. return this.zIndex_
  14438. }, t.prototype.setGeometry = function (t) {
  14439. "function" == typeof t ? this.geometryFunction_ = t : "string" == typeof t ? this.geometryFunction_ = function (e) {
  14440. return e.get(t)
  14441. } : t ? void 0 !== t && (this.geometryFunction_ = function () {
  14442. return t
  14443. }) : this.geometryFunction_ = xp, this.geometry_ = t
  14444. }, t.prototype.setZIndex = function (t) {
  14445. this.zIndex_ = t
  14446. }, t
  14447. }();
  14448. function mp(t) {
  14449. var e;
  14450. if ("function" == typeof t) e = t; else {
  14451. var r;
  14452. if (Array.isArray(t)) r = t; else pt("function" == typeof t.getZIndex, 41), r = [t];
  14453. e = function () {
  14454. return r
  14455. }
  14456. }
  14457. return e
  14458. }
  14459. var vp = null;
  14460. function _p(t, e) {
  14461. if (!vp) {
  14462. var r = new ep({color: "rgba(255,255,255,0.4)"}), n = new gp({color: "#3399CC", width: 1.25});
  14463. vp = [new yp({image: new tp({fill: r, stroke: n, radius: 5}), fill: r, stroke: n})]
  14464. }
  14465. return vp
  14466. }
  14467. function bp() {
  14468. var t = {}, e = [255, 255, 255, 1], r = [0, 153, 255, 1];
  14469. return t[bt.POLYGON] = [new yp({fill: new ep({color: [255, 255, 255, .5]})})], t[bt.MULTI_POLYGON] = t[bt.POLYGON], t[bt.LINE_STRING] = [new yp({
  14470. stroke: new gp({
  14471. color: e,
  14472. width: 5
  14473. })
  14474. }), new yp({
  14475. stroke: new gp({
  14476. color: r,
  14477. width: 3
  14478. })
  14479. })], t[bt.MULTI_LINE_STRING] = t[bt.LINE_STRING], t[bt.CIRCLE] = t[bt.POLYGON].concat(t[bt.LINE_STRING]), t[bt.POINT] = [new yp({
  14480. image: new tp({
  14481. radius: 6,
  14482. fill: new ep({color: r}),
  14483. stroke: new gp({color: e, width: 1.5})
  14484. }), zIndex: 1 / 0
  14485. })], t[bt.MULTI_POINT] = t[bt.POINT], t[bt.GEOMETRY_COLLECTION] = t[bt.POLYGON].concat(t[bt.LINE_STRING], t[bt.POINT]), t
  14486. }
  14487. function xp(t) {
  14488. return t.getGeometry()
  14489. }
  14490. var wp = yp, Sp = "point", Ep = "line", Tp = function () {
  14491. function t(t) {
  14492. var e = t || {};
  14493. this.font_ = e.font, this.rotation_ = e.rotation, this.rotateWithView_ = e.rotateWithView, this.scale_ = e.scale, this.scaleArray_ = Is(void 0 !== e.scale ? e.scale : 1), this.text_ = e.text, this.textAlign_ = e.textAlign, this.textBaseline_ = e.textBaseline, this.fill_ = void 0 !== e.fill ? e.fill : new ep({color: "#333"}), this.maxAngle_ = void 0 !== e.maxAngle ? e.maxAngle : Math.PI / 4, this.placement_ = void 0 !== e.placement ? e.placement : Sp, this.overflow_ = !!e.overflow, this.stroke_ = void 0 !== e.stroke ? e.stroke : null, this.offsetX_ = void 0 !== e.offsetX ? e.offsetX : 0, this.offsetY_ = void 0 !== e.offsetY ? e.offsetY : 0, this.backgroundFill_ = e.backgroundFill ? e.backgroundFill : null, this.backgroundStroke_ = e.backgroundStroke ? e.backgroundStroke : null, this.padding_ = void 0 === e.padding ? null : e.padding
  14494. }
  14495. return t.prototype.clone = function () {
  14496. var e = this.getScale();
  14497. return new t({
  14498. font: this.getFont(),
  14499. placement: this.getPlacement(),
  14500. maxAngle: this.getMaxAngle(),
  14501. overflow: this.getOverflow(),
  14502. rotation: this.getRotation(),
  14503. rotateWithView: this.getRotateWithView(),
  14504. scale: Array.isArray(e) ? e.slice() : e,
  14505. text: this.getText(),
  14506. textAlign: this.getTextAlign(),
  14507. textBaseline: this.getTextBaseline(),
  14508. fill: this.getFill() ? this.getFill().clone() : void 0,
  14509. stroke: this.getStroke() ? this.getStroke().clone() : void 0,
  14510. offsetX: this.getOffsetX(),
  14511. offsetY: this.getOffsetY(),
  14512. backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : void 0,
  14513. backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : void 0,
  14514. padding: this.getPadding()
  14515. })
  14516. }, t.prototype.getOverflow = function () {
  14517. return this.overflow_
  14518. }, t.prototype.getFont = function () {
  14519. return this.font_
  14520. }, t.prototype.getMaxAngle = function () {
  14521. return this.maxAngle_
  14522. }, t.prototype.getPlacement = function () {
  14523. return this.placement_
  14524. }, t.prototype.getOffsetX = function () {
  14525. return this.offsetX_
  14526. }, t.prototype.getOffsetY = function () {
  14527. return this.offsetY_
  14528. }, t.prototype.getFill = function () {
  14529. return this.fill_
  14530. }, t.prototype.getRotateWithView = function () {
  14531. return this.rotateWithView_
  14532. }, t.prototype.getRotation = function () {
  14533. return this.rotation_
  14534. }, t.prototype.getScale = function () {
  14535. return this.scale_
  14536. }, t.prototype.getScaleArray = function () {
  14537. return this.scaleArray_
  14538. }, t.prototype.getStroke = function () {
  14539. return this.stroke_
  14540. }, t.prototype.getText = function () {
  14541. return this.text_
  14542. }, t.prototype.getTextAlign = function () {
  14543. return this.textAlign_
  14544. }, t.prototype.getTextBaseline = function () {
  14545. return this.textBaseline_
  14546. }, t.prototype.getBackgroundFill = function () {
  14547. return this.backgroundFill_
  14548. }, t.prototype.getBackgroundStroke = function () {
  14549. return this.backgroundStroke_
  14550. }, t.prototype.getPadding = function () {
  14551. return this.padding_
  14552. }, t.prototype.setOverflow = function (t) {
  14553. this.overflow_ = t
  14554. }, t.prototype.setFont = function (t) {
  14555. this.font_ = t
  14556. }, t.prototype.setMaxAngle = function (t) {
  14557. this.maxAngle_ = t
  14558. }, t.prototype.setOffsetX = function (t) {
  14559. this.offsetX_ = t
  14560. }, t.prototype.setOffsetY = function (t) {
  14561. this.offsetY_ = t
  14562. }, t.prototype.setPlacement = function (t) {
  14563. this.placement_ = t
  14564. }, t.prototype.setRotateWithView = function (t) {
  14565. this.rotateWithView_ = t
  14566. }, t.prototype.setFill = function (t) {
  14567. this.fill_ = t
  14568. }, t.prototype.setRotation = function (t) {
  14569. this.rotation_ = t
  14570. }, t.prototype.setScale = function (t) {
  14571. this.scale_ = t, this.scaleArray_ = Is(void 0 !== t ? t : 1)
  14572. }, t.prototype.setStroke = function (t) {
  14573. this.stroke_ = t
  14574. }, t.prototype.setText = function (t) {
  14575. this.text_ = t
  14576. }, t.prototype.setTextAlign = function (t) {
  14577. this.textAlign_ = t
  14578. }, t.prototype.setTextBaseline = function (t) {
  14579. this.textBaseline_ = t
  14580. }, t.prototype.setBackgroundFill = function (t) {
  14581. this.backgroundFill_ = t
  14582. }, t.prototype.setBackgroundStroke = function (t) {
  14583. this.backgroundStroke_ = t
  14584. }, t.prototype.setPadding = function (t) {
  14585. this.padding_ = t
  14586. }, t
  14587. }(), Cp = function () {
  14588. function t(t) {
  14589. this.first_, this.last_, this.head_, this.circular_ = void 0 === t || t, this.length_ = 0
  14590. }
  14591. return t.prototype.insertItem = function (t) {
  14592. var e = {prev: void 0, next: void 0, data: t}, r = this.head_;
  14593. if (r) {
  14594. var n = r.next;
  14595. e.prev = r, e.next = n, r.next = e, n && (n.prev = e), r === this.last_ && (this.last_ = e)
  14596. } else this.first_ = e, this.last_ = e, this.circular_ && (e.next = e, e.prev = e);
  14597. this.head_ = e, this.length_++
  14598. }, t.prototype.removeItem = function () {
  14599. var t = this.head_;
  14600. if (t) {
  14601. var e = t.next, r = t.prev;
  14602. e && (e.prev = r), r && (r.next = e), this.head_ = e || r, this.first_ === this.last_ ? (this.head_ = void 0, this.first_ = void 0, this.last_ = void 0) : this.first_ === t ? this.first_ = this.head_ : this.last_ === t && (this.last_ = r ? this.head_.prev : this.head_), this.length_--
  14603. }
  14604. }, t.prototype.firstItem = function () {
  14605. if (this.head_ = this.first_, this.head_) return this.head_.data
  14606. }, t.prototype.lastItem = function () {
  14607. if (this.head_ = this.last_, this.head_) return this.head_.data
  14608. }, t.prototype.nextItem = function () {
  14609. if (this.head_ && this.head_.next) return this.head_ = this.head_.next, this.head_.data
  14610. }, t.prototype.getNextItem = function () {
  14611. if (this.head_ && this.head_.next) return this.head_.next.data
  14612. }, t.prototype.prevItem = function () {
  14613. if (this.head_ && this.head_.prev) return this.head_ = this.head_.prev, this.head_.data
  14614. }, t.prototype.getPrevItem = function () {
  14615. if (this.head_ && this.head_.prev) return this.head_.prev.data
  14616. }, t.prototype.getCurrItem = function () {
  14617. if (this.head_) return this.head_.data
  14618. }, t.prototype.setFirstItem = function () {
  14619. this.circular_ && this.head_ && (this.first_ = this.head_, this.last_ = this.head_.prev)
  14620. }, t.prototype.concat = function (t) {
  14621. if (t.head_) {
  14622. if (this.head_) {
  14623. var e = this.head_.next;
  14624. this.head_.next = t.first_, t.first_.prev = this.head_, e.prev = t.last_, t.last_.next = e, this.length_ += t.length_
  14625. } else this.head_ = t.head_, this.first_ = t.first_, this.last_ = t.last_, this.length_ = t.length_;
  14626. t.head_ = void 0, t.first_ = void 0, t.last_ = void 0, t.length_ = 0
  14627. }
  14628. }, t.prototype.getLength = function () {
  14629. return this.length_
  14630. }, t
  14631. }(), Op = r(1), Pp = r.n(Op), Rp = function () {
  14632. function t(t) {
  14633. this.rbush_ = new Pp.a(t), this.items_ = {}
  14634. }
  14635. return t.prototype.insert = function (t, e) {
  14636. var r = {minX: t[0], minY: t[1], maxX: t[2], maxY: t[3], value: e};
  14637. this.rbush_.insert(r), this.items_[o(e)] = r
  14638. }, t.prototype.load = function (t, e) {
  14639. for (var r = new Array(e.length), n = 0, i = e.length; n < i; n++) {
  14640. var a = t[n], s = e[n], l = {minX: a[0], minY: a[1], maxX: a[2], maxY: a[3], value: s};
  14641. r[n] = l, this.items_[o(s)] = l
  14642. }
  14643. this.rbush_.load(r)
  14644. }, t.prototype.remove = function (t) {
  14645. var e = o(t), r = this.items_[e];
  14646. return delete this.items_[e], null !== this.rbush_.remove(r)
  14647. }, t.prototype.update = function (t, e) {
  14648. var r = this.items_[o(e)];
  14649. ue([r.minX, r.minY, r.maxX, r.maxY], t) || (this.remove(e), this.insert(t, e))
  14650. }, t.prototype.getAll = function () {
  14651. return this.rbush_.all().map((function (t) {
  14652. return t.value
  14653. }))
  14654. }, t.prototype.getInExtent = function (t) {
  14655. var e = {minX: t[0], minY: t[1], maxX: t[2], maxY: t[3]};
  14656. return this.rbush_.search(e).map((function (t) {
  14657. return t.value
  14658. }))
  14659. }, t.prototype.forEach = function (t) {
  14660. return this.forEach_(this.getAll(), t)
  14661. }, t.prototype.forEachInExtent = function (t, e) {
  14662. return this.forEach_(this.getInExtent(t), e)
  14663. }, t.prototype.forEach_ = function (t, e) {
  14664. for (var r, n = 0, i = t.length; n < i; n++) if (r = e(t[n])) return r;
  14665. return r
  14666. }, t.prototype.isEmpty = function () {
  14667. return I(this.items_)
  14668. }, t.prototype.clear = function () {
  14669. this.rbush_.clear(), this.items_ = {}
  14670. }, t.prototype.getExtent = function (t) {
  14671. var e = this.rbush_.toJSON();
  14672. return ie(e.minX, e.minY, e.maxX, e.maxY, t)
  14673. }, t.prototype.concat = function (t) {
  14674. for (var e in this.rbush_.load(t.rbush_.all()), t.items_) this.items_[e] = t.items_[e]
  14675. }, t
  14676. }(), Ip = function () {
  14677. function t(t, e, r, n, i, o) {
  14678. this.sourceProj_ = t, this.targetProj_ = e;
  14679. var a = {}, s = Kr(this.targetProj_, this.sourceProj_);
  14680. this.transformInv_ = function (t) {
  14681. var e = t[0] + "/" + t[1];
  14682. return a[e] || (a[e] = s(t)), a[e]
  14683. }, this.maxSourceExtent_ = n, this.errorThresholdSquared_ = i * i, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!n && !!this.sourceProj_.getExtent() && Pe(n) == Pe(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? Pe(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? Pe(this.targetProj_.getExtent()) : null;
  14684. var l = Ce(r), u = Oe(r), c = be(r), h = _e(r), p = this.transformInv_(l), f = this.transformInv_(u),
  14685. d = this.transformInv_(c), g = this.transformInv_(h),
  14686. y = 10 + (o ? Math.max(0, Math.ceil(Ge(ve(r) / (o * o * 256 * 256)))) : 0);
  14687. if (this.addQuad_(l, u, c, h, p, f, d, g, y), this.wrapsXInSource_) {
  14688. var m = 1 / 0;
  14689. this.triangles_.forEach((function (t, e, r) {
  14690. m = Math.min(m, t.source[0][0], t.source[1][0], t.source[2][0])
  14691. })), this.triangles_.forEach(function (t) {
  14692. if (Math.max(t.source[0][0], t.source[1][0], t.source[2][0]) - m > this.sourceWorldWidth_ / 2) {
  14693. var e = [[t.source[0][0], t.source[0][1]], [t.source[1][0], t.source[1][1]], [t.source[2][0], t.source[2][1]]];
  14694. e[0][0] - m > this.sourceWorldWidth_ / 2 && (e[0][0] -= this.sourceWorldWidth_), e[1][0] - m > this.sourceWorldWidth_ / 2 && (e[1][0] -= this.sourceWorldWidth_), e[2][0] - m > this.sourceWorldWidth_ / 2 && (e[2][0] -= this.sourceWorldWidth_);
  14695. var r = Math.min(e[0][0], e[1][0], e[2][0]);
  14696. Math.max(e[0][0], e[1][0], e[2][0]) - r < this.sourceWorldWidth_ / 2 && (t.source = e)
  14697. }
  14698. }.bind(this))
  14699. }
  14700. a = {}
  14701. }
  14702. return t.prototype.addTriangle_ = function (t, e, r, n, i, o) {
  14703. this.triangles_.push({source: [n, i, o], target: [t, e, r]})
  14704. }, t.prototype.addQuad_ = function (t, e, r, n, i, o, a, s, l) {
  14705. var u = Kt([i, o, a, s]), c = this.sourceWorldWidth_ ? Pe(u) / this.sourceWorldWidth_ : null,
  14706. h = this.sourceWorldWidth_, p = this.sourceProj_.canWrapX() && c > .5 && c < 1, f = !1;
  14707. if (l > 0) {
  14708. if (this.targetProj_.isGlobal() && this.targetWorldWidth_) f = Pe(Kt([t, e, r, n])) / this.targetWorldWidth_ > .25 || f;
  14709. !p && this.sourceProj_.isGlobal() && c && (f = c > .25 || f)
  14710. }
  14711. if (!(!f && this.maxSourceExtent_ && isFinite(u[0]) && isFinite(u[1]) && isFinite(u[2]) && isFinite(u[3])) || Re(u, this.maxSourceExtent_)) {
  14712. var d = 0;
  14713. if (!(f || isFinite(i[0]) && isFinite(i[1]) && isFinite(o[0]) && isFinite(o[1]) && isFinite(a[0]) && isFinite(a[1]) && isFinite(s[0]) && isFinite(s[1]))) if (l > 0) f = !0; else if (1 != (d = (isFinite(i[0]) && isFinite(i[1]) ? 0 : 8) + (isFinite(o[0]) && isFinite(o[1]) ? 0 : 4) + (isFinite(a[0]) && isFinite(a[1]) ? 0 : 2) + (isFinite(s[0]) && isFinite(s[1]) ? 0 : 1)) && 2 != d && 4 != d && 8 != d) return;
  14714. if (l > 0) {
  14715. if (!f) {
  14716. var g = [(t[0] + r[0]) / 2, (t[1] + r[1]) / 2], y = this.transformInv_(g), m = void 0;
  14717. if (p) m = (We(i[0], h) + We(a[0], h)) / 2 - We(y[0], h); else m = (i[0] + a[0]) / 2 - y[0];
  14718. var v = (i[1] + a[1]) / 2 - y[1];
  14719. f = m * m + v * v > this.errorThresholdSquared_
  14720. }
  14721. if (f) {
  14722. if (Math.abs(t[0] - r[0]) <= Math.abs(t[1] - r[1])) {
  14723. var _ = [(e[0] + r[0]) / 2, (e[1] + r[1]) / 2], b = this.transformInv_(_),
  14724. x = [(n[0] + t[0]) / 2, (n[1] + t[1]) / 2], w = this.transformInv_(x);
  14725. this.addQuad_(t, e, _, x, i, o, b, w, l - 1), this.addQuad_(x, _, r, n, w, b, a, s, l - 1)
  14726. } else {
  14727. var S = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], E = this.transformInv_(S),
  14728. T = [(r[0] + n[0]) / 2, (r[1] + n[1]) / 2], C = this.transformInv_(T);
  14729. this.addQuad_(t, S, T, n, i, E, C, s, l - 1), this.addQuad_(S, e, r, T, E, o, a, C, l - 1)
  14730. }
  14731. return
  14732. }
  14733. }
  14734. if (p) {
  14735. if (!this.canWrapXInSource_) return;
  14736. this.wrapsXInSource_ = !0
  14737. }
  14738. 0 == (11 & d) && this.addTriangle_(t, r, n, i, a, s), 0 == (14 & d) && this.addTriangle_(t, r, e, i, a, o), d && (0 == (13 & d) && this.addTriangle_(e, n, t, o, s, i), 0 == (7 & d) && this.addTriangle_(e, n, r, o, s, a))
  14739. }
  14740. }, t.prototype.calculateSourceExtent = function () {
  14741. var t = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
  14742. return this.triangles_.forEach((function (e, r, n) {
  14743. var i = e.source;
  14744. pe(t, i[0]), pe(t, i[1]), pe(t, i[2])
  14745. })), t
  14746. }, t.prototype.getTriangles = function () {
  14747. return this.triangles_
  14748. }, t
  14749. }(), Lp = function () {
  14750. var t = function (e, r) {
  14751. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  14752. t.__proto__ = e
  14753. } || function (t, e) {
  14754. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  14755. })(e, r)
  14756. };
  14757. return function (e, r) {
  14758. function n() {
  14759. this.constructor = e
  14760. }
  14761. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14762. }
  14763. }(), Mp = function (t) {
  14764. function e(e, r, n, i, o, a, s, l, u, c, h, p) {
  14765. var f = t.call(this, o, Ji) || this;
  14766. f.renderEdges_ = void 0 !== h && h, f.contextOptions_ = p, f.pixelRatio_ = s, f.gutter_ = l, f.canvas_ = null, f.sourceTileGrid_ = r, f.targetTileGrid_ = i, f.wrappedTileCoord_ = a || o, f.sourceTiles_ = [], f.sourcesListenerKeys_ = null, f.sourceZ_ = 0;
  14767. var d = i.getTileCoordExtent(f.wrappedTileCoord_), g = f.targetTileGrid_.getExtent(),
  14768. y = f.sourceTileGrid_.getExtent(), m = g ? Te(d, g) : d;
  14769. if (0 === ve(m)) return f.state = ro, f;
  14770. var v = e.getExtent();
  14771. v && (y = y ? Te(y, v) : v);
  14772. var _ = i.getResolution(f.wrappedTileCoord_[0]), b = ec(e, n, m, _);
  14773. if (!isFinite(b) || b <= 0) return f.state = ro, f;
  14774. var x = void 0 !== c ? c : .5;
  14775. if (f.triangulation_ = new Ip(e, n, m, y, b * x, _), 0 === f.triangulation_.getTriangles().length) return f.state = ro, f;
  14776. f.sourceZ_ = r.getZForResolution(b);
  14777. var w = f.triangulation_.calculateSourceExtent();
  14778. if (y && (e.canWrapX() ? (w[1] = Ne(w[1], y[1], y[3]), w[3] = Ne(w[3], y[1], y[3])) : w = Te(w, y)), ve(w)) {
  14779. for (var S = r.getTileRangeForExtentAndZ(w, f.sourceZ_), E = S.minX; E <= S.maxX; E++) for (var T = S.minY; T <= S.maxY; T++) {
  14780. var C = u(f.sourceZ_, E, T, s);
  14781. C && f.sourceTiles_.push(C)
  14782. }
  14783. 0 === f.sourceTiles_.length && (f.state = ro)
  14784. } else f.state = ro;
  14785. return f
  14786. }
  14787. return Lp(e, t), e.prototype.getImage = function () {
  14788. return this.canvas_
  14789. }, e.prototype.reproject_ = function () {
  14790. var t = [];
  14791. if (this.sourceTiles_.forEach(function (e, r, n) {
  14792. e && e.getState() == to && t.push({
  14793. extent: this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),
  14794. image: e.getImage()
  14795. })
  14796. }.bind(this)), this.sourceTiles_.length = 0, 0 === t.length) this.state = eo; else {
  14797. var e = this.wrappedTileCoord_[0], r = this.targetTileGrid_.getTileSize(e),
  14798. n = "number" == typeof r ? r : r[0], i = "number" == typeof r ? r : r[1],
  14799. o = this.targetTileGrid_.getResolution(e), a = this.sourceTileGrid_.getResolution(this.sourceZ_),
  14800. s = this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);
  14801. this.canvas_ = rc(n, i, this.pixelRatio_, a, this.sourceTileGrid_.getExtent(), o, s, this.triangulation_, t, this.gutter_, this.renderEdges_, this.contextOptions_), this.state = to
  14802. }
  14803. this.changed()
  14804. }, e.prototype.load = function () {
  14805. if (this.state == Ji) {
  14806. this.state = Qi, this.changed();
  14807. var t = 0;
  14808. this.sourcesListenerKeys_ = [], this.sourceTiles_.forEach(function (e, r, n) {
  14809. var i = e.getState();
  14810. if (i == Ji || i == Qi) {
  14811. t++;
  14812. var o = Z(e, F, (function (r) {
  14813. var n = e.getState();
  14814. n != to && n != eo && n != ro || (H(o), 0 === --t && (this.unlistenSources_(), this.reproject_()))
  14815. }), this);
  14816. this.sourcesListenerKeys_.push(o)
  14817. }
  14818. }.bind(this)), this.sourceTiles_.forEach((function (t, e, r) {
  14819. t.getState() == Ji && t.load()
  14820. })), 0 === t && setTimeout(this.reproject_.bind(this), 0)
  14821. }
  14822. }, e.prototype.unlistenSources_ = function () {
  14823. this.sourcesListenerKeys_.forEach(H), this.sourcesListenerKeys_ = null
  14824. }, e
  14825. }(lo), Fp = "tileloadstart", Ap = "tileloadend", kp = "tileloaderror", jp = function () {
  14826. var t = function (e, r) {
  14827. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  14828. t.__proto__ = e
  14829. } || function (t, e) {
  14830. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  14831. })(e, r)
  14832. };
  14833. return function (e, r) {
  14834. function n() {
  14835. this.constructor = e
  14836. }
  14837. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14838. }
  14839. }();
  14840. function Np(t) {
  14841. return t ? Array.isArray(t) ? function (e) {
  14842. return t
  14843. } : "function" == typeof t ? t : function (e) {
  14844. return [t]
  14845. } : null
  14846. }
  14847. var Dp = function (t) {
  14848. function e(e) {
  14849. var r = t.call(this) || this;
  14850. return r.projection_ = Gr(e.projection), r.attributions_ = Np(e.attributions), r.attributionsCollapsible_ = void 0 === e.attributionsCollapsible || e.attributionsCollapsible, r.loading = !1, r.state_ = void 0 !== e.state ? e.state : Qo, r.wrapX_ = void 0 !== e.wrapX && e.wrapX, r
  14851. }
  14852. return jp(e, t), e.prototype.getAttributions = function () {
  14853. return this.attributions_
  14854. }, e.prototype.getAttributionsCollapsible = function () {
  14855. return this.attributionsCollapsible_
  14856. }, e.prototype.getProjection = function () {
  14857. return this.projection_
  14858. }, e.prototype.getResolutions = function () {
  14859. return n()
  14860. }, e.prototype.getState = function () {
  14861. return this.state_
  14862. }, e.prototype.getWrapX = function () {
  14863. return this.wrapX_
  14864. }, e.prototype.getContextOptions = function () {
  14865. }, e.prototype.refresh = function () {
  14866. this.changed()
  14867. }, e.prototype.setAttributions = function (t) {
  14868. this.attributions_ = Np(t), this.changed()
  14869. }, e.prototype.setState = function (t) {
  14870. this.state_ = t, this.changed()
  14871. }, e
  14872. }(ot), Gp = function () {
  14873. var t = function (e, r) {
  14874. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  14875. t.__proto__ = e
  14876. } || function (t, e) {
  14877. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  14878. })(e, r)
  14879. };
  14880. return function (e, r) {
  14881. function n() {
  14882. this.constructor = e
  14883. }
  14884. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14885. }
  14886. }(), zp = function (t) {
  14887. function e(e) {
  14888. var r = t.call(this, {
  14889. attributions: e.attributions,
  14890. attributionsCollapsible: e.attributionsCollapsible,
  14891. projection: e.projection,
  14892. state: e.state,
  14893. wrapX: e.wrapX
  14894. }) || this;
  14895. r.opaque_ = void 0 !== e.opaque && e.opaque, r.tilePixelRatio_ = void 0 !== e.tilePixelRatio ? e.tilePixelRatio : 1, r.tileGrid = void 0 !== e.tileGrid ? e.tileGrid : null;
  14896. var n = e.tileGrid;
  14897. return n && Is(n.getTileSize(n.getMinZoom()), [256, 256]), r.tileCache = new yu(e.cacheSize || 0), r.tmpSize = [0, 0], r.key_ = e.key || "", r.tileOptions = {transition: e.transition}, r.zDirection = e.zDirection ? e.zDirection : 0, r
  14898. }
  14899. return Gp(e, t), e.prototype.canExpireCache = function () {
  14900. return this.tileCache.canExpireCache()
  14901. }, e.prototype.expireCache = function (t, e) {
  14902. var r = this.getTileCacheForProjection(t);
  14903. r && r.expireCache(e)
  14904. }, e.prototype.forEachLoadedTile = function (t, e, r, n) {
  14905. var i = this.getTileCacheForProjection(t);
  14906. if (!i) return !1;
  14907. for (var o, a, s, l = !0, u = r.minX; u <= r.maxX; ++u) for (var c = r.minY; c <= r.maxY; ++c) a = cu(e, u, c), s = !1, i.containsKey(a) && (s = (o = i.get(a)).getState() === to) && (s = !1 !== n(o)), s || (l = !1);
  14908. return l
  14909. }, e.prototype.getGutterForProjection = function (t) {
  14910. return 0
  14911. }, e.prototype.getKey = function () {
  14912. return this.key_
  14913. }, e.prototype.setKey = function (t) {
  14914. this.key_ !== t && (this.key_ = t, this.changed())
  14915. }, e.prototype.getOpaque = function (t) {
  14916. return this.opaque_
  14917. }, e.prototype.getResolutions = function () {
  14918. return this.tileGrid.getResolutions()
  14919. }, e.prototype.getTile = function (t, e, r, i, o) {
  14920. return n()
  14921. }, e.prototype.getTileGrid = function () {
  14922. return this.tileGrid
  14923. }, e.prototype.getTileGridForProjection = function (t) {
  14924. return this.tileGrid ? this.tileGrid : oc(t)
  14925. }, e.prototype.getTileCacheForProjection = function (t) {
  14926. return pt(Xr(this.getProjection(), t), 68), this.tileCache
  14927. }, e.prototype.getTilePixelRatio = function (t) {
  14928. return this.tilePixelRatio_
  14929. }, e.prototype.getTilePixelSize = function (t, e, r) {
  14930. var n = this.getTileGridForProjection(r), i = this.getTilePixelRatio(e), o = Is(n.getTileSize(t), this.tmpSize);
  14931. return 1 == i ? o : Rs(o, i, this.tmpSize)
  14932. }, e.prototype.getTileCoordForTileUrlFunction = function (t, e) {
  14933. var r = void 0 !== e ? e : this.getProjection(), n = this.getTileGridForProjection(r);
  14934. return this.getWrapX() && r.isGlobal() && (t = ac(n, t, r)), du(t, n) ? t : null
  14935. }, e.prototype.clear = function () {
  14936. this.tileCache.clear()
  14937. }, e.prototype.refresh = function () {
  14938. this.clear(), t.prototype.refresh.call(this)
  14939. }, e.prototype.updateCacheSize = function (t, e) {
  14940. var r = this.getTileCacheForProjection(e);
  14941. t > r.highWaterMark && (r.highWaterMark = t)
  14942. }, e.prototype.useTile = function (t, e, r, n) {
  14943. }, e
  14944. }(Dp), Up = function (t) {
  14945. function e(e, r) {
  14946. var n = t.call(this, e) || this;
  14947. return n.tile = r, n
  14948. }
  14949. return Gp(e, t), e
  14950. }(c), Bp = zp, Vp = function () {
  14951. var t = function (e, r) {
  14952. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  14953. t.__proto__ = e
  14954. } || function (t, e) {
  14955. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  14956. })(e, r)
  14957. };
  14958. return function (e, r) {
  14959. function n() {
  14960. this.constructor = e
  14961. }
  14962. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  14963. }
  14964. }(), Yp = function (t) {
  14965. function e(r) {
  14966. var n = t.call(this, {
  14967. attributions: r.attributions,
  14968. cacheSize: r.cacheSize,
  14969. opaque: r.opaque,
  14970. projection: r.projection,
  14971. state: r.state,
  14972. tileGrid: r.tileGrid,
  14973. tilePixelRatio: r.tilePixelRatio,
  14974. wrapX: r.wrapX,
  14975. transition: r.transition,
  14976. key: r.key,
  14977. attributionsCollapsible: r.attributionsCollapsible,
  14978. zDirection: r.zDirection
  14979. }) || this;
  14980. return n.generateTileUrlFunction_ = n.tileUrlFunction === e.prototype.tileUrlFunction, n.tileLoadFunction = r.tileLoadFunction, r.tileUrlFunction && (n.tileUrlFunction = r.tileUrlFunction), n.urls = null, r.urls ? n.setUrls(r.urls) : r.url && n.setUrl(r.url), n.tileLoadingKeys_ = {}, n
  14981. }
  14982. return Vp(e, t), e.prototype.getTileLoadFunction = function () {
  14983. return this.tileLoadFunction
  14984. }, e.prototype.getTileUrlFunction = function () {
  14985. return Object.getPrototypeOf(this).tileUrlFunction === this.tileUrlFunction ? this.tileUrlFunction.bind(this) : this.tileUrlFunction
  14986. }, e.prototype.getUrls = function () {
  14987. return this.urls
  14988. }, e.prototype.handleTileChange = function (t) {
  14989. var e, r = t.target, n = o(r), i = r.getState();
  14990. i == Qi ? (this.tileLoadingKeys_[n] = !0, e = Fp) : n in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[n], e = i == eo ? kp : i == to ? Ap : void 0), null != e && this.dispatchEvent(new Up(e, r))
  14991. }, e.prototype.setTileLoadFunction = function (t) {
  14992. this.tileCache.clear(), this.tileLoadFunction = t, this.changed()
  14993. }, e.prototype.setTileUrlFunction = function (t, e) {
  14994. this.tileUrlFunction = t, this.tileCache.pruneExceptNewestZ(), void 0 !== e ? this.setKey(e) : this.changed()
  14995. }, e.prototype.setUrl = function (t) {
  14996. var e = yc(t);
  14997. this.urls = e, this.setUrls(e)
  14998. }, e.prototype.setUrls = function (t) {
  14999. this.urls = t;
  15000. var e = t.join("\n");
  15001. this.generateTileUrlFunction_ ? this.setTileUrlFunction(fc(t, this.tileGrid), e) : this.setKey(e)
  15002. }, e.prototype.tileUrlFunction = function (t, e, r) {
  15003. }, e.prototype.useTile = function (t, e, r) {
  15004. var n = cu(t, e, r);
  15005. this.tileCache.containsKey(n) && this.tileCache.get(n)
  15006. }, e
  15007. }(Bp), Wp = function () {
  15008. var t = function (e, r) {
  15009. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15010. t.__proto__ = e
  15011. } || function (t, e) {
  15012. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15013. })(e, r)
  15014. };
  15015. return function (e, r) {
  15016. function n() {
  15017. this.constructor = e
  15018. }
  15019. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15020. }
  15021. }();
  15022. function qp(t, e) {
  15023. t.getImage().src = e
  15024. }
  15025. var Xp = function (t) {
  15026. function e(e) {
  15027. var r = t.call(this, {
  15028. attributions: e.attributions,
  15029. cacheSize: e.cacheSize,
  15030. opaque: e.opaque,
  15031. projection: e.projection,
  15032. state: e.state,
  15033. tileGrid: e.tileGrid,
  15034. tileLoadFunction: e.tileLoadFunction ? e.tileLoadFunction : qp,
  15035. tilePixelRatio: e.tilePixelRatio,
  15036. tileUrlFunction: e.tileUrlFunction,
  15037. url: e.url,
  15038. urls: e.urls,
  15039. wrapX: e.wrapX,
  15040. transition: e.transition,
  15041. key: e.key,
  15042. attributionsCollapsible: e.attributionsCollapsible,
  15043. zDirection: e.zDirection
  15044. }) || this;
  15045. return r.crossOrigin = void 0 !== e.crossOrigin ? e.crossOrigin : null, r.tileClass = void 0 !== e.tileClass ? e.tileClass : vo, r.tileCacheForProjection = {}, r.tileGridForProjection = {}, r.reprojectionErrorThreshold_ = e.reprojectionErrorThreshold, r.contextOptions_ = !1 === e.imageSmoothing ? $u : void 0, r.renderReprojectionEdges_ = !1, r
  15046. }
  15047. return Wp(e, t), e.prototype.canExpireCache = function () {
  15048. if (this.tileCache.canExpireCache()) return !0;
  15049. for (var t in this.tileCacheForProjection) if (this.tileCacheForProjection[t].canExpireCache()) return !0;
  15050. return !1
  15051. }, e.prototype.expireCache = function (t, e) {
  15052. var r = this.getTileCacheForProjection(t);
  15053. for (var n in this.tileCache.expireCache(this.tileCache == r ? e : {}), this.tileCacheForProjection) {
  15054. var i = this.tileCacheForProjection[n];
  15055. i.expireCache(i == r ? e : {})
  15056. }
  15057. }, e.prototype.getContextOptions = function () {
  15058. return this.contextOptions_
  15059. }, e.prototype.getGutterForProjection = function (t) {
  15060. return this.getProjection() && t && !Xr(this.getProjection(), t) ? 0 : this.getGutter()
  15061. }, e.prototype.getGutter = function () {
  15062. return 0
  15063. }, e.prototype.getKey = function () {
  15064. return t.prototype.getKey.call(this) + (this.contextOptions_ ? "\n" + JSON.stringify(this.contextOptions_) : "")
  15065. }, e.prototype.getOpaque = function (e) {
  15066. return !(this.getProjection() && e && !Xr(this.getProjection(), e)) && t.prototype.getOpaque.call(this, e)
  15067. }, e.prototype.getTileGridForProjection = function (t) {
  15068. var e = this.getProjection();
  15069. if (!this.tileGrid || e && !Xr(e, t)) {
  15070. var r = o(t);
  15071. return r in this.tileGridForProjection || (this.tileGridForProjection[r] = oc(t)), this.tileGridForProjection[r]
  15072. }
  15073. return this.tileGrid
  15074. }, e.prototype.getTileCacheForProjection = function (t) {
  15075. var e = this.getProjection();
  15076. if (!e || Xr(e, t)) return this.tileCache;
  15077. var r = o(t);
  15078. return r in this.tileCacheForProjection || (this.tileCacheForProjection[r] = new yu(this.tileCache.highWaterMark)), this.tileCacheForProjection[r]
  15079. }, e.prototype.createTile_ = function (t, e, r, n, i, o) {
  15080. var a = [t, e, r], s = this.getTileCoordForTileUrlFunction(a, i),
  15081. l = s ? this.tileUrlFunction(s, n, i) : void 0,
  15082. u = new this.tileClass(a, void 0 !== l ? Ji : ro, void 0 !== l ? l : "", this.crossOrigin, this.tileLoadFunction, this.tileOptions);
  15083. return u.key = o, u.addEventListener(F, this.handleTileChange.bind(this)), u
  15084. }, e.prototype.getTile = function (t, e, r, n, i) {
  15085. var o = this.getProjection();
  15086. if (o && i && !Xr(o, i)) {
  15087. var a = this.getTileCacheForProjection(i), s = [t, e, r], l = void 0, u = hu(s);
  15088. a.containsKey(u) && (l = a.get(u));
  15089. var c = this.getKey();
  15090. if (l && l.key == c) return l;
  15091. var h = this.getTileGridForProjection(o), p = this.getTileGridForProjection(i),
  15092. f = this.getTileCoordForTileUrlFunction(s, i),
  15093. d = new Mp(o, h, i, p, s, f, this.getTilePixelRatio(n), this.getGutter(), function (t, e, r, n) {
  15094. return this.getTileInternal(t, e, r, n, o)
  15095. }.bind(this), this.reprojectionErrorThreshold_, this.renderReprojectionEdges_, this.contextOptions_);
  15096. return d.key = c, l ? (d.interimTile = l, d.refreshInterimChain(), a.replace(u, d)) : a.set(u, d), d
  15097. }
  15098. return this.getTileInternal(t, e, r, n, o || i)
  15099. }, e.prototype.getTileInternal = function (t, e, r, n, i) {
  15100. var o = null, a = cu(t, e, r), s = this.getKey();
  15101. if (this.tileCache.containsKey(a)) {
  15102. if ((o = this.tileCache.get(a)).key != s) {
  15103. var l = o;
  15104. o = this.createTile_(t, e, r, n, i, s), l.getState() == Ji ? o.interimTile = l.interimTile : o.interimTile = l, o.refreshInterimChain(), this.tileCache.replace(a, o)
  15105. }
  15106. } else o = this.createTile_(t, e, r, n, i, s), this.tileCache.set(a, o);
  15107. return o
  15108. }, e.prototype.setRenderReprojectionEdges = function (t) {
  15109. if (this.renderReprojectionEdges_ != t) {
  15110. for (var e in this.renderReprojectionEdges_ = t, this.tileCacheForProjection) this.tileCacheForProjection[e].clear();
  15111. this.changed()
  15112. }
  15113. }, e.prototype.setTileGridForProjection = function (t, e) {
  15114. var r = Gr(t);
  15115. if (r) {
  15116. var n = o(r);
  15117. n in this.tileGridForProjection || (this.tileGridForProjection[n] = e)
  15118. }
  15119. }, e
  15120. }(Yp), Zp = function () {
  15121. var t = function (e, r) {
  15122. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15123. t.__proto__ = e
  15124. } || function (t, e) {
  15125. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15126. })(e, r)
  15127. };
  15128. return function (e, r) {
  15129. function n() {
  15130. this.constructor = e
  15131. }
  15132. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15133. }
  15134. }();
  15135. function Kp(t) {
  15136. var e, r, n = t[0], i = new Array(n), o = 1 << n - 1;
  15137. for (e = 0; e < n; ++e) r = 48, t[1] & o && (r += 1), t[2] & o && (r += 2), i[e] = String.fromCharCode(r), o >>= 1;
  15138. return i.join("")
  15139. }
  15140. var Hp = function (t) {
  15141. function e(e) {
  15142. var r = this, n = void 0 !== e.hidpi && e.hidpi;
  15143. return (r = t.call(this, {
  15144. cacheSize: e.cacheSize,
  15145. crossOrigin: "anonymous",
  15146. imageSmoothing: e.imageSmoothing,
  15147. opaque: !0,
  15148. projection: Gr("EPSG:3857"),
  15149. reprojectionErrorThreshold: e.reprojectionErrorThreshold,
  15150. state: Jo,
  15151. tileLoadFunction: e.tileLoadFunction,
  15152. tilePixelRatio: n ? 2 : 1,
  15153. wrapX: void 0 === e.wrapX || e.wrapX,
  15154. transition: e.transition
  15155. }) || this).hidpi_ = n, r.culture_ = void 0 !== e.culture ? e.culture : "en-us", r.maxZoom_ = void 0 !== e.maxZoom ? e.maxZoom : -1, r.apiKey_ = e.key, r.imagerySet_ = e.imagerySet, Au("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/" + r.imagerySet_ + "?uriScheme=https&include=ImageryProviders&key=" + r.apiKey_ + "&c=" + r.culture_, r.handleImageryMetadataResponse.bind(r), void 0, "jsonp"), r
  15156. }
  15157. return Zp(e, t), e.prototype.getApiKey = function () {
  15158. return this.apiKey_
  15159. }, e.prototype.getImagerySet = function () {
  15160. return this.imagerySet_
  15161. }, e.prototype.handleImageryMetadataResponse = function (t) {
  15162. if (200 == t.statusCode && "OK" == t.statusDescription && "ValidCredentials" == t.authenticationResultCode && 1 == t.resourceSets.length && 1 == t.resourceSets[0].resources.length) {
  15163. var e = t.resourceSets[0].resources[0], r = -1 == this.maxZoom_ ? e.zoomMax : this.maxZoom_,
  15164. n = hc(this.getProjection()), i = this.hidpi_ ? 2 : 1,
  15165. o = e.imageWidth == e.imageHeight ? e.imageWidth / i : [e.imageWidth / i, e.imageHeight / i],
  15166. a = lc({extent: n, minZoom: e.zoomMin, maxZoom: r, tileSize: o});
  15167. this.tileGrid = a;
  15168. var s = this.culture_, l = this.hidpi_;
  15169. if (this.tileUrlFunction = dc(e.imageUrlSubdomains.map((function (t) {
  15170. var r = [0, 0, 0], n = e.imageUrl.replace("{subdomain}", t).replace("{culture}", s);
  15171. return function (t, e, i) {
  15172. if (t) {
  15173. uu(t[0], t[1], t[2], r);
  15174. var o = n;
  15175. return l && (o += "&dpi=d1&device=mobile"), o.replace("{quadkey}", Kp(r))
  15176. }
  15177. }
  15178. }))), e.imageryProviders) {
  15179. var u = Zr(Gr("EPSG:4326"), this.getProjection());
  15180. this.setAttributions(function (t) {
  15181. var r = [], n = t.viewState, i = this.getTileGrid(),
  15182. o = i.getZForResolution(n.resolution, this.zDirection), a = i.getTileCoordForCoordAndZ(n.center, o)[0];
  15183. return e.imageryProviders.map((function (e) {
  15184. for (var n = !1, i = e.coverageAreas, o = 0, s = i.length; o < s; ++o) {
  15185. var l = i[o];
  15186. if (a >= l.zoomMin && a <= l.zoomMax) {
  15187. var c = l.bbox;
  15188. if (Re(Ae([c[1], c[0], c[3], c[2]], u), t.extent)) {
  15189. n = !0;
  15190. break
  15191. }
  15192. }
  15193. }
  15194. n && r.push(e.attribution)
  15195. })), r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'), r
  15196. }.bind(this))
  15197. }
  15198. this.setState(Qo)
  15199. } else this.setState(ta)
  15200. }, e
  15201. }(Xp), $p = function () {
  15202. var t = function (e, r) {
  15203. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15204. t.__proto__ = e
  15205. } || function (t, e) {
  15206. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15207. })(e, r)
  15208. };
  15209. return function (e, r) {
  15210. function n() {
  15211. this.constructor = e
  15212. }
  15213. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15214. }
  15215. }(), Jp = function (t) {
  15216. function e(e) {
  15217. var r = e || {}, n = void 0 !== r.projection ? r.projection : "EPSG:3857",
  15218. i = void 0 !== r.tileGrid ? r.tileGrid : lc({
  15219. extent: hc(n),
  15220. maxResolution: r.maxResolution,
  15221. maxZoom: r.maxZoom,
  15222. minZoom: r.minZoom,
  15223. tileSize: r.tileSize
  15224. });
  15225. return t.call(this, {
  15226. attributions: r.attributions,
  15227. cacheSize: r.cacheSize,
  15228. crossOrigin: r.crossOrigin,
  15229. imageSmoothing: r.imageSmoothing,
  15230. opaque: r.opaque,
  15231. projection: n,
  15232. reprojectionErrorThreshold: r.reprojectionErrorThreshold,
  15233. tileGrid: i,
  15234. tileLoadFunction: r.tileLoadFunction,
  15235. tilePixelRatio: r.tilePixelRatio,
  15236. tileUrlFunction: r.tileUrlFunction,
  15237. url: r.url,
  15238. urls: r.urls,
  15239. wrapX: void 0 === r.wrapX || r.wrapX,
  15240. transition: r.transition,
  15241. attributionsCollapsible: r.attributionsCollapsible,
  15242. zDirection: r.zDirection
  15243. }) || this
  15244. }
  15245. return $p(e, t), e
  15246. }(Xp), Qp = function () {
  15247. var t = function (e, r) {
  15248. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15249. t.__proto__ = e
  15250. } || function (t, e) {
  15251. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15252. })(e, r)
  15253. };
  15254. return function (e, r) {
  15255. function n() {
  15256. this.constructor = e
  15257. }
  15258. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15259. }
  15260. }(), tf = function (t) {
  15261. function e(e) {
  15262. var r = t.call(this, {
  15263. attributions: e.attributions,
  15264. cacheSize: e.cacheSize,
  15265. crossOrigin: e.crossOrigin,
  15266. maxZoom: void 0 !== e.maxZoom ? e.maxZoom : 18,
  15267. minZoom: e.minZoom,
  15268. projection: e.projection,
  15269. transition: e.transition,
  15270. wrapX: e.wrapX
  15271. }) || this;
  15272. return r.account_ = e.account, r.mapId_ = e.map || "", r.config_ = e.config || {}, r.templateCache_ = {}, r.initializeMap_(), r
  15273. }
  15274. return Qp(e, t), e.prototype.getConfig = function () {
  15275. return this.config_
  15276. }, e.prototype.updateConfig = function (t) {
  15277. O(this.config_, t), this.initializeMap_()
  15278. }, e.prototype.setConfig = function (t) {
  15279. this.config_ = t || {}, this.initializeMap_()
  15280. }, e.prototype.initializeMap_ = function () {
  15281. var t = JSON.stringify(this.config_);
  15282. if (this.templateCache_[t]) this.applyTemplate_(this.templateCache_[t]); else {
  15283. var e = "https://" + this.account_ + ".carto.com/api/v1/map";
  15284. this.mapId_ && (e += "/named/" + this.mapId_);
  15285. var r = new XMLHttpRequest;
  15286. r.addEventListener("load", this.handleInitResponse_.bind(this, t)), r.addEventListener("error", this.handleInitError_.bind(this)), r.open("POST", e), r.setRequestHeader("Content-type", "application/json"), r.send(JSON.stringify(this.config_))
  15287. }
  15288. }, e.prototype.handleInitResponse_ = function (t, e) {
  15289. var r = e.target;
  15290. if (!r.status || r.status >= 200 && r.status < 300) {
  15291. var n = void 0;
  15292. try {
  15293. n = JSON.parse(r.responseText)
  15294. } catch (t) {
  15295. return void this.setState(ta)
  15296. }
  15297. this.applyTemplate_(n), this.templateCache_[t] = n, this.setState(Qo)
  15298. } else this.setState(ta)
  15299. }, e.prototype.handleInitError_ = function (t) {
  15300. this.setState(ta)
  15301. }, e.prototype.applyTemplate_ = function (t) {
  15302. var e = "https://" + t.cdn_url.https + "/" + this.account_ + "/api/v1/map/" + t.layergroupid + "/{z}/{x}/{y}.png";
  15303. this.setUrl(e)
  15304. }, e
  15305. }(Jp), ef = "addfeature", rf = "changefeature", nf = "clear", of = "removefeature", af = "featuresloadstart",
  15306. sf = "featuresloadend", lf = "featuresloaderror", uf = function () {
  15307. var t = function (e, r) {
  15308. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15309. t.__proto__ = e
  15310. } || function (t, e) {
  15311. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15312. })(e, r)
  15313. };
  15314. return function (e, r) {
  15315. function n() {
  15316. this.constructor = e
  15317. }
  15318. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15319. }
  15320. }(), cf = function (t) {
  15321. function e(e, r, n) {
  15322. var i = t.call(this, e) || this;
  15323. return i.feature = r, i.features = n, i
  15324. }
  15325. return uf(e, t), e
  15326. }(c), hf = function (t) {
  15327. function e(e) {
  15328. var r = this, n = e || {};
  15329. (r = t.call(this, {
  15330. attributions: n.attributions,
  15331. projection: void 0,
  15332. state: Qo,
  15333. wrapX: void 0 === n.wrapX || n.wrapX
  15334. }) || this).loader_ = T, r.format_ = n.format, r.overlaps_ = void 0 === n.overlaps || n.overlaps, r.url_ = n.url, void 0 !== n.loader ? r.loader_ = n.loader : void 0 !== r.url_ && (pt(r.format_, 7), r.loader_ = Mu(r.url_, r.format_)), r.strategy_ = void 0 !== n.strategy ? n.strategy : Fu;
  15335. var i, o, a = void 0 === n.useSpatialIndex || n.useSpatialIndex;
  15336. return r.featuresRtree_ = a ? new Rp : null, r.loadedExtentsRtree_ = new Rp, r.nullGeometryFeatures_ = {}, r.idIndex_ = {}, r.uidIndex_ = {}, r.featureChangeKeys_ = {}, r.featuresCollection_ = null, Array.isArray(n.features) ? o = n.features : n.features && (o = (i = n.features).getArray()), a || void 0 !== i || (i = new ht(o)), void 0 !== o && r.addFeaturesInternal(o), void 0 !== i && r.bindFeaturesCollection_(i), r
  15337. }
  15338. return uf(e, t), e.prototype.addFeature = function (t) {
  15339. this.addFeatureInternal(t), this.changed()
  15340. }, e.prototype.addFeatureInternal = function (t) {
  15341. var e = o(t);
  15342. if (this.addToIndex_(e, t)) {
  15343. this.setupChangeEvents_(e, t);
  15344. var r = t.getGeometry();
  15345. if (r) {
  15346. var n = r.getExtent();
  15347. this.featuresRtree_ && this.featuresRtree_.insert(n, t)
  15348. } else this.nullGeometryFeatures_[e] = t;
  15349. this.dispatchEvent(new cf(ef, t))
  15350. } else this.featuresCollection_ && this.featuresCollection_.remove(t)
  15351. }, e.prototype.setupChangeEvents_ = function (t, e) {
  15352. this.featureChangeKeys_[t] = [Z(e, F, this.handleFeatureChange_, this), Z(e, h, this.handleFeatureChange_, this)]
  15353. }, e.prototype.addToIndex_ = function (t, e) {
  15354. var r = !0, n = e.getId();
  15355. return void 0 !== n && (n.toString() in this.idIndex_ ? r = !1 : this.idIndex_[n.toString()] = e), r && (pt(!(t in this.uidIndex_), 30), this.uidIndex_[t] = e), r
  15356. }, e.prototype.addFeatures = function (t) {
  15357. this.addFeaturesInternal(t), this.changed()
  15358. }, e.prototype.addFeaturesInternal = function (t) {
  15359. for (var e = [], r = [], n = [], i = 0, a = t.length; i < a; i++) {
  15360. var s = o(u = t[i]);
  15361. this.addToIndex_(s, u) && r.push(u)
  15362. }
  15363. i = 0;
  15364. for (var l = r.length; i < l; i++) {
  15365. var u;
  15366. s = o(u = r[i]);
  15367. this.setupChangeEvents_(s, u);
  15368. var c = u.getGeometry();
  15369. if (c) {
  15370. var h = c.getExtent();
  15371. e.push(h), n.push(u)
  15372. } else this.nullGeometryFeatures_[s] = u
  15373. }
  15374. this.featuresRtree_ && this.featuresRtree_.load(e, n);
  15375. i = 0;
  15376. for (var p = r.length; i < p; i++) this.dispatchEvent(new cf(ef, r[i]))
  15377. }, e.prototype.bindFeaturesCollection_ = function (t) {
  15378. var e = !1;
  15379. this.addEventListener(ef, (function (r) {
  15380. e || (e = !0, t.push(r.feature), e = !1)
  15381. })), this.addEventListener(of, (function (r) {
  15382. e || (e = !0, t.remove(r.feature), e = !1)
  15383. })), t.addEventListener(at, function (t) {
  15384. e || (e = !0, this.addFeature(t.element), e = !1)
  15385. }.bind(this)), t.addEventListener(st, function (t) {
  15386. e || (e = !0, this.removeFeature(t.element), e = !1)
  15387. }.bind(this)), this.featuresCollection_ = t
  15388. }, e.prototype.clear = function (t) {
  15389. if (t) {
  15390. for (var e in this.featureChangeKeys_) {
  15391. this.featureChangeKeys_[e].forEach(H)
  15392. }
  15393. this.featuresCollection_ || (this.featureChangeKeys_ = {}, this.idIndex_ = {}, this.uidIndex_ = {})
  15394. } else if (this.featuresRtree_) for (var r in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)), this.nullGeometryFeatures_) this.removeFeatureInternal(this.nullGeometryFeatures_[r]);
  15395. this.featuresCollection_ && this.featuresCollection_.clear(), this.featuresRtree_ && this.featuresRtree_.clear(), this.nullGeometryFeatures_ = {};
  15396. var n = new cf(nf);
  15397. this.dispatchEvent(n), this.changed()
  15398. }, e.prototype.forEachFeature = function (t) {
  15399. if (this.featuresRtree_) return this.featuresRtree_.forEach(t);
  15400. this.featuresCollection_ && this.featuresCollection_.forEach(t)
  15401. }, e.prototype.forEachFeatureAtCoordinateDirect = function (t, e) {
  15402. var r = [t[0], t[1], t[0], t[1]];
  15403. return this.forEachFeatureInExtent(r, (function (r) {
  15404. return r.getGeometry().intersectsCoordinate(t) ? e(r) : void 0
  15405. }))
  15406. }, e.prototype.forEachFeatureInExtent = function (t, e) {
  15407. if (this.featuresRtree_) return this.featuresRtree_.forEachInExtent(t, e);
  15408. this.featuresCollection_ && this.featuresCollection_.forEach(e)
  15409. }, e.prototype.forEachFeatureIntersectingExtent = function (t, e) {
  15410. return this.forEachFeatureInExtent(t, (function (r) {
  15411. if (r.getGeometry().intersectsExtent(t)) {
  15412. var n = e(r);
  15413. if (n) return n
  15414. }
  15415. }))
  15416. }, e.prototype.getFeaturesCollection = function () {
  15417. return this.featuresCollection_
  15418. }, e.prototype.getFeatures = function () {
  15419. var t;
  15420. return this.featuresCollection_ ? t = this.featuresCollection_.getArray() : this.featuresRtree_ && (t = this.featuresRtree_.getAll(), I(this.nullGeometryFeatures_) || v(t, R(this.nullGeometryFeatures_))), t
  15421. }, e.prototype.getFeaturesAtCoordinate = function (t) {
  15422. var e = [];
  15423. return this.forEachFeatureAtCoordinateDirect(t, (function (t) {
  15424. e.push(t)
  15425. })), e
  15426. }, e.prototype.getFeaturesInExtent = function (t) {
  15427. return this.featuresRtree_ ? this.featuresRtree_.getInExtent(t) : this.featuresCollection_ ? this.featuresCollection_.getArray() : []
  15428. }, e.prototype.getClosestFeatureToCoordinate = function (t, e) {
  15429. var r = t[0], n = t[1], i = null, o = [NaN, NaN], a = 1 / 0, s = [-1 / 0, -1 / 0, 1 / 0, 1 / 0], l = e || S;
  15430. return this.featuresRtree_.forEachInExtent(s, (function (t) {
  15431. if (l(t)) {
  15432. var e = t.getGeometry(), u = a;
  15433. if ((a = e.closestPointXY(r, n, o, a)) < u) {
  15434. i = t;
  15435. var c = Math.sqrt(a);
  15436. s[0] = r - c, s[1] = n - c, s[2] = r + c, s[3] = n + c
  15437. }
  15438. }
  15439. })), i
  15440. }, e.prototype.getExtent = function (t) {
  15441. return this.featuresRtree_.getExtent(t)
  15442. }, e.prototype.getFeatureById = function (t) {
  15443. var e = this.idIndex_[t.toString()];
  15444. return void 0 !== e ? e : null
  15445. }, e.prototype.getFeatureByUid = function (t) {
  15446. var e = this.uidIndex_[t];
  15447. return void 0 !== e ? e : null
  15448. }, e.prototype.getFormat = function () {
  15449. return this.format_
  15450. }, e.prototype.getOverlaps = function () {
  15451. return this.overlaps_
  15452. }, e.prototype.getUrl = function () {
  15453. return this.url_
  15454. }, e.prototype.handleFeatureChange_ = function (t) {
  15455. var e = t.target, r = o(e), n = e.getGeometry();
  15456. if (n) {
  15457. var i = n.getExtent();
  15458. r in this.nullGeometryFeatures_ ? (delete this.nullGeometryFeatures_[r], this.featuresRtree_ && this.featuresRtree_.insert(i, e)) : this.featuresRtree_ && this.featuresRtree_.update(i, e)
  15459. } else r in this.nullGeometryFeatures_ || (this.featuresRtree_ && this.featuresRtree_.remove(e), this.nullGeometryFeatures_[r] = e);
  15460. var a = e.getId();
  15461. if (void 0 !== a) {
  15462. var s = a.toString();
  15463. this.idIndex_[s] !== e && (this.removeFromIdIndex_(e), this.idIndex_[s] = e)
  15464. } else this.removeFromIdIndex_(e), this.uidIndex_[r] = e;
  15465. this.changed(), this.dispatchEvent(new cf(rf, e))
  15466. }, e.prototype.hasFeature = function (t) {
  15467. var e = t.getId();
  15468. return void 0 !== e ? e in this.idIndex_ : o(t) in this.uidIndex_
  15469. }, e.prototype.isEmpty = function () {
  15470. return this.featuresRtree_.isEmpty() && I(this.nullGeometryFeatures_)
  15471. }, e.prototype.loadFeatures = function (t, e, r) {
  15472. var n = this.loadedExtentsRtree_, i = this.strategy_(t, e);
  15473. this.loading = !1;
  15474. for (var o = function (t, o) {
  15475. var s = i[t];
  15476. n.forEachInExtent(s, (function (t) {
  15477. return te(t.extent, s)
  15478. })) || (a.dispatchEvent(new cf(af)), a.loader_.call(a, s, e, r, function (t) {
  15479. this.dispatchEvent(new cf(sf, void 0, t))
  15480. }.bind(a), function () {
  15481. this.dispatchEvent(new cf(lf))
  15482. }.bind(a)), n.insert(s, {extent: s.slice()}), a.loading = a.loader_ !== T)
  15483. }, a = this, s = 0, l = i.length; s < l; ++s) o(s)
  15484. }, e.prototype.refresh = function () {
  15485. this.clear(!0), this.loadedExtentsRtree_.clear(), t.prototype.refresh.call(this)
  15486. }, e.prototype.removeLoadedExtent = function (t) {
  15487. var e, r = this.loadedExtentsRtree_;
  15488. r.forEachInExtent(t, (function (r) {
  15489. if (ue(r.extent, t)) return e = r, !0
  15490. })), e && r.remove(e)
  15491. }, e.prototype.removeFeature = function (t) {
  15492. var e = o(t);
  15493. e in this.nullGeometryFeatures_ ? delete this.nullGeometryFeatures_[e] : this.featuresRtree_ && this.featuresRtree_.remove(t), this.removeFeatureInternal(t), this.changed()
  15494. }, e.prototype.removeFeatureInternal = function (t) {
  15495. var e = o(t);
  15496. this.featureChangeKeys_[e].forEach(H), delete this.featureChangeKeys_[e];
  15497. var r = t.getId();
  15498. void 0 !== r && delete this.idIndex_[r.toString()], delete this.uidIndex_[e], this.dispatchEvent(new cf(of, t))
  15499. }, e.prototype.removeFromIdIndex_ = function (t) {
  15500. var e = !1;
  15501. for (var r in this.idIndex_) if (this.idIndex_[r] === t) {
  15502. delete this.idIndex_[r], e = !0;
  15503. break
  15504. }
  15505. return e
  15506. }, e.prototype.setLoader = function (t) {
  15507. this.loader_ = t
  15508. }, e.prototype.setUrl = function (t) {
  15509. pt(this.format_, 7), this.setLoader(Mu(t, this.format_))
  15510. }, e
  15511. }(Dp), pf = function () {
  15512. var t = function (e, r) {
  15513. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15514. t.__proto__ = e
  15515. } || function (t, e) {
  15516. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15517. })(e, r)
  15518. };
  15519. return function (e, r) {
  15520. function n() {
  15521. this.constructor = e
  15522. }
  15523. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15524. }
  15525. }(), ff = function (t) {
  15526. function e(e) {
  15527. var r = t.call(this, {attributions: e.attributions, wrapX: e.wrapX}) || this;
  15528. return r.resolution = void 0, r.distance = void 0 !== e.distance ? e.distance : 20, r.features = [], r.geometryFunction = e.geometryFunction || function (t) {
  15529. var e = t.getGeometry();
  15530. return pt(e.getType() == bt.POINT, 10), e
  15531. }, r.boundRefresh_ = r.refresh.bind(r), r.setSource(e.source || null), r
  15532. }
  15533. return pf(e, t), e.prototype.clear = function (e) {
  15534. this.features.length = 0, t.prototype.clear.call(this, e)
  15535. }, e.prototype.getDistance = function () {
  15536. return this.distance
  15537. }, e.prototype.getSource = function () {
  15538. return this.source
  15539. }, e.prototype.loadFeatures = function (t, e, r) {
  15540. this.source.loadFeatures(t, e, r), e !== this.resolution && (this.clear(), this.resolution = e, this.cluster(), this.addFeatures(this.features))
  15541. }, e.prototype.setDistance = function (t) {
  15542. this.distance = t, this.refresh()
  15543. }, e.prototype.setSource = function (t) {
  15544. this.source && this.source.removeEventListener(F, this.boundRefresh_), this.source = t, t && t.addEventListener(F, this.boundRefresh_), this.refresh()
  15545. }, e.prototype.refresh = function () {
  15546. this.clear(), this.cluster(), this.addFeatures(this.features)
  15547. }, e.prototype.cluster = function () {
  15548. if (void 0 !== this.resolution && this.source) for (var t = [1 / 0, 1 / 0, -1 / 0, -1 / 0], e = this.distance * this.resolution, r = this.source.getFeatures(), n = {}, i = 0, a = r.length; i < a; i++) {
  15549. var s = r[i];
  15550. if (!(o(s) in n)) {
  15551. var l = this.geometryFunction(s);
  15552. if (l) {
  15553. ae(l.getCoordinates(), t), Ht(t, e, t);
  15554. var u = this.source.getFeaturesInExtent(t);
  15555. u = u.filter((function (t) {
  15556. var e = o(t);
  15557. return !(e in n) && (n[e] = !0, !0)
  15558. })), this.features.push(this.createCluster(u))
  15559. }
  15560. }
  15561. }
  15562. }, e.prototype.createCluster = function (t) {
  15563. for (var e = [0, 0], r = t.length - 1; r >= 0; --r) {
  15564. var n = this.geometryFunction(t[r]);
  15565. n ? xr(e, n.getCoordinates()) : t.splice(r, 1)
  15566. }
  15567. Pr(e, 1 / t.length);
  15568. var i = new gt(new qn(e));
  15569. return i.set("features", t), i
  15570. }, e
  15571. }(hf), df = function () {
  15572. var t = function (e, r) {
  15573. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15574. t.__proto__ = e
  15575. } || function (t, e) {
  15576. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15577. })(e, r)
  15578. };
  15579. return function (e, r) {
  15580. function n() {
  15581. this.constructor = e
  15582. }
  15583. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15584. }
  15585. }(), gf = "default", yf = "truncated", mf = function (t) {
  15586. function e(e, r, n, i, o, a, s) {
  15587. var l = t.call(this, r, n, i, o, a, s) || this;
  15588. return l.zoomifyImage_ = null, l.tileSize_ = e, l
  15589. }
  15590. return df(e, t), e.prototype.getImage = function () {
  15591. if (this.zoomifyImage_) return this.zoomifyImage_;
  15592. var e = t.prototype.getImage.call(this);
  15593. if (this.state == to) {
  15594. var r = this.tileSize_;
  15595. if (e.width == r[0] && e.height == r[1]) return this.zoomifyImage_ = e, e;
  15596. var n = uo(r[0], r[1]);
  15597. return n.drawImage(e, 0, 0), this.zoomifyImage_ = n.canvas, n.canvas
  15598. }
  15599. return e
  15600. }, e
  15601. }(vo), vf = function (t) {
  15602. function e(e) {
  15603. var r = this, n = e, i = n.size, o = void 0 !== n.tierSizeCalculation ? n.tierSizeCalculation : gf,
  15604. a = n.tilePixelRatio || 1, s = i[0], l = i[1], u = [], c = n.tileSize || 256, h = c * a;
  15605. switch (o) {
  15606. case gf:
  15607. for (; s > h || l > h;) u.push([Math.ceil(s / h), Math.ceil(l / h)]), h += h;
  15608. break;
  15609. case yf:
  15610. for (var p = s, f = l; p > h || f > h;) u.push([Math.ceil(p / h), Math.ceil(f / h)]), p >>= 1, f >>= 1;
  15611. break;
  15612. default:
  15613. pt(!1, 53)
  15614. }
  15615. u.push([1, 1]), u.reverse();
  15616. for (var d = [a], g = [0], y = 1, m = u.length; y < m; y++) d.push(a << y), g.push(u[y - 1][0] * u[y - 1][1] + g[y - 1]);
  15617. d.reverse();
  15618. var v = new ic({tileSize: c, extent: n.extent || [0, -l, s, 0], resolutions: d}), _ = n.url;
  15619. _ && -1 == _.indexOf("{TileGroup}") && -1 == _.indexOf("{tileIndex}") && (_ += "{TileGroup}/{z}-{x}-{y}.jpg");
  15620. var b = yc(_), x = c * a;
  15621. var w = dc(b.map((function (t) {
  15622. return function (e, r, n) {
  15623. if (e) {
  15624. var i = e[0], o = e[1], a = e[2], s = o + a * u[i][0],
  15625. l = {z: i, x: o, y: a, tileIndex: s, TileGroup: "TileGroup" + ((s + g[i]) / x | 0)};
  15626. return t.replace(/\{(\w+?)\}/g, (function (t, e) {
  15627. return l[e]
  15628. }))
  15629. }
  15630. }
  15631. }))), S = mf.bind(null, Is(c * a));
  15632. (r = t.call(this, {
  15633. attributions: n.attributions,
  15634. cacheSize: n.cacheSize,
  15635. crossOrigin: n.crossOrigin,
  15636. imageSmoothing: n.imageSmoothing,
  15637. projection: n.projection,
  15638. tilePixelRatio: a,
  15639. reprojectionErrorThreshold: n.reprojectionErrorThreshold,
  15640. tileClass: S,
  15641. tileGrid: v,
  15642. tileUrlFunction: w,
  15643. transition: n.transition
  15644. }) || this).zDirection = n.zDirection;
  15645. var E = w(v.getTileCoordForCoordAndResolution(xe(v.getExtent()), d[d.length - 1]), 1, null), T = new Image;
  15646. return T.addEventListener("error", function () {
  15647. x = c, this.changed()
  15648. }.bind(r)), T.src = E, r
  15649. }
  15650. return df(e, t), e
  15651. }(Xp), _f = function () {
  15652. for (var t = 0, e = 0, r = arguments.length; e < r; e++) t += arguments[e].length;
  15653. var n = Array(t), i = 0;
  15654. for (e = 0; e < r; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) n[i] = o[a];
  15655. return n
  15656. }, bf = "version1", xf = "version2", wf = "version3", Sf = {};
  15657. Sf[bf] = {
  15658. level0: {supports: [], formats: [], qualities: ["native"]},
  15659. level1: {supports: ["regionByPx", "sizeByW", "sizeByH", "sizeByPct"], formats: ["jpg"], qualities: ["native"]},
  15660. level2: {
  15661. supports: ["regionByPx", "regionByPct", "sizeByW", "sizeByH", "sizeByPct", "sizeByConfinedWh", "sizeByWh"],
  15662. formats: ["jpg", "png"],
  15663. qualities: ["native", "color", "grey", "bitonal"]
  15664. }
  15665. }, Sf[xf] = {
  15666. level0: {supports: [], formats: ["jpg"], qualities: ["default"]},
  15667. level1: {supports: ["regionByPx", "sizeByW", "sizeByH", "sizeByPct"], formats: ["jpg"], qualities: ["default"]},
  15668. level2: {
  15669. supports: ["regionByPx", "regionByPct", "sizeByW", "sizeByH", "sizeByPct", "sizeByConfinedWh", "sizeByDistortedWh", "sizeByWh"],
  15670. formats: ["jpg", "png"],
  15671. qualities: ["default", "bitonal"]
  15672. }
  15673. }, Sf[wf] = {
  15674. level0: {supports: [], formats: ["jpg"], qualities: ["default"]},
  15675. level1: {
  15676. supports: ["regionByPx", "regionSquare", "sizeByW", "sizeByH", "sizeByWh"],
  15677. formats: ["jpg"],
  15678. qualities: ["default"]
  15679. },
  15680. level2: {
  15681. supports: ["regionByPx", "regionSquare", "regionByPct", "sizeByW", "sizeByH", "sizeByPct", "sizeByConfinedWh", "sizeByWh"],
  15682. formats: ["jpg", "png"],
  15683. qualities: ["default"]
  15684. }
  15685. }, Sf.none = {none: {supports: [], formats: [], qualities: []}};
  15686. var Ef = /^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,
  15687. Tf = /^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,
  15688. Cf = /(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;
  15689. var Of = {};
  15690. Of[bf] = function (t) {
  15691. var e = t.getComplianceLevelSupportedFeatures();
  15692. return void 0 === e && (e = Sf[bf].level0), {
  15693. url: void 0 === t.imageInfo["@id"] ? void 0 : t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g, ""),
  15694. supports: e.supports,
  15695. formats: _f(e.formats, [void 0 === t.imageInfo.formats ? [] : t.imageInfo.formats]),
  15696. qualities: _f(e.qualities, [void 0 === t.imageInfo.qualities ? [] : t.imageInfo.qualities]),
  15697. resolutions: t.imageInfo.scale_factors,
  15698. tileSize: void 0 !== t.imageInfo.tile_width ? void 0 !== t.imageInfo.tile_height ? [t.imageInfo.tile_width, t.imageInfo.tile_height] : [t.imageInfo.tile_width, t.imageInfo.tile_width] : null != t.imageInfo.tile_height ? [t.imageInfo.tile_height, t.imageInfo.tile_height] : void 0
  15699. }
  15700. }, Of[xf] = function (t) {
  15701. var e = t.getComplianceLevelSupportedFeatures(),
  15702. r = Array.isArray(t.imageInfo.profile) && t.imageInfo.profile.length > 1,
  15703. n = r && t.imageInfo.profile[1].supports ? t.imageInfo.profile[1].supports : [],
  15704. i = r && t.imageInfo.profile[1].formats ? t.imageInfo.profile[1].formats : [],
  15705. o = r && t.imageInfo.profile[1].qualities ? t.imageInfo.profile[1].qualities : [];
  15706. return {
  15707. url: t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g, ""),
  15708. sizes: void 0 === t.imageInfo.sizes ? void 0 : t.imageInfo.sizes.map((function (t) {
  15709. return [t.width, t.height]
  15710. })),
  15711. tileSize: void 0 === t.imageInfo.tiles ? void 0 : [t.imageInfo.tiles.map((function (t) {
  15712. return t.width
  15713. }))[0], t.imageInfo.tiles.map((function (t) {
  15714. return void 0 === t.height ? t.width : t.height
  15715. }))[0]],
  15716. resolutions: void 0 === t.imageInfo.tiles ? void 0 : t.imageInfo.tiles.map((function (t) {
  15717. return t.scaleFactors
  15718. }))[0],
  15719. supports: _f(e.supports, n),
  15720. formats: _f(e.formats, i),
  15721. qualities: _f(e.qualities, o)
  15722. }
  15723. }, Of[wf] = function (t) {
  15724. var e = t.getComplianceLevelSupportedFeatures(),
  15725. r = void 0 === t.imageInfo.extraFormats ? e.formats : _f(e.formats, t.imageInfo.extraFormats),
  15726. n = void 0 !== t.imageInfo.preferredFormats && Array.isArray(t.imageInfo.preferredFormats) && t.imageInfo.preferredFormats.length > 0 ? t.imageInfo.preferredFormats.filter((function (t) {
  15727. return ["jpg", "png", "gif"].includes(t)
  15728. })).reduce((function (t, e) {
  15729. return void 0 === t && r.includes(e) ? e : t
  15730. }), void 0) : void 0;
  15731. return {
  15732. url: t.imageInfo.id,
  15733. sizes: void 0 === t.imageInfo.sizes ? void 0 : t.imageInfo.sizes.map((function (t) {
  15734. return [t.width, t.height]
  15735. })),
  15736. tileSize: void 0 === t.imageInfo.tiles ? void 0 : [t.imageInfo.tiles.map((function (t) {
  15737. return t.width
  15738. }))[0], t.imageInfo.tiles.map((function (t) {
  15739. return t.height
  15740. }))[0]],
  15741. resolutions: void 0 === t.imageInfo.tiles ? void 0 : t.imageInfo.tiles.map((function (t) {
  15742. return t.scaleFactors
  15743. }))[0],
  15744. supports: void 0 === t.imageInfo.extraFeatures ? e.supports : _f(e.supports, t.imageInfo.extraFeatures),
  15745. formats: r,
  15746. qualities: void 0 === t.imageInfo.extraQualities ? e.qualities : _f(e.qualities, t.imageInfo.extraQualities),
  15747. preferredFormat: n
  15748. }
  15749. };
  15750. var Pf = function () {
  15751. function t(t) {
  15752. this.setImageInfo(t)
  15753. }
  15754. return t.prototype.setImageInfo = function (t) {
  15755. this.imageInfo = "string" == typeof t ? JSON.parse(t) : t
  15756. }, t.prototype.getImageApiVersion = function () {
  15757. if (void 0 !== this.imageInfo) {
  15758. var t = this.imageInfo["@context"] || "ol-no-context";
  15759. "string" == typeof t && (t = [t]);
  15760. for (var e = 0; e < t.length; e++) switch (t[e]) {
  15761. case"http://library.stanford.edu/iiif/image-api/1.1/context.json":
  15762. case"http://iiif.io/api/image/1/context.json":
  15763. return bf;
  15764. case"http://iiif.io/api/image/2/context.json":
  15765. return xf;
  15766. case"http://iiif.io/api/image/3/context.json":
  15767. return wf;
  15768. case"ol-no-context":
  15769. if (this.getComplianceLevelEntryFromProfile(bf) && this.imageInfo.identifier) return bf
  15770. }
  15771. pt(!1, 61)
  15772. }
  15773. }, t.prototype.getComplianceLevelEntryFromProfile = function (t) {
  15774. if (void 0 !== this.imageInfo && void 0 !== this.imageInfo.profile) switch (void 0 === t && (t = this.getImageApiVersion()), t) {
  15775. case bf:
  15776. if (Ef.test(this.imageInfo.profile)) return this.imageInfo.profile;
  15777. break;
  15778. case wf:
  15779. if (Cf.test(this.imageInfo.profile)) return this.imageInfo.profile;
  15780. break;
  15781. case xf:
  15782. if ("string" == typeof this.imageInfo.profile && Tf.test(this.imageInfo.profile)) return this.imageInfo.profile;
  15783. if (Array.isArray(this.imageInfo.profile) && this.imageInfo.profile.length > 0 && "string" == typeof this.imageInfo.profile[0] && Tf.test(this.imageInfo.profile[0])) return this.imageInfo.profile[0]
  15784. }
  15785. }, t.prototype.getComplianceLevelFromProfile = function (t) {
  15786. var e = this.getComplianceLevelEntryFromProfile(t);
  15787. if (void 0 !== e) {
  15788. var r = e.match(/level[0-2](?:\.json)?$/g);
  15789. return Array.isArray(r) ? r[0].replace(".json", "") : void 0
  15790. }
  15791. }, t.prototype.getComplianceLevelSupportedFeatures = function () {
  15792. if (void 0 !== this.imageInfo) {
  15793. var t = this.getImageApiVersion(), e = this.getComplianceLevelFromProfile(t);
  15794. return void 0 === e ? Sf.none.none : Sf[t][e]
  15795. }
  15796. }, t.prototype.getTileSourceOptions = function (t) {
  15797. var e = t || {}, r = this.getImageApiVersion();
  15798. if (void 0 !== r) {
  15799. var n = void 0 === r ? void 0 : Of[r](this);
  15800. if (void 0 !== n) return {
  15801. url: n.url,
  15802. version: r,
  15803. size: [this.imageInfo.width, this.imageInfo.height],
  15804. sizes: n.sizes,
  15805. format: void 0 !== e.format && n.formats.includes(e.format) ? e.format : void 0 !== n.preferredFormat ? n.preferredFormat : "jpg",
  15806. supports: n.supports,
  15807. quality: e.quality && n.qualities.includes(e.quality) ? e.quality : n.qualities.includes("native") ? "native" : "default",
  15808. resolutions: Array.isArray(n.resolutions) ? n.resolutions.sort((function (t, e) {
  15809. return e - t
  15810. })) : void 0,
  15811. tileSize: n.tileSize
  15812. }
  15813. }
  15814. }, t
  15815. }(), Rf = function () {
  15816. var t = function (e, r) {
  15817. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15818. t.__proto__ = e
  15819. } || function (t, e) {
  15820. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15821. })(e, r)
  15822. };
  15823. return function (e, r) {
  15824. function n() {
  15825. this.constructor = e
  15826. }
  15827. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15828. }
  15829. }();
  15830. function If(t) {
  15831. return t.toLocaleString("en", {maximumFractionDigits: 10})
  15832. }
  15833. var Lf = function (t) {
  15834. function e(e) {
  15835. var r = this, n = e || {}, i = n.url || "";
  15836. i += i.lastIndexOf("/") === i.length - 1 || "" === i ? "" : "/";
  15837. var o = n.version || xf, a = n.sizes || [], s = n.size;
  15838. pt(null != s && Array.isArray(s) && 2 == s.length && !isNaN(s[0]) && s[0] > 0 && !isNaN(s[1]) && s[1] > 0, 60);
  15839. var l, u, c, h = s[0], p = s[1], f = n.tileSize, d = n.tilePixelRatio || 1, g = n.format || "jpg",
  15840. y = n.quality || (n.version == bf ? "native" : "default"), m = n.resolutions || [], v = n.supports || [],
  15841. _ = n.extent || [0, -p, h, 0], b = null != a && Array.isArray(a) && a.length > 0,
  15842. x = void 0 !== f && ("number" == typeof f && Number.isInteger(f) && f > 0 || Array.isArray(f) && f.length > 0),
  15843. w = null != v && Array.isArray(v) && (v.includes("regionByPx") || v.includes("regionByPct")) && (v.includes("sizeByWh") || v.includes("sizeByH") || v.includes("sizeByW") || v.includes("sizeByPct"));
  15844. if (m.sort((function (t, e) {
  15845. return e - t
  15846. })), x || w) if (null != f && ("number" == typeof f && Number.isInteger(f) && f > 0 ? (l = f, u = f) : Array.isArray(f) && f.length > 0 && ((1 == f.length || null == f[1] && Number.isInteger(f[0])) && (l = f[0], u = f[0]), 2 == f.length && (Number.isInteger(f[0]) && Number.isInteger(f[1]) ? (l = f[0], u = f[1]) : null == f[0] && Number.isInteger(f[1]) && (l = f[1], u = f[1])))), void 0 !== l && void 0 !== u || (l = 256, u = 256), 0 == m.length) for (var S = c = Math.max(Math.ceil(Math.log(h / l) / Math.LN2), Math.ceil(Math.log(p / u) / Math.LN2)); S >= 0; S--) m.push(Math.pow(2, S)); else {
  15847. var E = Math.max.apply(Math, m);
  15848. c = Math.round(Math.log(E) / Math.LN2)
  15849. } else if (l = h, u = p, m = [], b) {
  15850. a.sort((function (t, e) {
  15851. return t[0] - e[0]
  15852. })), c = -1;
  15853. var T = [];
  15854. for (S = 0; S < a.length; S++) {
  15855. var C = h / a[S][0];
  15856. m.length > 0 && m[m.length - 1] == C ? T.push(S) : (m.push(C), c++)
  15857. }
  15858. if (T.length > 0) for (S = 0; S < T.length; S++) a.splice(T[S] - S, 1)
  15859. } else m.push(1), a.push([h, p]), c = 0;
  15860. var O = new ic({tileSize: [l, u], extent: _, origin: Ce(_), resolutions: m}),
  15861. P = mf.bind(null, Is(f || 256).map((function (t) {
  15862. return t * d
  15863. })));
  15864. return (r = t.call(this, {
  15865. attributions: n.attributions,
  15866. attributionsCollapsible: n.attributionsCollapsible,
  15867. cacheSize: n.cacheSize,
  15868. crossOrigin: n.crossOrigin,
  15869. imageSmoothing: n.imageSmoothing,
  15870. projection: n.projection,
  15871. reprojectionErrorThreshold: n.reprojectionErrorThreshold,
  15872. state: n.state,
  15873. tileClass: P,
  15874. tileGrid: O,
  15875. tilePixelRatio: n.tilePixelRatio,
  15876. tileUrlFunction: function (t, e, r) {
  15877. var n, s, f = t[0];
  15878. if (!(f > c)) {
  15879. var d = t[1], _ = t[2], S = m[f];
  15880. if (!(void 0 === d || void 0 === _ || void 0 === S || d < 0 || Math.ceil(h / S / l) <= d || _ < 0 || Math.ceil(p / S / u) <= _)) {
  15881. if (w || x) {
  15882. var E = d * l * S, T = _ * u * S, C = l * S, O = u * S, P = l, R = u;
  15883. if (E + C > h && (C = h - E), T + O > p && (O = p - T), E + l * S > h && (P = Math.floor((h - E + S - 1) / S)), T + u * S > p && (R = Math.floor((p - T + S - 1) / S)), 0 == E && C == h && 0 == T && O == p) n = "full"; else if (!w || v.includes("regionByPx")) n = E + "," + T + "," + C + "," + O; else if (v.includes("regionByPct")) {
  15884. n = "pct:" + If(E / h * 100) + "," + If(T / p * 100) + "," + If(C / h * 100) + "," + If(O / p * 100)
  15885. }
  15886. o != wf || w && !v.includes("sizeByWh") ? !w || v.includes("sizeByW") ? s = P + "," : v.includes("sizeByH") ? s = "," + R : v.includes("sizeByWh") ? s = P + "," + R : v.includes("sizeByPct") && (s = "pct:" + If(100 / S)) : s = P + "," + R
  15887. } else if (n = "full", b) {
  15888. var I = a[f][0], L = a[f][1];
  15889. s = o == wf ? I == h && L == p ? "max" : I + "," + L : I == h ? "full" : I + ","
  15890. } else s = o == wf ? "max" : "full";
  15891. return i + n + "/" + s + "/0/" + y + "." + g
  15892. }
  15893. }
  15894. },
  15895. transition: n.transition
  15896. }) || this).zDirection = n.zDirection, r
  15897. }
  15898. return Rf(e, t), e
  15899. }(Xp), Mf = function () {
  15900. var t = function (e, r) {
  15901. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15902. t.__proto__ = e
  15903. } || function (t, e) {
  15904. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15905. })(e, r)
  15906. };
  15907. return function (e, r) {
  15908. function n() {
  15909. this.constructor = e
  15910. }
  15911. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15912. }
  15913. }(), Ff = function (t) {
  15914. function e(e, r, n, i, o, a, s) {
  15915. var l = this, u = e.getExtent(), c = r.getExtent(), h = c ? Te(n, c) : n, p = tc(e, r, xe(h), i),
  15916. f = new Ip(e, r, h, u, .5 * p, i), d = a(f.calculateSourceExtent(), p, o), g = d ? Fi : Ni,
  15917. y = d ? d.getPixelRatio() : 1;
  15918. return (l = t.call(this, n, i, y, g) || this).targetProj_ = r, l.maxSourceExtent_ = u, l.triangulation_ = f, l.targetResolution_ = i, l.targetExtent_ = n, l.sourceImage_ = d, l.sourcePixelRatio_ = y, l.contextOptions_ = s, l.canvas_ = null, l.sourceListenerKey_ = null, l
  15919. }
  15920. return Mf(e, t), e.prototype.disposeInternal = function () {
  15921. this.state == Ai && this.unlistenSource_(), t.prototype.disposeInternal.call(this)
  15922. }, e.prototype.getImage = function () {
  15923. return this.canvas_
  15924. }, e.prototype.getProjection = function () {
  15925. return this.targetProj_
  15926. }, e.prototype.reproject_ = function () {
  15927. var t = this.sourceImage_.getState();
  15928. if (t == ki) {
  15929. var e = Pe(this.targetExtent_) / this.targetResolution_, r = Ee(this.targetExtent_) / this.targetResolution_;
  15930. this.canvas_ = rc(e, r, this.sourcePixelRatio_, this.sourceImage_.getResolution(), this.maxSourceExtent_, this.targetResolution_, this.targetExtent_, this.triangulation_, [{
  15931. extent: this.sourceImage_.getExtent(),
  15932. image: this.sourceImage_.getImage()
  15933. }], 0, void 0, this.contextOptions_)
  15934. }
  15935. this.state = t, this.changed()
  15936. }, e.prototype.load = function () {
  15937. if (this.state == Fi) {
  15938. this.state = Ai, this.changed();
  15939. var t = this.sourceImage_.getState();
  15940. t == ki || t == ji ? this.reproject_() : (this.sourceListenerKey_ = Z(this.sourceImage_, F, (function (t) {
  15941. var e = this.sourceImage_.getState();
  15942. e != ki && e != ji || (this.unlistenSource_(), this.reproject_())
  15943. }), this), this.sourceImage_.load())
  15944. }
  15945. }, e.prototype.unlistenSource_ = function () {
  15946. H(this.sourceListenerKey_), this.sourceListenerKey_ = null
  15947. }, e
  15948. }(Mi), Af = function () {
  15949. var t = function (e, r) {
  15950. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  15951. t.__proto__ = e
  15952. } || function (t, e) {
  15953. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  15954. })(e, r)
  15955. };
  15956. return function (e, r) {
  15957. function n() {
  15958. this.constructor = e
  15959. }
  15960. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  15961. }
  15962. }(), kf = "imageloadstart", jf = "imageloadend", Nf = "imageloaderror", Df = function (t) {
  15963. function e(e, r) {
  15964. var n = t.call(this, e) || this;
  15965. return n.image = r, n
  15966. }
  15967. return Af(e, t), e
  15968. }(c);
  15969. function Gf(t, e) {
  15970. t.getImage().src = e
  15971. }
  15972. var zf = function (t) {
  15973. function e(e) {
  15974. var r = t.call(this, {attributions: e.attributions, projection: e.projection, state: e.state}) || this;
  15975. return r.resolutions_ = void 0 !== e.resolutions ? e.resolutions : null, r.reprojectedImage_ = null, r.reprojectedRevision_ = 0, r.contextOptions_ = !1 === e.imageSmoothing ? $u : void 0, r
  15976. }
  15977. return Af(e, t), e.prototype.getResolutions = function () {
  15978. return this.resolutions_
  15979. }, e.prototype.getContextOptions = function () {
  15980. return this.contextOptions_
  15981. }, e.prototype.findNearestResolution = function (t) {
  15982. if (this.resolutions_) {
  15983. var e = y(this.resolutions_, t, 0);
  15984. t = this.resolutions_[e]
  15985. }
  15986. return t
  15987. }, e.prototype.getImage = function (t, e, r, n) {
  15988. var i = this.getProjection();
  15989. if (i && n && !Xr(i, n)) {
  15990. if (this.reprojectedImage_) {
  15991. if (this.reprojectedRevision_ == this.getRevision() && Xr(this.reprojectedImage_.getProjection(), n) && this.reprojectedImage_.getResolution() == e && ue(this.reprojectedImage_.getExtent(), t)) return this.reprojectedImage_;
  15992. this.reprojectedImage_.dispose(), this.reprojectedImage_ = null
  15993. }
  15994. return this.reprojectedImage_ = new Ff(i, n, t, e, r, function (t, e, r) {
  15995. return this.getImageInternal(t, e, r, i)
  15996. }.bind(this), this.contextOptions_), this.reprojectedRevision_ = this.getRevision(), this.reprojectedImage_
  15997. }
  15998. return i && (n = i), this.getImageInternal(t, e, r, n)
  15999. }, e.prototype.getImageInternal = function (t, e, r, i) {
  16000. return n()
  16001. }, e.prototype.handleImageChange = function (t) {
  16002. var e = t.target;
  16003. switch (e.getState()) {
  16004. case Ai:
  16005. this.loading = !0, this.dispatchEvent(new Df(kf, e));
  16006. break;
  16007. case ki:
  16008. this.loading = !1, this.dispatchEvent(new Df(jf, e));
  16009. break;
  16010. case ji:
  16011. this.loading = !1, this.dispatchEvent(new Df(Nf, e))
  16012. }
  16013. }, e
  16014. }(Dp), Uf = function () {
  16015. var t = function (e, r) {
  16016. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16017. t.__proto__ = e
  16018. } || function (t, e) {
  16019. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16020. })(e, r)
  16021. };
  16022. return function (e, r) {
  16023. function n() {
  16024. this.constructor = e
  16025. }
  16026. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16027. }
  16028. }(), Bf = function (t) {
  16029. function e(e) {
  16030. var r = this, n = e || {};
  16031. return (r = t.call(this, {
  16032. attributions: n.attributions,
  16033. imageSmoothing: n.imageSmoothing,
  16034. projection: n.projection,
  16035. resolutions: n.resolutions
  16036. }) || this).crossOrigin_ = void 0 !== n.crossOrigin ? n.crossOrigin : null, r.hidpi_ = void 0 === n.hidpi || n.hidpi, r.url_ = n.url, r.imageLoadFunction_ = void 0 !== n.imageLoadFunction ? n.imageLoadFunction : Gf, r.params_ = n.params || {}, r.image_ = null, r.imageSize_ = [0, 0], r.renderedRevision_ = 0, r.ratio_ = void 0 !== n.ratio ? n.ratio : 1.5, r
  16037. }
  16038. return Uf(e, t), e.prototype.getParams = function () {
  16039. return this.params_
  16040. }, e.prototype.getImageInternal = function (t, e, r, n) {
  16041. if (void 0 === this.url_) return null;
  16042. e = this.findNearestResolution(e), r = this.hidpi_ ? r : 1;
  16043. var i = this.image_;
  16044. if (i && this.renderedRevision_ == this.getRevision() && i.getResolution() == e && i.getPixelRatio() == r && te(i.getExtent(), t)) return i;
  16045. var o = {F: "image", FORMAT: "PNG32", TRANSPARENT: !0};
  16046. O(o, this.params_);
  16047. var a = ((t = t.slice())[0] + t[2]) / 2, s = (t[1] + t[3]) / 2;
  16048. if (1 != this.ratio_) {
  16049. var l = this.ratio_ * Pe(t) / 2, u = this.ratio_ * Ee(t) / 2;
  16050. t[0] = a - l, t[1] = s - u, t[2] = a + l, t[3] = s + u
  16051. }
  16052. var c = e / r, h = Math.ceil(Pe(t) / c), p = Math.ceil(Ee(t) / c);
  16053. t[0] = a - c * h / 2, t[2] = a + c * h / 2, t[1] = s - c * p / 2, t[3] = s + c * p / 2, this.imageSize_[0] = h, this.imageSize_[1] = p;
  16054. var f = this.getRequestUrl_(t, this.imageSize_, r, n, o);
  16055. return this.image_ = new Ki(t, e, r, f, this.crossOrigin_, this.imageLoadFunction_), this.renderedRevision_ = this.getRevision(), this.image_.addEventListener(F, this.handleImageChange.bind(this)), this.image_
  16056. }, e.prototype.getImageLoadFunction = function () {
  16057. return this.imageLoadFunction_
  16058. }, e.prototype.getRequestUrl_ = function (t, e, r, n, i) {
  16059. var o = n.getCode().split(":").pop();
  16060. i.SIZE = e[0] + "," + e[1], i.BBOX = t.join(","), i.BBOXSR = o, i.IMAGESR = o, i.DPI = Math.round(90 * r);
  16061. var a = this.url_,
  16062. s = a.replace(/MapServer\/?$/, "MapServer/export").replace(/ImageServer\/?$/, "ImageServer/exportImage");
  16063. return s == a && pt(!1, 50), mc(s, i)
  16064. }, e.prototype.getUrl = function () {
  16065. return this.url_
  16066. }, e.prototype.setImageLoadFunction = function (t) {
  16067. this.image_ = null, this.imageLoadFunction_ = t, this.changed()
  16068. }, e.prototype.setUrl = function (t) {
  16069. t != this.url_ && (this.url_ = t, this.image_ = null, this.changed())
  16070. }, e.prototype.updateParams = function (t) {
  16071. O(this.params_, t), this.image_ = null, this.changed()
  16072. }, e
  16073. }(zf), Vf = function () {
  16074. var t = function (e, r) {
  16075. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16076. t.__proto__ = e
  16077. } || function (t, e) {
  16078. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16079. })(e, r)
  16080. };
  16081. return function (e, r) {
  16082. function n() {
  16083. this.constructor = e
  16084. }
  16085. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16086. }
  16087. }(), Yf = function (t) {
  16088. function e(e) {
  16089. var r = this, n = e || {};
  16090. return (r = t.call(this, {
  16091. attributions: n.attributions,
  16092. imageSmoothing: n.imageSmoothing,
  16093. projection: n.projection,
  16094. resolutions: n.resolutions,
  16095. state: n.state
  16096. }) || this).canvasFunction_ = n.canvasFunction, r.canvas_ = null, r.renderedRevision_ = 0, r.ratio_ = void 0 !== n.ratio ? n.ratio : 1.5, r
  16097. }
  16098. return Vf(e, t), e.prototype.getImageInternal = function (t, e, r, n) {
  16099. e = this.findNearestResolution(e);
  16100. var i = this.canvas_;
  16101. if (i && this.renderedRevision_ == this.getRevision() && i.getResolution() == e && i.getPixelRatio() == r && te(i.getExtent(), t)) return i;
  16102. Me(t = t.slice(), this.ratio_);
  16103. var o = [Pe(t) / e * r, Ee(t) / e * r], a = this.canvasFunction_.call(this, t, e, r, o, n);
  16104. return a && (i = new $i(t, e, r, a)), this.canvas_ = i, this.renderedRevision_ = this.getRevision(), i
  16105. }, e
  16106. }(zf), Wf = function () {
  16107. var t = function (e, r) {
  16108. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16109. t.__proto__ = e
  16110. } || function (t, e) {
  16111. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16112. })(e, r)
  16113. };
  16114. return function (e, r) {
  16115. function n() {
  16116. this.constructor = e
  16117. }
  16118. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16119. }
  16120. }();
  16121. var qf = function (t) {
  16122. function e(e) {
  16123. var r = t.call(this, {
  16124. imageSmoothing: e.imageSmoothing,
  16125. projection: e.projection,
  16126. resolutions: e.resolutions
  16127. }) || this;
  16128. return r.crossOrigin_ = void 0 !== e.crossOrigin ? e.crossOrigin : null, r.displayDpi_ = void 0 !== e.displayDpi ? e.displayDpi : 96, r.params_ = e.params || {}, r.url_ = e.url, r.imageLoadFunction_ = void 0 !== e.imageLoadFunction ? e.imageLoadFunction : Gf, r.hidpi_ = void 0 === e.hidpi || e.hidpi, r.metersPerUnit_ = void 0 !== e.metersPerUnit ? e.metersPerUnit : 1, r.ratio_ = void 0 !== e.ratio ? e.ratio : 1, r.useOverlay_ = void 0 !== e.useOverlay && e.useOverlay, r.image_ = null, r.renderedRevision_ = 0, r
  16129. }
  16130. return Wf(e, t), e.prototype.getParams = function () {
  16131. return this.params_
  16132. }, e.prototype.getImageInternal = function (t, e, r, n) {
  16133. e = this.findNearestResolution(e), r = this.hidpi_ ? r : 1;
  16134. var i = this.image_;
  16135. if (i && this.renderedRevision_ == this.getRevision() && i.getResolution() == e && i.getPixelRatio() == r && te(i.getExtent(), t)) return i;
  16136. 1 != this.ratio_ && Me(t = t.slice(), this.ratio_);
  16137. var o = [Pe(t) / e * r, Ee(t) / e * r];
  16138. if (void 0 !== this.url_) {
  16139. var a = this.getUrl(this.url_, this.params_, t, o, n);
  16140. (i = new Ki(t, e, r, a, this.crossOrigin_, this.imageLoadFunction_)).addEventListener(F, this.handleImageChange.bind(this))
  16141. } else i = null;
  16142. return this.image_ = i, this.renderedRevision_ = this.getRevision(), i
  16143. }, e.prototype.getImageLoadFunction = function () {
  16144. return this.imageLoadFunction_
  16145. }, e.prototype.updateParams = function (t) {
  16146. O(this.params_, t), this.changed()
  16147. }, e.prototype.getUrl = function (t, e, r, n, i) {
  16148. var o = function (t, e, r, n) {
  16149. var i = Pe(t), o = Ee(t), a = e[0], s = e[1], l = .0254 / n;
  16150. return s * i > a * o ? i * r / (a * l) : o * r / (s * l)
  16151. }(r, n, this.metersPerUnit_, this.displayDpi_), a = xe(r), s = {
  16152. OPERATION: this.useOverlay_ ? "GETDYNAMICMAPOVERLAYIMAGE" : "GETMAPIMAGE",
  16153. VERSION: "2.0.0",
  16154. LOCALE: "en",
  16155. CLIENTAGENT: "ol/source/ImageMapGuide source",
  16156. CLIP: "1",
  16157. SETDISPLAYDPI: this.displayDpi_,
  16158. SETDISPLAYWIDTH: Math.round(n[0]),
  16159. SETDISPLAYHEIGHT: Math.round(n[1]),
  16160. SETVIEWSCALE: o,
  16161. SETVIEWCENTERX: a[0],
  16162. SETVIEWCENTERY: a[1]
  16163. };
  16164. return O(s, e), mc(t, s)
  16165. }, e.prototype.setImageLoadFunction = function (t) {
  16166. this.image_ = null, this.imageLoadFunction_ = t, this.changed()
  16167. }, e
  16168. }(zf), Xf = function () {
  16169. var t = function (e, r) {
  16170. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16171. t.__proto__ = e
  16172. } || function (t, e) {
  16173. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16174. })(e, r)
  16175. };
  16176. return function (e, r) {
  16177. function n() {
  16178. this.constructor = e
  16179. }
  16180. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16181. }
  16182. }(), Zf = function (t) {
  16183. function e(e) {
  16184. var r = this, n = void 0 !== e.crossOrigin ? e.crossOrigin : null,
  16185. i = void 0 !== e.imageLoadFunction ? e.imageLoadFunction : Gf;
  16186. return (r = t.call(this, {
  16187. attributions: e.attributions,
  16188. imageSmoothing: e.imageSmoothing,
  16189. projection: Gr(e.projection)
  16190. }) || this).url_ = e.url, r.imageExtent_ = e.imageExtent, r.image_ = new Ki(r.imageExtent_, void 0, 1, r.url_, n, i), r.imageSize_ = e.imageSize ? e.imageSize : null, r.image_.addEventListener(F, r.handleImageChange.bind(r)), r
  16191. }
  16192. return Xf(e, t), e.prototype.getImageExtent = function () {
  16193. return this.imageExtent_
  16194. }, e.prototype.getImageInternal = function (t, e, r, n) {
  16195. return Re(t, this.image_.getExtent()) ? this.image_ : null
  16196. }, e.prototype.getUrl = function () {
  16197. return this.url_
  16198. }, e.prototype.handleImageChange = function (e) {
  16199. if (this.image_.getState() == ki) {
  16200. var r = this.image_.getExtent(), n = this.image_.getImage(), i = void 0, o = void 0;
  16201. this.imageSize_ ? (i = this.imageSize_[0], o = this.imageSize_[1]) : (i = n.width, o = n.height);
  16202. var a = Ee(r) / o, s = Math.ceil(Pe(r) / a);
  16203. if (s != i) {
  16204. var l = uo(s, o);
  16205. O(l, this.getContextOptions());
  16206. var u = l.canvas;
  16207. l.drawImage(n, 0, 0, i, o, 0, 0, u.width, u.height), this.image_.setImage(u)
  16208. }
  16209. }
  16210. t.prototype.handleImageChange.call(this, e)
  16211. }, e
  16212. }(zf), Kf = "carmentaserver", Hf = "geoserver", $f = "mapserver", Jf = "qgis", Qf = function () {
  16213. var t = function (e, r) {
  16214. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16215. t.__proto__ = e
  16216. } || function (t, e) {
  16217. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16218. })(e, r)
  16219. };
  16220. return function (e, r) {
  16221. function n() {
  16222. this.constructor = e
  16223. }
  16224. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16225. }
  16226. }(), td = [101, 101], ed = function (t) {
  16227. function e(e) {
  16228. var r = this, n = e || {};
  16229. return (r = t.call(this, {
  16230. attributions: n.attributions,
  16231. imageSmoothing: n.imageSmoothing,
  16232. projection: n.projection,
  16233. resolutions: n.resolutions
  16234. }) || this).crossOrigin_ = void 0 !== n.crossOrigin ? n.crossOrigin : null, r.url_ = n.url, r.imageLoadFunction_ = void 0 !== n.imageLoadFunction ? n.imageLoadFunction : Gf, r.params_ = n.params || {}, r.v13_ = !0, r.updateV13_(), r.serverType_ = n.serverType, r.hidpi_ = void 0 === n.hidpi || n.hidpi, r.image_ = null, r.imageSize_ = [0, 0], r.renderedRevision_ = 0, r.ratio_ = void 0 !== n.ratio ? n.ratio : 1.5, r
  16235. }
  16236. return Qf(e, t), e.prototype.getFeatureInfoUrl = function (t, e, r, n) {
  16237. if (void 0 !== this.url_) {
  16238. var i = Gr(r), o = this.getProjection();
  16239. o && o !== i && (e = tc(o, i, t, e), t = Hr(t, i, o));
  16240. var a = Se(t, e, 0, td), s = {
  16241. SERVICE: "WMS",
  16242. VERSION: "1.3.0",
  16243. REQUEST: "GetFeatureInfo",
  16244. FORMAT: "image/png",
  16245. TRANSPARENT: !0,
  16246. QUERY_LAYERS: this.params_.LAYERS
  16247. };
  16248. O(s, this.params_, n);
  16249. var l = Math.floor((t[0] - a[0]) / e), u = Math.floor((a[3] - t[1]) / e);
  16250. return s[this.v13_ ? "I" : "X"] = l, s[this.v13_ ? "J" : "Y"] = u, this.getRequestUrl_(a, td, 1, o || i, s)
  16251. }
  16252. }, e.prototype.getLegendUrl = function (t, e) {
  16253. if (void 0 !== this.url_) {
  16254. var r = {SERVICE: "WMS", VERSION: "1.3.0", REQUEST: "GetLegendGraphic", FORMAT: "image/png"};
  16255. if (void 0 === e || void 0 === e.LAYER) {
  16256. var n = this.params_.LAYERS;
  16257. if (!(!Array.isArray(n) || 1 === n.length)) return;
  16258. r.LAYER = n
  16259. }
  16260. if (void 0 !== t) {
  16261. var i = this.getProjection() ? this.getProjection().getMetersPerUnit() : 1;
  16262. r.SCALE = t * i / 28e-5
  16263. }
  16264. return O(r, e), mc(this.url_, r)
  16265. }
  16266. }, e.prototype.getParams = function () {
  16267. return this.params_
  16268. }, e.prototype.getImageInternal = function (t, e, r, n) {
  16269. if (void 0 === this.url_) return null;
  16270. e = this.findNearestResolution(e), 1 == r || this.hidpi_ && void 0 !== this.serverType_ || (r = 1);
  16271. var i = e / r, o = xe(t), a = Se(o, i, 0, [Math.ceil(Pe(t) / i), Math.ceil(Ee(t) / i)]),
  16272. s = Se(o, i, 0, [Math.ceil(this.ratio_ * Pe(t) / i), Math.ceil(this.ratio_ * Ee(t) / i)]), l = this.image_;
  16273. if (l && this.renderedRevision_ == this.getRevision() && l.getResolution() == e && l.getPixelRatio() == r && te(l.getExtent(), a)) return l;
  16274. var u = {SERVICE: "WMS", VERSION: "1.3.0", REQUEST: "GetMap", FORMAT: "image/png", TRANSPARENT: !0};
  16275. O(u, this.params_), this.imageSize_[0] = Math.round(Pe(s) / i), this.imageSize_[1] = Math.round(Ee(s) / i);
  16276. var c = this.getRequestUrl_(s, this.imageSize_, r, n, u);
  16277. return this.image_ = new Ki(s, e, r, c, this.crossOrigin_, this.imageLoadFunction_), this.renderedRevision_ = this.getRevision(), this.image_.addEventListener(F, this.handleImageChange.bind(this)), this.image_
  16278. }, e.prototype.getImageLoadFunction = function () {
  16279. return this.imageLoadFunction_
  16280. }, e.prototype.getRequestUrl_ = function (t, e, r, n, i) {
  16281. if (pt(void 0 !== this.url_, 9), i[this.v13_ ? "CRS" : "SRS"] = n.getCode(), "STYLES" in this.params_ || (i.STYLES = ""), 1 != r) switch (this.serverType_) {
  16282. case Hf:
  16283. var o = 90 * r + .5 | 0;
  16284. "FORMAT_OPTIONS" in i ? i.FORMAT_OPTIONS += ";dpi:" + o : i.FORMAT_OPTIONS = "dpi:" + o;
  16285. break;
  16286. case $f:
  16287. i.MAP_RESOLUTION = 90 * r;
  16288. break;
  16289. case Kf:
  16290. case Jf:
  16291. i.DPI = 90 * r;
  16292. break;
  16293. default:
  16294. pt(!1, 8)
  16295. }
  16296. i.WIDTH = e[0], i.HEIGHT = e[1];
  16297. var a, s = n.getAxisOrientation();
  16298. return a = this.v13_ && "ne" == s.substr(0, 2) ? [t[1], t[0], t[3], t[2]] : t, i.BBOX = a.join(","), mc(this.url_, i)
  16299. }, e.prototype.getUrl = function () {
  16300. return this.url_
  16301. }, e.prototype.setImageLoadFunction = function (t) {
  16302. this.image_ = null, this.imageLoadFunction_ = t, this.changed()
  16303. }, e.prototype.setUrl = function (t) {
  16304. t != this.url_ && (this.url_ = t, this.image_ = null, this.changed())
  16305. }, e.prototype.updateParams = function (t) {
  16306. O(this.params_, t), this.updateV13_(), this.image_ = null, this.changed()
  16307. }, e.prototype.updateV13_ = function () {
  16308. var t = this.params_.VERSION || "1.3.0";
  16309. this.v13_ = br(t, "1.3") >= 0
  16310. }, e
  16311. }(zf), rd = function () {
  16312. var t = function (e, r) {
  16313. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16314. t.__proto__ = e
  16315. } || function (t, e) {
  16316. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16317. })(e, r)
  16318. };
  16319. return function (e, r) {
  16320. function n() {
  16321. this.constructor = e
  16322. }
  16323. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16324. }
  16325. }(),
  16326. nd = '&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',
  16327. id = function (t) {
  16328. function e(e) {
  16329. var r, n = e || {};
  16330. r = void 0 !== n.attributions ? n.attributions : [nd];
  16331. var i = void 0 !== n.crossOrigin ? n.crossOrigin : "anonymous",
  16332. o = void 0 !== n.url ? n.url : "https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";
  16333. return t.call(this, {
  16334. attributions: r,
  16335. attributionsCollapsible: !1,
  16336. cacheSize: n.cacheSize,
  16337. crossOrigin: i,
  16338. imageSmoothing: n.imageSmoothing,
  16339. maxZoom: void 0 !== n.maxZoom ? n.maxZoom : 19,
  16340. opaque: void 0 === n.opaque || n.opaque,
  16341. reprojectionErrorThreshold: n.reprojectionErrorThreshold,
  16342. tileLoadFunction: n.tileLoadFunction,
  16343. transition: n.transition,
  16344. url: o,
  16345. wrapX: n.wrapX
  16346. }) || this
  16347. }
  16348. return rd(e, t), e
  16349. }(Jp), od = function () {
  16350. var t = function (e, r) {
  16351. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16352. t.__proto__ = e
  16353. } || function (t, e) {
  16354. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16355. })(e, r)
  16356. };
  16357. return function (e, r) {
  16358. function n() {
  16359. this.constructor = e
  16360. }
  16361. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16362. }
  16363. }(), ad = function (t) {
  16364. function e(e) {
  16365. var r = e || {};
  16366. return t.call(this, r) || this
  16367. }
  16368. return od(e, t), e
  16369. }(na), sd = function () {
  16370. var t = function (e, r) {
  16371. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16372. t.__proto__ = e
  16373. } || function (t, e) {
  16374. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16375. })(e, r)
  16376. };
  16377. return function (e, r) {
  16378. function n() {
  16379. this.constructor = e
  16380. }
  16381. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16382. }
  16383. }(), ld = function (t) {
  16384. function e(e) {
  16385. var r = t.call(this) || this;
  16386. return r.boundHandleImageChange_ = r.handleImageChange_.bind(r), r.layer_ = e, r.declutterExecutorGroup = null, r
  16387. }
  16388. return sd(e, t), e.prototype.getFeatures = function (t) {
  16389. return n()
  16390. }, e.prototype.prepareFrame = function (t) {
  16391. return n()
  16392. }, e.prototype.renderFrame = function (t, e) {
  16393. return n()
  16394. }, e.prototype.loadedTileCallback = function (t, e, r) {
  16395. t[e] || (t[e] = {}), t[e][r.tileCoord.toString()] = r
  16396. }, e.prototype.createLoadedTileFinder = function (t, e, r) {
  16397. return function (n, i) {
  16398. var o = this.loadedTileCallback.bind(this, r, n);
  16399. return t.forEachLoadedTile(e, n, i, o)
  16400. }.bind(this)
  16401. }, e.prototype.forEachFeatureAtCoordinate = function (t, e, r, n, i) {
  16402. }, e.prototype.getDataAtPixel = function (t, e, r) {
  16403. return n()
  16404. }, e.prototype.getLayer = function () {
  16405. return this.layer_
  16406. }, e.prototype.handleFontsChanged = function () {
  16407. }, e.prototype.handleImageChange_ = function (t) {
  16408. t.target.getState() === ki && this.renderIfReadyAndVisible()
  16409. }, e.prototype.loadImage = function (t) {
  16410. var e = t.getState();
  16411. return e != ki && e != ji && t.addEventListener(F, this.boundHandleImageChange_), e == Fi && (t.load(), e = t.getState()), e == ki
  16412. }, e.prototype.renderIfReadyAndVisible = function () {
  16413. var t = this.getLayer();
  16414. t.getVisible() && t.getSourceState() == Qo && t.changed()
  16415. }, e
  16416. }(Q), ud = function () {
  16417. var t = function (e, r) {
  16418. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16419. t.__proto__ = e
  16420. } || function (t, e) {
  16421. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16422. })(e, r)
  16423. };
  16424. return function (e, r) {
  16425. function n() {
  16426. this.constructor = e
  16427. }
  16428. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16429. }
  16430. }(), cd = function (t) {
  16431. function e(e) {
  16432. var r = t.call(this, e) || this;
  16433. return r.container = null, r.renderedResolution, r.tempTransform = [1, 0, 0, 1, 0, 0], r.pixelTransform = [1, 0, 0, 1, 0, 0], r.inversePixelTransform = [1, 0, 0, 1, 0, 0], r.context = null, r.containerReused = !1, r
  16434. }
  16435. return ud(e, t), e.prototype.useContainer = function (t, e, r) {
  16436. var n, i, o = this.getLayer().getClassName();
  16437. t && "" === t.style.opacity && t.className === o && ((s = t.firstElementChild) instanceof HTMLCanvasElement && (i = s.getContext("2d")));
  16438. if (!i || 0 !== i.canvas.width && i.canvas.style.transform !== e ? this.containerReused && (this.container = null, this.context = null, this.containerReused = !1) : (this.container = t, this.context = i, this.containerReused = !0), !this.container) {
  16439. (n = document.createElement("div")).className = o;
  16440. var a = n.style;
  16441. a.position = "absolute", a.width = "100%", a.height = "100%";
  16442. var s = (i = uo()).canvas;
  16443. n.appendChild(s), (a = s.style).position = "absolute", a.left = "0", a.transformOrigin = "top left", this.container = n, this.context = i
  16444. }
  16445. }, e.prototype.clip = function (t, e, r) {
  16446. var n = e.pixelRatio, i = e.size[0] * n / 2, o = e.size[1] * n / 2, a = e.viewState.rotation, s = Ce(r),
  16447. l = Oe(r), u = be(r), c = _e(r);
  16448. It(e.coordinateToPixelTransform, s), It(e.coordinateToPixelTransform, l), It(e.coordinateToPixelTransform, u), It(e.coordinateToPixelTransform, c), t.save(), Ca(t, -a, i, o), t.beginPath(), t.moveTo(s[0] * n, s[1] * n), t.lineTo(l[0] * n, l[1] * n), t.lineTo(u[0] * n, u[1] * n), t.lineTo(c[0] * n, c[1] * n), t.clip(), Ca(t, a, i, o)
  16449. }, e.prototype.clipUnrotated = function (t, e, r) {
  16450. var n = Ce(r), i = Oe(r), o = be(r), a = _e(r);
  16451. It(e.coordinateToPixelTransform, n), It(e.coordinateToPixelTransform, i), It(e.coordinateToPixelTransform, o), It(e.coordinateToPixelTransform, a);
  16452. var s = this.inversePixelTransform;
  16453. It(s, n), It(s, i), It(s, o), It(s, a), t.save(), t.beginPath(), t.moveTo(Math.round(n[0]), Math.round(n[1])), t.lineTo(Math.round(i[0]), Math.round(i[1])), t.lineTo(Math.round(o[0]), Math.round(o[1])), t.lineTo(Math.round(a[0]), Math.round(a[1])), t.clip()
  16454. }, e.prototype.dispatchRenderEvent_ = function (t, e, r) {
  16455. var n = this.getLayer();
  16456. if (n.hasListener(t)) {
  16457. var i = new la(t, this.inversePixelTransform, r, e);
  16458. n.dispatchEvent(i)
  16459. }
  16460. }, e.prototype.preRender = function (t, e) {
  16461. this.dispatchRenderEvent_(qo, t, e)
  16462. }, e.prototype.postRender = function (t, e) {
  16463. this.dispatchRenderEvent_(Xo, t, e)
  16464. }, e.prototype.getRenderTransform = function (t, e, r, n, i, o, a) {
  16465. var s = i / 2, l = o / 2, u = n / e, c = -u, h = -t[0] + a, p = -t[1];
  16466. return kt(this.tempTransform, s, l, u, c, -r, h, p)
  16467. }, e.prototype.getDataAtPixel = function (t, e, r) {
  16468. var n, i = It(this.inversePixelTransform, t.slice()), o = this.context, a = this.getLayer().getExtent();
  16469. if (a && !Qt(a, It(e.pixelToCoordinateTransform, t.slice()))) return null;
  16470. try {
  16471. var s = Math.round(i[0]), l = Math.round(i[1]), u = document.createElement("canvas"), c = u.getContext("2d");
  16472. u.width = 1, u.height = 1, c.clearRect(0, 0, 1, 1), c.drawImage(o.canvas, s, l, 1, 1, 0, 0, 1, 1), n = c.getImageData(0, 0, 1, 1).data
  16473. } catch (t) {
  16474. return "SecurityError" === t.name ? new Uint8Array : n
  16475. }
  16476. return 0 === n[3] ? null : n
  16477. }, e
  16478. }(ld), hd = function () {
  16479. var t = function (e, r) {
  16480. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16481. t.__proto__ = e
  16482. } || function (t, e) {
  16483. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16484. })(e, r)
  16485. };
  16486. return function (e, r) {
  16487. function n() {
  16488. this.constructor = e
  16489. }
  16490. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16491. }
  16492. }(), pd = function (t) {
  16493. function e(e) {
  16494. var r = t.call(this, e) || this;
  16495. return r.image_ = null, r
  16496. }
  16497. return hd(e, t), e.prototype.getImage = function () {
  16498. return this.image_ ? this.image_.getImage() : null
  16499. }, e.prototype.prepareFrame = function (t) {
  16500. var e = t.layerStatesArray[t.layerIndex], r = t.pixelRatio, n = t.viewState, i = n.resolution,
  16501. o = this.getLayer().getSource(), a = t.viewHints, s = t.extent;
  16502. if (void 0 !== e.extent && (s = Te(s, on(e.extent, n.projection))), !a[ns] && !a[is] && !Ie(s)) if (o) {
  16503. var l = n.projection, u = o.getImage(s, i, r, l);
  16504. u && this.loadImage(u) && (this.image_ = u)
  16505. } else this.image_ = null;
  16506. return !!this.image_
  16507. }, e.prototype.renderFrame = function (t, e) {
  16508. var r = this.image_, n = r.getExtent(), i = r.getResolution(), o = r.getPixelRatio(),
  16509. a = t.layerStatesArray[t.layerIndex], s = t.pixelRatio, l = t.viewState, u = l.center, c = l.resolution,
  16510. h = t.size, p = s * i / (c * o), f = Math.round(h[0] * s), d = Math.round(h[1] * s), g = l.rotation;
  16511. if (g) {
  16512. var y = Math.round(Math.sqrt(f * f + d * d));
  16513. f = y, d = y
  16514. }
  16515. kt(this.pixelTransform, t.size[0] / 2, t.size[1] / 2, 1 / s, 1 / s, g, -f / 2, -d / 2), jt(this.inversePixelTransform, this.pixelTransform);
  16516. var m = Ra(this.pixelTransform);
  16517. this.useContainer(e, m, a.opacity);
  16518. var v = this.context, _ = v.canvas;
  16519. _.width != f || _.height != d ? (_.width = f, _.height = d) : this.containerReused || v.clearRect(0, 0, f, d);
  16520. var b = !1;
  16521. if (a.extent) {
  16522. var x = on(a.extent, l.projection);
  16523. (b = !te(x, t.extent) && Re(x, t.extent)) && this.clipUnrotated(v, t, x)
  16524. }
  16525. var w = r.getImage(),
  16526. S = kt(this.tempTransform, f / 2, d / 2, p, p, 0, o * (n[0] - u[0]) / i, o * (u[1] - n[3]) / i);
  16527. this.renderedResolution = i * s / o;
  16528. var E = S[4], T = S[5], C = w.width * S[0], P = w.height * S[3];
  16529. if (O(v, this.getLayer().getSource().getContextOptions()), this.preRender(v, t), C >= .5 && P >= .5) {
  16530. var R = a.opacity, I = void 0;
  16531. 1 !== R && (I = this.context.globalAlpha, this.context.globalAlpha = R), this.context.drawImage(w, 0, 0, +w.width, +w.height, Math.round(E), Math.round(T), Math.round(C), Math.round(P)), 1 !== R && (this.context.globalAlpha = I)
  16532. }
  16533. return this.postRender(v, t), b && v.restore(), m !== _.style.transform && (_.style.transform = m), this.container
  16534. }, e
  16535. }(cd), fd = function () {
  16536. var t = function (e, r) {
  16537. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16538. t.__proto__ = e
  16539. } || function (t, e) {
  16540. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16541. })(e, r)
  16542. };
  16543. return function (e, r) {
  16544. function n() {
  16545. this.constructor = e
  16546. }
  16547. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16548. }
  16549. }(), dd = function (t) {
  16550. function e(e) {
  16551. return t.call(this, e) || this
  16552. }
  16553. return fd(e, t), e.prototype.createRenderer = function () {
  16554. return new pd(this)
  16555. }, e
  16556. }(ad), gd = "preload", yd = "useInterimTilesOnError", md = function () {
  16557. var t = function (e, r) {
  16558. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16559. t.__proto__ = e
  16560. } || function (t, e) {
  16561. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16562. })(e, r)
  16563. };
  16564. return function (e, r) {
  16565. function n() {
  16566. this.constructor = e
  16567. }
  16568. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16569. }
  16570. }(), vd = function (t) {
  16571. function e(e) {
  16572. var r = this, n = e || {}, i = O({}, n);
  16573. return delete i.preload, delete i.useInterimTilesOnError, (r = t.call(this, i) || this).setPreload(void 0 !== n.preload ? n.preload : 0), r.setUseInterimTilesOnError(void 0 === n.useInterimTilesOnError || n.useInterimTilesOnError), r
  16574. }
  16575. return md(e, t), e.prototype.getPreload = function () {
  16576. return this.get(gd)
  16577. }, e.prototype.setPreload = function (t) {
  16578. this.set(gd, t)
  16579. }, e.prototype.getUseInterimTilesOnError = function () {
  16580. return this.get(yd)
  16581. }, e.prototype.setUseInterimTilesOnError = function (t) {
  16582. this.set(yd, t)
  16583. }, e
  16584. }(na), _d = function () {
  16585. var t = function (e, r) {
  16586. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16587. t.__proto__ = e
  16588. } || function (t, e) {
  16589. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16590. })(e, r)
  16591. };
  16592. return function (e, r) {
  16593. function n() {
  16594. this.constructor = e
  16595. }
  16596. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16597. }
  16598. }(), bd = function (t) {
  16599. function e(e) {
  16600. var r = t.call(this, e) || this;
  16601. return r.extentChanged = !0, r.renderedExtent_ = null, r.renderedPixelRatio, r.renderedProjection = null, r.renderedRevision, r.renderedTiles = [], r.newTiles_ = !1, r.tmpExtent = [1 / 0, 1 / 0, -1 / 0, -1 / 0], r.tmpTileRange_ = new _u(0, 0, 0, 0), r
  16602. }
  16603. return _d(e, t), e.prototype.isDrawableTile = function (t) {
  16604. var e = this.getLayer(), r = t.getState(), n = e.getUseInterimTilesOnError();
  16605. return r == to || r == ro || r == eo && !n
  16606. }, e.prototype.getTile = function (t, e, r, n) {
  16607. var i = n.pixelRatio, o = n.viewState.projection, a = this.getLayer(), s = a.getSource().getTile(t, e, r, i, o);
  16608. return s.getState() == eo && (a.getUseInterimTilesOnError() ? a.getPreload() > 0 && (this.newTiles_ = !0) : s.setState(to)), this.isDrawableTile(s) || (s = s.getInterimTile()), s
  16609. }, e.prototype.loadedTileCallback = function (e, r, n) {
  16610. return !!this.isDrawableTile(n) && t.prototype.loadedTileCallback.call(this, e, r, n)
  16611. }, e.prototype.prepareFrame = function (t) {
  16612. return !!this.getLayer().getSource()
  16613. }, e.prototype.renderFrame = function (t, e) {
  16614. var r = t.layerStatesArray[t.layerIndex], n = t.viewState, i = n.projection, a = n.resolution, s = n.center,
  16615. l = n.rotation, u = t.pixelRatio, c = this.getLayer(), h = c.getSource(), p = h.getRevision(),
  16616. f = h.getTileGridForProjection(i), g = f.getZForResolution(a, h.zDirection), y = f.getResolution(g),
  16617. m = t.extent, v = r.extent && on(r.extent, i);
  16618. v && (m = Te(m, on(r.extent, i)));
  16619. var _ = h.getTilePixelRatio(u), b = Math.round(t.size[0] * _), x = Math.round(t.size[1] * _);
  16620. if (l) {
  16621. var w = Math.round(Math.sqrt(b * b + x * x));
  16622. b = w, x = w
  16623. }
  16624. var S = y * b / 2 / _, E = y * x / 2 / _, T = [s[0] - S, s[1] - E, s[0] + S, s[1] + E],
  16625. C = f.getTileRangeForExtentAndZ(m, g), P = {};
  16626. P[g] = {};
  16627. var R = this.createLoadedTileFinder(h, i, P), I = this.tmpExtent, L = this.tmpTileRange_;
  16628. this.newTiles_ = !1;
  16629. for (var M = C.minX; M <= C.maxX; ++M) for (var F = C.minY; F <= C.maxY; ++F) {
  16630. var A = this.getTile(g, M, F, t);
  16631. if (this.isDrawableTile(A)) {
  16632. var k = o(this);
  16633. if (A.getState() == to) {
  16634. P[g][A.tileCoord.toString()] = A;
  16635. var j = A.inTransition(k);
  16636. this.newTiles_ || !j && -1 !== this.renderedTiles.indexOf(A) || (this.newTiles_ = !0)
  16637. }
  16638. if (1 === A.getAlpha(k, t.time)) continue
  16639. }
  16640. var N = f.getTileCoordChildTileRange(A.tileCoord, L, I), D = !1;
  16641. N && (D = R(g + 1, N)), D || f.forEachTileCoordParentTileRange(A.tileCoord, R, L, I)
  16642. }
  16643. var G = y / a;
  16644. kt(this.pixelTransform, t.size[0] / 2, t.size[1] / 2, 1 / _, 1 / _, l, -b / 2, -x / 2);
  16645. var z = Ra(this.pixelTransform);
  16646. this.useContainer(e, z, r.opacity);
  16647. var U = this.context, B = U.canvas;
  16648. jt(this.inversePixelTransform, this.pixelTransform), kt(this.tempTransform, b / 2, x / 2, G, G, 0, -b / 2, -x / 2), B.width != b || B.height != x ? (B.width = b, B.height = x) : this.containerReused || U.clearRect(0, 0, b, x), v && this.clipUnrotated(U, t, v), O(U, h.getContextOptions()), this.preRender(U, t), this.renderedTiles.length = 0;
  16649. var V, Y, W, q = Object.keys(P).map(Number);
  16650. q.sort(d), 1 !== r.opacity || this.containerReused && !h.getOpaque(t.viewState.projection) ? (V = [], Y = []) : q = q.reverse();
  16651. for (var X = q.length - 1; X >= 0; --X) {
  16652. var Z = q[X], K = h.getTilePixelSize(Z, u, i), H = f.getResolution(Z) / y, $ = K[0] * H * G, J = K[1] * H * G,
  16653. Q = f.getTileCoordForCoordAndZ(Ce(T), Z), tt = f.getTileCoordExtent(Q),
  16654. et = It(this.tempTransform, [_ * (tt[0] - T[0]) / y, _ * (T[3] - tt[3]) / y]),
  16655. rt = _ * h.getGutterForProjection(i), nt = P[Z];
  16656. for (var it in nt) {
  16657. var ot = (A = nt[it]).tileCoord, at = et[0] - (Q[1] - ot[1]) * $, st = Math.round(at + $),
  16658. lt = et[1] - (Q[2] - ot[2]) * J, ut = Math.round(lt + J), ct = st - (M = Math.round(at)),
  16659. ht = ut - (F = Math.round(lt)), pt = g === Z;
  16660. if (!(j = pt && 1 !== A.getAlpha(o(this), t.time))) if (V) {
  16661. U.save(), W = [M, F, M + ct, F, M + ct, F + ht, M, F + ht];
  16662. for (var ft = 0, dt = V.length; ft < dt; ++ft) if (g !== Z && Z < Y[ft]) {
  16663. var gt = V[ft];
  16664. U.beginPath(), U.moveTo(W[0], W[1]), U.lineTo(W[2], W[3]), U.lineTo(W[4], W[5]), U.lineTo(W[6], W[7]), U.moveTo(gt[6], gt[7]), U.lineTo(gt[4], gt[5]), U.lineTo(gt[2], gt[3]), U.lineTo(gt[0], gt[1]), U.clip()
  16665. }
  16666. V.push(W), Y.push(Z)
  16667. } else U.clearRect(M, F, ct, ht);
  16668. this.drawTileImage(A, t, M, F, ct, ht, rt, pt, r.opacity), V && !j && U.restore(), this.renderedTiles.push(A), this.updateUsedTiles(t.usedTiles, h, A)
  16669. }
  16670. }
  16671. return this.renderedRevision = p, this.renderedResolution = y, this.extentChanged = !this.renderedExtent_ || !ue(this.renderedExtent_, T), this.renderedExtent_ = T, this.renderedPixelRatio = u, this.renderedProjection = i, this.manageTilePyramid(t, h, f, u, i, m, g, c.getPreload()), this.scheduleExpireCache(t, h), this.postRender(U, t), r.extent && U.restore(), z !== B.style.transform && (B.style.transform = z), this.container
  16672. }, e.prototype.drawTileImage = function (t, e, r, n, i, a, s, l, u) {
  16673. var c = this.getTileImage(t);
  16674. if (c) {
  16675. var h = o(this), p = l ? t.getAlpha(h, e.time) : 1, f = u * p, d = f !== this.context.globalAlpha;
  16676. d && (this.context.save(), this.context.globalAlpha = f), this.context.drawImage(c, s, s, c.width - 2 * s, c.height - 2 * s, r, n, i, a), d && this.context.restore(), 1 !== p ? e.animate = !0 : l && t.endTransition(h)
  16677. }
  16678. }, e.prototype.getImage = function () {
  16679. var t = this.context;
  16680. return t ? t.canvas : null
  16681. }, e.prototype.getTileImage = function (t) {
  16682. return t.getImage()
  16683. }, e.prototype.scheduleExpireCache = function (t, e) {
  16684. if (e.canExpireCache()) {
  16685. var r = function (t, e, r) {
  16686. var n = o(t);
  16687. n in r.usedTiles && t.expireCache(r.viewState.projection, r.usedTiles[n])
  16688. }.bind(null, e);
  16689. t.postRenderFunctions.push(r)
  16690. }
  16691. }, e.prototype.updateUsedTiles = function (t, e, r) {
  16692. var n = o(e);
  16693. n in t || (t[n] = {}), t[n][r.getKey()] = !0
  16694. }, e.prototype.manageTilePyramid = function (t, e, r, n, i, a, s, l, u) {
  16695. var c = o(e);
  16696. c in t.wantedTiles || (t.wantedTiles[c] = {});
  16697. var h, p, f, d, g, y, m = t.wantedTiles[c], v = t.tileQueue, _ = 0;
  16698. for (y = r.getMinZoom(); y <= s; ++y) for (p = r.getTileRangeForExtentAndZ(a, y, p), f = r.getResolution(y), d = p.minX; d <= p.maxX; ++d) for (g = p.minY; g <= p.maxY; ++g) s - y <= l ? (++_, (h = e.getTile(y, d, g, n, i)).getState() == Ji && (m[h.getKey()] = !0, v.isKeyQueued(h.getKey()) || v.enqueue([h, c, r.getTileCoordCenter(h.tileCoord), f])), void 0 !== u && u(h)) : e.useTile(y, d, g, i);
  16699. e.updateCacheSize(_, i)
  16700. }, e
  16701. }(cd);
  16702. bd.prototype.getLayer;
  16703. var xd = bd, wd = function () {
  16704. var t = function (e, r) {
  16705. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16706. t.__proto__ = e
  16707. } || function (t, e) {
  16708. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16709. })(e, r)
  16710. };
  16711. return function (e, r) {
  16712. function n() {
  16713. this.constructor = e
  16714. }
  16715. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16716. }
  16717. }(), Sd = function (t) {
  16718. function e(e) {
  16719. return t.call(this, e) || this
  16720. }
  16721. return wd(e, t), e.prototype.createRenderer = function () {
  16722. return new xd(this)
  16723. }, e
  16724. }(vd), Ed = function () {
  16725. var t = function (e, r) {
  16726. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16727. t.__proto__ = e
  16728. } || function (t, e) {
  16729. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16730. })(e, r)
  16731. };
  16732. return function (e, r) {
  16733. function n() {
  16734. this.constructor = e
  16735. }
  16736. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16737. }
  16738. }(), Td = !0;
  16739. try {
  16740. new ImageData(10, 10)
  16741. } catch (t) {
  16742. Td = !1
  16743. }
  16744. var Cd = document.createElement("canvas").getContext("2d");
  16745. function Od(t, e, r) {
  16746. if (Td) return new ImageData(t, e, r);
  16747. var n = Cd.createImageData(e, r);
  16748. return n.data.set(t), n
  16749. }
  16750. function Pd(t) {
  16751. var e = !0;
  16752. try {
  16753. new ImageData(10, 10)
  16754. } catch (t) {
  16755. e = !1
  16756. }
  16757. function r(t, r, n) {
  16758. return e ? new ImageData(t, r, n) : {data: t, width: r, height: n}
  16759. }
  16760. return function (e) {
  16761. var n, i, o = e.buffers, a = e.meta, s = e.imageOps, l = e.width, u = e.height, c = o.length,
  16762. h = o[0].byteLength;
  16763. if (s) {
  16764. var p = new Array(c);
  16765. for (i = 0; i < c; ++i) p[i] = r(new Uint8ClampedArray(o[i]), l, u);
  16766. n = t(p, a).data
  16767. } else {
  16768. n = new Uint8ClampedArray(h);
  16769. var f = new Array(c), d = new Array(c);
  16770. for (i = 0; i < c; ++i) f[i] = new Uint8ClampedArray(o[i]), d[i] = [0, 0, 0, 0];
  16771. for (var g = 0; g < h; g += 4) {
  16772. for (var y = 0; y < c; ++y) {
  16773. var m = f[y];
  16774. d[y][0] = m[g], d[y][1] = m[g + 1], d[y][2] = m[g + 2], d[y][3] = m[g + 3]
  16775. }
  16776. var v = t(d, a);
  16777. n[g] = v[0], n[g + 1] = v[1], n[g + 2] = v[2], n[g + 3] = v[3]
  16778. }
  16779. }
  16780. return n.buffer
  16781. }
  16782. }
  16783. function Rd(t, e) {
  16784. var r = Object.keys(t.lib || {}).map((function (e) {
  16785. return "var " + e + " = " + t.lib[e].toString() + ";"
  16786. })).concat(["var __minion__ = (" + Pd.toString() + ")(", t.operation.toString(), ");", 'self.addEventListener("message", function(event) {', " var buffer = __minion__(event.data);", " self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);", "});"]),
  16787. n = new Blob(r, {type: "text/javascript"}), i = URL.createObjectURL(n), o = new Worker(i);
  16788. return o.addEventListener("message", e), o
  16789. }
  16790. var Id = function (t) {
  16791. function e(e) {
  16792. var r, n = t.call(this) || this;
  16793. n._imageOps = !!e.imageOps;
  16794. var i = [];
  16795. if (r = 0 === e.threads ? 0 : n._imageOps ? 1 : e.threads || 1) for (var o = 0; o < r; ++o) i[o] = Rd(e, n._onWorkerMessage.bind(n, o)); else i[0] = function (t, e) {
  16796. var r = Pd(t.operation), n = !1;
  16797. return {
  16798. postMessage: function (t) {
  16799. setTimeout((function () {
  16800. n || e({data: {buffer: r(t), meta: t.meta}})
  16801. }), 0)
  16802. }, terminate: function () {
  16803. n = !0
  16804. }
  16805. }
  16806. }(e, n._onWorkerMessage.bind(n, 0));
  16807. return n._workers = i, n._queue = [], n._maxQueueLength = e.queue || 1 / 0, n._running = 0, n._dataLookup = {}, n._job = null, n
  16808. }
  16809. return Ed(e, t), e.prototype.process = function (t, e, r) {
  16810. this._enqueue({inputs: t, meta: e, callback: r}), this._dispatch()
  16811. }, e.prototype._enqueue = function (t) {
  16812. for (this._queue.push(t); this._queue.length > this._maxQueueLength;) this._queue.shift().callback(null, null)
  16813. }, e.prototype._dispatch = function () {
  16814. if (0 === this._running && this._queue.length > 0) {
  16815. var t = this._queue.shift();
  16816. this._job = t;
  16817. var e = t.inputs[0].width, r = t.inputs[0].height, n = t.inputs.map((function (t) {
  16818. return t.data.buffer
  16819. })), i = this._workers.length;
  16820. if (this._running = i, 1 === i) this._workers[0].postMessage({
  16821. buffers: n,
  16822. meta: t.meta,
  16823. imageOps: this._imageOps,
  16824. width: e,
  16825. height: r
  16826. }, n); else for (var o = t.inputs[0].data.length, a = 4 * Math.ceil(o / 4 / i), s = 0; s < i; ++s) {
  16827. for (var l = s * a, u = [], c = 0, h = n.length; c < h; ++c) u.push(n[c].slice(l, l + a));
  16828. this._workers[s].postMessage({buffers: u, meta: t.meta, imageOps: this._imageOps, width: e, height: r}, u)
  16829. }
  16830. }
  16831. }, e.prototype._onWorkerMessage = function (t, e) {
  16832. this.disposed || (this._dataLookup[t] = e.data, --this._running, 0 === this._running && this._resolveJob())
  16833. }, e.prototype._resolveJob = function () {
  16834. var t, e, r = this._job, n = this._workers.length;
  16835. if (1 === n) t = new Uint8ClampedArray(this._dataLookup[0].buffer), e = this._dataLookup[0].meta; else {
  16836. var i = r.inputs[0].data.length;
  16837. t = new Uint8ClampedArray(i), e = new Array(i);
  16838. for (var o = 4 * Math.ceil(i / 4 / n), a = 0; a < n; ++a) {
  16839. var s = this._dataLookup[a].buffer, l = a * o;
  16840. t.set(new Uint8ClampedArray(s), l), e[a] = this._dataLookup[a].meta
  16841. }
  16842. }
  16843. this._job = null, this._dataLookup = {}, r.callback(null, Od(t, r.inputs[0].width, r.inputs[0].height), e), this._dispatch()
  16844. }, e.prototype.disposeInternal = function () {
  16845. for (var t = 0; t < this._workers.length; ++t) this._workers[t].terminate();
  16846. this._workers.length = 0
  16847. }, e
  16848. }(p), Ld = "beforeoperations", Md = "afteroperations", Fd = "pixel", Ad = "image", kd = function (t) {
  16849. function e(e, r, n) {
  16850. var i = t.call(this, e) || this;
  16851. return i.extent = r.extent, i.resolution = r.viewState.resolution / r.pixelRatio, i.data = n, i
  16852. }
  16853. return Ed(e, t), e
  16854. }(c), jd = function (t) {
  16855. function e(e) {
  16856. var r = t.call(this, {projection: null}) || this;
  16857. r.processor_ = null, r.operationType_ = void 0 !== e.operationType ? e.operationType : Fd, r.threads_ = void 0 !== e.threads ? e.threads : 1, r.layers_ = function (t) {
  16858. for (var e = t.length, r = new Array(e), n = 0; n < e; ++n) r[n] = Gd(t[n]);
  16859. return r
  16860. }(e.sources);
  16861. for (var n, i = r.changed.bind(r), o = 0, a = r.layers_.length; o < a; ++o) r.layers_[o].addEventListener(F, i);
  16862. return r.tileQueue_ = new es((function () {
  16863. return 1
  16864. }), r.changed.bind(r)), r.requestedFrameState_, r.renderedImageCanvas_ = null, r.renderedRevision_, r.frameState_ = {
  16865. animate: !1,
  16866. coordinateToPixelTransform: [1, 0, 0, 1, 0, 0],
  16867. declutterTree: null,
  16868. extent: null,
  16869. index: 0,
  16870. layerIndex: 0,
  16871. layerStatesArray: (n = r.layers_, n.map((function (t) {
  16872. return t.getLayerState()
  16873. }))),
  16874. pixelRatio: 1,
  16875. pixelToCoordinateTransform: [1, 0, 0, 1, 0, 0],
  16876. postRenderFunctions: [],
  16877. size: [0, 0],
  16878. tileQueue: r.tileQueue_,
  16879. time: Date.now(),
  16880. usedTiles: {},
  16881. viewState: {rotation: 0},
  16882. viewHints: [],
  16883. wantedTiles: {}
  16884. }, r.setAttributions((function (t) {
  16885. for (var r = [], n = 0, i = e.sources.length; n < i; ++n) {
  16886. var o = e.sources[n], a = (o instanceof Dp ? o : o.getSource()).getAttributions();
  16887. if ("function" == typeof a) {
  16888. var s = a(t);
  16889. r.push.apply(r, s)
  16890. }
  16891. }
  16892. return 0 !== r.length ? r : null
  16893. })), void 0 !== e.operation && r.setOperation(e.operation, e.lib), r
  16894. }
  16895. return Ed(e, t), e.prototype.setOperation = function (t, e) {
  16896. this.processor_ && this.processor_.dispose(), this.processor_ = new Id({
  16897. operation: t,
  16898. imageOps: this.operationType_ === Ad,
  16899. queue: 1,
  16900. lib: e,
  16901. threads: this.threads_
  16902. }), this.changed()
  16903. }, e.prototype.updateFrameState_ = function (t, e, r) {
  16904. var n = O({}, this.frameState_);
  16905. n.viewState = O({}, n.viewState);
  16906. var i = xe(t);
  16907. n.extent = t.slice(), n.size[0] = Math.round(Pe(t) / e), n.size[1] = Math.round(Ee(t) / e), n.time = 1 / 0;
  16908. var o = n.viewState;
  16909. return o.center = i, o.projection = r, o.resolution = e, n
  16910. }, e.prototype.allSourcesReady_ = function () {
  16911. for (var t = !0, e = 0, r = this.layers_.length; e < r; ++e) if (this.layers_[e].getSource().getState() !== Qo) {
  16912. t = !1;
  16913. break
  16914. }
  16915. return t
  16916. }, e.prototype.getImage = function (t, e, r, n) {
  16917. if (!this.allSourcesReady_()) return null;
  16918. var i = this.updateFrameState_(t, e, n);
  16919. if (this.requestedFrameState_ = i, this.renderedImageCanvas_) {
  16920. var o = this.renderedImageCanvas_.getResolution(), a = this.renderedImageCanvas_.getExtent();
  16921. e === o && ue(t, a) || (this.renderedImageCanvas_ = null)
  16922. }
  16923. return this.renderedImageCanvas_ && this.getRevision() === this.renderedRevision_ || this.processSources_(), i.tileQueue.loadMoreTiles(16, 16), i.animate && requestAnimationFrame(this.changed.bind(this)), this.renderedImageCanvas_
  16924. }, e.prototype.processSources_ = function () {
  16925. for (var t = this.requestedFrameState_, e = this.layers_.length, r = new Array(e), n = 0; n < e; ++n) {
  16926. t.layerIndex = n;
  16927. var i = Dd(this.layers_[n], t);
  16928. if (!i) return;
  16929. r[n] = i
  16930. }
  16931. var o = {};
  16932. this.dispatchEvent(new kd(Ld, t, o)), this.processor_.process(r, o, this.onWorkerComplete_.bind(this, t))
  16933. }, e.prototype.onWorkerComplete_ = function (t, e, r, n) {
  16934. if (!e && r) {
  16935. var i = t.extent, o = t.viewState.resolution;
  16936. if (o === this.requestedFrameState_.viewState.resolution && ue(i, this.requestedFrameState_.extent)) {
  16937. var a;
  16938. if (this.renderedImageCanvas_) a = this.renderedImageCanvas_.getImage().getContext("2d"); else a = uo(Math.round(Pe(i) / o), Math.round(Ee(i) / o)), this.renderedImageCanvas_ = new $i(i, o, 1, a.canvas);
  16939. a.putImageData(r, 0, 0), this.changed(), this.renderedRevision_ = this.getRevision(), this.dispatchEvent(new kd(Md, t, n))
  16940. }
  16941. }
  16942. }, e.prototype.getImageInternal = function () {
  16943. return null
  16944. }, e.prototype.disposeInternal = function () {
  16945. this.processor_ && this.processor_.dispose(), t.prototype.disposeInternal.call(this)
  16946. }, e
  16947. }(zf);
  16948. jd.prototype.dispose;
  16949. var Nd = null;
  16950. function Dd(t, e) {
  16951. var r = t.getRenderer();
  16952. if (!r) throw new Error("Unsupported layer type: " + t);
  16953. if (!r.prepareFrame(e)) return null;
  16954. var n = e.size[0], i = e.size[1];
  16955. if (0 === n || 0 === i) return null;
  16956. var o, a = r.renderFrame(e, null);
  16957. if (a && (o = a.firstElementChild), !(o instanceof HTMLCanvasElement)) throw new Error("Unsupported rendered element: " + o);
  16958. if (o.width === n && o.height === i) return o.getContext("2d").getImageData(0, 0, n, i);
  16959. if (Nd) {
  16960. var s = Nd.canvas;
  16961. s.width !== n || s.height !== i ? Nd = uo(n, i) : Nd.clearRect(0, 0, n, i)
  16962. } else Nd = uo(n, i);
  16963. return Nd.drawImage(o, 0, 0, n, i), Nd.getImageData(0, 0, n, i)
  16964. }
  16965. function Gd(t) {
  16966. var e;
  16967. return t instanceof Dp ? t instanceof Bp ? e = new Sd({source: t}) : t instanceof zf && (e = new dd({source: t})) : e = t, e
  16968. }
  16969. var zd = jd, Ud = function () {
  16970. var t = function (e, r) {
  16971. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  16972. t.__proto__ = e
  16973. } || function (t, e) {
  16974. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  16975. })(e, r)
  16976. };
  16977. return function (e, r) {
  16978. function n() {
  16979. this.constructor = e
  16980. }
  16981. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  16982. }
  16983. }(),
  16984. Bd = ['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.', nd],
  16985. Vd = {
  16986. terrain: {extension: "jpg", opaque: !0},
  16987. "terrain-background": {extension: "jpg", opaque: !0},
  16988. "terrain-labels": {extension: "png", opaque: !1},
  16989. "terrain-lines": {extension: "png", opaque: !1},
  16990. "toner-background": {extension: "png", opaque: !0},
  16991. toner: {extension: "png", opaque: !0},
  16992. "toner-hybrid": {extension: "png", opaque: !1},
  16993. "toner-labels": {extension: "png", opaque: !1},
  16994. "toner-lines": {extension: "png", opaque: !1},
  16995. "toner-lite": {extension: "png", opaque: !0},
  16996. watercolor: {extension: "jpg", opaque: !0}
  16997. }, Yd = {
  16998. terrain: {minZoom: 0, maxZoom: 18},
  16999. toner: {minZoom: 0, maxZoom: 20},
  17000. watercolor: {minZoom: 0, maxZoom: 18}
  17001. }, Wd = function (t) {
  17002. function e(e) {
  17003. var r = e.layer.indexOf("-"), n = -1 == r ? e.layer : e.layer.slice(0, r), i = Yd[n], o = Vd[e.layer],
  17004. a = void 0 !== e.url ? e.url : "https://stamen-tiles-{a-d}.a.ssl.fastly.net/" + e.layer + "/{z}/{x}/{y}." + o.extension;
  17005. return t.call(this, {
  17006. attributions: Bd,
  17007. cacheSize: e.cacheSize,
  17008. crossOrigin: "anonymous",
  17009. imageSmoothing: e.imageSmoothing,
  17010. maxZoom: null != e.maxZoom ? e.maxZoom : i.maxZoom,
  17011. minZoom: null != e.minZoom ? e.minZoom : i.minZoom,
  17012. opaque: o.opaque,
  17013. reprojectionErrorThreshold: e.reprojectionErrorThreshold,
  17014. tileLoadFunction: e.tileLoadFunction,
  17015. transition: e.transition,
  17016. url: a,
  17017. wrapX: e.wrapX
  17018. }) || this
  17019. }
  17020. return Ud(e, t), e
  17021. }(Jp), qd = function () {
  17022. var t = function (e, r) {
  17023. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17024. t.__proto__ = e
  17025. } || function (t, e) {
  17026. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17027. })(e, r)
  17028. };
  17029. return function (e, r) {
  17030. function n() {
  17031. this.constructor = e
  17032. }
  17033. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17034. }
  17035. }(), Xd = function (t) {
  17036. function e(e) {
  17037. var r = this, n = e || {};
  17038. return (r = t.call(this, {
  17039. attributions: n.attributions,
  17040. cacheSize: n.cacheSize,
  17041. crossOrigin: n.crossOrigin,
  17042. imageSmoothing: n.imageSmoothing,
  17043. projection: n.projection,
  17044. reprojectionErrorThreshold: n.reprojectionErrorThreshold,
  17045. tileGrid: n.tileGrid,
  17046. tileLoadFunction: n.tileLoadFunction,
  17047. url: n.url,
  17048. urls: n.urls,
  17049. wrapX: void 0 === n.wrapX || n.wrapX,
  17050. transition: n.transition
  17051. }) || this).params_ = n.params || {}, r.hidpi_ = void 0 === n.hidpi || n.hidpi, r.tmpExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], r.setKey(r.getKeyForParams_()), r
  17052. }
  17053. return qd(e, t), e.prototype.getKeyForParams_ = function () {
  17054. var t = 0, e = [];
  17055. for (var r in this.params_) e[t++] = r + "-" + this.params_[r];
  17056. return e.join("/")
  17057. }, e.prototype.getParams = function () {
  17058. return this.params_
  17059. }, e.prototype.getRequestUrl_ = function (t, e, r, n, i, o) {
  17060. var a = this.urls;
  17061. if (a) {
  17062. var s, l = i.getCode().split(":").pop();
  17063. if (o.SIZE = e[0] + "," + e[1], o.BBOX = r.join(","), o.BBOXSR = l, o.IMAGESR = l, o.DPI = Math.round(o.DPI ? o.DPI * n : 90 * n), 1 == a.length) s = a[0]; else s = a[We(fu(t), a.length)];
  17064. return mc(s.replace(/MapServer\/?$/, "MapServer/export").replace(/ImageServer\/?$/, "ImageServer/exportImage"), o)
  17065. }
  17066. }, e.prototype.getTilePixelRatio = function (t) {
  17067. return this.hidpi_ ? t : 1
  17068. }, e.prototype.updateParams = function (t) {
  17069. O(this.params_, t), this.setKey(this.getKeyForParams_())
  17070. }, e.prototype.tileUrlFunction = function (t, e, r) {
  17071. var n = this.getTileGrid();
  17072. if (n || (n = this.getTileGridForProjection(r)), !(n.getResolutions().length <= t[0])) {
  17073. 1 == e || this.hidpi_ || (e = 1);
  17074. var i = n.getTileCoordExtent(t, this.tmpExtent_), o = Is(n.getTileSize(t[0]), this.tmpSize);
  17075. 1 != e && (o = Rs(o, e, this.tmpSize));
  17076. var a = {F: "image", FORMAT: "PNG32", TRANSPARENT: !0};
  17077. return O(a, this.params_), this.getRequestUrl_(t, o, i, e, r, a)
  17078. }
  17079. }, e
  17080. }(Xp), Zd = function () {
  17081. var t = function (e, r) {
  17082. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17083. t.__proto__ = e
  17084. } || function (t, e) {
  17085. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17086. })(e, r)
  17087. };
  17088. return function (e, r) {
  17089. function n() {
  17090. this.constructor = e
  17091. }
  17092. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17093. }
  17094. }(), Kd = function (t) {
  17095. function e(e, r, n) {
  17096. var i = t.call(this, e, to) || this;
  17097. return i.tileSize_ = r, i.text_ = n, i.canvas_ = null, i
  17098. }
  17099. return Zd(e, t), e.prototype.getImage = function () {
  17100. if (this.canvas_) return this.canvas_;
  17101. var t = this.tileSize_, e = uo(t[0], t[1]);
  17102. return e.strokeStyle = "grey", e.strokeRect(.5, .5, t[0] + .5, t[1] + .5), e.fillStyle = "grey", e.strokeStyle = "white", e.textAlign = "center", e.textBaseline = "middle", e.font = "24px sans-serif", e.lineWidth = 4, e.strokeText(this.text_, t[0] / 2, t[1] / 2, t[0]), e.fillText(this.text_, t[0] / 2, t[1] / 2, t[0]), this.canvas_ = e.canvas, e.canvas
  17103. }, e.prototype.load = function () {
  17104. }, e
  17105. }(lo), Hd = function (t) {
  17106. function e(e) {
  17107. var r = e || {};
  17108. return t.call(this, {
  17109. opaque: !1,
  17110. projection: r.projection,
  17111. tileGrid: r.tileGrid,
  17112. wrapX: void 0 === r.wrapX || r.wrapX,
  17113. zDirection: r.zDirection
  17114. }) || this
  17115. }
  17116. return Zd(e, t), e.prototype.getTile = function (t, e, r) {
  17117. var n = cu(t, e, r);
  17118. if (this.tileCache.containsKey(n)) return this.tileCache.get(n);
  17119. var i = Is(this.tileGrid.getTileSize(t)), o = [t, e, r], a = this.getTileCoordForTileUrlFunction(o), s = void 0;
  17120. s = a ? "z:" + a[0] + " x:" + a[1] + " y:" + a[2] : "none";
  17121. var l = new Kd(o, i, s);
  17122. return this.tileCache.set(n, l), l
  17123. }, e
  17124. }(Jp), $d = function () {
  17125. var t = function (e, r) {
  17126. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17127. t.__proto__ = e
  17128. } || function (t, e) {
  17129. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17130. })(e, r)
  17131. };
  17132. return function (e, r) {
  17133. function n() {
  17134. this.constructor = e
  17135. }
  17136. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17137. }
  17138. }(), Jd = function (t) {
  17139. function e(e) {
  17140. var r = t.call(this, {
  17141. attributions: e.attributions,
  17142. cacheSize: e.cacheSize,
  17143. crossOrigin: e.crossOrigin,
  17144. imageSmoothing: e.imageSmoothing,
  17145. projection: Gr("EPSG:3857"),
  17146. reprojectionErrorThreshold: e.reprojectionErrorThreshold,
  17147. state: Jo,
  17148. tileLoadFunction: e.tileLoadFunction,
  17149. wrapX: void 0 === e.wrapX || e.wrapX,
  17150. transition: e.transition
  17151. }) || this;
  17152. if (r.tileJSON_ = null, r.tileSize_ = e.tileSize, e.url) if (e.jsonp) Au(e.url, r.handleTileJSONResponse.bind(r), r.handleTileJSONError.bind(r)); else {
  17153. var n = new XMLHttpRequest;
  17154. n.addEventListener("load", r.onXHRLoad_.bind(r)), n.addEventListener("error", r.onXHRError_.bind(r)), n.open("GET", e.url), n.send()
  17155. } else e.tileJSON ? r.handleTileJSONResponse(e.tileJSON) : pt(!1, 51);
  17156. return r
  17157. }
  17158. return $d(e, t), e.prototype.onXHRLoad_ = function (t) {
  17159. var e = t.target;
  17160. if (!e.status || e.status >= 200 && e.status < 300) {
  17161. var r = void 0;
  17162. try {
  17163. r = JSON.parse(e.responseText)
  17164. } catch (t) {
  17165. return void this.handleTileJSONError()
  17166. }
  17167. this.handleTileJSONResponse(r)
  17168. } else this.handleTileJSONError()
  17169. }, e.prototype.onXHRError_ = function (t) {
  17170. this.handleTileJSONError()
  17171. }, e.prototype.getTileJSON = function () {
  17172. return this.tileJSON_
  17173. }, e.prototype.handleTileJSONResponse = function (t) {
  17174. var e, r = Gr("EPSG:4326"), n = this.getProjection();
  17175. if (void 0 !== t.bounds) {
  17176. var i = Zr(r, n);
  17177. e = Ae(t.bounds, i)
  17178. }
  17179. var o = t.minzoom || 0, a = t.maxzoom || 22,
  17180. s = lc({extent: hc(n), maxZoom: a, minZoom: o, tileSize: this.tileSize_});
  17181. if (this.tileGrid = s, this.tileUrlFunction = fc(t.tiles, s), void 0 !== t.attribution && !this.getAttributions()) {
  17182. var l = void 0 !== e ? e : r.getExtent();
  17183. this.setAttributions((function (e) {
  17184. return Re(l, e.extent) ? [t.attribution] : null
  17185. }))
  17186. }
  17187. this.tileJSON_ = t, this.setState(Qo)
  17188. }, e.prototype.handleTileJSONError = function () {
  17189. this.setState(ta)
  17190. }, e
  17191. }(Xp), Qd = function () {
  17192. var t = function (e, r) {
  17193. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17194. t.__proto__ = e
  17195. } || function (t, e) {
  17196. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17197. })(e, r)
  17198. };
  17199. return function (e, r) {
  17200. function n() {
  17201. this.constructor = e
  17202. }
  17203. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17204. }
  17205. }(), tg = function (t) {
  17206. function e(e) {
  17207. var r = this, n = e || {}, i = n.params || {}, o = !("TRANSPARENT" in i) || i.TRANSPARENT;
  17208. return (r = t.call(this, {
  17209. attributions: n.attributions,
  17210. cacheSize: n.cacheSize,
  17211. crossOrigin: n.crossOrigin,
  17212. imageSmoothing: n.imageSmoothing,
  17213. opaque: !o,
  17214. projection: n.projection,
  17215. reprojectionErrorThreshold: n.reprojectionErrorThreshold,
  17216. tileClass: n.tileClass,
  17217. tileGrid: n.tileGrid,
  17218. tileLoadFunction: n.tileLoadFunction,
  17219. url: n.url,
  17220. urls: n.urls,
  17221. wrapX: void 0 === n.wrapX || n.wrapX,
  17222. transition: n.transition
  17223. }) || this).gutter_ = void 0 !== n.gutter ? n.gutter : 0, r.params_ = i, r.v13_ = !0, r.serverType_ = n.serverType, r.hidpi_ = void 0 === n.hidpi || n.hidpi, r.tmpExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], r.updateV13_(), r.setKey(r.getKeyForParams_()), r
  17224. }
  17225. return Qd(e, t), e.prototype.getFeatureInfoUrl = function (t, e, r, n) {
  17226. var i = Gr(r), o = this.getProjection(), a = this.getTileGrid();
  17227. a || (a = this.getTileGridForProjection(i));
  17228. var s = a.getZForResolution(e, this.zDirection), l = a.getTileCoordForCoordAndZ(t, s);
  17229. if (!(a.getResolutions().length <= l[0])) {
  17230. var u = a.getResolution(l[0]), c = a.getTileCoordExtent(l, this.tmpExtent_),
  17231. h = Is(a.getTileSize(l[0]), this.tmpSize), p = this.gutter_;
  17232. 0 !== p && (h = Os(h, p, this.tmpSize), c = Ht(c, u * p, c)), o && o !== i && (u = tc(o, i, t, u), c = $r(c, i, o), t = Hr(t, i, o));
  17233. var f = {
  17234. SERVICE: "WMS",
  17235. VERSION: "1.3.0",
  17236. REQUEST: "GetFeatureInfo",
  17237. FORMAT: "image/png",
  17238. TRANSPARENT: !0,
  17239. QUERY_LAYERS: this.params_.LAYERS
  17240. };
  17241. O(f, this.params_, n);
  17242. var d = Math.floor((t[0] - c[0]) / u), g = Math.floor((c[3] - t[1]) / u);
  17243. return f[this.v13_ ? "I" : "X"] = d, f[this.v13_ ? "J" : "Y"] = g, this.getRequestUrl_(l, h, c, 1, o || i, f)
  17244. }
  17245. }, e.prototype.getLegendUrl = function (t, e) {
  17246. if (void 0 !== this.urls[0]) {
  17247. var r = {SERVICE: "WMS", VERSION: "1.3.0", REQUEST: "GetLegendGraphic", FORMAT: "image/png"};
  17248. if (void 0 === e || void 0 === e.LAYER) {
  17249. var n = this.params_.LAYERS;
  17250. if (!(!Array.isArray(n) || 1 === n.length)) return;
  17251. r.LAYER = n
  17252. }
  17253. if (void 0 !== t) {
  17254. var i = this.getProjection() ? this.getProjection().getMetersPerUnit() : 1;
  17255. r.SCALE = t * i / 28e-5
  17256. }
  17257. return O(r, e), mc(this.urls[0], r)
  17258. }
  17259. }, e.prototype.getGutter = function () {
  17260. return this.gutter_
  17261. }, e.prototype.getParams = function () {
  17262. return this.params_
  17263. }, e.prototype.getRequestUrl_ = function (t, e, r, n, i, o) {
  17264. var a = this.urls;
  17265. if (a) {
  17266. if (o.WIDTH = e[0], o.HEIGHT = e[1], o[this.v13_ ? "CRS" : "SRS"] = i.getCode(), "STYLES" in this.params_ || (o.STYLES = ""), 1 != n) switch (this.serverType_) {
  17267. case Hf:
  17268. var s = 90 * n + .5 | 0;
  17269. "FORMAT_OPTIONS" in o ? o.FORMAT_OPTIONS += ";dpi:" + s : o.FORMAT_OPTIONS = "dpi:" + s;
  17270. break;
  17271. case $f:
  17272. o.MAP_RESOLUTION = 90 * n;
  17273. break;
  17274. case Kf:
  17275. case Jf:
  17276. o.DPI = 90 * n;
  17277. break;
  17278. default:
  17279. pt(!1, 52)
  17280. }
  17281. var l, u = i.getAxisOrientation(), c = r;
  17282. if (this.v13_ && "ne" == u.substr(0, 2)) {
  17283. var h = void 0;
  17284. h = r[0], c[0] = r[1], c[1] = h, h = r[2], c[2] = r[3], c[3] = h
  17285. }
  17286. if (o.BBOX = c.join(","), 1 == a.length) l = a[0]; else l = a[We(fu(t), a.length)];
  17287. return mc(l, o)
  17288. }
  17289. }, e.prototype.getTilePixelRatio = function (t) {
  17290. return this.hidpi_ && void 0 !== this.serverType_ ? t : 1
  17291. }, e.prototype.getKeyForParams_ = function () {
  17292. var t = 0, e = [];
  17293. for (var r in this.params_) e[t++] = r + "-" + this.params_[r];
  17294. return e.join("/")
  17295. }, e.prototype.updateParams = function (t) {
  17296. O(this.params_, t), this.updateV13_(), this.setKey(this.getKeyForParams_())
  17297. }, e.prototype.updateV13_ = function () {
  17298. var t = this.params_.VERSION || "1.3.0";
  17299. this.v13_ = br(t, "1.3") >= 0
  17300. }, e.prototype.tileUrlFunction = function (t, e, r) {
  17301. var n = this.getTileGrid();
  17302. if (n || (n = this.getTileGridForProjection(r)), !(n.getResolutions().length <= t[0])) {
  17303. 1 == e || this.hidpi_ && void 0 !== this.serverType_ || (e = 1);
  17304. var i = n.getResolution(t[0]), o = n.getTileCoordExtent(t, this.tmpExtent_),
  17305. a = Is(n.getTileSize(t[0]), this.tmpSize), s = this.gutter_;
  17306. 0 !== s && (a = Os(a, s, this.tmpSize), o = Ht(o, i * s, o)), 1 != e && (a = Rs(a, e, this.tmpSize));
  17307. var l = {SERVICE: "WMS", VERSION: "1.3.0", REQUEST: "GetMap", FORMAT: "image/png", TRANSPARENT: !0};
  17308. return O(l, this.params_), this.getRequestUrl_(t, a, o, e, r, l)
  17309. }
  17310. }, e
  17311. }(Xp), eg = function () {
  17312. var t = function (e, r) {
  17313. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17314. t.__proto__ = e
  17315. } || function (t, e) {
  17316. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17317. })(e, r)
  17318. };
  17319. return function (e, r) {
  17320. function n() {
  17321. this.constructor = e
  17322. }
  17323. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17324. }
  17325. }(), rg = function (t) {
  17326. function e(e, r, n, i, o, a) {
  17327. var s = t.call(this, e, r) || this;
  17328. return s.src_ = n, s.extent_ = i, s.preemptive_ = o, s.grid_ = null, s.keys_ = null, s.data_ = null, s.jsonp_ = a, s
  17329. }
  17330. return eg(e, t), e.prototype.getImage = function () {
  17331. return null
  17332. }, e.prototype.getData = function (t) {
  17333. if (!this.grid_ || !this.keys_) return null;
  17334. var e = (t[0] - this.extent_[0]) / (this.extent_[2] - this.extent_[0]),
  17335. r = (t[1] - this.extent_[1]) / (this.extent_[3] - this.extent_[1]),
  17336. n = this.grid_[Math.floor((1 - r) * this.grid_.length)];
  17337. if ("string" != typeof n) return null;
  17338. var i = n.charCodeAt(Math.floor(e * n.length));
  17339. i >= 93 && i--, i >= 35 && i--;
  17340. var o = null;
  17341. if ((i -= 32) in this.keys_) {
  17342. var a = this.keys_[i];
  17343. o = this.data_ && a in this.data_ ? this.data_[a] : a
  17344. }
  17345. return o
  17346. }, e.prototype.forDataAtCoordinate = function (t, e, r) {
  17347. this.state == ro && !0 === r ? (this.state = Ji, K(this, F, (function (r) {
  17348. e(this.getData(t))
  17349. }), this), this.loadInternal_()) : !0 === r ? setTimeout(function () {
  17350. e(this.getData(t))
  17351. }.bind(this), 0) : e(this.getData(t))
  17352. }, e.prototype.getKey = function () {
  17353. return this.src_
  17354. }, e.prototype.handleError_ = function () {
  17355. this.state = eo, this.changed()
  17356. }, e.prototype.handleLoad_ = function (t) {
  17357. this.grid_ = t.grid, this.keys_ = t.keys, this.data_ = t.data, this.state = to, this.changed()
  17358. }, e.prototype.loadInternal_ = function () {
  17359. if (this.state == Ji) if (this.state = Qi, this.jsonp_) Au(this.src_, this.handleLoad_.bind(this), this.handleError_.bind(this)); else {
  17360. var t = new XMLHttpRequest;
  17361. t.addEventListener("load", this.onXHRLoad_.bind(this)), t.addEventListener("error", this.onXHRError_.bind(this)), t.open("GET", this.src_), t.send()
  17362. }
  17363. }, e.prototype.onXHRLoad_ = function (t) {
  17364. var e = t.target;
  17365. if (!e.status || e.status >= 200 && e.status < 300) {
  17366. var r = void 0;
  17367. try {
  17368. r = JSON.parse(e.responseText)
  17369. } catch (t) {
  17370. return void this.handleError_()
  17371. }
  17372. this.handleLoad_(r)
  17373. } else this.handleError_()
  17374. }, e.prototype.onXHRError_ = function (t) {
  17375. this.handleError_()
  17376. }, e.prototype.load = function () {
  17377. this.preemptive_ ? this.loadInternal_() : this.setState(ro)
  17378. }, e
  17379. }(lo), ng = function (t) {
  17380. function e(e) {
  17381. var r = t.call(this, {projection: Gr("EPSG:3857"), state: Jo}) || this;
  17382. if (r.preemptive_ = void 0 === e.preemptive || e.preemptive, r.tileUrlFunction_ = gc, r.template_ = void 0, r.jsonp_ = e.jsonp || !1, e.url) if (r.jsonp_) Au(e.url, r.handleTileJSONResponse.bind(r), r.handleTileJSONError.bind(r)); else {
  17383. var n = new XMLHttpRequest;
  17384. n.addEventListener("load", r.onXHRLoad_.bind(r)), n.addEventListener("error", r.onXHRError_.bind(r)), n.open("GET", e.url), n.send()
  17385. } else e.tileJSON ? r.handleTileJSONResponse(e.tileJSON) : pt(!1, 51);
  17386. return r
  17387. }
  17388. return eg(e, t), e.prototype.onXHRLoad_ = function (t) {
  17389. var e = t.target;
  17390. if (!e.status || e.status >= 200 && e.status < 300) {
  17391. var r = void 0;
  17392. try {
  17393. r = JSON.parse(e.responseText)
  17394. } catch (t) {
  17395. return void this.handleTileJSONError()
  17396. }
  17397. this.handleTileJSONResponse(r)
  17398. } else this.handleTileJSONError()
  17399. }, e.prototype.onXHRError_ = function (t) {
  17400. this.handleTileJSONError()
  17401. }, e.prototype.getTemplate = function () {
  17402. return this.template_
  17403. }, e.prototype.forDataAtCoordinateAndResolution = function (t, e, r, n) {
  17404. if (this.tileGrid) {
  17405. var i = this.tileGrid.getZForResolution(e, this.zDirection), o = this.tileGrid.getTileCoordForCoordAndZ(t, i);
  17406. this.getTile(o[0], o[1], o[2], 1, this.getProjection()).forDataAtCoordinate(t, r, n)
  17407. } else !0 === n ? setTimeout((function () {
  17408. r(null)
  17409. }), 0) : r(null)
  17410. }, e.prototype.handleTileJSONError = function () {
  17411. this.setState(ta)
  17412. }, e.prototype.handleTileJSONResponse = function (t) {
  17413. var e, r = Gr("EPSG:4326"), n = this.getProjection();
  17414. if (void 0 !== t.bounds) {
  17415. var i = Zr(r, n);
  17416. e = Ae(t.bounds, i)
  17417. }
  17418. var o = t.minzoom || 0, a = t.maxzoom || 22, s = lc({extent: hc(n), maxZoom: a, minZoom: o});
  17419. this.tileGrid = s, this.template_ = t.template;
  17420. var l = t.grids;
  17421. if (l) {
  17422. if (this.tileUrlFunction_ = fc(l, s), void 0 !== t.attribution) {
  17423. var u = void 0 !== e ? e : r.getExtent();
  17424. this.setAttributions((function (e) {
  17425. return Re(u, e.extent) ? [t.attribution] : null
  17426. }))
  17427. }
  17428. this.setState(Qo)
  17429. } else this.setState(ta)
  17430. }, e.prototype.getTile = function (t, e, r, n, i) {
  17431. var o = cu(t, e, r);
  17432. if (this.tileCache.containsKey(o)) return this.tileCache.get(o);
  17433. var a = [t, e, r], s = this.getTileCoordForTileUrlFunction(a, i), l = this.tileUrlFunction_(s, n, i),
  17434. u = new rg(a, void 0 !== l ? Ji : ro, void 0 !== l ? l : "", this.tileGrid.getTileCoordExtent(a), this.preemptive_, this.jsonp_);
  17435. return this.tileCache.set(o, u), u
  17436. }, e.prototype.useTile = function (t, e, r) {
  17437. var n = cu(t, e, r);
  17438. this.tileCache.containsKey(n) && this.tileCache.get(n)
  17439. }, e
  17440. }(Bp), ig = function () {
  17441. var t = function (e, r) {
  17442. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17443. t.__proto__ = e
  17444. } || function (t, e) {
  17445. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17446. })(e, r)
  17447. };
  17448. return function (e, r) {
  17449. function n() {
  17450. this.constructor = e
  17451. }
  17452. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17453. }
  17454. }(), og = function (t) {
  17455. function e(e) {
  17456. var r = this, n = e.projection || "EPSG:3857", i = e.extent || hc(n), o = e.tileGrid || lc({
  17457. extent: i,
  17458. maxResolution: e.maxResolution,
  17459. maxZoom: void 0 !== e.maxZoom ? e.maxZoom : 22,
  17460. minZoom: e.minZoom,
  17461. tileSize: e.tileSize || 512
  17462. });
  17463. return (r = t.call(this, {
  17464. attributions: e.attributions,
  17465. attributionsCollapsible: e.attributionsCollapsible,
  17466. cacheSize: e.cacheSize,
  17467. opaque: !1,
  17468. projection: n,
  17469. state: e.state,
  17470. tileGrid: o,
  17471. tileLoadFunction: e.tileLoadFunction ? e.tileLoadFunction : ag,
  17472. tileUrlFunction: e.tileUrlFunction,
  17473. url: e.url,
  17474. urls: e.urls,
  17475. wrapX: void 0 === e.wrapX || e.wrapX,
  17476. transition: e.transition,
  17477. zDirection: void 0 === e.zDirection ? 1 : e.zDirection
  17478. }) || this).format_ = e.format ? e.format : null, r.loadingTiles_ = {}, r.sourceTileCache = new yu(r.tileCache.highWaterMark), r.overlaps_ = null == e.overlaps || e.overlaps, r.tileClass = e.tileClass ? e.tileClass : Eu, r.tileGrids_ = {}, r
  17479. }
  17480. return ig(e, t), e.prototype.getFeaturesInExtent = function (t) {
  17481. var e = [], r = this.tileCache;
  17482. if (0 === r.getCount()) return e;
  17483. var n = pu(r.peekFirstKey())[0], i = this.tileGrid;
  17484. return r.forEach((function (r) {
  17485. if (r.tileCoord[0] === n && r.getState() === to) for (var o = r.getSourceTiles(), a = 0, s = o.length; a < s; ++a) {
  17486. var l = o[a], u = l.tileCoord;
  17487. if (Re(t, i.getTileCoordExtent(u))) {
  17488. var c = l.getFeatures();
  17489. if (c) for (var h = 0, p = c.length; h < p; ++h) {
  17490. var f = c[h], d = f.getGeometry();
  17491. Re(t, d.getExtent()) && e.push(f)
  17492. }
  17493. }
  17494. }
  17495. })), e
  17496. }, e.prototype.getOverlaps = function () {
  17497. return this.overlaps_
  17498. }, e.prototype.clear = function () {
  17499. this.tileCache.clear(), this.sourceTileCache.clear()
  17500. }, e.prototype.expireCache = function (e, r) {
  17501. t.prototype.expireCache.call(this, e, r), this.sourceTileCache.expireCache({})
  17502. }, e.prototype.getSourceTiles = function (t, e, r) {
  17503. var n = r.wrappedTileCoord, i = this.getTileGridForProjection(e), o = i.getTileCoordExtent(n), a = n[0],
  17504. s = i.getResolution(a);
  17505. Ht(o, -s, o);
  17506. var l = this.tileGrid, u = l.getExtent();
  17507. u && Te(o, u, o);
  17508. var c, h, p, f = l.getZForResolution(s, 1), d = l.getMinZoom(), g = r.sourceTiles;
  17509. if (g && g.length > 0 && g[0].tileCoord[0] === f) c = g, h = !0, p = f; else {
  17510. c = [], p = f + 1;
  17511. do {
  17512. --p, h = !0, l.forEachTileCoord(o, p, function (n) {
  17513. var i, o = this.tileUrlFunction(n, t, e);
  17514. if (void 0 !== o) if (this.sourceTileCache.containsKey(o)) {
  17515. var a = (i = this.sourceTileCache.get(o)).getState();
  17516. if (a === to || a === eo || a === ro) return void c.push(i)
  17517. } else p === f && ((i = new this.tileClass(n, Ji, o, this.format_, this.tileLoadFunction)).extent = l.getTileCoordExtent(n), i.projection = e, i.resolution = l.getResolution(n[0]), this.sourceTileCache.set(o, i), i.addEventListener(F, this.handleTileChange.bind(this)), i.load());
  17518. h = h && i && i.getState() === to, i && i.getState() !== ro && r.getState() === Ji && (r.loadingSourceTiles++, i.addEventListener(F, (function t() {
  17519. var e = i.getState(), n = i.getKey();
  17520. if (e === to || e === eo) {
  17521. e === to ? (i.removeEventListener(F, t), r.loadingSourceTiles--, delete r.errorSourceTileKeys[n]) : e === eo && (r.errorSourceTileKeys[n] = !0);
  17522. var o = Object.keys(r.errorSourceTileKeys).length;
  17523. r.loadingSourceTiles - o == 0 && (r.hifi = 0 === o, r.sourceZ = f, r.setState(to))
  17524. }
  17525. })))
  17526. }.bind(this)), h || (c.length = 0)
  17527. } while (!h && p > d)
  17528. }
  17529. return r.getState() === Ji && r.setState(Qi), h && (r.hifi = f === p, r.sourceZ = p, r.getState() < to ? r.setState(to) : g && b(c, g) || (r.sourceTiles = c)), c
  17530. }, e.prototype.getTile = function (t, e, r, n, i) {
  17531. var o, a = cu(t, e, r), s = this.getKey();
  17532. if (this.tileCache.containsKey(a) && (o = this.tileCache.get(a)).key === s) return o;
  17533. var l = [t, e, r], u = this.getTileCoordForTileUrlFunction(l, i), c = this.getTileGrid().getExtent(),
  17534. h = this.getTileGridForProjection(i);
  17535. if (u && c) {
  17536. var p = h.getTileCoordExtent(u);
  17537. Ht(p, -h.getResolution(t), p), Re(c, p) || (u = null)
  17538. }
  17539. var f = !0;
  17540. if (null !== u) {
  17541. var d = this.tileGrid, g = h.getResolution(t), y = d.getZForResolution(g, 1), m = h.getTileCoordExtent(u);
  17542. Ht(m, -g, m), d.forEachTileCoord(m, y, function (t) {
  17543. f = f && !this.tileUrlFunction(t, n, i)
  17544. }.bind(this))
  17545. }
  17546. var v = new wu(l, f ? ro : Ji, u, this.getSourceTiles.bind(this, n, i));
  17547. return v.key = s, o ? (v.interimTile = o, v.refreshInterimChain(), this.tileCache.replace(a, v)) : this.tileCache.set(a, v), v
  17548. }, e.prototype.getTileGridForProjection = function (t) {
  17549. var e = t.getCode(), r = this.tileGrids_[e];
  17550. if (!r) {
  17551. var n = this.tileGrid;
  17552. r = cc(t, void 0, n ? n.getTileSize(n.getMinZoom()) : void 0), this.tileGrids_[e] = r
  17553. }
  17554. return r
  17555. }, e.prototype.getTilePixelRatio = function (t) {
  17556. return t
  17557. }, e.prototype.getTilePixelSize = function (t, e, r) {
  17558. var n = Is(this.getTileGridForProjection(r).getTileSize(t), this.tmpSize);
  17559. return [Math.round(n[0] * e), Math.round(n[1] * e)]
  17560. }, e.prototype.updateCacheSize = function (e, r) {
  17561. t.prototype.updateCacheSize.call(this, 2 * e, r)
  17562. }, e
  17563. }(Yp);
  17564. function ag(t, e) {
  17565. t.setLoader((function (r, n, i) {
  17566. Lu(e, t.getFormat(), r, n, i, t.onLoad.bind(t), t.onError.bind(t))
  17567. }))
  17568. }
  17569. var sg = "KVP", lg = "REST", ug = function () {
  17570. var t = function (e, r) {
  17571. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17572. t.__proto__ = e
  17573. } || function (t, e) {
  17574. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17575. })(e, r)
  17576. };
  17577. return function (e, r) {
  17578. function n() {
  17579. this.constructor = e
  17580. }
  17581. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17582. }
  17583. }(), cg = function (t) {
  17584. function e(e) {
  17585. var r = this, n = void 0 !== e.requestEncoding ? e.requestEncoding : sg, i = e.tileGrid, o = e.urls;
  17586. return void 0 === o && void 0 !== e.url && (o = yc(e.url)), (r = t.call(this, {
  17587. attributions: e.attributions,
  17588. cacheSize: e.cacheSize,
  17589. crossOrigin: e.crossOrigin,
  17590. imageSmoothing: e.imageSmoothing,
  17591. projection: e.projection,
  17592. reprojectionErrorThreshold: e.reprojectionErrorThreshold,
  17593. tileClass: e.tileClass,
  17594. tileGrid: i,
  17595. tileLoadFunction: e.tileLoadFunction,
  17596. tilePixelRatio: e.tilePixelRatio,
  17597. urls: o,
  17598. wrapX: void 0 !== e.wrapX && e.wrapX,
  17599. transition: e.transition
  17600. }) || this).version_ = void 0 !== e.version ? e.version : "1.0.0", r.format_ = void 0 !== e.format ? e.format : "image/jpeg", r.dimensions_ = void 0 !== e.dimensions ? e.dimensions : {}, r.layer_ = e.layer, r.matrixSet_ = e.matrixSet, r.style_ = e.style, r.requestEncoding_ = n, r.setKey(r.getKeyForDimensions_()), o && o.length > 0 && (r.tileUrlFunction = dc(o.map(r.createFromWMTSTemplate.bind(r)))), r
  17601. }
  17602. return ug(e, t), e.prototype.setUrls = function (t) {
  17603. this.urls = t;
  17604. var e = t.join("\n");
  17605. this.setTileUrlFunction(dc(t.map(this.createFromWMTSTemplate.bind(this))), e)
  17606. }, e.prototype.getDimensions = function () {
  17607. return this.dimensions_
  17608. }, e.prototype.getFormat = function () {
  17609. return this.format_
  17610. }, e.prototype.getLayer = function () {
  17611. return this.layer_
  17612. }, e.prototype.getMatrixSet = function () {
  17613. return this.matrixSet_
  17614. }, e.prototype.getRequestEncoding = function () {
  17615. return this.requestEncoding_
  17616. }, e.prototype.getStyle = function () {
  17617. return this.style_
  17618. }, e.prototype.getVersion = function () {
  17619. return this.version_
  17620. }, e.prototype.getKeyForDimensions_ = function () {
  17621. var t = 0, e = [];
  17622. for (var r in this.dimensions_) e[t++] = r + "-" + this.dimensions_[r];
  17623. return e.join("/")
  17624. }, e.prototype.updateDimensions = function (t) {
  17625. O(this.dimensions_, t), this.setKey(this.getKeyForDimensions_())
  17626. }, e.prototype.createFromWMTSTemplate = function (t) {
  17627. var e = this.requestEncoding_, r = {layer: this.layer_, style: this.style_, tilematrixset: this.matrixSet_};
  17628. e == sg && O(r, {
  17629. Service: "WMTS",
  17630. Request: "GetTile",
  17631. Version: this.version_,
  17632. Format: this.format_
  17633. }), t = e == sg ? mc(t, r) : t.replace(/\{(\w+?)\}/g, (function (t, e) {
  17634. return e.toLowerCase() in r ? r[e.toLowerCase()] : t
  17635. }));
  17636. var n = this.tileGrid, i = this.dimensions_;
  17637. return function (r, o, a) {
  17638. if (r) {
  17639. var s = {TileMatrix: n.getMatrixId(r[0]), TileCol: r[1], TileRow: r[2]};
  17640. O(s, i);
  17641. var l = t;
  17642. return l = e == sg ? mc(l, s) : l.replace(/\{(\w+?)\}/g, (function (t, e) {
  17643. return s[e]
  17644. }))
  17645. }
  17646. }
  17647. }, e
  17648. }(Xp);
  17649. var hg = function () {
  17650. var t = function (e, r) {
  17651. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17652. t.__proto__ = e
  17653. } || function (t, e) {
  17654. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17655. })(e, r)
  17656. };
  17657. return function (e, r) {
  17658. function n() {
  17659. this.constructor = e
  17660. }
  17661. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17662. }
  17663. }(), pg = "GENERATE_BUFFERS", fg = function (t) {
  17664. function e(e, r) {
  17665. var n = t.call(this, e) || this, i = r || {};
  17666. return n.helper = new gh({
  17667. postProcesses: i.postProcesses,
  17668. uniforms: i.uniforms
  17669. }), void 0 !== i.className && (n.helper.getCanvas().className = i.className), n
  17670. }
  17671. return hg(e, t), e.prototype.disposeInternal = function () {
  17672. this.helper.dispose(), t.prototype.disposeInternal.call(this)
  17673. }, e.prototype.getShaderCompileErrors = function () {
  17674. return this.helper.getShaderCompileErrors()
  17675. }, e.prototype.dispatchRenderEvent_ = function (t, e) {
  17676. var r = this.getLayer();
  17677. if (r.hasListener(t)) {
  17678. var n = new la(t, null, e, null);
  17679. r.dispatchEvent(n)
  17680. }
  17681. }, e.prototype.preRender = function (t) {
  17682. this.dispatchRenderEvent_(qo, t)
  17683. }, e.prototype.postRender = function (t) {
  17684. this.dispatchRenderEvent_(Xo, t)
  17685. }, e
  17686. }(ld), dg = [], gg = {vertexPosition: 0, indexPosition: 0};
  17687. function yg(t, e, r, n, i) {
  17688. t[e + 0] = r, t[e + 1] = n, t[e + 2] = i
  17689. }
  17690. function mg(t, e) {
  17691. var r = e || [];
  17692. return r[0] = Math.floor(t / 256 / 256 / 256) / 255, r[1] = Math.floor(t / 256 / 256) % 256 / 255, r[2] = Math.floor(t / 256) % 256 / 255, r[3] = t % 256 / 255, r
  17693. }
  17694. function vg(t) {
  17695. var e = 0;
  17696. return e += Math.round(256 * t[0] * 256 * 256 * 255), e += Math.round(256 * t[1] * 256 * 255), e += Math.round(256 * t[2] * 255), e += Math.round(255 * t[3])
  17697. }
  17698. var _g = fg, bg = function () {
  17699. var t = function (e, r) {
  17700. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17701. t.__proto__ = e
  17702. } || function (t, e) {
  17703. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17704. })(e, r)
  17705. };
  17706. return function (e, r) {
  17707. function n() {
  17708. this.constructor = e
  17709. }
  17710. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17711. }
  17712. }(), xg = "renderOrder", wg = function (t) {
  17713. function e(e) {
  17714. var r = this, n = e || {}, i = O({}, n);
  17715. return delete i.style, delete i.renderBuffer, delete i.updateWhileAnimating, delete i.updateWhileInteracting, (r = t.call(this, i) || this).declutter_ = void 0 !== n.declutter && n.declutter, r.renderBuffer_ = void 0 !== n.renderBuffer ? n.renderBuffer : 100, r.style_ = null, r.styleFunction_ = void 0, r.setStyle(n.style), r.updateWhileAnimating_ = void 0 !== n.updateWhileAnimating && n.updateWhileAnimating, r.updateWhileInteracting_ = void 0 !== n.updateWhileInteracting && n.updateWhileInteracting, r
  17716. }
  17717. return bg(e, t), e.prototype.getDeclutter = function () {
  17718. return this.declutter_
  17719. }, e.prototype.getFeatures = function (e) {
  17720. return t.prototype.getFeatures.call(this, e)
  17721. }, e.prototype.getRenderBuffer = function () {
  17722. return this.renderBuffer_
  17723. }, e.prototype.getRenderOrder = function () {
  17724. return this.get(xg)
  17725. }, e.prototype.getStyle = function () {
  17726. return this.style_
  17727. }, e.prototype.getStyleFunction = function () {
  17728. return this.styleFunction_
  17729. }, e.prototype.getUpdateWhileAnimating = function () {
  17730. return this.updateWhileAnimating_
  17731. }, e.prototype.getUpdateWhileInteracting = function () {
  17732. return this.updateWhileInteracting_
  17733. }, e.prototype.renderDeclutter = function (t) {
  17734. t.declutterTree || (t.declutterTree = new Pp.a(9)), this.getRenderer().renderDeclutter(t)
  17735. }, e.prototype.setRenderOrder = function (t) {
  17736. this.set(xg, t)
  17737. }, e.prototype.setStyle = function (t) {
  17738. this.style_ = void 0 !== t ? t : _p, this.styleFunction_ = null === t ? void 0 : mp(this.style_), this.changed()
  17739. }, e
  17740. }(na), Sg = function () {
  17741. var t = function (e, r) {
  17742. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17743. t.__proto__ = e
  17744. } || function (t, e) {
  17745. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17746. })(e, r)
  17747. };
  17748. return function (e, r) {
  17749. function n() {
  17750. this.constructor = e
  17751. }
  17752. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17753. }
  17754. }(), Eg = function (t) {
  17755. function e(e, r) {
  17756. var n = this, i = r.uniforms || {}, a = [1, 0, 0, 1, 0, 0];
  17757. i[ah] = a, (n = t.call(this, e, {
  17758. className: r.className,
  17759. uniforms: i,
  17760. postProcesses: r.postProcesses
  17761. }) || this).sourceRevision_ = -1, n.verticesBuffer_ = new Qc(34962, 35048), n.hitVerticesBuffer_ = new Qc(34962, 35048), n.indicesBuffer_ = new Qc(34963, 35048), n.program_ = n.helper.getProgram(r.fragmentShader, r.vertexShader), n.hitDetectionEnabled_ = !(!r.hitFragmentShader || !r.hitVertexShader), n.hitProgram_ = n.hitDetectionEnabled_ && n.helper.getProgram(r.hitFragmentShader, r.hitVertexShader);
  17762. var s = r.attributes ? r.attributes.map((function (t) {
  17763. return {name: "a_" + t.name, size: 1, type: ph.FLOAT}
  17764. })) : [];
  17765. n.attributes = [{name: "a_position", size: 2, type: ph.FLOAT}, {
  17766. name: "a_index",
  17767. size: 1,
  17768. type: ph.FLOAT
  17769. }].concat(s), n.hitDetectionAttributes = [{name: "a_position", size: 2, type: ph.FLOAT}, {
  17770. name: "a_index",
  17771. size: 1,
  17772. type: ph.FLOAT
  17773. }, {name: "a_hitColor", size: 4, type: ph.FLOAT}, {
  17774. name: "a_featureUid",
  17775. size: 1,
  17776. type: ph.FLOAT
  17777. }].concat(s), n.customAttributes = r.attributes ? r.attributes : [], n.previousExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n.currentTransform_ = a, n.renderTransform_ = [1, 0, 0, 1, 0, 0], n.invertRenderTransform_ = [1, 0, 0, 1, 0, 0], n.renderInstructions_ = new Float32Array(0), n.hitRenderInstructions_ = new Float32Array(0), n.hitRenderTarget_ = n.hitDetectionEnabled_ && new mh(n.helper), n.worker_ = new Worker(Hc), n.worker_.addEventListener("message", function (t) {
  17778. var e = t.data;
  17779. if (e.type === pg) {
  17780. var r = e.projectionTransform;
  17781. e.hitDetection ? (this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer), this.helper.flushBufferData(this.hitVerticesBuffer_)) : (this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer), this.helper.flushBufferData(this.verticesBuffer_)), this.indicesBuffer_.fromArrayBuffer(e.indexBuffer), this.helper.flushBufferData(this.indicesBuffer_), this.renderTransform_ = r, jt(this.invertRenderTransform_, this.renderTransform_), e.hitDetection ? this.hitRenderInstructions_ = new Float32Array(t.data.renderInstructions) : this.renderInstructions_ = new Float32Array(t.data.renderInstructions), this.getLayer().changed()
  17782. }
  17783. }.bind(n)), n.featureCache_ = {}, n.featureCount_ = 0;
  17784. var l = n.getLayer().getSource();
  17785. return n.sourceListenKeys_ = [Z(l, ef, n.handleSourceFeatureAdded_, n), Z(l, rf, n.handleSourceFeatureChanged_, n), Z(l, of, n.handleSourceFeatureDelete_, n), Z(l, nf, n.handleSourceFeatureClear_, n)], l.forEachFeature(function (t) {
  17786. this.featureCache_[o(t)] = {
  17787. feature: t,
  17788. properties: t.getProperties(),
  17789. geometry: t.getGeometry()
  17790. }, this.featureCount_++
  17791. }.bind(n)), n
  17792. }
  17793. return Sg(e, t), e.prototype.handleSourceFeatureAdded_ = function (t) {
  17794. var e = t.feature;
  17795. this.featureCache_[o(e)] = {
  17796. feature: e,
  17797. properties: e.getProperties(),
  17798. geometry: e.getGeometry()
  17799. }, this.featureCount_++
  17800. }, e.prototype.handleSourceFeatureChanged_ = function (t) {
  17801. var e = t.feature;
  17802. this.featureCache_[o(e)] = {feature: e, properties: e.getProperties(), geometry: e.getGeometry()}
  17803. }, e.prototype.handleSourceFeatureDelete_ = function (t) {
  17804. var e = t.feature;
  17805. delete this.featureCache_[o(e)], this.featureCount_--
  17806. }, e.prototype.handleSourceFeatureClear_ = function () {
  17807. this.featureCache_ = {}, this.featureCount_ = 0
  17808. }, e.prototype.renderFrame = function (t) {
  17809. this.preRender(t);
  17810. var e = this.indicesBuffer_.getSize();
  17811. this.helper.drawElements(0, e), this.helper.finalizeDraw(t);
  17812. var r = this.helper.getCanvas(), n = t.layerStatesArray[t.layerIndex].opacity;
  17813. return n !== parseFloat(r.style.opacity) && (r.style.opacity = String(n)), this.hitDetectionEnabled_ && (this.renderHitDetection(t), this.hitRenderTarget_.clearCachedData()), this.postRender(t), r
  17814. }, e.prototype.prepareFrame = function (t) {
  17815. var e = this.getLayer(), r = e.getSource(), n = t.viewState, i = !t.viewHints[ns] && !t.viewHints[is],
  17816. o = !ue(this.previousExtent_, t.extent), a = this.sourceRevision_ < r.getRevision();
  17817. if (a && (this.sourceRevision_ = r.getRevision()), i && (o || a)) {
  17818. var s = n.projection, l = n.resolution, u = e instanceof wg ? e.getRenderBuffer() : 0,
  17819. c = Ht(t.extent, u * l);
  17820. r.loadFeatures(c, l, s), this.rebuildBuffers_(t), this.previousExtent_ = t.extent.slice()
  17821. }
  17822. return this.helper.makeProjectionTransform(t, this.currentTransform_), Ot(this.currentTransform_, this.invertRenderTransform_), this.helper.useProgram(this.program_), this.helper.prepareDraw(t), this.helper.bindBuffer(this.verticesBuffer_), this.helper.bindBuffer(this.indicesBuffer_), this.helper.enableAttributes(this.attributes), !0
  17823. }, e.prototype.rebuildBuffers_ = function (t) {
  17824. var e = [1, 0, 0, 1, 0, 0];
  17825. this.helper.makeProjectionTransform(t, e);
  17826. var r, n, i = (2 + this.customAttributes.length) * this.featureCount_;
  17827. if (this.renderInstructions_ && this.renderInstructions_.length === i || (this.renderInstructions_ = new Float32Array(i)), this.hitDetectionEnabled_) {
  17828. var o = (7 + this.customAttributes.length) * this.featureCount_;
  17829. this.hitRenderInstructions_ && this.hitRenderInstructions_.length === o || (this.hitRenderInstructions_ = new Float32Array(o))
  17830. }
  17831. var a, s = [], l = [], u = 0, c = 0;
  17832. for (var h in this.featureCache_) if ((n = (r = this.featureCache_[h]).geometry) && n.getType() === bt.POINT) {
  17833. s[0] = n.getFlatCoordinates()[0], s[1] = n.getFlatCoordinates()[1], It(e, s), a = mg(c + 6, l), this.renderInstructions_[u++] = s[0], this.renderInstructions_[u++] = s[1], this.hitDetectionEnabled_ && (this.hitRenderInstructions_[c++] = s[0], this.hitRenderInstructions_[c++] = s[1], this.hitRenderInstructions_[c++] = a[0], this.hitRenderInstructions_[c++] = a[1], this.hitRenderInstructions_[c++] = a[2], this.hitRenderInstructions_[c++] = a[3], this.hitRenderInstructions_[c++] = Number(h));
  17834. for (var p = void 0, f = 0; f < this.customAttributes.length; f++) p = this.customAttributes[f].callback(r.feature, r.properties), this.renderInstructions_[u++] = p, this.hitDetectionEnabled_ && (this.hitRenderInstructions_[c++] = p)
  17835. }
  17836. var d = {
  17837. type: pg,
  17838. renderInstructions: this.renderInstructions_.buffer,
  17839. customAttributesCount: this.customAttributes.length
  17840. };
  17841. if (d.projectionTransform = e, this.worker_.postMessage(d, [this.renderInstructions_.buffer]), this.renderInstructions_ = null, this.hitDetectionEnabled_) {
  17842. var g = {
  17843. type: pg,
  17844. renderInstructions: this.hitRenderInstructions_.buffer,
  17845. customAttributesCount: 5 + this.customAttributes.length
  17846. };
  17847. g.projectionTransform = e, g.hitDetection = !0, this.worker_.postMessage(g, [this.hitRenderInstructions_.buffer]), this.hitRenderInstructions_ = null
  17848. }
  17849. }, e.prototype.forEachFeatureAtCoordinate = function (t, e, r, n, i) {
  17850. if (pt(this.hitDetectionEnabled_, 66), this.hitRenderInstructions_) {
  17851. var o = It(e.coordinateToPixelTransform, t.slice()), a = this.hitRenderTarget_.readPixel(o[0] / 2, o[1] / 2),
  17852. s = vg([a[0] / 255, a[1] / 255, a[2] / 255, a[3] / 255]), l = this.hitRenderInstructions_[s],
  17853. u = Math.floor(l).toString(), c = this.getLayer().getSource().getFeatureByUid(u);
  17854. return c ? n(c, this.getLayer(), null) : void 0
  17855. }
  17856. }, e.prototype.renderHitDetection = function (t) {
  17857. if (this.hitVerticesBuffer_.getSize()) {
  17858. this.hitRenderTarget_.setSize([Math.floor(t.size[0] / 2), Math.floor(t.size[1] / 2)]), this.helper.useProgram(this.hitProgram_), this.helper.prepareDrawToRenderTarget(t, this.hitRenderTarget_, !0), this.helper.bindBuffer(this.hitVerticesBuffer_), this.helper.bindBuffer(this.indicesBuffer_), this.helper.enableAttributes(this.hitDetectionAttributes);
  17859. var e = this.indicesBuffer_.getSize();
  17860. this.helper.drawElements(0, e)
  17861. }
  17862. }, e.prototype.disposeInternal = function () {
  17863. this.worker_.terminate(), this.layer_ = null, this.sourceListenKeys_.forEach((function (t) {
  17864. H(t)
  17865. })), this.sourceListenKeys_ = null, t.prototype.disposeInternal.call(this)
  17866. }, e
  17867. }(_g), Tg = {
  17868. BEGIN_GEOMETRY: 0,
  17869. BEGIN_PATH: 1,
  17870. CIRCLE: 2,
  17871. CLOSE_PATH: 3,
  17872. CUSTOM: 4,
  17873. DRAW_CHARS: 5,
  17874. DRAW_IMAGE: 6,
  17875. END_GEOMETRY: 7,
  17876. FILL: 8,
  17877. MOVE_TO_LINE_TO: 9,
  17878. SET_FILL_STYLE: 10,
  17879. SET_STROKE_STYLE: 11,
  17880. STROKE: 12
  17881. }, Cg = [Tg.FILL], Og = [Tg.STROKE], Pg = [Tg.BEGIN_PATH], Rg = [Tg.CLOSE_PATH], Ig = Tg, Lg = function () {
  17882. var t = function (e, r) {
  17883. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17884. t.__proto__ = e
  17885. } || function (t, e) {
  17886. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  17887. })(e, r)
  17888. };
  17889. return function (e, r) {
  17890. function n() {
  17891. this.constructor = e
  17892. }
  17893. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  17894. }
  17895. }(), Mg = function (t) {
  17896. function e(e, r, n, i) {
  17897. var o = t.call(this) || this;
  17898. return o.tolerance = e, o.maxExtent = r, o.pixelRatio = i, o.maxLineWidth = 0, o.resolution = n, o.beginGeometryInstruction1_ = null, o.beginGeometryInstruction2_ = null, o.bufferedMaxExtent_ = null, o.instructions = [], o.coordinates = [], o.tmpCoordinate_ = [], o.hitDetectionInstructions = [], o.state = {}, o
  17899. }
  17900. return Lg(e, t), e.prototype.applyPixelRatio = function (t) {
  17901. var e = this.pixelRatio;
  17902. return 1 == e ? t : t.map((function (t) {
  17903. return t * e
  17904. }))
  17905. }, e.prototype.appendFlatPointCoordinates = function (t, e) {
  17906. for (var r = this.getBufferedMaxExtent(), n = this.tmpCoordinate_, i = this.coordinates, o = i.length, a = 0, s = t.length; a < s; a += e) n[0] = t[a], n[1] = t[a + 1], Qt(r, n) && (i[o++] = n[0], i[o++] = n[1]);
  17907. return o
  17908. }, e.prototype.appendFlatLineCoordinates = function (t, e, r, n, i, o) {
  17909. var a = this.coordinates, s = a.length, l = this.getBufferedMaxExtent();
  17910. o && (e += n);
  17911. var u, c, h, p = t[e], f = t[e + 1], d = this.tmpCoordinate_, g = !0;
  17912. for (u = e + n; u < r; u += n) d[0] = t[u], d[1] = t[u + 1], (h = re(l, d)) !== c ? (g && (a[s++] = p, a[s++] = f, g = !1), a[s++] = d[0], a[s++] = d[1]) : h === Yt ? (a[s++] = d[0], a[s++] = d[1], g = !1) : g = !0, p = d[0], f = d[1], c = h;
  17913. return (i && g || u === e + n) && (a[s++] = p, a[s++] = f), s
  17914. }, e.prototype.drawCustomCoordinates_ = function (t, e, r, n, i) {
  17915. for (var o = 0, a = r.length; o < a; ++o) {
  17916. var s = r[o], l = this.appendFlatLineCoordinates(t, e, s, n, !1, !1);
  17917. i.push(l), e = s
  17918. }
  17919. return e
  17920. }, e.prototype.drawCustom = function (t, e, r) {
  17921. this.beginGeometry(t, e);
  17922. var n, i, o, a, s, l = t.getType(), u = t.getStride(), c = this.coordinates.length;
  17923. if (l == bt.MULTI_POLYGON) {
  17924. n = t.getOrientedFlatCoordinates(), a = [];
  17925. var h = t.getEndss();
  17926. s = 0;
  17927. for (var p = 0, f = h.length; p < f; ++p) {
  17928. var d = [];
  17929. s = this.drawCustomCoordinates_(n, s, h[p], u, d), a.push(d)
  17930. }
  17931. this.instructions.push([Ig.CUSTOM, c, a, t, r, Gn])
  17932. } else l == bt.POLYGON || l == bt.MULTI_LINE_STRING ? (o = [], n = l == bt.POLYGON ? t.getOrientedFlatCoordinates() : t.getFlatCoordinates(), s = this.drawCustomCoordinates_(n, 0, t.getEnds(), u, o), this.instructions.push([Ig.CUSTOM, c, o, t, r, Dn])) : l == bt.LINE_STRING || l == bt.CIRCLE ? (n = t.getFlatCoordinates(), i = this.appendFlatLineCoordinates(n, 0, n.length, u, !1, !1), this.instructions.push([Ig.CUSTOM, c, i, t, r, Nn])) : l == bt.MULTI_POINT ? (n = t.getFlatCoordinates(), (i = this.appendFlatPointCoordinates(n, u)) > c && this.instructions.push([Ig.CUSTOM, c, i, t, r, Nn])) : l == bt.POINT && (n = t.getFlatCoordinates(), this.coordinates.push(n[0], n[1]), i = this.coordinates.length, this.instructions.push([Ig.CUSTOM, c, i, t, r]));
  17933. this.endGeometry(e)
  17934. }, e.prototype.beginGeometry = function (t, e) {
  17935. this.beginGeometryInstruction1_ = [Ig.BEGIN_GEOMETRY, e, 0, t], this.instructions.push(this.beginGeometryInstruction1_), this.beginGeometryInstruction2_ = [Ig.BEGIN_GEOMETRY, e, 0, t], this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)
  17936. }, e.prototype.finish = function () {
  17937. return {
  17938. instructions: this.instructions,
  17939. hitDetectionInstructions: this.hitDetectionInstructions,
  17940. coordinates: this.coordinates
  17941. }
  17942. }, e.prototype.reverseHitDetectionInstructions = function () {
  17943. var t, e = this.hitDetectionInstructions;
  17944. e.reverse();
  17945. var r, n, i = e.length, o = -1;
  17946. for (t = 0; t < i; ++t) (n = (r = e[t])[0]) == Ig.END_GEOMETRY ? o = t : n == Ig.BEGIN_GEOMETRY && (r[2] = t, m(this.hitDetectionInstructions, o, t), o = -1)
  17947. }, e.prototype.setFillStrokeStyle = function (t, e) {
  17948. var r = this.state;
  17949. if (t) {
  17950. var n = t.getColor();
  17951. r.fillStyle = Tu(n || "#000")
  17952. } else r.fillStyle = void 0;
  17953. if (e) {
  17954. var i = e.getColor();
  17955. r.strokeStyle = Tu(i || "#000");
  17956. var o = e.getLineCap();
  17957. r.lineCap = void 0 !== o ? o : "round";
  17958. var a = e.getLineDash();
  17959. r.lineDash = a ? a.slice() : pa;
  17960. var s = e.getLineDashOffset();
  17961. r.lineDashOffset = s || 0;
  17962. var l = e.getLineJoin();
  17963. r.lineJoin = void 0 !== l ? l : "round";
  17964. var u = e.getWidth();
  17965. r.lineWidth = void 0 !== u ? u : 1;
  17966. var c = e.getMiterLimit();
  17967. r.miterLimit = void 0 !== c ? c : 10, r.lineWidth > this.maxLineWidth && (this.maxLineWidth = r.lineWidth, this.bufferedMaxExtent_ = null)
  17968. } else r.strokeStyle = void 0, r.lineCap = void 0, r.lineDash = null, r.lineDashOffset = void 0, r.lineJoin = void 0, r.lineWidth = void 0, r.miterLimit = void 0
  17969. }, e.prototype.createFill = function (t) {
  17970. var e = t.fillStyle, r = [Ig.SET_FILL_STYLE, e];
  17971. return "string" != typeof e && r.push(!0), r
  17972. }, e.prototype.applyStroke = function (t) {
  17973. this.instructions.push(this.createStroke(t))
  17974. }, e.prototype.createStroke = function (t) {
  17975. return [Ig.SET_STROKE_STYLE, t.strokeStyle, t.lineWidth * this.pixelRatio, t.lineCap, t.lineJoin, t.miterLimit, this.applyPixelRatio(t.lineDash), t.lineDashOffset * this.pixelRatio]
  17976. }, e.prototype.updateFillStyle = function (t, e) {
  17977. var r = t.fillStyle;
  17978. "string" == typeof r && t.currentFillStyle == r || (void 0 !== r && this.instructions.push(e.call(this, t)), t.currentFillStyle = r)
  17979. }, e.prototype.updateStrokeStyle = function (t, e) {
  17980. var r = t.strokeStyle, n = t.lineCap, i = t.lineDash, o = t.lineDashOffset, a = t.lineJoin, s = t.lineWidth,
  17981. l = t.miterLimit;
  17982. (t.currentStrokeStyle != r || t.currentLineCap != n || i != t.currentLineDash && !b(t.currentLineDash, i) || t.currentLineDashOffset != o || t.currentLineJoin != a || t.currentLineWidth != s || t.currentMiterLimit != l) && (void 0 !== r && e.call(this, t), t.currentStrokeStyle = r, t.currentLineCap = n, t.currentLineDash = i, t.currentLineDashOffset = o, t.currentLineJoin = a, t.currentLineWidth = s, t.currentMiterLimit = l)
  17983. }, e.prototype.endGeometry = function (t) {
  17984. this.beginGeometryInstruction1_[2] = this.instructions.length, this.beginGeometryInstruction1_ = null, this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length, this.beginGeometryInstruction2_ = null;
  17985. var e = [Ig.END_GEOMETRY, t];
  17986. this.instructions.push(e), this.hitDetectionInstructions.push(e)
  17987. }, e.prototype.getBufferedMaxExtent = function () {
  17988. if (!this.bufferedMaxExtent_ && (this.bufferedMaxExtent_ = $t(this.maxExtent), this.maxLineWidth > 0)) {
  17989. var t = this.resolution * (this.maxLineWidth + 1) / 2;
  17990. Ht(this.bufferedMaxExtent_, t, this.bufferedMaxExtent_)
  17991. }
  17992. return this.bufferedMaxExtent_
  17993. }, e
  17994. }(ku), Fg = function () {
  17995. var t = function (e, r) {
  17996. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  17997. t.__proto__ = e
  17998. } || function (t, e) {
  17999. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  18000. })(e, r)
  18001. };
  18002. return function (e, r) {
  18003. function n() {
  18004. this.constructor = e
  18005. }
  18006. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  18007. }
  18008. }(), Ag = function (t) {
  18009. function e(e, r, n, i) {
  18010. var o = t.call(this, e, r, n, i) || this;
  18011. return o.hitDetectionImage_ = null, o.image_ = null, o.imagePixelRatio_ = void 0, o.anchorX_ = void 0, o.anchorY_ = void 0, o.height_ = void 0, o.opacity_ = void 0, o.originX_ = void 0, o.originY_ = void 0, o.rotateWithView_ = void 0, o.rotation_ = void 0, o.scale_ = void 0, o.width_ = void 0, o.declutterImageWithText_ = void 0, o
  18012. }
  18013. return Fg(e, t), e.prototype.drawPoint = function (t, e) {
  18014. if (this.image_) {
  18015. this.beginGeometry(t, e);
  18016. var r = t.getFlatCoordinates(), n = t.getStride(), i = this.coordinates.length,
  18017. o = this.appendFlatPointCoordinates(r, n);
  18018. this.instructions.push([Ig.DRAW_IMAGE, i, o, this.image_, this.anchorX_ * this.imagePixelRatio_, this.anchorY_ * this.imagePixelRatio_, Math.ceil(this.height_ * this.imagePixelRatio_), this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, [this.scale_[0] * this.pixelRatio / this.imagePixelRatio_, this.scale_[1] * this.pixelRatio / this.imagePixelRatio_], Math.ceil(this.width_ * this.imagePixelRatio_), this.declutterImageWithText_]), this.hitDetectionInstructions.push([Ig.DRAW_IMAGE, i, o, this.hitDetectionImage_, this.anchorX_, this.anchorY_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_, this.declutterImageWithText_]), this.endGeometry(e)
  18019. }
  18020. }, e.prototype.drawMultiPoint = function (t, e) {
  18021. if (this.image_) {
  18022. this.beginGeometry(t, e);
  18023. var r = t.getFlatCoordinates(), n = t.getStride(), i = this.coordinates.length,
  18024. o = this.appendFlatPointCoordinates(r, n);
  18025. this.instructions.push([Ig.DRAW_IMAGE, i, o, this.image_, this.anchorX_ * this.imagePixelRatio_, this.anchorY_ * this.imagePixelRatio_, Math.ceil(this.height_ * this.imagePixelRatio_), this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, [this.scale_[0] * this.pixelRatio / this.imagePixelRatio_, this.scale_[1] * this.pixelRatio / this.imagePixelRatio_], Math.ceil(this.width_ * this.imagePixelRatio_), this.declutterImageWithText_]), this.hitDetectionInstructions.push([Ig.DRAW_IMAGE, i, o, this.hitDetectionImage_, this.anchorX_, this.anchorY_, this.height_, this.opacity_, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_, this.declutterImageWithText_]), this.endGeometry(e)
  18026. }
  18027. }, e.prototype.finish = function () {
  18028. return this.reverseHitDetectionInstructions(), this.anchorX_ = void 0, this.anchorY_ = void 0, this.hitDetectionImage_ = null, this.image_ = null, this.imagePixelRatio_ = void 0, this.height_ = void 0, this.scale_ = void 0, this.opacity_ = void 0, this.originX_ = void 0, this.originY_ = void 0, this.rotateWithView_ = void 0, this.rotation_ = void 0, this.width_ = void 0, t.prototype.finish.call(this)
  18029. }, e.prototype.setImageStyle = function (t, e) {
  18030. var r = t.getAnchor(), n = t.getSize(), i = t.getHitDetectionImage(), o = t.getImage(this.pixelRatio),
  18031. a = t.getOrigin();
  18032. this.imagePixelRatio_ = t.getPixelRatio(this.pixelRatio), this.anchorX_ = r[0], this.anchorY_ = r[1], this.hitDetectionImage_ = i, this.image_ = o, this.height_ = n[1], this.opacity_ = t.getOpacity(), this.originX_ = a[0], this.originY_ = a[1], this.rotateWithView_ = t.getRotateWithView(), this.rotation_ = t.getRotation(), this.scale_ = t.getScaleArray(), this.width_ = n[0], this.declutterImageWithText_ = e
  18033. }, e
  18034. }(Mg), kg = function () {
  18035. var t = function (e, r) {
  18036. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  18037. t.__proto__ = e
  18038. } || function (t, e) {
  18039. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  18040. })(e, r)
  18041. };
  18042. return function (e, r) {
  18043. function n() {
  18044. this.constructor = e
  18045. }
  18046. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  18047. }
  18048. }(), jg = function (t) {
  18049. function e(e, r, n, i) {
  18050. return t.call(this, e, r, n, i) || this
  18051. }
  18052. return kg(e, t), e.prototype.drawFlatCoordinates_ = function (t, e, r, n) {
  18053. var i = this.coordinates.length, o = this.appendFlatLineCoordinates(t, e, r, n, !1, !1),
  18054. a = [Ig.MOVE_TO_LINE_TO, i, o];
  18055. return this.instructions.push(a), this.hitDetectionInstructions.push(a), r
  18056. }, e.prototype.drawLineString = function (t, e) {
  18057. var r = this.state, n = r.strokeStyle, i = r.lineWidth;
  18058. if (void 0 !== n && void 0 !== i) {
  18059. this.updateStrokeStyle(r, this.applyStroke), this.beginGeometry(t, e), this.hitDetectionInstructions.push([Ig.SET_STROKE_STYLE, r.strokeStyle, r.lineWidth, r.lineCap, r.lineJoin, r.miterLimit, r.lineDash, r.lineDashOffset], Pg);
  18060. var o = t.getFlatCoordinates(), a = t.getStride();
  18061. this.drawFlatCoordinates_(o, 0, o.length, a), this.hitDetectionInstructions.push(Og), this.endGeometry(e)
  18062. }
  18063. }, e.prototype.drawMultiLineString = function (t, e) {
  18064. var r = this.state, n = r.strokeStyle, i = r.lineWidth;
  18065. if (void 0 !== n && void 0 !== i) {
  18066. this.updateStrokeStyle(r, this.applyStroke), this.beginGeometry(t, e), this.hitDetectionInstructions.push([Ig.SET_STROKE_STYLE, r.strokeStyle, r.lineWidth, r.lineCap, r.lineJoin, r.miterLimit, r.lineDash, r.lineDashOffset], Pg);
  18067. for (var o = t.getEnds(), a = t.getFlatCoordinates(), s = t.getStride(), l = 0, u = 0, c = o.length; u < c; ++u) l = this.drawFlatCoordinates_(a, l, o[u], s);
  18068. this.hitDetectionInstructions.push(Og), this.endGeometry(e)
  18069. }
  18070. }, e.prototype.finish = function () {
  18071. var e = this.state;
  18072. return null != e.lastStroke && e.lastStroke != this.coordinates.length && this.instructions.push(Og), this.reverseHitDetectionInstructions(), this.state = null, t.prototype.finish.call(this)
  18073. }, e.prototype.applyStroke = function (e) {
  18074. null != e.lastStroke && e.lastStroke != this.coordinates.length && (this.instructions.push(Og), e.lastStroke = this.coordinates.length), e.lastStroke = 0, t.prototype.applyStroke.call(this, e), this.instructions.push(Pg)
  18075. }, e
  18076. }(Mg), Ng = function () {
  18077. var t = function (e, r) {
  18078. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  18079. t.__proto__ = e
  18080. } || function (t, e) {
  18081. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  18082. })(e, r)
  18083. };
  18084. return function (e, r) {
  18085. function n() {
  18086. this.constructor = e
  18087. }
  18088. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  18089. }
  18090. }(), Dg = function (t) {
  18091. function e(e, r, n, i) {
  18092. return t.call(this, e, r, n, i) || this
  18093. }
  18094. return Ng(e, t), e.prototype.drawFlatCoordinatess_ = function (t, e, r, n) {
  18095. var i = this.state, o = void 0 !== i.fillStyle, a = void 0 !== i.strokeStyle, s = r.length;
  18096. this.instructions.push(Pg), this.hitDetectionInstructions.push(Pg);
  18097. for (var l = 0; l < s; ++l) {
  18098. var u = r[l], c = this.coordinates.length, h = this.appendFlatLineCoordinates(t, e, u, n, !0, !a),
  18099. p = [Ig.MOVE_TO_LINE_TO, c, h];
  18100. this.instructions.push(p), this.hitDetectionInstructions.push(p), a && (this.instructions.push(Rg), this.hitDetectionInstructions.push(Rg)), e = u
  18101. }
  18102. return o && (this.instructions.push(Cg), this.hitDetectionInstructions.push(Cg)), a && (this.instructions.push(Og), this.hitDetectionInstructions.push(Og)), e
  18103. }, e.prototype.drawCircle = function (t, e) {
  18104. var r = this.state, n = r.fillStyle, i = r.strokeStyle;
  18105. if (void 0 !== n || void 0 !== i) {
  18106. this.setFillStrokeStyles_(), this.beginGeometry(t, e), void 0 !== r.fillStyle && this.hitDetectionInstructions.push([Ig.SET_FILL_STYLE, "#000"]), void 0 !== r.strokeStyle && this.hitDetectionInstructions.push([Ig.SET_STROKE_STYLE, r.strokeStyle, r.lineWidth, r.lineCap, r.lineJoin, r.miterLimit, r.lineDash, r.lineDashOffset]);
  18107. var o = t.getFlatCoordinates(), a = t.getStride(), s = this.coordinates.length;
  18108. this.appendFlatLineCoordinates(o, 0, o.length, a, !1, !1);
  18109. var l = [Ig.CIRCLE, s];
  18110. this.instructions.push(Pg, l), this.hitDetectionInstructions.push(Pg, l), void 0 !== r.fillStyle && (this.instructions.push(Cg), this.hitDetectionInstructions.push(Cg)), void 0 !== r.strokeStyle && (this.instructions.push(Og), this.hitDetectionInstructions.push(Og)), this.endGeometry(e)
  18111. }
  18112. }, e.prototype.drawPolygon = function (t, e) {
  18113. var r = this.state, n = r.fillStyle, i = r.strokeStyle;
  18114. if (void 0 !== n || void 0 !== i) {
  18115. this.setFillStrokeStyles_(), this.beginGeometry(t, e), void 0 !== r.fillStyle && this.hitDetectionInstructions.push([Ig.SET_FILL_STYLE, "#000"]), void 0 !== r.strokeStyle && this.hitDetectionInstructions.push([Ig.SET_STROKE_STYLE, r.strokeStyle, r.lineWidth, r.lineCap, r.lineJoin, r.miterLimit, r.lineDash, r.lineDashOffset]);
  18116. var o = t.getEnds(), a = t.getOrientedFlatCoordinates(), s = t.getStride();
  18117. this.drawFlatCoordinatess_(a, 0, o, s), this.endGeometry(e)
  18118. }
  18119. }, e.prototype.drawMultiPolygon = function (t, e) {
  18120. var r = this.state, n = r.fillStyle, i = r.strokeStyle;
  18121. if (void 0 !== n || void 0 !== i) {
  18122. this.setFillStrokeStyles_(), this.beginGeometry(t, e), void 0 !== r.fillStyle && this.hitDetectionInstructions.push([Ig.SET_FILL_STYLE, "#000"]), void 0 !== r.strokeStyle && this.hitDetectionInstructions.push([Ig.SET_STROKE_STYLE, r.strokeStyle, r.lineWidth, r.lineCap, r.lineJoin, r.miterLimit, r.lineDash, r.lineDashOffset]);
  18123. for (var o = t.getEndss(), a = t.getOrientedFlatCoordinates(), s = t.getStride(), l = 0, u = 0, c = o.length; u < c; ++u) l = this.drawFlatCoordinatess_(a, l, o[u], s);
  18124. this.endGeometry(e)
  18125. }
  18126. }, e.prototype.finish = function () {
  18127. this.reverseHitDetectionInstructions(), this.state = null;
  18128. var e = this.tolerance;
  18129. if (0 !== e) for (var r = this.coordinates, n = 0, i = r.length; n < i; ++n) r[n] = Fn(r[n], e);
  18130. return t.prototype.finish.call(this)
  18131. }, e.prototype.setFillStrokeStyles_ = function () {
  18132. var t = this.state;
  18133. void 0 !== t.fillStyle && this.updateFillStyle(t, this.createFill), void 0 !== t.strokeStyle && this.updateStrokeStyle(t, this.applyStroke)
  18134. }, e
  18135. }(Mg);
  18136. function Gg(t, e, r, n, i) {
  18137. var o, a, s, l, u, c, h, p, f, d = r, g = r, y = 0, m = 0, v = r;
  18138. for (o = r; o < n; o += i) {
  18139. var _ = e[o], b = e[o + 1];
  18140. void 0 !== l && (p = _ - l, f = b - u, s = Math.sqrt(p * p + f * f), void 0 !== c && (m += a, Math.acos((c * p + h * f) / (a * s)) > t && (m > y && (y = m, d = v, g = o), m = 0, v = o - i)), a = s, c = p, h = f), l = _, u = b
  18141. }
  18142. return (m += s) > y ? [v, o] : [d, g]
  18143. }
  18144. var zg = function () {
  18145. var t = function (e, r) {
  18146. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  18147. t.__proto__ = e
  18148. } || function (t, e) {
  18149. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  18150. })(e, r)
  18151. };
  18152. return function (e, r) {
  18153. function n() {
  18154. this.constructor = e
  18155. }
  18156. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  18157. }
  18158. }(), Ug = {
  18159. left: 0,
  18160. end: 0,
  18161. center: .5,
  18162. right: 1,
  18163. start: 1,
  18164. top: 0,
  18165. middle: .5,
  18166. hanging: .2,
  18167. alphabetic: .8,
  18168. ideographic: .8,
  18169. bottom: 1
  18170. }, Bg = function (t) {
  18171. function e(e, r, n, i) {
  18172. var o = t.call(this, e, r, n, i) || this;
  18173. return o.labels_ = null, o.text_ = "", o.textOffsetX_ = 0, o.textOffsetY_ = 0, o.textRotateWithView_ = void 0, o.textRotation_ = 0, o.textFillState_ = null, o.fillStates = {}, o.textStrokeState_ = null, o.strokeStates = {}, o.textState_ = {}, o.textStates = {}, o.textKey_ = "", o.fillKey_ = "", o.strokeKey_ = "", o.declutterImageWithText_ = void 0, o
  18174. }
  18175. return zg(e, t), e.prototype.finish = function () {
  18176. var e = t.prototype.finish.call(this);
  18177. return e.textStates = this.textStates, e.fillStates = this.fillStates, e.strokeStates = this.strokeStates, e
  18178. }, e.prototype.drawText = function (t, e) {
  18179. var r = this.textFillState_, n = this.textStrokeState_, i = this.textState_;
  18180. if ("" !== this.text_ && i && (r || n)) {
  18181. var o = this.coordinates, a = o.length, s = t.getType(), l = null, u = t.getStride();
  18182. if (i.placement !== Ep || s != bt.LINE_STRING && s != bt.MULTI_LINE_STRING && s != bt.POLYGON && s != bt.MULTI_POLYGON) {
  18183. var c = i.overflow ? null : [];
  18184. switch (s) {
  18185. case bt.POINT:
  18186. case bt.MULTI_POINT:
  18187. l = t.getFlatCoordinates();
  18188. break;
  18189. case bt.LINE_STRING:
  18190. l = t.getFlatMidpoint();
  18191. break;
  18192. case bt.CIRCLE:
  18193. l = t.getCenter();
  18194. break;
  18195. case bt.MULTI_LINE_STRING:
  18196. l = t.getFlatMidpoints(), u = 2;
  18197. break;
  18198. case bt.POLYGON:
  18199. l = t.getFlatInteriorPoint(), i.overflow || c.push(l[2] / this.resolution), u = 3;
  18200. break;
  18201. case bt.MULTI_POLYGON:
  18202. var h = t.getFlatInteriorPoints();
  18203. l = [];
  18204. for (x = 0, w = h.length; x < w; x += 3) i.overflow || c.push(h[x + 2] / this.resolution), l.push(h[x], h[x + 1]);
  18205. if (0 === l.length) return;
  18206. u = 2
  18207. }
  18208. if ((R = this.appendFlatPointCoordinates(l, u)) === a) return;
  18209. this.saveTextStates_(), (i.backgroundFill || i.backgroundStroke) && (this.setFillStrokeStyle(i.backgroundFill, i.backgroundStroke), i.backgroundFill && (this.updateFillStyle(this.state, this.createFill), this.hitDetectionInstructions.push(this.createFill(this.state))), i.backgroundStroke && (this.updateStrokeStyle(this.state, this.applyStroke), this.hitDetectionInstructions.push(this.createStroke(this.state)))), this.beginGeometry(t, e);
  18210. var p = i.padding;
  18211. if (p != fa && (i.scale[0] < 0 || i.scale[1] < 0)) {
  18212. var f = i.padding[0], d = i.padding[1], g = i.padding[2], y = i.padding[3];
  18213. i.scale[0] < 0 && (d = -d, y = -y), i.scale[1] < 0 && (f = -f, g = -g), p = [f, d, g, y]
  18214. }
  18215. var m = this.pixelRatio;
  18216. this.instructions.push([Ig.DRAW_IMAGE, a, R, null, NaN, NaN, NaN, 1, 0, 0, this.textRotateWithView_, this.textRotation_, [1, 1], NaN, this.declutterImageWithText_, p == fa ? fa : p.map((function (t) {
  18217. return t * m
  18218. })), !!i.backgroundFill, !!i.backgroundStroke, this.text_, this.textKey_, this.strokeKey_, this.fillKey_, this.textOffsetX_, this.textOffsetY_, c]);
  18219. var v = 1 / m;
  18220. this.hitDetectionInstructions.push([Ig.DRAW_IMAGE, a, R, null, NaN, NaN, NaN, 1, 0, 0, this.textRotateWithView_, this.textRotation_, [v, v], NaN, this.declutterImageWithText_, p, !!i.backgroundFill, !!i.backgroundStroke, this.text_, this.textKey_, this.strokeKey_, this.fillKey_, this.textOffsetX_, this.textOffsetY_, c]), this.endGeometry(e)
  18221. } else {
  18222. if (!Re(this.getBufferedMaxExtent(), t.getExtent())) return;
  18223. var _ = void 0;
  18224. if (l = t.getFlatCoordinates(), s == bt.LINE_STRING) _ = [l.length]; else if (s == bt.MULTI_LINE_STRING) _ = t.getEnds(); else if (s == bt.POLYGON) _ = t.getEnds().slice(0, 1); else if (s == bt.MULTI_POLYGON) {
  18225. var b = t.getEndss();
  18226. _ = [];
  18227. for (var x = 0, w = b.length; x < w; ++x) _.push(b[x][0])
  18228. }
  18229. this.beginGeometry(t, e);
  18230. for (var S = i.textAlign, E = 0, T = void 0, C = 0, O = _.length; C < O; ++C) {
  18231. if (null == S) {
  18232. var P = Gg(i.maxAngle, l, E, _[C], u);
  18233. E = P[0], T = P[1]
  18234. } else T = _[C];
  18235. for (var x = E; x < T; x += u) o.push(l[x], l[x + 1]);
  18236. var R = o.length;
  18237. E = _[C], this.drawChars_(a, R), a = R
  18238. }
  18239. this.endGeometry(e)
  18240. }
  18241. }
  18242. }, e.prototype.saveTextStates_ = function () {
  18243. var t = this.textStrokeState_, e = this.textState_, r = this.textFillState_, n = this.strokeKey_;
  18244. t && (n in this.strokeStates || (this.strokeStates[n] = {
  18245. strokeStyle: t.strokeStyle,
  18246. lineCap: t.lineCap,
  18247. lineDashOffset: t.lineDashOffset,
  18248. lineWidth: t.lineWidth,
  18249. lineJoin: t.lineJoin,
  18250. miterLimit: t.miterLimit,
  18251. lineDash: t.lineDash
  18252. }));
  18253. var i = this.textKey_;
  18254. i in this.textStates || (this.textStates[i] = {
  18255. font: e.font,
  18256. textAlign: e.textAlign || "center",
  18257. textBaseline: e.textBaseline || "middle",
  18258. scale: e.scale
  18259. });
  18260. var o = this.fillKey_;
  18261. r && (o in this.fillStates || (this.fillStates[o] = {fillStyle: r.fillStyle}))
  18262. }, e.prototype.drawChars_ = function (t, e) {
  18263. var r = this.textStrokeState_, n = this.textState_, i = this.strokeKey_, o = this.textKey_, a = this.fillKey_;
  18264. this.saveTextStates_();
  18265. var s = this.pixelRatio, l = Ug[n.textBaseline], u = this.textOffsetY_ * s, c = this.text_,
  18266. h = r ? r.lineWidth * Math.abs(n.scale[0]) / 2 : 0;
  18267. this.instructions.push([Ig.DRAW_CHARS, t, e, l, n.overflow, a, n.maxAngle, s, u, i, h * s, c, o, 1]), this.hitDetectionInstructions.push([Ig.DRAW_CHARS, t, e, l, n.overflow, a, n.maxAngle, 1, u, i, h, c, o, 1 / s])
  18268. }, e.prototype.setTextStyle = function (t, e) {
  18269. var r, n, i;
  18270. if (t) {
  18271. var a = t.getFill();
  18272. a ? ((n = this.textFillState_) || (n = {}, this.textFillState_ = n), n.fillStyle = Tu(a.getColor() || "#000")) : (n = null, this.textFillState_ = n);
  18273. var s = t.getStroke();
  18274. if (s) {
  18275. (i = this.textStrokeState_) || (i = {}, this.textStrokeState_ = i);
  18276. var l = s.getLineDash(), u = s.getLineDashOffset(), c = s.getWidth(), h = s.getMiterLimit();
  18277. i.lineCap = s.getLineCap() || "round", i.lineDash = l ? l.slice() : pa, i.lineDashOffset = void 0 === u ? 0 : u, i.lineJoin = s.getLineJoin() || "round", i.lineWidth = void 0 === c ? 1 : c, i.miterLimit = void 0 === h ? 10 : h, i.strokeStyle = Tu(s.getColor() || "#000")
  18278. } else i = null, this.textStrokeState_ = i;
  18279. r = this.textState_;
  18280. var p = t.getFont() || "10px sans-serif";
  18281. ba(p);
  18282. var f = t.getScaleArray();
  18283. r.overflow = t.getOverflow(), r.font = p, r.maxAngle = t.getMaxAngle(), r.placement = t.getPlacement(), r.textAlign = t.getTextAlign(), r.textBaseline = t.getTextBaseline() || "middle", r.backgroundFill = t.getBackgroundFill(), r.backgroundStroke = t.getBackgroundStroke(), r.padding = t.getPadding() || fa, r.scale = void 0 === f ? [1, 1] : f;
  18284. var d = t.getOffsetX(), g = t.getOffsetY(), y = t.getRotateWithView(), m = t.getRotation();
  18285. this.text_ = t.getText() || "", this.textOffsetX_ = void 0 === d ? 0 : d, this.textOffsetY_ = void 0 === g ? 0 : g, this.textRotateWithView_ = void 0 !== y && y, this.textRotation_ = void 0 === m ? 0 : m, this.strokeKey_ = i ? ("string" == typeof i.strokeStyle ? i.strokeStyle : o(i.strokeStyle)) + i.lineCap + i.lineDashOffset + "|" + i.lineWidth + i.lineJoin + i.miterLimit + "[" + i.lineDash.join() + "]" : "", this.textKey_ = r.font + r.scale + (r.textAlign || "?") + (r.textBaseline || "?"), this.fillKey_ = n ? "string" == typeof n.fillStyle ? n.fillStyle : "|" + o(n.fillStyle) : ""
  18286. } else this.text_ = "";
  18287. this.declutterImageWithText_ = e
  18288. }, e
  18289. }(Mg), Vg = {Circle: Dg, Default: Mg, Image: Ag, LineString: jg, Polygon: Dg, Text: Bg}, Yg = function () {
  18290. function t(t, e, r, n) {
  18291. this.tolerance_ = t, this.maxExtent_ = e, this.pixelRatio_ = n, this.resolution_ = r, this.buildersByZIndex_ = {}
  18292. }
  18293. return t.prototype.finish = function () {
  18294. var t = {};
  18295. for (var e in this.buildersByZIndex_) {
  18296. t[e] = t[e] || {};
  18297. var r = this.buildersByZIndex_[e];
  18298. for (var n in r) {
  18299. var i = r[n].finish();
  18300. t[e][n] = i
  18301. }
  18302. }
  18303. return t
  18304. }, t.prototype.getBuilder = function (t, e) {
  18305. var r = void 0 !== t ? t.toString() : "0", n = this.buildersByZIndex_[r];
  18306. void 0 === n && (n = {}, this.buildersByZIndex_[r] = n);
  18307. var i = n[e];
  18308. void 0 === i && (i = new (0, Vg[e])(this.tolerance_, this.maxExtent_, this.resolution_, this.pixelRatio_), n[e] = i);
  18309. return i
  18310. }, t
  18311. }();
  18312. function Wg(t, e, r, n, i, o, a, s, l, u, c, h) {
  18313. var p = t[e], f = t[e + 1], d = 0, g = 0, y = 0, m = 0;
  18314. function v() {
  18315. d = p, g = f, p = t[e += n], f = t[e + 1], m += y, y = Math.sqrt((p - d) * (p - d) + (f - g) * (f - g))
  18316. }
  18317. do {
  18318. v()
  18319. } while (e < r - n && m + y < o);
  18320. for (var _ = (o - m) / y, b = qe(d, p, _), x = qe(g, f, _), w = e - n, S = m, E = o + s * l(u, i, c); e < r - n && m + y < E;) v();
  18321. var T, C = qe(d, p, _ = (E - m) / y), O = qe(g, f, _);
  18322. if (h) {
  18323. var P = [b, x, C, O];
  18324. un(P, 0, 4, 2, h, P, P), T = P[0] > P[2]
  18325. } else T = b > C;
  18326. var R, I = Math.PI, L = [], M = w + n === e;
  18327. if (y = 0, m = S, p = t[e = w], f = t[e + 1], M) {
  18328. v();
  18329. var F = Math.atan2(f - g, p - d);
  18330. T && (F += F > 0 ? -I : I);
  18331. var A = (C + b) / 2, k = (O + x) / 2;
  18332. return L[0] = [A, k, (E - o) / 2, F, i], L
  18333. }
  18334. for (var j = 0, N = i.length; j < N;) {
  18335. v();
  18336. var D = Math.atan2(f - g, p - d);
  18337. if (T && (D += D > 0 ? -I : I), void 0 !== R) {
  18338. var G = D - R;
  18339. if (G += G > I ? -2 * I : G < -I ? 2 * I : 0, Math.abs(G) > a) return null
  18340. }
  18341. R = D;
  18342. for (var z = j, U = 0; j < N; ++j) {
  18343. var B = s * l(u, i[T ? N - j - 1 : j], c);
  18344. if (e + n < r && m + y < o + U + B / 2) break;
  18345. U += B
  18346. }
  18347. if (j !== z) {
  18348. var V = T ? i.substring(N - z, N - j) : i.substring(z, j);
  18349. A = qe(d, p, _ = (o + U / 2 - m) / y), k = qe(g, f, _);
  18350. L.push([A, k, U / 2, D, V]), o += U
  18351. }
  18352. }
  18353. return L
  18354. }
  18355. function qg(t, e, r, n) {
  18356. for (var i = t[e], o = t[e + 1], a = 0, s = e + n; s < r; s += n) {
  18357. var l = t[s], u = t[s + 1];
  18358. a += Math.sqrt((l - i) * (l - i) + (u - o) * (u - o)), i = l, o = u
  18359. }
  18360. return a
  18361. }
  18362. var Xg = [1 / 0, 1 / 0, -1 / 0, -1 / 0], Zg = [], Kg = [], Hg = [], $g = [];
  18363. function Jg(t) {
  18364. return t[3].declutterBox
  18365. }
  18366. var Qg = new RegExp("[" + String.fromCharCode(1425) + "-" + String.fromCharCode(2303) + String.fromCharCode(64285) + "-" + String.fromCharCode(65023) + String.fromCharCode(65136) + "-" + String.fromCharCode(65276) + String.fromCharCode(67584) + "-" + String.fromCharCode(69631) + String.fromCharCode(124928) + "-" + String.fromCharCode(126975) + "]");
  18367. function ty(t, e) {
  18368. return "start" !== e && "end" !== e || Qg.test(t) || (e = "start" === e ? "left" : "right"), Ug[e]
  18369. }
  18370. var ey = function () {
  18371. function t(t, e, r, n, i) {
  18372. this.overlaps = r, this.pixelRatio = e, this.resolution = t, this.alignFill_, this.instructions = n.instructions, this.coordinates = n.coordinates, this.coordinateCache_ = {}, this.renderBuffer_ = i, this.renderedTransform_ = [1, 0, 0, 1, 0, 0], this.hitDetectionInstructions = n.hitDetectionInstructions, this.pixelCoordinates_ = null, this.viewRotation_ = 0, this.fillStates = n.fillStates || {}, this.strokeStates = n.strokeStates || {}, this.textStates = n.textStates || {}, this.widths_ = {}, this.labels_ = {}
  18373. }
  18374. return t.prototype.createLabel = function (t, e, r, n) {
  18375. var i = t + e + r + n;
  18376. if (this.labels_[i]) return this.labels_[i];
  18377. var o = n ? this.strokeStates[n] : null, a = r ? this.fillStates[r] : null, s = this.textStates[e],
  18378. l = this.pixelRatio, u = [s.scale[0] * l, s.scale[1] * l], c = ty(t, s.textAlign || "center"),
  18379. h = n && o.lineWidth ? o.lineWidth : 0, p = t.split("\n"), f = p.length, d = [], g = Ta(s.font, p, d),
  18380. y = xa(s.font), m = g + h, v = [], _ = (m + 2) * u[0], b = (y * f + h) * u[1], x = {
  18381. width: _ < 0 ? Math.floor(_) : Math.ceil(_),
  18382. height: b < 0 ? Math.floor(b) : Math.ceil(b),
  18383. contextInstructions: v
  18384. };
  18385. (1 == u[0] && 1 == u[1] || v.push("scale", u), v.push("font", s.font), n) && (v.push("strokeStyle", o.strokeStyle), v.push("lineWidth", h), v.push("lineCap", o.lineCap), v.push("lineJoin", o.lineJoin), v.push("miterLimit", o.miterLimit), (Yi ? OffscreenCanvasRenderingContext2D : CanvasRenderingContext2D).prototype.setLineDash && (v.push("setLineDash", [o.lineDash]), v.push("lineDashOffset", o.lineDashOffset)));
  18386. r && v.push("fillStyle", a.fillStyle), v.push("textBaseline", "middle"), v.push("textAlign", "center");
  18387. var w, S = .5 - c, E = c * m + S * h;
  18388. if (n) for (w = 0; w < f; ++w) v.push("strokeText", [p[w], E + S * d[w], .5 * (h + y) + w * y]);
  18389. if (r) for (w = 0; w < f; ++w) v.push("fillText", [p[w], E + S * d[w], .5 * (h + y) + w * y]);
  18390. return this.labels_[i] = x, x
  18391. }, t.prototype.replayTextBackground_ = function (t, e, r, n, i, o, a) {
  18392. t.beginPath(), t.moveTo.apply(t, e), t.lineTo.apply(t, r), t.lineTo.apply(t, n), t.lineTo.apply(t, i), t.lineTo.apply(t, e), o && (this.alignFill_ = o[2], this.fill_(t)), a && (this.setStrokeStyle_(t, a), t.stroke())
  18393. }, t.prototype.calculateImageOrLabelDimensions_ = function (t, e, r, n, i, o, a, s, l, u, c, h, p, f, d, g) {
  18394. var y, m = r - (a *= h[0]), v = n - (s *= h[1]), _ = i + l > t ? t - l : i, b = o + u > e ? e - u : o,
  18395. x = f[3] + _ * h[0] + f[1], w = f[0] + b * h[1] + f[2], S = m - f[3], E = v - f[0];
  18396. return (d || 0 !== c) && (Zg[0] = S, $g[0] = S, Zg[1] = E, Kg[1] = E, Kg[0] = S + x, Hg[0] = Kg[0], Hg[1] = E + w, $g[1] = Hg[1]), 0 !== c ? (It(y = kt([1, 0, 0, 1, 0, 0], r, n, 1, 1, c, -r, -n), Zg), It(y, Kg), It(y, Hg), It(y, $g), ie(Math.min(Zg[0], Kg[0], Hg[0], $g[0]), Math.min(Zg[1], Kg[1], Hg[1], $g[1]), Math.max(Zg[0], Kg[0], Hg[0], $g[0]), Math.max(Zg[1], Kg[1], Hg[1], $g[1]), Xg)) : ie(Math.min(S, S + x), Math.min(E, E + w), Math.max(S, S + x), Math.max(E, E + w), Xg), p && (m = Math.round(m), v = Math.round(v)), {
  18397. drawImageX: m,
  18398. drawImageY: v,
  18399. drawImageW: _,
  18400. drawImageH: b,
  18401. originX: l,
  18402. originY: u,
  18403. declutterBox: {minX: Xg[0], minY: Xg[1], maxX: Xg[2], maxY: Xg[3], value: g},
  18404. canvasTransform: y,
  18405. scale: h
  18406. }
  18407. }, t.prototype.replayImageOrLabel_ = function (t, e, r, n, i, o, a) {
  18408. var s = !(!o && !a), l = n.declutterBox, u = t.canvas, c = a ? a[2] * n.scale[0] / 2 : 0;
  18409. return l.minX - c <= u.width / e && l.maxX + c >= 0 && l.minY - c <= u.height / e && l.maxY + c >= 0 && (s && this.replayTextBackground_(t, Zg, Kg, Hg, $g, o, a), Oa(t, n.canvasTransform, i, r, n.originX, n.originY, n.drawImageW, n.drawImageH, n.drawImageX, n.drawImageY, n.scale)), !0
  18410. }, t.prototype.fill_ = function (t) {
  18411. if (this.alignFill_) {
  18412. var e = It(this.renderedTransform_, [0, 0]), r = 512 * this.pixelRatio;
  18413. t.save(), t.translate(e[0] % r, e[1] % r), t.rotate(this.viewRotation_)
  18414. }
  18415. t.fill(), this.alignFill_ && t.restore()
  18416. }, t.prototype.setStrokeStyle_ = function (t, e) {
  18417. t.strokeStyle = e[1], t.lineWidth = e[2], t.lineCap = e[3], t.lineJoin = e[4], t.miterLimit = e[5], t.setLineDash && (t.lineDashOffset = e[7], t.setLineDash(e[6]))
  18418. }, t.prototype.drawLabelWithPointPlacement_ = function (t, e, r, n) {
  18419. var i = this.textStates[e], o = this.createLabel(t, e, n, r), a = this.strokeStates[r], s = this.pixelRatio,
  18420. l = ty(t, i.textAlign || "center"), u = Ug[i.textBaseline || "middle"],
  18421. c = a && a.lineWidth ? a.lineWidth : 0;
  18422. return {
  18423. label: o,
  18424. anchorX: l * (o.width / s - 2 * i.scale[0]) + 2 * (.5 - l) * c,
  18425. anchorY: u * o.height / s + 2 * (.5 - u) * c
  18426. }
  18427. }, t.prototype.execute_ = function (t, e, r, n, i, o, a, s) {
  18428. var l;
  18429. this.pixelCoordinates_ && b(r, this.renderedTransform_) ? l = this.pixelCoordinates_ : (this.pixelCoordinates_ || (this.pixelCoordinates_ = []), l = ln(this.coordinates, 0, this.coordinates.length, 2, r, this.pixelCoordinates_), Rt(this.renderedTransform_, r));
  18430. for (var u, c, h, p, f, d, g, y, m, v, _, x, w, S, E, T, C = 0, O = n.length, P = 0, R = 0, I = 0, L = null, M = null, F = this.coordinateCache_, A = this.viewRotation_, k = Math.round(1e12 * Math.atan2(-r[1], r[0])) / 1e12, j = {
  18431. context: t,
  18432. pixelRatio: this.pixelRatio,
  18433. resolution: this.resolution,
  18434. rotation: A
  18435. }, N = this.instructions != n || this.overlaps ? 0 : 200; C < O;) {
  18436. var D = n[C];
  18437. switch (D[0]) {
  18438. case Ig.BEGIN_GEOMETRY:
  18439. w = D[1], T = D[3], w.getGeometry() ? void 0 === a || Re(a, T.getExtent()) ? ++C : C = D[2] + 1 : C = D[2];
  18440. break;
  18441. case Ig.BEGIN_PATH:
  18442. R > N && (this.fill_(t), R = 0), I > N && (t.stroke(), I = 0), R || I || (t.beginPath(), p = NaN, f = NaN), ++C;
  18443. break;
  18444. case Ig.CIRCLE:
  18445. var G = l[P = D[1]], z = l[P + 1], U = l[P + 2] - G, B = l[P + 3] - z, V = Math.sqrt(U * U + B * B);
  18446. t.moveTo(G + V, z), t.arc(G, z, V, 0, 2 * Math.PI, !0), ++C;
  18447. break;
  18448. case Ig.CLOSE_PATH:
  18449. t.closePath(), ++C;
  18450. break;
  18451. case Ig.CUSTOM:
  18452. P = D[1], u = D[2];
  18453. var Y = D[3], W = D[4], q = 6 == D.length ? D[5] : void 0;
  18454. j.geometry = Y, j.feature = w, C in F || (F[C] = []);
  18455. var X = F[C];
  18456. q ? q(l, P, u, 2, X) : (X[0] = l[P], X[1] = l[P + 1], X.length = 2), W(X, j), ++C;
  18457. break;
  18458. case Ig.DRAW_IMAGE:
  18459. P = D[1], u = D[2], y = D[3], c = D[4], h = D[5];
  18460. var Z = D[6], K = D[7], H = D[8], $ = D[9], J = D[10], Q = D[11], tt = D[12], et = D[13], rt = D[14];
  18461. if (!y && D.length >= 19) {
  18462. m = D[18], v = D[19], _ = D[20], x = D[21];
  18463. var nt = this.drawLabelWithPointPlacement_(m, v, _, x);
  18464. y = nt.label, D[3] = y;
  18465. var it = D[22];
  18466. c = (nt.anchorX - it) * this.pixelRatio, D[4] = c;
  18467. var ot = D[23];
  18468. h = (nt.anchorY - ot) * this.pixelRatio, D[5] = h, Z = y.height, D[6] = Z, et = y.width, D[13] = et
  18469. }
  18470. var at = void 0;
  18471. D.length > 24 && (at = D[24]);
  18472. var st = void 0, lt = void 0, ut = void 0;
  18473. D.length > 16 ? (st = D[15], lt = D[16], ut = D[17]) : (st = fa, lt = !1, ut = !1), J && k ? Q += A : J || k || (Q -= A);
  18474. for (var ct = 0; P < u; P += 2) if (!(at && at[ct++] < et / this.pixelRatio)) {
  18475. var ht = [t, e, y, Dt = this.calculateImageOrLabelDimensions_(y.width, y.height, l[P], l[P + 1], et, Z, c, h, H, $, Q, tt, i, st, lt || ut, w), K, lt ? L : null, ut ? M : null],
  18476. pt = void 0, ft = void 0;
  18477. if (s && rt) {
  18478. if (!rt[P]) {
  18479. rt[P] = ht;
  18480. continue
  18481. }
  18482. if (pt = rt[P], delete rt[P], ft = Jg(pt), s.collides(ft)) continue
  18483. }
  18484. s && s.collides(Dt.declutterBox) || (pt && (s && s.insert(ft), this.replayImageOrLabel_.apply(this, pt)), s && s.insert(Dt.declutterBox), this.replayImageOrLabel_.apply(this, ht))
  18485. }
  18486. ++C;
  18487. break;
  18488. case Ig.DRAW_CHARS:
  18489. var dt = D[1], gt = D[2], yt = D[3], mt = D[4];
  18490. x = D[5];
  18491. var vt = D[6], _t = D[7], bt = D[8];
  18492. _ = D[9];
  18493. var xt = D[10];
  18494. m = D[11], v = D[12];
  18495. var wt = [D[13], D[13]], St = this.textStates[v], Et = St.font, Tt = [St.scale[0] * _t, St.scale[1] * _t],
  18496. Ct = void 0;
  18497. Et in this.widths_ ? Ct = this.widths_[Et] : (Ct = {}, this.widths_[Et] = Ct);
  18498. var Ot = qg(l, dt, gt, 2), Pt = Math.abs(Tt[0]) * Ea(Et, m, Ct);
  18499. if (mt || Pt <= Ot) {
  18500. var It = this.textStates[v].textAlign,
  18501. Lt = Wg(l, dt, gt, 2, m, (Ot - Pt) * Ug[It], vt, Math.abs(Tt[0]), Ea, Et, Ct, k ? 0 : this.viewRotation_);
  18502. t:if (Lt) {
  18503. var Mt = [], Ft = void 0, At = void 0, kt = void 0, jt = void 0, Nt = void 0;
  18504. if (_) for (Ft = 0, At = Lt.length; Ft < At; ++Ft) {
  18505. kt = (Nt = Lt[Ft])[4], jt = this.createLabel(kt, v, "", _), c = Nt[2] + (Tt[0] < 0 ? -xt : xt), h = yt * jt.height + 2 * (.5 - yt) * xt * Tt[1] / Tt[0] - bt;
  18506. var Dt = this.calculateImageOrLabelDimensions_(jt.width, jt.height, Nt[0], Nt[1], jt.width, jt.height, c, h, 0, 0, Nt[3], wt, !1, fa, !1, w);
  18507. if (s && s.collides(Dt.declutterBox)) break t;
  18508. Mt.push([t, e, jt, Dt, 1, null, null])
  18509. }
  18510. if (x) for (Ft = 0, At = Lt.length; Ft < At; ++Ft) {
  18511. kt = (Nt = Lt[Ft])[4], jt = this.createLabel(kt, v, x, ""), c = Nt[2], h = yt * jt.height - bt;
  18512. Dt = this.calculateImageOrLabelDimensions_(jt.width, jt.height, Nt[0], Nt[1], jt.width, jt.height, c, h, 0, 0, Nt[3], wt, !1, fa, !1, w);
  18513. if (s && s.collides(Dt.declutterBox)) break t;
  18514. Mt.push([t, e, jt, Dt, 1, null, null])
  18515. }
  18516. s && s.load(Mt.map(Jg));
  18517. for (var Gt = 0, zt = Mt.length; Gt < zt; ++Gt) this.replayImageOrLabel_.apply(this, Mt[Gt])
  18518. }
  18519. }
  18520. ++C;
  18521. break;
  18522. case Ig.END_GEOMETRY:
  18523. if (void 0 !== o) {
  18524. var Ut = o(w = D[1], T);
  18525. if (Ut) return Ut
  18526. }
  18527. ++C;
  18528. break;
  18529. case Ig.FILL:
  18530. N ? R++ : this.fill_(t), ++C;
  18531. break;
  18532. case Ig.MOVE_TO_LINE_TO:
  18533. for (P = D[1], u = D[2], S = l[P], g = (E = l[P + 1]) + .5 | 0, (d = S + .5 | 0) === p && g === f || (t.moveTo(S, E), p = d, f = g), P += 2; P < u; P += 2) d = (S = l[P]) + .5 | 0, g = (E = l[P + 1]) + .5 | 0, P != u - 2 && d === p && g === f || (t.lineTo(S, E), p = d, f = g);
  18534. ++C;
  18535. break;
  18536. case Ig.SET_FILL_STYLE:
  18537. L = D, this.alignFill_ = D[2], R && (this.fill_(t), R = 0, I && (t.stroke(), I = 0)), t.fillStyle = D[1], ++C;
  18538. break;
  18539. case Ig.SET_STROKE_STYLE:
  18540. M = D, I && (t.stroke(), I = 0), this.setStrokeStyle_(t, D), ++C;
  18541. break;
  18542. case Ig.STROKE:
  18543. N ? I++ : t.stroke(), ++C;
  18544. break;
  18545. default:
  18546. ++C
  18547. }
  18548. }
  18549. R && this.fill_(t), I && t.stroke()
  18550. }, t.prototype.execute = function (t, e, r, n, i, o) {
  18551. this.viewRotation_ = n, this.execute_(t, e, r, this.instructions, i, void 0, void 0, o)
  18552. }, t.prototype.executeHitDetection = function (t, e, r, n, i) {
  18553. return this.viewRotation_ = r, this.execute_(t, 1, e, this.hitDetectionInstructions, !0, n, i)
  18554. }, t
  18555. }(), ry = [Bu, Du, Uu, zu, Vu, Gu], ny = function () {
  18556. function t(t, e, r, n, i, o) {
  18557. this.maxExtent_ = t, this.overlaps_ = n, this.pixelRatio_ = r, this.resolution_ = e, this.renderBuffer_ = o, this.executorsByZIndex_ = {}, this.hitDetectionContext_ = null, this.hitDetectionTransform_ = [1, 0, 0, 1, 0, 0], this.createExecutors_(i)
  18558. }
  18559. return t.prototype.clip = function (t, e) {
  18560. var r = this.getClipCoords(e);
  18561. t.beginPath(), t.moveTo(r[0], r[1]), t.lineTo(r[2], r[3]), t.lineTo(r[4], r[5]), t.lineTo(r[6], r[7]), t.clip()
  18562. }, t.prototype.createExecutors_ = function (t) {
  18563. for (var e in t) {
  18564. var r = this.executorsByZIndex_[e];
  18565. void 0 === r && (r = {}, this.executorsByZIndex_[e] = r);
  18566. var n = t[e], i = [this.renderBuffer_ || 0, this.renderBuffer_ || 0];
  18567. for (var o in n) {
  18568. var a = n[o];
  18569. r[o] = new ey(this.resolution_, this.pixelRatio_, this.overlaps_, a, i)
  18570. }
  18571. }
  18572. }, t.prototype.hasExecutors = function (t) {
  18573. for (var e in this.executorsByZIndex_) for (var r = this.executorsByZIndex_[e], n = 0, i = t.length; n < i; ++n) if (t[n] in r) return !0;
  18574. return !1
  18575. }, t.prototype.forEachFeatureAtCoordinate = function (t, e, r, n, i, o) {
  18576. var a = 2 * (n = Math.round(n)) + 1,
  18577. s = kt(this.hitDetectionTransform_, n + .5, n + .5, 1 / e, -1 / e, -r, -t[0], -t[1]),
  18578. l = !this.hitDetectionContext_;
  18579. l && (this.hitDetectionContext_ = uo(a, a));
  18580. var u, c = this.hitDetectionContext_;
  18581. c.canvas.width !== a || c.canvas.height !== a ? (c.canvas.width = a, c.canvas.height = a) : l || c.clearRect(0, 0, a, a), void 0 !== this.renderBuffer_ && (pe(u = [1 / 0, 1 / 0, -1 / 0, -1 / 0], t), Ht(u, e * (this.renderBuffer_ + n), u));
  18582. var h, p = oy(n);
  18583. function f(t, e) {
  18584. for (var r = c.getImageData(0, 0, a, a).data, s = 0, l = p.length; s < l; s++) if (r[p[s]] > 0) {
  18585. if (!o || h !== zu && h !== Vu || -1 !== o.indexOf(t)) {
  18586. var u = (p[s] - 3) / 4, f = n - u % a, d = n - (u / a | 0), g = i(t, e, f * f + d * d);
  18587. if (g) return g
  18588. }
  18589. c.clearRect(0, 0, a, a);
  18590. break
  18591. }
  18592. }
  18593. var g, y, m, v, _, b = Object.keys(this.executorsByZIndex_).map(Number);
  18594. for (b.sort(d), g = b.length - 1; g >= 0; --g) {
  18595. var x = b[g].toString();
  18596. for (m = this.executorsByZIndex_[x], y = ry.length - 1; y >= 0; --y) if (void 0 !== (v = m[h = ry[y]]) && (_ = v.executeHitDetection(c, s, r, f, u))) return _
  18597. }
  18598. }, t.prototype.getClipCoords = function (t) {
  18599. var e = this.maxExtent_;
  18600. if (!e) return null;
  18601. var r = e[0], n = e[1], i = e[2], o = e[3], a = [r, n, r, o, i, o, i, n];
  18602. return ln(a, 0, 8, 2, t, a), a
  18603. }, t.prototype.isEmpty = function () {
  18604. return I(this.executorsByZIndex_)
  18605. }, t.prototype.execute = function (t, e, r, n, i, o, a) {
  18606. var s = Object.keys(this.executorsByZIndex_).map(Number);
  18607. s.sort(d), this.maxExtent_ && (t.save(), this.clip(t, r));
  18608. var l, u, c, h, p, f, g = o || ry;
  18609. for (a && s.reverse(), l = 0, u = s.length; l < u; ++l) {
  18610. var y = s[l].toString();
  18611. for (p = this.executorsByZIndex_[y], c = 0, h = g.length; c < h; ++c) {
  18612. void 0 !== (f = p[g[c]]) && f.execute(t, e, r, n, i, a)
  18613. }
  18614. }
  18615. this.maxExtent_ && t.restore()
  18616. }, t
  18617. }(), iy = {};
  18618. function oy(t) {
  18619. if (void 0 !== iy[t]) return iy[t];
  18620. for (var e = 2 * t + 1, r = t * t, n = new Array(r + 1), i = 0; i <= t; ++i) for (var o = 0; o <= t; ++o) {
  18621. var a = i * i + o * o;
  18622. if (a > r) break;
  18623. var s = n[a];
  18624. s || (s = [], n[a] = s), s.push(4 * ((t + i) * e + (t + o)) + 3), i > 0 && s.push(4 * ((t - i) * e + (t + o)) + 3), o > 0 && (s.push(4 * ((t + i) * e + (t - o)) + 3), i > 0 && s.push(4 * ((t - i) * e + (t - o)) + 3))
  18625. }
  18626. for (var l = [], u = (i = 0, n.length); i < u; ++i) n[i] && l.push.apply(l, n[i]);
  18627. return iy[t] = l, l
  18628. }
  18629. var ay = ny;
  18630. function sy(t, e, r, n, i, o, a) {
  18631. var s = uo(t[0] / 2, t[1] / 2);
  18632. s.imageSmoothingEnabled = !1;
  18633. for (var l = s.canvas, u = new Nu(s, .5, i, null, a), c = r.length, h = Math.floor(16777215 / c), p = {}, f = 1; f <= c; ++f) {
  18634. var g = r[f - 1], y = g.getStyleFunction() || n;
  18635. if (n) {
  18636. var m = y(g, o);
  18637. if (m) {
  18638. Array.isArray(m) || (m = [m]);
  18639. for (var v = "#" + ("000000" + (f * h).toString(16)).slice(-6), _ = 0, b = m.length; _ < b; ++_) {
  18640. var x = m[_], w = x.clone(), S = w.getFill();
  18641. S && S.setColor(v);
  18642. var E = w.getStroke();
  18643. E && E.setColor(v), w.setText(void 0);
  18644. var T = x.getImage();
  18645. if (T) {
  18646. var C = T.getImageSize();
  18647. if (!C) continue;
  18648. var O = document.createElement("canvas");
  18649. O.width = C[0], O.height = C[1];
  18650. var P = O.getContext("2d", {alpha: !1});
  18651. P.fillStyle = v;
  18652. var R = P.canvas;
  18653. P.fillRect(0, 0, R.width, R.height), uo(C ? C[0] : R.width, C ? C[1] : R.height).drawImage(R, 0, 0), w.setImage(new dp({
  18654. img: R,
  18655. imgSize: C,
  18656. anchor: T.getAnchor(),
  18657. anchorXUnits: np,
  18658. anchorYUnits: np,
  18659. offset: T.getOrigin(),
  18660. size: T.getSize(),
  18661. opacity: T.getOpacity(),
  18662. scale: T.getScale(),
  18663. rotation: T.getRotation(),
  18664. rotateWithView: T.getRotateWithView()
  18665. }))
  18666. }
  18667. var I = Number(w.getZIndex());
  18668. (A = p[I]) || (A = {}, p[I] = A, A[bt.POLYGON] = [], A[bt.CIRCLE] = [], A[bt.LINE_STRING] = [], A[bt.POINT] = []);
  18669. var L = w.getGeometryFunction()(g);
  18670. L && Re(i, L.getExtent()) && A[L.getType().replace("Multi", "")].push(L, w)
  18671. }
  18672. }
  18673. }
  18674. }
  18675. for (var M = Object.keys(p).map(Number).sort(d), F = (f = 0, M.length); f < F; ++f) {
  18676. var A = p[M[f]];
  18677. for (var k in A) {
  18678. var j = A[k];
  18679. for (_ = 0, b = j.length; _ < b; _ += 2) {
  18680. u.setStyle(j[_ + 1]);
  18681. for (var N = 0, D = e.length; N < D; ++N) u.setTransform(e[N]), u.drawGeometry(j[_])
  18682. }
  18683. }
  18684. }
  18685. return s.getImageData(0, 0, l.width, l.height)
  18686. }
  18687. function ly(t, e, r) {
  18688. var n = [];
  18689. if (r) {
  18690. var i = 4 * (Math.round(t[0] / 2) + Math.round(t[1] / 2) * r.width), o = r.data[i], a = r.data[i + 1],
  18691. s = r.data[i + 2] + 256 * (a + 256 * o), l = Math.floor(16777215 / e.length);
  18692. s && s % l == 0 && n.push(e[s / l - 1])
  18693. }
  18694. return n
  18695. }
  18696. var uy = function () {
  18697. var t = function (e, r) {
  18698. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  18699. t.__proto__ = e
  18700. } || function (t, e) {
  18701. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  18702. })(e, r)
  18703. };
  18704. return function (e, r) {
  18705. function n() {
  18706. this.constructor = e
  18707. }
  18708. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  18709. }
  18710. }(), cy = function (t) {
  18711. function e(e) {
  18712. var r = t.call(this, e) || this;
  18713. return r.boundHandleStyleImageChange_ = r.handleStyleImageChange_.bind(r), r.animatingOrInteracting_, r.dirty_ = !1, r.hitDetectionImageData_ = null, r.renderedFeatures_ = null, r.renderedRevision_ = -1, r.renderedResolution_ = NaN, r.renderedExtent_ = [1 / 0, 1 / 0, -1 / 0, -1 / 0], r.renderedRotation_, r.renderedCenter_ = null, r.renderedProjection_ = null, r.renderedRenderOrder_ = null, r.replayGroup_ = null, r.replayGroupChanged = !0, r.declutterExecutorGroup = null, r.clipping = !0, r
  18714. }
  18715. return uy(e, t), e.prototype.useContainer = function (e, r, n) {
  18716. n < 1 && (e = null), t.prototype.useContainer.call(this, e, r, n)
  18717. }, e.prototype.renderWorlds = function (t, e, r) {
  18718. var n = e.extent, i = e.viewState, o = i.center, a = i.resolution, s = i.projection, l = i.rotation,
  18719. u = s.getExtent(), c = this.getLayer().getSource(), h = e.pixelRatio, p = e.viewHints, f = !(p[ns] || p[is]),
  18720. d = this.context, g = Math.round(e.size[0] * h), y = Math.round(e.size[1] * h),
  18721. m = c.getWrapX() && s.canWrapX(), v = m ? Pe(u) : null, _ = m ? Math.ceil((n[2] - u[2]) / v) + 1 : 1,
  18722. b = m ? Math.floor((n[0] - u[0]) / v) : 0;
  18723. do {
  18724. var x = this.getRenderTransform(o, a, l, h, g, y, b * v);
  18725. t.execute(d, 1, x, l, f, void 0, r)
  18726. } while (++b < _)
  18727. }, e.prototype.renderDeclutter = function (t) {
  18728. this.declutterExecutorGroup && this.renderWorlds(this.declutterExecutorGroup, t, t.declutterTree)
  18729. }, e.prototype.renderFrame = function (t, e) {
  18730. var r = t.pixelRatio, n = t.layerStatesArray[t.layerIndex];
  18731. Ft(this.pixelTransform, 1 / r, 1 / r), jt(this.inversePixelTransform, this.pixelTransform);
  18732. var i = Dt(this.pixelTransform);
  18733. this.useContainer(e, i, n.opacity);
  18734. var o = this.context, a = o.canvas, s = this.replayGroup_, l = this.declutterExecutorGroup;
  18735. if ((!s || s.isEmpty()) && (!l || l.isEmpty())) return !this.containerReused && a.width > 0 && (a.width = 0), this.container;
  18736. var u = Math.round(t.size[0] * r), c = Math.round(t.size[1] * r);
  18737. a.width != u || a.height != c ? (a.width = u, a.height = c, a.style.transform !== i && (a.style.transform = i)) : this.containerReused || o.clearRect(0, 0, u, c), this.preRender(o, t);
  18738. var h = t.viewState, p = h.projection, f = !1;
  18739. if (n.extent && this.clipping) {
  18740. var d = on(n.extent, p);
  18741. (f = !te(d, t.extent) && Re(d, t.extent)) && this.clipUnrotated(o, t, d)
  18742. }
  18743. this.renderWorlds(s, t), f && o.restore(), this.postRender(o, t);
  18744. var g = n.opacity, y = this.container;
  18745. return g !== parseFloat(y.style.opacity) && (y.style.opacity = 1 === g ? "" : String(g)), this.renderedRotation_ !== h.rotation && (this.renderedRotation_ = h.rotation, this.hitDetectionImageData_ = null), this.container
  18746. }, e.prototype.getFeatures = function (t) {
  18747. return new Promise(function (e) {
  18748. if (!this.hitDetectionImageData_ && !this.animatingOrInteracting_) {
  18749. var r = [this.context.canvas.width, this.context.canvas.height];
  18750. It(this.pixelTransform, r);
  18751. var n = this.renderedCenter_, i = this.renderedResolution_, o = this.renderedRotation_,
  18752. a = this.renderedProjection_, s = this.renderedExtent_, l = this.getLayer(), u = [], c = r[0] / 2,
  18753. h = r[1] / 2;
  18754. u.push(this.getRenderTransform(n, i, o, .5, c, h, 0).slice());
  18755. var p = l.getSource(), f = a.getExtent();
  18756. if (p.getWrapX() && a.canWrapX() && !te(f, s)) {
  18757. for (var d = s[0], g = Pe(f), y = 0, m = void 0; d < f[0];) m = g * --y, u.push(this.getRenderTransform(n, i, o, .5, c, h, m).slice()), d += g;
  18758. for (y = 0, d = s[2]; d > f[2];) m = g * ++y, u.push(this.getRenderTransform(n, i, o, .5, c, h, m).slice()), d -= g
  18759. }
  18760. this.hitDetectionImageData_ = sy(r, u, this.renderedFeatures_, l.getStyleFunction(), s, i, o)
  18761. }
  18762. e(ly(t, this.renderedFeatures_, this.hitDetectionImageData_))
  18763. }.bind(this))
  18764. }, e.prototype.forEachFeatureAtCoordinate = function (t, e, r, n, i) {
  18765. var a = this;
  18766. if (this.replayGroup_) {
  18767. var s, l = e.viewState.resolution, u = e.viewState.rotation, c = this.getLayer(), h = {},
  18768. p = function (t, e, r) {
  18769. var a = o(t), s = h[a];
  18770. if (s) {
  18771. if (!0 !== s && r < s.distanceSq) {
  18772. if (0 === r) return h[a] = !0, i.splice(i.lastIndexOf(s), 1), n(t, c, e);
  18773. s.geometry = e, s.distanceSq = r
  18774. }
  18775. } else {
  18776. if (0 === r) return h[a] = !0, n(t, c, e);
  18777. i.push(h[a] = {feature: t, layer: c, geometry: e, distanceSq: r, callback: n})
  18778. }
  18779. }, f = [this.replayGroup_];
  18780. return this.declutterExecutorGroup && f.push(this.declutterExecutorGroup), f.some((function (n) {
  18781. return s = n.forEachFeatureAtCoordinate(t, l, u, r, p, n === a.declutterExecutorGroup ? e.declutterTree.all().map((function (t) {
  18782. return t.value
  18783. })) : null)
  18784. })), s
  18785. }
  18786. }, e.prototype.handleFontsChanged = function () {
  18787. var t = this.getLayer();
  18788. t.getVisible() && this.replayGroup_ && t.changed()
  18789. }, e.prototype.handleStyleImageChange_ = function (t) {
  18790. this.renderIfReadyAndVisible()
  18791. }, e.prototype.prepareFrame = function (t) {
  18792. var e = this.getLayer(), r = e.getSource();
  18793. if (!r) return !1;
  18794. var n = t.viewHints[ns], i = t.viewHints[is], o = e.getUpdateWhileAnimating(),
  18795. a = e.getUpdateWhileInteracting();
  18796. if (!this.dirty_ && !o && n || !a && i) return this.animatingOrInteracting_ = !0, !0;
  18797. this.animatingOrInteracting_ = !1;
  18798. var s = t.extent, l = t.viewState, u = l.projection, c = l.resolution, h = t.pixelRatio, p = e.getRevision(),
  18799. f = e.getRenderBuffer(), d = e.getRenderOrder();
  18800. void 0 === d && (d = Wu);
  18801. var g = l.center.slice(), y = Ht(s, f * c), m = [y.slice()], v = u.getExtent();
  18802. if (r.getWrapX() && u.canWrapX() && !te(v, t.extent)) {
  18803. var _ = Pe(v), b = Math.max(Pe(y) / 2, _);
  18804. y[0] = v[0] - b, y[2] = v[2] + b, Fr(g, u);
  18805. var x = ke(m[0], u);
  18806. x[0] < v[0] && x[2] < v[2] ? m.push([x[0] + _, x[1], x[2] + _, x[3]]) : x[0] > v[0] && x[2] > v[2] && m.push([x[0] - _, x[1], x[2] - _, x[3]])
  18807. }
  18808. if (!this.dirty_ && this.renderedResolution_ == c && this.renderedRevision_ == p && this.renderedRenderOrder_ == d && te(this.renderedExtent_, y)) return this.replayGroupChanged = !1, !0;
  18809. this.replayGroup_ = null, this.dirty_ = !1;
  18810. var w, S = new Yg(Xu(c, h), y, c, h);
  18811. this.getLayer().getDeclutter() && (w = new Yg(Xu(c, h), y, c, h));
  18812. var E, T = tn();
  18813. if (T) {
  18814. for (var C = 0, O = m.length; C < O; ++C) r.loadFeatures(nn(m[C], u), c, T);
  18815. E = Zr(T, u)
  18816. } else for (C = 0, O = m.length; C < O; ++C) r.loadFeatures(m[C], c, u);
  18817. var P = qu(c, h), R = function (t) {
  18818. var r, n = t.getStyleFunction() || e.getStyleFunction();
  18819. if (n && (r = n(t, c)), r) {
  18820. var i = this.renderFeature(t, P, r, S, E, w);
  18821. this.dirty_ = this.dirty_ || i
  18822. }
  18823. }.bind(this), I = nn(y, u), L = r.getFeaturesInExtent(I);
  18824. d && L.sort(d);
  18825. for (C = 0, O = L.length; C < O; ++C) R(L[C]);
  18826. this.renderedFeatures_ = L;
  18827. var M = S.finish(), F = new ay(y, c, h, r.getOverlaps(), M, e.getRenderBuffer());
  18828. return w && (this.declutterExecutorGroup = new ay(y, c, h, r.getOverlaps(), w.finish(), e.getRenderBuffer())), this.renderedResolution_ = c, this.renderedRevision_ = p, this.renderedRenderOrder_ = d, this.renderedExtent_ = y, this.renderedCenter_ = g, this.renderedProjection_ = u, this.replayGroup_ = F, this.hitDetectionImageData_ = null, this.replayGroupChanged = !0, !0
  18829. }, e.prototype.renderFeature = function (t, e, r, n, i, o) {
  18830. if (!r) return !1;
  18831. var a = !1;
  18832. if (Array.isArray(r)) for (var s = 0, l = r.length; s < l; ++s) a = Zu(n, t, r[s], e, this.boundHandleStyleImageChange_, i, o) || a; else a = Zu(n, t, r, e, this.boundHandleStyleImageChange_, i, o);
  18833. return a
  18834. }, e
  18835. }(cd), hy = function () {
  18836. var t = function (e, r) {
  18837. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  18838. t.__proto__ = e
  18839. } || function (t, e) {
  18840. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  18841. })(e, r)
  18842. };
  18843. return function (e, r) {
  18844. function n() {
  18845. this.constructor = e
  18846. }
  18847. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  18848. }
  18849. }(), py = function (t) {
  18850. function e(e) {
  18851. var r = t.call(this, e) || this;
  18852. return r.vectorRenderer_ = new cy(e), r.layerImageRatio_ = e.getImageRatio(), r.coordinateToVectorPixelTransform_ = [1, 0, 0, 1, 0, 0], r.renderedPixelToCoordinateTransform_ = null, r
  18853. }
  18854. return hy(e, t), e.prototype.disposeInternal = function () {
  18855. this.vectorRenderer_.dispose(), t.prototype.disposeInternal.call(this)
  18856. }, e.prototype.getFeatures = function (t) {
  18857. if (this.vectorRenderer_) {
  18858. var e = It(this.coordinateToVectorPixelTransform_, It(this.renderedPixelToCoordinateTransform_, t.slice()));
  18859. return this.vectorRenderer_.getFeatures(e)
  18860. }
  18861. return new Promise((function (t, e) {
  18862. t([])
  18863. }))
  18864. }, e.prototype.handleFontsChanged = function () {
  18865. this.vectorRenderer_.handleFontsChanged()
  18866. }, e.prototype.prepareFrame = function (t) {
  18867. var e = t.pixelRatio, r = t.viewState, n = r.resolution, i = t.viewHints, o = this.vectorRenderer_,
  18868. a = t.extent;
  18869. 1 !== this.layerImageRatio_ && Me(a = a.slice(0), this.layerImageRatio_);
  18870. var s = Pe(a) / n, l = Ee(a) / n;
  18871. if (!i[ns] && !i[is] && !Ie(a)) {
  18872. o.useContainer(null, null, 1);
  18873. var u = o.context, c = O({}, t, {
  18874. declutterTree: new Pp.a(9),
  18875. extent: a,
  18876. size: [s, l],
  18877. viewState: O({}, t.viewState, {rotation: 0})
  18878. }), h = new $i(a, n, e, u.canvas, (function (t) {
  18879. o.prepareFrame(c) && o.replayGroupChanged && (o.clipping = !1, o.renderFrame(c, null), o.renderDeclutter(c), t())
  18880. }));
  18881. h.addEventListener(F, function () {
  18882. if (h.getState() === ki) {
  18883. this.image_ = h;
  18884. var t = h.getResolution(), n = h.getPixelRatio(), i = t * e / n;
  18885. this.renderedResolution = i, this.coordinateToVectorPixelTransform_ = kt(this.coordinateToVectorPixelTransform_, s / 2, l / 2, 1 / i, -1 / i, 0, -r.center[0], -r.center[1])
  18886. }
  18887. }.bind(this)), h.load()
  18888. }
  18889. return this.image_ && (this.renderedPixelToCoordinateTransform_ = t.pixelToCoordinateTransform.slice()), !!this.image_
  18890. }, e.prototype.preRender = function () {
  18891. }, e.prototype.postRender = function () {
  18892. }, e.prototype.renderDeclutter = function () {
  18893. }, e.prototype.forEachFeatureAtCoordinate = function (e, r, n, i, o) {
  18894. return this.vectorRenderer_ ? this.vectorRenderer_.forEachFeatureAtCoordinate(e, r, n, i, o) : t.prototype.forEachFeatureAtCoordinate.call(this, e, r, n, i, o)
  18895. }, e
  18896. }(pd), fy = "image", dy = "hybrid", gy = "vector", yy = function () {
  18897. var t = function (e, r) {
  18898. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  18899. t.__proto__ = e
  18900. } || function (t, e) {
  18901. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  18902. })(e, r)
  18903. };
  18904. return function (e, r) {
  18905. function n() {
  18906. this.constructor = e
  18907. }
  18908. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  18909. }
  18910. }(), my = {image: [Bu, Du, Uu, zu, Vu], hybrid: [Bu, Uu], vector: []},
  18911. vy = {image: [Gu], hybrid: [zu, Vu, Gu], vector: [Bu, Du, Uu, zu, Vu, Gu]}, _y = function (t) {
  18912. function e(e) {
  18913. var r = t.call(this, e) || this;
  18914. return r.boundHandleStyleImageChange_ = r.handleStyleImageChange_.bind(r), r.dirty_ = !1, r.renderedLayerRevision_, r.renderedPixelToCoordinateTransform_ = null, r.renderedRotation_, r.renderTileImageQueue_ = {}, r.tileListenerKeys_ = {}, r.tmpTransform_ = [1, 0, 0, 1, 0, 0], r
  18915. }
  18916. return yy(e, t), e.prototype.prepareTile = function (t, e, r, n) {
  18917. var i, a = o(t), s = t.getState();
  18918. return (s === to && t.hifi || s === eo) && a in this.tileListenerKeys_ && (H(this.tileListenerKeys_[a]), delete this.tileListenerKeys_[a]), s !== to && s !== eo || (this.updateExecutorGroup_(t, e, r), this.tileImageNeedsRender_(t, e, r) && (i = !0, n && (this.renderTileImageQueue_[a] = t))), i
  18919. }, e.prototype.getTile = function (e, r, n, i) {
  18920. var a = i.pixelRatio, s = i.viewState, l = s.resolution, u = s.projection, c = this.getLayer(),
  18921. h = c.getSource().getTile(e, r, n, a, u);
  18922. if (h.getState() < to) {
  18923. h.wantedResolution = l;
  18924. var p = o(h);
  18925. if (!(p in this.tileListenerKeys_)) {
  18926. var f = Z(h, F, this.prepareTile.bind(this, h, a, u, !0));
  18927. this.tileListenerKeys_[p] = f
  18928. }
  18929. } else {
  18930. var d = i.viewHints;
  18931. !!(d[ns] || d[is]) && h.wantedResolution || (h.wantedResolution = l), this.prepareTile(h, a, u, !1) && c.getRenderMode() !== gy && this.renderTileImage_(h, i)
  18932. }
  18933. return t.prototype.getTile.call(this, e, r, n, i)
  18934. }, e.prototype.isDrawableTile = function (e) {
  18935. var r = this.getLayer();
  18936. return t.prototype.isDrawableTile.call(this, e) && (r.getRenderMode() === gy ? o(r) in e.executorGroups : e.hasContext(r))
  18937. }, e.prototype.getTileImage = function (t) {
  18938. return t.getImage(this.getLayer())
  18939. }, e.prototype.prepareFrame = function (e) {
  18940. var r = this.getLayer().getRevision();
  18941. return this.renderedLayerRevision_ != r && (this.renderedTiles.length = 0), this.renderedLayerRevision_ = r, t.prototype.prepareFrame.call(this, e)
  18942. }, e.prototype.updateExecutorGroup_ = function (t, e, r) {
  18943. var n = this.getLayer(), i = n.getRevision(), a = n.getRenderOrder() || null, s = t.wantedResolution,
  18944. l = t.getReplayState(n);
  18945. if (l.dirty || l.renderedResolution !== s || l.renderedRevision != i || l.renderedRenderOrder != a || l.renderedZ !== t.sourceZ) {
  18946. var u = n.getSource(), c = n.getDeclutter(), h = u.getTileGrid(),
  18947. p = u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord), f = u.getSourceTiles(e, r, t),
  18948. d = o(n);
  18949. delete t.hitDetectionImageData[d], t.executorGroups[d] = [], c && (t.declutterExecutorGroups[d] = []);
  18950. for (var g = function (r, i) {
  18951. var o = f[r];
  18952. if (o.getState() != to) return "continue";
  18953. var g = o.tileCoord, m = h.getTileCoordExtent(g), v = Te(p, m),
  18954. _ = ue(m, v) ? null : Ht(v, n.getRenderBuffer() * s, y.tmpExtent);
  18955. l.dirty = !1;
  18956. var b = new Yg(0, v, s, e), x = c ? new Yg(0, v, s, e) : void 0, w = qu(s, e), S = function (t) {
  18957. var e, r = t.getStyleFunction() || n.getStyleFunction();
  18958. if (r && (e = r(t, s)), e) {
  18959. var i = this.renderFeature(t, w, e, b, x);
  18960. this.dirty_ = this.dirty_ || i, l.dirty = l.dirty || i
  18961. }
  18962. }, E = o.getFeatures();
  18963. a && a !== l.renderedRenderOrder && E.sort(a);
  18964. for (var T = 0, C = E.length; T < C; ++T) {
  18965. var O = E[T];
  18966. _ && !Re(_, O.getGeometry().getExtent()) || S.call(y, O)
  18967. }
  18968. var P = b.finish(), R = n.getRenderMode() !== gy && c && 1 === f.length ? null : v,
  18969. I = new ay(R, s, e, u.getOverlaps(), P, n.getRenderBuffer());
  18970. if (t.executorGroups[d].push(I), x) {
  18971. var L = new ay(R, s, e, u.getOverlaps(), x.finish(), n.getRenderBuffer());
  18972. t.declutterExecutorGroups[d].push(L)
  18973. }
  18974. }, y = this, m = 0, v = f.length; m < v; ++m) g(m);
  18975. l.renderedRevision = i, l.renderedZ = t.sourceZ, l.renderedRenderOrder = a, l.renderedResolution = s
  18976. }
  18977. }, e.prototype.forEachFeatureAtCoordinate = function (t, e, r, n, i) {
  18978. var a = e.viewState.resolution, s = e.viewState.rotation;
  18979. r = null == r ? 0 : r;
  18980. var l = this.getLayer(), u = l.getSource().getTileGridForProjection(e.viewState.projection), c = Kt([t]);
  18981. Ht(c, a * r, c);
  18982. for (var h, p = {}, f = function (t, e, r) {
  18983. var a = t.getId();
  18984. void 0 === a && (a = o(t));
  18985. var s = p[a];
  18986. if (s) {
  18987. if (!0 !== s && r < s.distanceSq) {
  18988. if (0 === r) return p[a] = !0, i.splice(i.lastIndexOf(s), 1), n(t, l, e);
  18989. s.geometry = e, s.distanceSq = r
  18990. }
  18991. } else {
  18992. if (0 === r) return p[a] = !0, n(t, l, e);
  18993. i.push(p[a] = {feature: t, layer: l, geometry: e, distanceSq: r, callback: n})
  18994. }
  18995. }, d = this.renderedTiles, g = function (n, i) {
  18996. var p = d[n];
  18997. if (!Re(u.getTileCoordExtent(p.wrappedTileCoord), c)) return "continue";
  18998. var g = o(l), y = [p.executorGroups[g]], m = p.declutterExecutorGroups[g];
  18999. m && y.push(m), y.some((function (n) {
  19000. for (var i = n === m ? e.declutterTree.all().map((function (t) {
  19001. return t.value
  19002. })) : null, o = 0, l = n.length; o < l; ++o) {
  19003. var u = n[o];
  19004. if (h = u.forEachFeatureAtCoordinate(t, a, s, r, f, i)) return !0
  19005. }
  19006. }))
  19007. }, y = 0, m = d.length; !h && y < m; ++y) g(y);
  19008. return h
  19009. }, e.prototype.getFeatures = function (t) {
  19010. return new Promise(function (e, r) {
  19011. for (var n, i = this.getLayer(), a = o(i), s = i.getSource(), l = this.renderedProjection, u = l.getExtent(), c = this.renderedResolution, h = s.getTileGridForProjection(l), p = It(this.renderedPixelToCoordinateTransform_, t.slice()), f = h.getTileCoordForCoordAndResolution(p, c), d = 0, g = this.renderedTiles.length; d < g; ++d) if (f.toString() === this.renderedTiles[d].tileCoord.toString()) {
  19012. if ((n = this.renderedTiles[d]).getState() === to && n.hifi) {
  19013. var y = h.getTileCoordExtent(n.tileCoord);
  19014. s.getWrapX() && l.canWrapX() && !te(u, y) && Fr(p, l);
  19015. break
  19016. }
  19017. n = void 0
  19018. }
  19019. if (!n || n.loadingSourceTiles > 0) e([]); else {
  19020. var m = Ce(h.getTileCoordExtent(n.wrappedTileCoord)), v = [(p[0] - m[0]) / c, (m[1] - p[1]) / c],
  19021. _ = n.getSourceTiles().reduce((function (t, e) {
  19022. return t.concat(e.getFeatures())
  19023. }), []), b = n.hitDetectionImageData[a];
  19024. if (!b && !this.animatingOrInteracting_) {
  19025. var x = Is(h.getTileSize(h.getZForResolution(c))), w = [x[0] / 2, x[1] / 2], S = this.renderedRotation_;
  19026. b = sy(x, [this.getRenderTransform(h.getTileCoordCenter(n.wrappedTileCoord), c, 0, .5, w[0], w[1], 0)], _, i.getStyleFunction(), h.getTileCoordExtent(n.wrappedTileCoord), n.getReplayState(i).renderedResolution, S), n.hitDetectionImageData[a] = b
  19027. }
  19028. e(ly(v, _, b))
  19029. }
  19030. }.bind(this))
  19031. }, e.prototype.handleFontsChanged = function () {
  19032. P(this.renderTileImageQueue_);
  19033. var t = this.getLayer();
  19034. t.getVisible() && void 0 !== this.renderedLayerRevision_ && t.changed()
  19035. }, e.prototype.handleStyleImageChange_ = function (t) {
  19036. this.renderIfReadyAndVisible()
  19037. }, e.prototype.renderDeclutter = function (t) {
  19038. for (var e = t.viewHints, r = !(e[ns] || e[is]), n = this.renderedTiles, i = 0, a = n.length; i < a; ++i) {
  19039. var s = n[i], l = s.declutterExecutorGroups[o(this.getLayer())];
  19040. if (l) for (var u = l.length - 1; u >= 0; --u) l[u].execute(this.context, 1, this.getTileRenderTransform(s, t), t.viewState.rotation, r, void 0, t.declutterTree)
  19041. }
  19042. }, e.prototype.getTileRenderTransform = function (t, e) {
  19043. var r = e.pixelRatio, n = e.viewState, i = n.center, o = n.resolution, a = n.rotation, s = e.size,
  19044. l = Math.round(s[0] * r), u = Math.round(s[1] * r),
  19045. c = this.getLayer().getSource().getTileGridForProjection(e.viewState.projection), h = t.tileCoord,
  19046. p = c.getTileCoordExtent(t.wrappedTileCoord), f = c.getTileCoordExtent(h, this.tmpExtent)[0] - p[0];
  19047. return Ot(Mt(this.inversePixelTransform.slice(), 1 / r, 1 / r), this.getRenderTransform(i, o, a, r, l, u, f))
  19048. }, e.prototype.renderFrame = function (e, r) {
  19049. var n = e.viewHints, i = !(n[ns] || n[is]);
  19050. this.renderQueuedTileImages_(i, e), t.prototype.renderFrame.call(this, e, r), this.renderedPixelToCoordinateTransform_ = e.pixelToCoordinateTransform.slice(), this.renderedRotation_ = e.viewState.rotation;
  19051. var a = this.getLayer(), s = a.getRenderMode();
  19052. if (s === fy) return this.container;
  19053. var l = a.getSource(), u = e.usedTiles[o(l)];
  19054. for (var c in this.renderTileImageQueue_) u && c in u || delete this.renderTileImageQueue_[c];
  19055. for (var h = this.context, p = vy[s], f = e.viewState.rotation, d = this.renderedTiles, g = [], y = [], m = d.length - 1; m >= 0; --m) for (var v = d[m], _ = this.getTileRenderTransform(v, e), b = v.executorGroups[o(a)], x = !1, w = 0, S = b.length; w < S; ++w) {
  19056. var E = b[w];
  19057. if (E.hasExecutors(p)) {
  19058. var T = v.tileCoord[0], C = void 0;
  19059. if (!x && (C = E.getClipCoords(_))) {
  19060. h.save();
  19061. for (var O = 0, P = g.length; O < P; ++O) {
  19062. var R = g[O];
  19063. T < y[O] && (h.beginPath(), h.moveTo(C[0], C[1]), h.lineTo(C[2], C[3]), h.lineTo(C[4], C[5]), h.lineTo(C[6], C[7]), h.moveTo(R[6], R[7]), h.lineTo(R[4], R[5]), h.lineTo(R[2], R[3]), h.lineTo(R[0], R[1]), h.clip())
  19064. }
  19065. }
  19066. E.execute(h, 1, _, f, i, p), !x && C && (h.restore(), g.push(C), y.push(T), x = !0)
  19067. }
  19068. }
  19069. return this.container
  19070. }, e.prototype.renderQueuedTileImages_ = function (t, e) {
  19071. for (var r in this.renderTileImageQueue_) {
  19072. if (!t && Date.now() - e.time > 8) {
  19073. e.animate = !0;
  19074. break
  19075. }
  19076. var n = this.renderTileImageQueue_[r];
  19077. delete this.renderTileImageQueue_[r], this.renderTileImage_(n, e)
  19078. }
  19079. }, e.prototype.renderFeature = function (t, e, r, n, i) {
  19080. if (!r) return !1;
  19081. var o = !1;
  19082. if (Array.isArray(r)) for (var a = 0, s = r.length; a < s; ++a) o = Zu(n, t, r[a], e, this.boundHandleStyleImageChange_, void 0, i) || o; else o = Zu(n, t, r, e, this.boundHandleStyleImageChange_, void 0, i);
  19083. return o
  19084. }, e.prototype.tileImageNeedsRender_ = function (t, e, r) {
  19085. var n = this.getLayer(), i = t.getReplayState(n), o = n.getRevision(), a = t.sourceZ, s = t.wantedResolution;
  19086. return i.renderedTileResolution !== s || i.renderedTileRevision !== o || i.renderedTileZ !== a
  19087. }, e.prototype.renderTileImage_ = function (t, e) {
  19088. var r = this.getLayer(), n = t.getReplayState(r), i = r.getRevision(), a = t.executorGroups[o(r)];
  19089. n.renderedTileRevision = i, n.renderedTileZ = t.sourceZ;
  19090. var s = t.wrappedTileCoord, l = s[0], u = r.getSource(), c = e.pixelRatio, h = e.viewState.projection,
  19091. p = u.getTileGridForProjection(h), f = p.getResolution(t.tileCoord[0]),
  19092. d = e.pixelRatio / t.wantedResolution * f, g = p.getResolution(l), y = t.getContext(r);
  19093. c = Math.round(Math.max(c, d / c));
  19094. var m = u.getTilePixelSize(l, c, h);
  19095. y.canvas.width = m[0], y.canvas.height = m[1];
  19096. var v = c / d;
  19097. if (1 !== v) {
  19098. var _ = Ct(this.tmpTransform_);
  19099. Mt(_, v, v), y.setTransform.apply(y, _)
  19100. }
  19101. var b = p.getTileCoordExtent(s, this.tmpExtent), x = d / g, w = Ct(this.tmpTransform_);
  19102. Mt(w, x, -x), At(w, -b[0], -b[3]);
  19103. for (var S = 0, E = a.length; S < E; ++S) {
  19104. a[S].execute(y, v, w, 0, !0, my[r.getRenderMode()])
  19105. }
  19106. n.renderedTileResolution = t.wantedResolution
  19107. }, e
  19108. }(xd);
  19109. function by(t, e, r, n, i, o, a) {
  19110. var s, l, u = (r - e) / n;
  19111. if (1 === u) s = e; else if (2 === u) s = e, l = i; else if (0 !== u) {
  19112. for (var c = t[e], h = t[e + 1], p = 0, d = [0], g = e + n; g < r; g += n) {
  19113. var y = t[g], m = t[g + 1];
  19114. p += Math.sqrt((y - c) * (y - c) + (m - h) * (m - h)), d.push(p), c = y, h = m
  19115. }
  19116. var v = i * p, _ = f(d, v);
  19117. _ < 0 ? (l = (v - d[-_ - 2]) / (d[-_ - 1] - d[-_ - 2]), s = e + (-_ - 2) * n) : s = e + _ * n
  19118. }
  19119. var b = a > 1 ? a : 2, x = o || new Array(b);
  19120. for (g = 0; g < b; ++g) x[g] = void 0 === s ? NaN : void 0 === l ? t[s + g] : qe(t[s + g], t[s + n + g], l);
  19121. return x
  19122. }
  19123. function xy(t, e, r, n, i, o) {
  19124. if (r == e) return null;
  19125. var a;
  19126. if (i < t[e + n - 1]) return o ? ((a = t.slice(e, e + n))[n - 1] = i, a) : null;
  19127. if (t[r - 1] < i) return o ? ((a = t.slice(r - n, r))[n - 1] = i, a) : null;
  19128. if (i == t[e + n - 1]) return t.slice(e, e + n);
  19129. for (var s = e / n, l = r / n; s < l;) {
  19130. var u = s + l >> 1;
  19131. i < t[(u + 1) * n - 1] ? l = u : s = u + 1
  19132. }
  19133. var c = t[s * n - 1];
  19134. if (i == c) return t.slice((s - 1) * n, (s - 1) * n + n);
  19135. var h = (i - c) / (t[(s + 1) * n - 1] - c);
  19136. a = [];
  19137. for (var p = 0; p < n - 1; ++p) a.push(qe(t[(s - 1) * n + p], t[s * n + p], h));
  19138. return a.push(i), a
  19139. }
  19140. function wy(t, e, r, n, i, o, a) {
  19141. if (a) return xy(t, e, r[r.length - 1], n, i, o);
  19142. var s;
  19143. if (i < t[n - 1]) return o ? ((s = t.slice(0, n))[n - 1] = i, s) : null;
  19144. if (t[t.length - 1] < i) return o ? ((s = t.slice(t.length - n))[n - 1] = i, s) : null;
  19145. for (var l = 0, u = r.length; l < u; ++l) {
  19146. var c = r[l];
  19147. if (e != c) {
  19148. if (i < t[e + n - 1]) return null;
  19149. if (i <= t[c - 1]) return xy(t, e, c, n, i, !1);
  19150. e = c
  19151. }
  19152. }
  19153. return null
  19154. }
  19155. function Sy(t, e, r, n) {
  19156. for (var i = [], o = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = 0, s = r.length; a < s; ++a) {
  19157. var l = r[a];
  19158. o = le(t, e, l[0], n), i.push((o[0] + o[2]) / 2, (o[1] + o[3]) / 2), e = l[l.length - 1]
  19159. }
  19160. return i
  19161. }
  19162. var Ey = [1, 0, 0, 1, 0, 0], Ty = function () {
  19163. function t(t, e, r, n, i) {
  19164. this.extent_, this.id_ = i, this.type_ = t, this.flatCoordinates_ = e, this.flatInteriorPoints_ = null, this.flatMidpoints_ = null, this.ends_ = r, this.properties_ = n
  19165. }
  19166. return t.prototype.get = function (t) {
  19167. return this.properties_[t]
  19168. }, t.prototype.getExtent = function () {
  19169. return this.extent_ || (this.extent_ = this.type_ === bt.POINT ? ae(this.flatCoordinates_) : le(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2)), this.extent_
  19170. }, t.prototype.getFlatInteriorPoint = function () {
  19171. if (!this.flatInteriorPoints_) {
  19172. var t = xe(this.getExtent());
  19173. this.flatInteriorPoints_ = $n(this.flatCoordinates_, 0, this.ends_, 2, t, 0)
  19174. }
  19175. return this.flatInteriorPoints_
  19176. }, t.prototype.getFlatInteriorPoints = function () {
  19177. if (!this.flatInteriorPoints_) {
  19178. var t = Sy(this.flatCoordinates_, 0, this.ends_, 2);
  19179. this.flatInteriorPoints_ = Jn(this.flatCoordinates_, 0, this.ends_, 2, t)
  19180. }
  19181. return this.flatInteriorPoints_
  19182. }, t.prototype.getFlatMidpoint = function () {
  19183. return this.flatMidpoints_ || (this.flatMidpoints_ = by(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, .5)), this.flatMidpoints_
  19184. }, t.prototype.getFlatMidpoints = function () {
  19185. if (!this.flatMidpoints_) {
  19186. this.flatMidpoints_ = [];
  19187. for (var t = this.flatCoordinates_, e = 0, r = this.ends_, n = 0, i = r.length; n < i; ++n) {
  19188. var o = r[n], a = by(t, e, o, 2, .5);
  19189. v(this.flatMidpoints_, a), e = o
  19190. }
  19191. }
  19192. return this.flatMidpoints_
  19193. }, t.prototype.getId = function () {
  19194. return this.id_
  19195. }, t.prototype.getOrientedFlatCoordinates = function () {
  19196. return this.flatCoordinates_
  19197. }, t.prototype.getGeometry = function () {
  19198. return this
  19199. }, t.prototype.getSimplifiedGeometry = function (t) {
  19200. return this
  19201. }, t.prototype.simplifyTransformed = function (t, e) {
  19202. return this
  19203. }, t.prototype.getProperties = function () {
  19204. return this.properties_
  19205. }, t.prototype.getStride = function () {
  19206. return 2
  19207. }, t.prototype.getStyleFunction = function () {
  19208. }, t.prototype.getType = function () {
  19209. return this.type_
  19210. }, t.prototype.transform = function (t) {
  19211. var e = (t = Gr(t)).getExtent(), r = t.getWorldExtent();
  19212. if (e && r) {
  19213. var n = Ee(r) / Ee(e);
  19214. kt(Ey, r[0], r[3], n, -n, 0, 0, 0), ln(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, Ey, this.flatCoordinates_)
  19215. }
  19216. }, t.prototype.getEnds = function () {
  19217. return this.ends_
  19218. }, t
  19219. }();
  19220. Ty.prototype.getEndss = Ty.prototype.getEnds, Ty.prototype.getFlatCoordinates = Ty.prototype.getOrientedFlatCoordinates;
  19221. var Cy = Ty;
  19222. var Oy = function () {
  19223. var t = function (e, r) {
  19224. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19225. t.__proto__ = e
  19226. } || function (t, e) {
  19227. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19228. })(e, r)
  19229. };
  19230. return function (e, r) {
  19231. function n() {
  19232. this.constructor = e
  19233. }
  19234. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19235. }
  19236. }(), Py = function (t) {
  19237. function e(e, r) {
  19238. var n = t.call(this) || this;
  19239. return n.flatMidpoint_ = null, n.flatMidpointRevision_ = -1, n.maxDelta_ = -1, n.maxDeltaRevision_ = -1, void 0 === r || Array.isArray(e[0]) ? n.setCoordinates(e, r) : n.setFlatCoordinates(r, e), n
  19240. }
  19241. return Oy(e, t), e.prototype.appendCoordinate = function (t) {
  19242. this.flatCoordinates ? v(this.flatCoordinates, t) : this.flatCoordinates = t.slice(), this.changed()
  19243. }, e.prototype.clone = function () {
  19244. var t = new e(this.flatCoordinates.slice(), this.layout);
  19245. return t.applyProperties(this), t
  19246. }, e.prototype.closestPointXY = function (t, e, r, n) {
  19247. return n < Jt(this.getExtent(), t, e) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(bn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Sn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, !1, t, e, r, n))
  19248. }, e.prototype.forEachSegment = function (t) {
  19249. return Qn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t)
  19250. }, e.prototype.getCoordinateAtM = function (t, e) {
  19251. if (this.layout != vt && this.layout != _t) return null;
  19252. var r = void 0 !== e && e;
  19253. return xy(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, r)
  19254. }, e.prototype.getCoordinates = function () {
  19255. return Nn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
  19256. }, e.prototype.getCoordinateAt = function (t, e) {
  19257. return by(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, e, this.stride)
  19258. }, e.prototype.getLength = function () {
  19259. return qg(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
  19260. }, e.prototype.getFlatMidpoint = function () {
  19261. return this.flatMidpointRevision_ != this.getRevision() && (this.flatMidpoint_ = this.getCoordinateAt(.5, this.flatMidpoint_), this.flatMidpointRevision_ = this.getRevision()), this.flatMidpoint_
  19262. }, e.prototype.getSimplifiedGeometryInternal = function (t) {
  19263. var r = [];
  19264. return r.length = In(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t, r, 0), new e(r, yt)
  19265. }, e.prototype.getType = function () {
  19266. return bt.LINE_STRING
  19267. }, e.prototype.intersectsExtent = function (t) {
  19268. return ti(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, t)
  19269. }, e.prototype.setCoordinates = function (t, e) {
  19270. this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = On(this.flatCoordinates, 0, t, this.stride), this.changed()
  19271. }, e
  19272. }(vn), Ry = function () {
  19273. var t = function (e, r) {
  19274. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19275. t.__proto__ = e
  19276. } || function (t, e) {
  19277. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19278. })(e, r)
  19279. };
  19280. return function (e, r) {
  19281. function n() {
  19282. this.constructor = e
  19283. }
  19284. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19285. }
  19286. }(), Iy = function (t) {
  19287. function e(e) {
  19288. return t.call(this, e) || this
  19289. }
  19290. return Ry(e, t), e.prototype.createRenderer = function () {
  19291. return new cy(this)
  19292. }, e
  19293. }(wg);
  19294. function Ly(t, e, r) {
  19295. for (var n, i, o, a, s, l, u = [], c = t(0), h = t(1), p = e(c), f = e(h), d = [h, c], g = [f, p], y = [1, 0], m = {}, v = 1e5; --v > 0 && y.length > 0;) o = y.pop(), c = d.pop(), p = g.pop(), (l = o.toString()) in m || (u.push(p[0], p[1]), m[l] = !0), a = y.pop(), h = d.pop(), f = g.pop(), ze((i = e(n = t(s = (o + a) / 2)))[0], i[1], p[0], p[1], f[0], f[1]) < r ? (u.push(f[0], f[1]), m[l = a.toString()] = !0) : (y.push(a, s, s, o), g.push(f, i, i, p), d.push(h, n, n, c));
  19296. return u
  19297. }
  19298. function My(t, e, r, n, i) {
  19299. return Ly((function (n) {
  19300. return [t, e + (r - e) * n]
  19301. }), Kr(Gr("EPSG:4326"), n), i)
  19302. }
  19303. function Fy(t, e, r, n, i) {
  19304. return Ly((function (n) {
  19305. return [e + (r - e) * n, t]
  19306. }), Kr(Gr("EPSG:4326"), n), i)
  19307. }
  19308. var Ay = function () {
  19309. var t = function (e, r) {
  19310. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19311. t.__proto__ = e
  19312. } || function (t, e) {
  19313. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19314. })(e, r)
  19315. };
  19316. return function (e, r) {
  19317. function n() {
  19318. this.constructor = e
  19319. }
  19320. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19321. }
  19322. }(), ky = new gp({color: "rgba(0,0,0,0.2)"}),
  19323. jy = [90, 45, 30, 20, 10, 5, 2, 1, .5, .2, .1, .05, .01, .005, .002, .001], Ny = function (t) {
  19324. function e(e) {
  19325. var r = this, n = e || {}, i = O({updateWhileAnimating: !0, updateWhileInteracting: !0, renderBuffer: 0}, n);
  19326. return delete i.maxLines, delete i.strokeStyle, delete i.targetSize, delete i.showLabels, delete i.lonLabelFormatter, delete i.latLabelFormatter, delete i.lonLabelPosition, delete i.latLabelPosition, delete i.lonLabelStyle, delete i.latLabelStyle, delete i.intervals, (r = t.call(this, i) || this).projection_ = null, r.maxLat_ = 1 / 0, r.maxLon_ = 1 / 0, r.minLat_ = -1 / 0, r.minLon_ = -1 / 0, r.maxX_ = 1 / 0, r.maxY_ = 1 / 0, r.minX_ = -1 / 0, r.minY_ = -1 / 0, r.targetSize_ = void 0 !== n.targetSize ? n.targetSize : 100, r.maxLines_ = void 0 !== n.maxLines ? n.maxLines : 100, r.meridians_ = [], r.parallels_ = [], r.strokeStyle_ = void 0 !== n.strokeStyle ? n.strokeStyle : ky, r.fromLonLatTransform_ = void 0, r.toLonLatTransform_ = void 0, r.projectionCenterLonLat_ = null, r.bottomLeft_ = null, r.bottomRight_ = null, r.topLeft_ = null, r.topRight_ = null, r.meridiansLabels_ = null, r.parallelsLabels_ = null, n.showLabels && (r.lonLabelFormatter_ = null == n.lonLabelFormatter ? Er.bind(r, "EW") : n.lonLabelFormatter, r.latLabelFormatter_ = null == n.latLabelFormatter ? Er.bind(r, "NS") : n.latLabelFormatter, r.lonLabelPosition_ = null == n.lonLabelPosition ? 0 : n.lonLabelPosition, r.latLabelPosition_ = null == n.latLabelPosition ? 1 : n.latLabelPosition, r.lonLabelStyleBase_ = new wp({
  19327. text: void 0 !== n.lonLabelStyle ? n.lonLabelStyle.clone() : new Tp({
  19328. font: "12px Calibri,sans-serif",
  19329. textBaseline: "bottom",
  19330. fill: new ep({color: "rgba(0,0,0,1)"}),
  19331. stroke: new gp({color: "rgba(255,255,255,1)", width: 3})
  19332. })
  19333. }), r.lonLabelStyle_ = function (t) {
  19334. var e = t.get("graticule_label");
  19335. return this.lonLabelStyleBase_.getText().setText(e), this.lonLabelStyleBase_
  19336. }.bind(r), r.latLabelStyleBase_ = new wp({
  19337. text: void 0 !== n.latLabelStyle ? n.latLabelStyle.clone() : new Tp({
  19338. font: "12px Calibri,sans-serif",
  19339. textAlign: "right",
  19340. fill: new ep({color: "rgba(0,0,0,1)"}),
  19341. stroke: new gp({color: "rgba(255,255,255,1)", width: 3})
  19342. })
  19343. }), r.latLabelStyle_ = function (t) {
  19344. var e = t.get("graticule_label");
  19345. return this.latLabelStyleBase_.getText().setText(e), this.latLabelStyleBase_
  19346. }.bind(r), r.meridiansLabels_ = [], r.parallelsLabels_ = [], r.addEventListener(Xo, r.drawLabels_.bind(r))), r.intervals_ = void 0 !== n.intervals ? n.intervals : jy, r.setSource(new hf({
  19347. loader: r.loaderFunction.bind(r),
  19348. strategy: r.strategyFunction.bind(r),
  19349. features: new ht,
  19350. overlaps: !1,
  19351. useSpatialIndex: !1,
  19352. wrapX: n.wrapX
  19353. })), r.featurePool_ = [], r.lineStyle_ = new wp({stroke: r.strokeStyle_}), r.loadedExtent_ = null, r.renderedExtent_ = null, r.setRenderOrder(null), r
  19354. }
  19355. return Ay(e, t), e.prototype.strategyFunction = function (t, e) {
  19356. var r = t.slice();
  19357. return this.projection_ && this.getSource().getWrapX() && ke(r, this.projection_), this.loadedExtent_ && (ce(this.loadedExtent_, r, e) ? r = this.loadedExtent_.slice() : this.getSource().removeLoadedExtent(this.loadedExtent_)), [r]
  19358. }, e.prototype.loaderFunction = function (t, e, r) {
  19359. this.loadedExtent_ = t;
  19360. var n = this.getSource(), i = Te(this.getExtent() || [-1 / 0, -1 / 0, 1 / 0, 1 / 0], t);
  19361. if (!(this.renderedExtent_ && ue(this.renderedExtent_, i) || (this.renderedExtent_ = i, Ie(i)))) {
  19362. var o = xe(i), a = e * e / 4;
  19363. (!this.projection_ || !Xr(this.projection_, r)) && this.updateProjectionInfo_(r), this.createGraticule_(i, o, e, a);
  19364. var s, l = this.meridians_.length + this.parallels_.length;
  19365. for (this.meridiansLabels_ && (l += this.meridians_.length), this.parallelsLabels_ && (l += this.parallels_.length); l > this.featurePool_.length;) s = new gt, this.featurePool_.push(s);
  19366. var u = n.getFeaturesCollection();
  19367. u.clear();
  19368. var c, h, p = 0;
  19369. for (c = 0, h = this.meridians_.length; c < h; ++c) (s = this.featurePool_[p++]).setGeometry(this.meridians_[c]), s.setStyle(this.lineStyle_), u.push(s);
  19370. for (c = 0, h = this.parallels_.length; c < h; ++c) (s = this.featurePool_[p++]).setGeometry(this.parallels_[c]), s.setStyle(this.lineStyle_), u.push(s)
  19371. }
  19372. }, e.prototype.addMeridian_ = function (t, e, r, n, i, o) {
  19373. var a = this.getMeridian_(t, e, r, n, o);
  19374. if (Re(a.getExtent(), i)) {
  19375. if (this.meridiansLabels_) {
  19376. var s = this.lonLabelFormatter_(t);
  19377. o in this.meridiansLabels_ ? this.meridiansLabels_[o].text = s : this.meridiansLabels_[o] = {
  19378. geom: new qn([]),
  19379. text: s
  19380. }
  19381. }
  19382. this.meridians_[o++] = a
  19383. }
  19384. return o
  19385. }, e.prototype.addParallel_ = function (t, e, r, n, i, o) {
  19386. var a = this.getParallel_(t, e, r, n, o);
  19387. if (Re(a.getExtent(), i)) {
  19388. if (this.parallelsLabels_) {
  19389. var s = this.latLabelFormatter_(t);
  19390. o in this.parallelsLabels_ ? this.parallelsLabels_[o].text = s : this.parallelsLabels_[o] = {
  19391. geom: new qn([]),
  19392. text: s
  19393. }
  19394. }
  19395. this.parallels_[o++] = a
  19396. }
  19397. return o
  19398. }, e.prototype.drawLabels_ = function (t) {
  19399. var e = t.frameState.viewState.rotation, r = t.frameState.extent, n = xe(r), i = r;
  19400. if (e) {
  19401. var o = Pe(r), a = Ee(r), s = Math.abs(Math.cos(e)), l = Math.abs(Math.sin(e)),
  19402. u = (l * a - s * o) / (l * l - s * s), c = (l * o - s * a) / (l * l - s * s);
  19403. i = [n[0] - u / 2, n[1] - c / 2, n[0] + u / 2, n[1] + c / 2]
  19404. }
  19405. var h = 0, p = 0, f = this.latLabelPosition_ < .5, d = this.projection_.getExtent(), g = Pe(d);
  19406. this.getSource().getWrapX() && this.projection_.canWrapX() && !te(d, r) && (h = Math.floor((r[0] - d[0]) / g), p = Math.ceil((r[2] - d[2]) / g), f = f !== Math.abs(e) > Math.PI / 2);
  19407. for (var y = Ku(t), m = h; m <= p; ++m) {
  19408. var v = this.meridians_.length + this.parallels_.length, _ = void 0, b = void 0, x = void 0, w = void 0;
  19409. if (this.meridiansLabels_) for (b = 0, x = this.meridiansLabels_.length; b < x; ++b) {
  19410. var S = this.meridians_[b];
  19411. if (e || 0 !== m) (E = S.clone()).translate(m * g, 0), E.rotate(-e, n), (w = this.getMeridianPoint_(E, i, b)).rotate(e, n); else w = this.getMeridianPoint_(S, r, b);
  19412. (_ = this.featurePool_[v++]).setGeometry(w), _.set("graticule_label", this.meridiansLabels_[b].text), y.drawFeature(_, this.lonLabelStyle_(_))
  19413. }
  19414. if (this.parallelsLabels_ && (m === h && f || m === p && !f)) for (b = 0, x = this.parallels_.length; b < x; ++b) {
  19415. var E;
  19416. S = this.parallels_[b];
  19417. if (e || 0 !== m) (E = S.clone()).translate(m * g, 0), E.rotate(-e, n), (w = this.getParallelPoint_(E, i, b)).rotate(e, n); else w = this.getParallelPoint_(S, r, b);
  19418. (_ = this.featurePool_[v++]).setGeometry(w), _.set("graticule_label", this.parallelsLabels_[b].text), y.drawFeature(_, this.latLabelStyle_(_))
  19419. }
  19420. }
  19421. }, e.prototype.createGraticule_ = function (t, e, r, n) {
  19422. var i = this.getInterval_(r);
  19423. if (-1 == i) return this.meridians_.length = 0, this.parallels_.length = 0, this.meridiansLabels_ && (this.meridiansLabels_.length = 0), void (this.parallelsLabels_ && (this.parallelsLabels_.length = 0));
  19424. var o = !1, a = this.projection_.getExtent(), s = Pe(a);
  19425. this.getSource().getWrapX() && this.projection_.canWrapX() && !te(a, t) && (Pe(t) >= s ? (t[0] = a[0], t[2] = a[2]) : o = !0);
  19426. var l = [Ne(e[0], this.minX_, this.maxX_), Ne(e[1], this.minY_, this.maxY_)], u = this.toLonLatTransform_(l);
  19427. isNaN(u[1]) && (u[1] = Math.abs(this.maxLat_) >= Math.abs(this.minLat_) ? this.maxLat_ : this.minLat_);
  19428. var c, h, p, f, d = Ne(u[0], this.minLon_, this.maxLon_), g = Ne(u[1], this.minLat_, this.maxLat_),
  19429. y = this.maxLines_, m = t;
  19430. o || (m = [Ne(t[0], this.minX_, this.maxX_), Ne(t[1], this.minY_, this.maxY_), Ne(t[2], this.minX_, this.maxX_), Ne(t[3], this.minY_, this.maxY_)]);
  19431. var v = Ae(m, this.toLonLatTransform_, void 0, 8), _ = v[3], b = v[2], x = v[1], w = v[0];
  19432. if (o || (Qt(m, this.bottomLeft_) && (w = this.minLon_, x = this.minLat_), Qt(m, this.bottomRight_) && (b = this.maxLon_, x = this.minLat_), Qt(m, this.topLeft_) && (w = this.minLon_, _ = this.maxLat_), Qt(m, this.topRight_) && (b = this.maxLon_, _ = this.maxLat_), _ = Ne(_, g, this.maxLat_), b = Ne(b, d, this.maxLon_), x = Ne(x, this.minLat_, g), w = Ne(w, this.minLon_, d)), f = Ne(d = Math.floor(d / i) * i, this.minLon_, this.maxLon_), h = this.addMeridian_(f, x, _, n, t, 0), c = 0, o) for (; (f -= i) >= w && c++ < y;) h = this.addMeridian_(f, x, _, n, t, h); else for (; f != this.minLon_ && c++ < y;) f = Math.max(f - i, this.minLon_), h = this.addMeridian_(f, x, _, n, t, h);
  19433. if (f = Ne(d, this.minLon_, this.maxLon_), c = 0, o) for (; (f += i) <= b && c++ < y;) h = this.addMeridian_(f, x, _, n, t, h); else for (; f != this.maxLon_ && c++ < y;) f = Math.min(f + i, this.maxLon_), h = this.addMeridian_(f, x, _, n, t, h);
  19434. for (this.meridians_.length = h, this.meridiansLabels_ && (this.meridiansLabels_.length = h), p = Ne(g = Math.floor(g / i) * i, this.minLat_, this.maxLat_), h = this.addParallel_(p, w, b, n, t, 0), c = 0; p != this.minLat_ && c++ < y;) p = Math.max(p - i, this.minLat_), h = this.addParallel_(p, w, b, n, t, h);
  19435. for (p = Ne(g, this.minLat_, this.maxLat_), c = 0; p != this.maxLat_ && c++ < y;) p = Math.min(p + i, this.maxLat_), h = this.addParallel_(p, w, b, n, t, h);
  19436. this.parallels_.length = h, this.parallelsLabels_ && (this.parallelsLabels_.length = h)
  19437. }, e.prototype.getInterval_ = function (t) {
  19438. for (var e = this.projectionCenterLonLat_[0], r = this.projectionCenterLonLat_[1], n = -1, i = Math.pow(this.targetSize_ * t, 2), o = [], a = [], s = 0, l = this.intervals_.length; s < l; ++s) {
  19439. var u = Ne(this.intervals_[s] / 2, 0, 90), c = Ne(r, -90 + u, 90 - u);
  19440. if (o[0] = e - u, o[1] = c - u, a[0] = e + u, a[1] = c + u, this.fromLonLatTransform_(o, o), this.fromLonLatTransform_(a, a), Math.pow(a[0] - o[0], 2) + Math.pow(a[1] - o[1], 2) <= i) break;
  19441. n = this.intervals_[s]
  19442. }
  19443. return n
  19444. }, e.prototype.getMeridian_ = function (t, e, r, n, i) {
  19445. var o = My(t, e, r, this.projection_, n), a = this.meridians_[i];
  19446. return a ? (a.setFlatCoordinates(yt, o), a.changed()) : (a = new Py(o, yt), this.meridians_[i] = a), a
  19447. }, e.prototype.getMeridianPoint_ = function (t, e, r) {
  19448. var n = t.getFlatCoordinates(), i = 1, o = n.length - 1;
  19449. n[i] > n[o] && (i = o, o = 1);
  19450. var a = Math.max(e[1], n[i]), s = Math.min(e[3], n[o]),
  19451. l = Ne(e[1] + Math.abs(e[1] - e[3]) * this.lonLabelPosition_, a, s),
  19452. u = [n[i - 1] + (n[o - 1] - n[i - 1]) * (l - n[i]) / (n[o] - n[i]), l], c = this.meridiansLabels_[r].geom;
  19453. return c.setCoordinates(u), c
  19454. }, e.prototype.getMeridians = function () {
  19455. return this.meridians_
  19456. }, e.prototype.getParallel_ = function (t, e, r, n, i) {
  19457. var o = Fy(t, e, r, this.projection_, n), a = this.parallels_[i];
  19458. return a ? (a.setFlatCoordinates(yt, o), a.changed()) : a = new Py(o, yt), a
  19459. }, e.prototype.getParallelPoint_ = function (t, e, r) {
  19460. var n = t.getFlatCoordinates(), i = 0, o = n.length - 2;
  19461. n[i] > n[o] && (i = o, o = 0);
  19462. var a = Math.max(e[0], n[i]), s = Math.min(e[2], n[o]),
  19463. l = Ne(e[0] + Math.abs(e[0] - e[2]) * this.latLabelPosition_, a, s),
  19464. u = [l, n[i + 1] + (n[o + 1] - n[i + 1]) * (l - n[i]) / (n[o] - n[i])], c = this.parallelsLabels_[r].geom;
  19465. return c.setCoordinates(u), c
  19466. }, e.prototype.getParallels = function () {
  19467. return this.parallels_
  19468. }, e.prototype.updateProjectionInfo_ = function (t) {
  19469. var e = Gr("EPSG:4326"), r = t.getWorldExtent();
  19470. this.maxLat_ = r[3], this.maxLon_ = r[2], this.minLat_ = r[1], this.minLon_ = r[0];
  19471. var n = Kr(t, e);
  19472. if (this.minLon_ < this.maxLon_) this.toLonLatTransform_ = n; else {
  19473. var i = this.minLon_ + this.maxLon_ / 2;
  19474. this.maxLon_ += 360, this.toLonLatTransform_ = function (t, e, r) {
  19475. for (var o = r || 2, a = n(t, e, o), s = 0, l = a.length; s < l; s += o) a[s] < i && (a[s] += 360);
  19476. return a
  19477. }
  19478. }
  19479. this.fromLonLatTransform_ = Kr(e, t);
  19480. var o = Ae([this.minLon_, this.minLat_, this.maxLon_, this.maxLat_], this.fromLonLatTransform_, void 0, 8);
  19481. this.minX_ = o[0], this.maxX_ = o[2], this.minY_ = o[1], this.maxY_ = o[3], this.bottomLeft_ = this.fromLonLatTransform_([this.minLon_, this.minLat_]), this.bottomRight_ = this.fromLonLatTransform_([this.maxLon_, this.minLat_]), this.topLeft_ = this.fromLonLatTransform_([this.minLon_, this.maxLat_]), this.topRight_ = this.fromLonLatTransform_([this.maxLon_, this.maxLat_]), this.projectionCenterLonLat_ = this.toLonLatTransform_(xe(t.getExtent())), isNaN(this.projectionCenterLonLat_[1]) && (this.projectionCenterLonLat_[1] = Math.abs(this.maxLat_) >= Math.abs(this.minLat_) ? this.maxLat_ : this.minLat_), this.projection_ = t
  19482. }, e
  19483. }(Iy), Dy = function () {
  19484. var t = function (e, r) {
  19485. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19486. t.__proto__ = e
  19487. } || function (t, e) {
  19488. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19489. })(e, r)
  19490. };
  19491. return function (e, r) {
  19492. function n() {
  19493. this.constructor = e
  19494. }
  19495. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19496. }
  19497. }(), Gy = "blur", zy = "gradient", Uy = "radius", By = ["#00f", "#0ff", "#0f0", "#ff0", "#f00"];
  19498. var Vy = function (t) {
  19499. function e(e) {
  19500. var r = this, n = e || {}, i = O({}, n);
  19501. delete i.gradient, delete i.radius, delete i.blur, delete i.weight, (r = t.call(this, i) || this).gradient_ = null, r.addEventListener(it(zy), r.handleGradientChanged_), r.setGradient(n.gradient ? n.gradient : By), r.setBlur(void 0 !== n.blur ? n.blur : 15), r.setRadius(void 0 !== n.radius ? n.radius : 8);
  19502. var o = n.weight ? n.weight : "weight";
  19503. return r.weightFunction_ = "string" == typeof o ? function (t) {
  19504. return t.get(o)
  19505. } : o, r.setRenderOrder(null), r
  19506. }
  19507. return Dy(e, t), e.prototype.getBlur = function () {
  19508. return this.get(Gy)
  19509. }, e.prototype.getGradient = function () {
  19510. return this.get(zy)
  19511. }, e.prototype.getRadius = function () {
  19512. return this.get(Uy)
  19513. }, e.prototype.handleGradientChanged_ = function () {
  19514. this.gradient_ = function (t) {
  19515. for (var e = uo(1, 256), r = e.createLinearGradient(0, 0, 1, 256), n = 1 / (t.length - 1), i = 0, o = t.length; i < o; ++i) r.addColorStop(i * n, t[i]);
  19516. return e.fillStyle = r, e.fillRect(0, 0, 1, 256), e.canvas
  19517. }(this.getGradient())
  19518. }, e.prototype.setBlur = function (t) {
  19519. this.set(Gy, t)
  19520. }, e.prototype.setGradient = function (t) {
  19521. this.set(zy, t)
  19522. }, e.prototype.setRadius = function (t) {
  19523. this.set(Uy, t)
  19524. }, e.prototype.createRenderer = function () {
  19525. return new Eg(this, {
  19526. className: this.getClassName(),
  19527. attributes: [{
  19528. name: "weight", callback: function (t) {
  19529. var e = this.weightFunction_(t);
  19530. return void 0 !== e ? Ne(e, 0, 1) : 1
  19531. }.bind(this)
  19532. }],
  19533. vertexShader: "\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",
  19534. fragmentShader: "\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",
  19535. hitVertexShader: "\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",
  19536. hitFragmentShader: "\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",
  19537. uniforms: {
  19538. u_size: function () {
  19539. return 2 * (this.get(Uy) + this.get(Gy))
  19540. }.bind(this), u_blurSlope: function () {
  19541. return this.get(Uy) / Math.max(1, this.get(Gy))
  19542. }.bind(this)
  19543. },
  19544. postProcesses: [{
  19545. fragmentShader: "\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",
  19546. uniforms: {
  19547. u_gradientTexture: function () {
  19548. return this.gradient_
  19549. }.bind(this)
  19550. }
  19551. }]
  19552. })
  19553. }, e.prototype.renderDeclutter = function () {
  19554. }, e
  19555. }(Iy), Yy = function () {
  19556. function t() {
  19557. this.dataProjection = null, this.defaultFeatureProjection = null
  19558. }
  19559. return t.prototype.getReadOptions = function (t, e) {
  19560. var r;
  19561. if (e) {
  19562. var n = e.dataProjection ? Gr(e.dataProjection) : this.readProjection(t);
  19563. e.extent && n && n.getUnits() === St.TILE_PIXELS && (n = Gr(n)).setWorldExtent(e.extent), r = {
  19564. dataProjection: n,
  19565. featureProjection: e.featureProjection
  19566. }
  19567. }
  19568. return this.adaptOptions(r)
  19569. }, t.prototype.adaptOptions = function (t) {
  19570. return O({dataProjection: this.dataProjection, featureProjection: this.defaultFeatureProjection}, t)
  19571. }, t.prototype.getType = function () {
  19572. return n()
  19573. }, t.prototype.readFeature = function (t, e) {
  19574. return n()
  19575. }, t.prototype.readFeatures = function (t, e) {
  19576. return n()
  19577. }, t.prototype.readGeometry = function (t, e) {
  19578. return n()
  19579. }, t.prototype.readProjection = function (t) {
  19580. return n()
  19581. }, t.prototype.writeFeature = function (t, e) {
  19582. return n()
  19583. }, t.prototype.writeFeatures = function (t, e) {
  19584. return n()
  19585. }, t.prototype.writeGeometry = function (t, e) {
  19586. return n()
  19587. }, t
  19588. }();
  19589. function Wy(t, e, r) {
  19590. var n, i = r ? Gr(r.featureProjection) : null, o = r ? Gr(r.dataProjection) : null;
  19591. if (n = i && o && !Xr(i, o) ? (e ? t.clone() : t).transform(e ? i : o, e ? o : i) : t, e && r && void 0 !== r.decimals) {
  19592. var a = Math.pow(10, r.decimals);
  19593. n === t && (n = t.clone()), n.applyTransform((function (t) {
  19594. for (var e = 0, r = t.length; e < r; ++e) t[e] = Math.round(t[e] * a) / a;
  19595. return t
  19596. }))
  19597. }
  19598. return n
  19599. }
  19600. function qy(t, e) {
  19601. var r = e ? Gr(e.featureProjection) : null, n = e ? Gr(e.dataProjection) : null;
  19602. return r && n && !Xr(r, n) ? $r(t, n, r) : t
  19603. }
  19604. var Xy = function () {
  19605. var t = function (e, r) {
  19606. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19607. t.__proto__ = e
  19608. } || function (t, e) {
  19609. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19610. })(e, r)
  19611. };
  19612. return function (e, r) {
  19613. function n() {
  19614. this.constructor = e
  19615. }
  19616. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19617. }
  19618. }(), Zy = function (t) {
  19619. function e(e, r, n) {
  19620. var i = t.call(this) || this;
  19621. if (i.ends_ = [], i.maxDelta_ = -1, i.maxDeltaRevision_ = -1, Array.isArray(e[0])) i.setCoordinates(e, r); else if (void 0 !== r && n) i.setFlatCoordinates(r, e), i.ends_ = n; else {
  19622. for (var o = i.getLayout(), a = e, s = [], l = [], u = 0, c = a.length; u < c; ++u) {
  19623. var h = a[u];
  19624. 0 === u && (o = h.getLayout()), v(s, h.getFlatCoordinates()), l.push(s.length)
  19625. }
  19626. i.setFlatCoordinates(o, s), i.ends_ = l
  19627. }
  19628. return i
  19629. }
  19630. return Xy(e, t), e.prototype.appendLineString = function (t) {
  19631. this.flatCoordinates ? v(this.flatCoordinates, t.getFlatCoordinates().slice()) : this.flatCoordinates = t.getFlatCoordinates().slice(), this.ends_.push(this.flatCoordinates.length), this.changed()
  19632. }, e.prototype.clone = function () {
  19633. var t = new e(this.flatCoordinates.slice(), this.layout, this.ends_.slice());
  19634. return t.applyProperties(this), t
  19635. }, e.prototype.closestPointXY = function (t, e, r, n) {
  19636. return n < Jt(this.getExtent(), t, e) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(xn(this.flatCoordinates, 0, this.ends_, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), En(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, !1, t, e, r, n))
  19637. }, e.prototype.getCoordinateAtM = function (t, e, r) {
  19638. if (this.layout != vt && this.layout != _t || 0 === this.flatCoordinates.length) return null;
  19639. var n = void 0 !== e && e, i = void 0 !== r && r;
  19640. return wy(this.flatCoordinates, 0, this.ends_, this.stride, t, n, i)
  19641. }, e.prototype.getCoordinates = function () {
  19642. return Dn(this.flatCoordinates, 0, this.ends_, this.stride)
  19643. }, e.prototype.getEnds = function () {
  19644. return this.ends_
  19645. }, e.prototype.getLineString = function (t) {
  19646. return t < 0 || this.ends_.length <= t ? null : new Py(this.flatCoordinates.slice(0 === t ? 0 : this.ends_[t - 1], this.ends_[t]), this.layout)
  19647. }, e.prototype.getLineStrings = function () {
  19648. for (var t = this.flatCoordinates, e = this.ends_, r = this.layout, n = [], i = 0, o = 0, a = e.length; o < a; ++o) {
  19649. var s = e[o], l = new Py(t.slice(i, s), r);
  19650. n.push(l), i = s
  19651. }
  19652. return n
  19653. }, e.prototype.getFlatMidpoints = function () {
  19654. for (var t = [], e = this.flatCoordinates, r = 0, n = this.ends_, i = this.stride, o = 0, a = n.length; o < a; ++o) {
  19655. var s = n[o];
  19656. v(t, by(e, r, s, i, .5)), r = s
  19657. }
  19658. return t
  19659. }, e.prototype.getSimplifiedGeometryInternal = function (t) {
  19660. var r = [], n = [];
  19661. return r.length = Ln(this.flatCoordinates, 0, this.ends_, this.stride, t, r, 0, n), new e(r, yt, n)
  19662. }, e.prototype.getType = function () {
  19663. return bt.MULTI_LINE_STRING
  19664. }, e.prototype.intersectsExtent = function (t) {
  19665. return ei(this.flatCoordinates, 0, this.ends_, this.stride, t)
  19666. }, e.prototype.setCoordinates = function (t, e) {
  19667. this.setLayout(e, t, 2), this.flatCoordinates || (this.flatCoordinates = []);
  19668. var r = Pn(this.flatCoordinates, 0, t, this.stride, this.ends_);
  19669. this.flatCoordinates.length = 0 === r.length ? 0 : r[r.length - 1], this.changed()
  19670. }, e
  19671. }(vn), Ky = function () {
  19672. var t = function (e, r) {
  19673. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19674. t.__proto__ = e
  19675. } || function (t, e) {
  19676. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19677. })(e, r)
  19678. };
  19679. return function (e, r) {
  19680. function n() {
  19681. this.constructor = e
  19682. }
  19683. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19684. }
  19685. }(), Hy = function (t) {
  19686. function e(e, r) {
  19687. var n = t.call(this) || this;
  19688. return r && !Array.isArray(e[0]) ? n.setFlatCoordinates(r, e) : n.setCoordinates(e, r), n
  19689. }
  19690. return Ky(e, t), e.prototype.appendPoint = function (t) {
  19691. this.flatCoordinates ? v(this.flatCoordinates, t.getFlatCoordinates()) : this.flatCoordinates = t.getFlatCoordinates().slice(), this.changed()
  19692. }, e.prototype.clone = function () {
  19693. var t = new e(this.flatCoordinates.slice(), this.layout);
  19694. return t.applyProperties(this), t
  19695. }, e.prototype.closestPointXY = function (t, e, r, n) {
  19696. if (n < Jt(this.getExtent(), t, e)) return n;
  19697. for (var i = this.flatCoordinates, o = this.stride, a = 0, s = i.length; a < s; a += o) {
  19698. var l = Ue(t, e, i[a], i[a + 1]);
  19699. if (l < n) {
  19700. n = l;
  19701. for (var u = 0; u < o; ++u) r[u] = i[a + u];
  19702. r.length = o
  19703. }
  19704. }
  19705. return n
  19706. }, e.prototype.getCoordinates = function () {
  19707. return Nn(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride)
  19708. }, e.prototype.getPoint = function (t) {
  19709. var e = this.flatCoordinates ? this.flatCoordinates.length / this.stride : 0;
  19710. return t < 0 || e <= t ? null : new qn(this.flatCoordinates.slice(t * this.stride, (t + 1) * this.stride), this.layout)
  19711. }, e.prototype.getPoints = function () {
  19712. for (var t = this.flatCoordinates, e = this.layout, r = this.stride, n = [], i = 0, o = t.length; i < o; i += r) {
  19713. var a = new qn(t.slice(i, i + r), e);
  19714. n.push(a)
  19715. }
  19716. return n
  19717. }, e.prototype.getType = function () {
  19718. return bt.MULTI_POINT
  19719. }, e.prototype.intersectsExtent = function (t) {
  19720. for (var e = this.flatCoordinates, r = this.stride, n = 0, i = e.length; n < i; n += r) {
  19721. if (ee(t, e[n], e[n + 1])) return !0
  19722. }
  19723. return !1
  19724. }, e.prototype.setCoordinates = function (t, e) {
  19725. this.setLayout(e, t, 1), this.flatCoordinates || (this.flatCoordinates = []), this.flatCoordinates.length = On(this.flatCoordinates, 0, t, this.stride), this.changed()
  19726. }, e
  19727. }(vn), $y = function () {
  19728. var t = function (e, r) {
  19729. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19730. t.__proto__ = e
  19731. } || function (t, e) {
  19732. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19733. })(e, r)
  19734. };
  19735. return function (e, r) {
  19736. function n() {
  19737. this.constructor = e
  19738. }
  19739. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19740. }
  19741. }(), Jy = function (t) {
  19742. function e(e, r, n) {
  19743. var i = t.call(this) || this;
  19744. if (i.endss_ = [], i.flatInteriorPointsRevision_ = -1, i.flatInteriorPoints_ = null, i.maxDelta_ = -1, i.maxDeltaRevision_ = -1, i.orientedRevision_ = -1, i.orientedFlatCoordinates_ = null, !n && !Array.isArray(e[0])) {
  19745. for (var o = i.getLayout(), a = e, s = [], l = [], u = 0, c = a.length; u < c; ++u) {
  19746. var h = a[u];
  19747. 0 === u && (o = h.getLayout());
  19748. for (var p = s.length, f = h.getEnds(), d = 0, g = f.length; d < g; ++d) f[d] += p;
  19749. v(s, h.getFlatCoordinates()), l.push(f)
  19750. }
  19751. r = o, e = s, n = l
  19752. }
  19753. return void 0 !== r && n ? (i.setFlatCoordinates(r, e), i.endss_ = n) : i.setCoordinates(e, r), i
  19754. }
  19755. return $y(e, t), e.prototype.appendPolygon = function (t) {
  19756. var e;
  19757. if (this.flatCoordinates) {
  19758. var r = this.flatCoordinates.length;
  19759. v(this.flatCoordinates, t.getFlatCoordinates());
  19760. for (var n = 0, i = (e = t.getEnds().slice()).length; n < i; ++n) e[n] += r
  19761. } else this.flatCoordinates = t.getFlatCoordinates().slice(), e = t.getEnds().slice(), this.endss_.push();
  19762. this.endss_.push(e), this.changed()
  19763. }, e.prototype.clone = function () {
  19764. for (var t = this.endss_.length, r = new Array(t), n = 0; n < t; ++n) r[n] = this.endss_[n].slice();
  19765. var i = new e(this.flatCoordinates.slice(), this.layout, r);
  19766. return i.applyProperties(this), i
  19767. }, e.prototype.closestPointXY = function (t, e, r, n) {
  19768. return n < Jt(this.getExtent(), t, e) ? n : (this.maxDeltaRevision_ != this.getRevision() && (this.maxDelta_ = Math.sqrt(wn(this.flatCoordinates, 0, this.endss_, this.stride, 0)), this.maxDeltaRevision_ = this.getRevision()), Tn(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, this.maxDelta_, !0, t, e, r, n))
  19769. }, e.prototype.containsXY = function (t, e) {
  19770. return Hn(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, t, e)
  19771. }, e.prototype.getArea = function () {
  19772. return Bn(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride)
  19773. }, e.prototype.getCoordinates = function (t) {
  19774. var e;
  19775. return void 0 !== t ? ci(e = this.getOrientedFlatCoordinates().slice(), 0, this.endss_, this.stride, t) : e = this.flatCoordinates, Gn(e, 0, this.endss_, this.stride)
  19776. }, e.prototype.getEndss = function () {
  19777. return this.endss_
  19778. }, e.prototype.getFlatInteriorPoints = function () {
  19779. if (this.flatInteriorPointsRevision_ != this.getRevision()) {
  19780. var t = Sy(this.flatCoordinates, 0, this.endss_, this.stride);
  19781. this.flatInteriorPoints_ = Jn(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, t), this.flatInteriorPointsRevision_ = this.getRevision()
  19782. }
  19783. return this.flatInteriorPoints_
  19784. }, e.prototype.getInteriorPoints = function () {
  19785. return new Hy(this.getFlatInteriorPoints().slice(), vt)
  19786. }, e.prototype.getOrientedFlatCoordinates = function () {
  19787. if (this.orientedRevision_ != this.getRevision()) {
  19788. var t = this.flatCoordinates;
  19789. li(t, 0, this.endss_, this.stride) ? this.orientedFlatCoordinates_ = t : (this.orientedFlatCoordinates_ = t.slice(), this.orientedFlatCoordinates_.length = ci(this.orientedFlatCoordinates_, 0, this.endss_, this.stride)), this.orientedRevision_ = this.getRevision()
  19790. }
  19791. return this.orientedFlatCoordinates_
  19792. }, e.prototype.getSimplifiedGeometryInternal = function (t) {
  19793. var r = [], n = [];
  19794. return r.length = jn(this.flatCoordinates, 0, this.endss_, this.stride, Math.sqrt(t), r, 0, n), new e(r, yt, n)
  19795. }, e.prototype.getPolygon = function (t) {
  19796. if (t < 0 || this.endss_.length <= t) return null;
  19797. var e;
  19798. if (0 === t) e = 0; else {
  19799. var r = this.endss_[t - 1];
  19800. e = r[r.length - 1]
  19801. }
  19802. var n = this.endss_[t].slice(), i = n[n.length - 1];
  19803. if (0 !== e) for (var o = 0, a = n.length; o < a; ++o) n[o] -= e;
  19804. return new fi(this.flatCoordinates.slice(e, i), this.layout, n)
  19805. }, e.prototype.getPolygons = function () {
  19806. for (var t = this.layout, e = this.flatCoordinates, r = this.endss_, n = [], i = 0, o = 0, a = r.length; o < a; ++o) {
  19807. var s = r[o].slice(), l = s[s.length - 1];
  19808. if (0 !== i) for (var u = 0, c = s.length; u < c; ++u) s[u] -= i;
  19809. var h = new fi(e.slice(i, l), t, s);
  19810. n.push(h), i = l
  19811. }
  19812. return n
  19813. }, e.prototype.getType = function () {
  19814. return bt.MULTI_POLYGON
  19815. }, e.prototype.intersectsExtent = function (t) {
  19816. return ii(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, t)
  19817. }, e.prototype.setCoordinates = function (t, e) {
  19818. this.setLayout(e, t, 3), this.flatCoordinates || (this.flatCoordinates = []);
  19819. var r = Rn(this.flatCoordinates, 0, t, this.stride, this.endss_);
  19820. if (0 === r.length) this.flatCoordinates.length = 0; else {
  19821. var n = r[r.length - 1];
  19822. this.flatCoordinates.length = 0 === n.length ? 0 : n[n.length - 1]
  19823. }
  19824. this.changed()
  19825. }, e
  19826. }(vn), Qy = r(5), tm = r.n(Qy), em = function () {
  19827. var t = function (e, r) {
  19828. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19829. t.__proto__ = e
  19830. } || function (t, e) {
  19831. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19832. })(e, r)
  19833. };
  19834. return function (e, r) {
  19835. function n() {
  19836. this.constructor = e
  19837. }
  19838. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19839. }
  19840. }();
  19841. function rm(t, e, r) {
  19842. if (3 === t) {
  19843. var n = {keys: [], values: [], features: []}, i = r.readVarint() + r.pos;
  19844. r.readFields(nm, n, i), n.length = n.features.length, n.length && (e[n.name] = n)
  19845. }
  19846. }
  19847. function nm(t, e, r) {
  19848. if (15 === t) e.version = r.readVarint(); else if (1 === t) e.name = r.readString(); else if (5 === t) e.extent = r.readVarint(); else if (2 === t) e.features.push(r.pos); else if (3 === t) e.keys.push(r.readString()); else if (4 === t) {
  19849. for (var n = null, i = r.readVarint() + r.pos; r.pos < i;) n = 1 === (t = r.readVarint() >> 3) ? r.readString() : 2 === t ? r.readFloat() : 3 === t ? r.readDouble() : 4 === t ? r.readVarint64() : 5 === t ? r.readVarint() : 6 === t ? r.readSVarint() : 7 === t ? r.readBoolean() : null;
  19850. e.values.push(n)
  19851. }
  19852. }
  19853. function im(t, e, r) {
  19854. if (1 == t) e.id = r.readVarint(); else if (2 == t) for (var n = r.readVarint() + r.pos; r.pos < n;) {
  19855. var i = e.layer.keys[r.readVarint()], o = e.layer.values[r.readVarint()];
  19856. e.properties[i] = o
  19857. } else 3 == t ? e.type = r.readVarint() : 4 == t && (e.geometry = r.pos)
  19858. }
  19859. function om(t, e, r) {
  19860. t.pos = e.features[r];
  19861. var n = t.readVarint() + t.pos, i = {layer: e, type: 0, properties: {}};
  19862. return t.readFields(im, i, n), i
  19863. }
  19864. var am = function (t) {
  19865. function e(e) {
  19866. var r = t.call(this) || this, n = e || {};
  19867. return r.dataProjection = new je({
  19868. code: "",
  19869. units: St.TILE_PIXELS
  19870. }), r.featureClass_ = n.featureClass ? n.featureClass : Cy, r.geometryName_ = n.geometryName, r.layerName_ = n.layerName ? n.layerName : "layer", r.layers_ = n.layers ? n.layers : null, r.idProperty_ = n.idProperty, r
  19871. }
  19872. return em(e, t), e.prototype.readRawGeometry_ = function (t, e, r, n) {
  19873. t.pos = e.geometry;
  19874. for (var i = t.readVarint() + t.pos, o = 1, a = 0, s = 0, l = 0, u = 0, c = 0; t.pos < i;) {
  19875. if (!a) {
  19876. var h = t.readVarint();
  19877. o = 7 & h, a = h >> 3
  19878. }
  19879. a--, 1 === o || 2 === o ? (s += t.readSVarint(), l += t.readSVarint(), 1 === o && u > c && (n.push(u), c = u), r.push(s, l), u += 2) : 7 === o ? u > c && (r.push(r[c], r[c + 1]), u += 2) : pt(!1, 59)
  19880. }
  19881. u > c && (n.push(u), c = u)
  19882. }, e.prototype.createFeature_ = function (t, e, r) {
  19883. var n, i = e.type;
  19884. if (0 === i) return null;
  19885. var o, a = e.properties;
  19886. this.idProperty_ ? (o = a[this.idProperty_], delete a[this.idProperty_]) : o = e.id, a[this.layerName_] = e.layer.name;
  19887. var s = [], l = [];
  19888. this.readRawGeometry_(t, e, s, l);
  19889. var u = function (t, e) {
  19890. var r;
  19891. 1 === t ? r = 1 === e ? bt.POINT : bt.MULTI_POINT : 2 === t ? r = 1 === e ? bt.LINE_STRING : bt.MULTI_LINE_STRING : 3 === t && (r = bt.POLYGON);
  19892. return r
  19893. }(i, l.length);
  19894. if (this.featureClass_ === Cy) (n = new this.featureClass_(u, s, l, a, o)).transform(r.dataProjection); else {
  19895. var c = void 0;
  19896. if (u == bt.POLYGON) {
  19897. for (var h = [], p = 0, f = 0, d = 0, g = l.length; d < g; ++d) {
  19898. var y = l[d];
  19899. if (ai(s, p, y, 2)) {
  19900. if (0 === h.length) continue;
  19901. h[h.length - 1].push(l[f])
  19902. } else h.push(l.slice(f, d + 1));
  19903. f = d + 1, p = y
  19904. }
  19905. c = h.length > 1 ? new Jy(s, yt, h) : new fi(s, yt, l)
  19906. } else c = u === bt.POINT ? new qn(s, yt) : u === bt.LINE_STRING ? new Py(s, yt) : u === bt.POLYGON ? new fi(s, yt, l) : u === bt.MULTI_POINT ? new Hy(s, yt) : u === bt.MULTI_LINE_STRING ? new Zy(s, yt, l) : null;
  19907. n = new (0, this.featureClass_), this.geometryName_ && n.setGeometryName(this.geometryName_);
  19908. var m = Wy(c, !1, r);
  19909. n.setGeometry(m), n.setId(o), n.setProperties(a, !0)
  19910. }
  19911. return n
  19912. }, e.prototype.getType = function () {
  19913. return Cu
  19914. }, e.prototype.readFeatures = function (t, e) {
  19915. var r = this.layers_, n = this.adaptOptions(e), i = Gr(n.dataProjection);
  19916. i.setWorldExtent(n.extent), n.dataProjection = i;
  19917. var o = new tm.a(t), a = o.readFields(rm, {}), s = [];
  19918. for (var l in a) if (!r || -1 != r.indexOf(l)) {
  19919. var u = a[l], c = u ? [0, 0, u.extent, u.extent] : null;
  19920. i.setExtent(c);
  19921. for (var h = 0, p = u.length; h < p; ++h) {
  19922. var f = om(o, u, h);
  19923. s.push(this.createFeature_(o, f, n))
  19924. }
  19925. }
  19926. return s
  19927. }, e.prototype.readProjection = function (t) {
  19928. return this.dataProjection
  19929. }, e.prototype.setLayers = function (t) {
  19930. this.layers_ = t
  19931. }, e
  19932. }(Yy), sm = function () {
  19933. var t = function (e, r) {
  19934. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  19935. t.__proto__ = e
  19936. } || function (t, e) {
  19937. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  19938. })(e, r)
  19939. };
  19940. return function (e, r) {
  19941. function n() {
  19942. this.constructor = e
  19943. }
  19944. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  19945. }
  19946. }(), lm = function (t) {
  19947. function e(e) {
  19948. var r = this, n = e || {}, i = O({}, n);
  19949. delete i.preload, delete i.useInterimTilesOnError, r = t.call(this, i) || this;
  19950. var o = n.renderMode || dy;
  19951. return pt(null == o || o == fy || o == dy || o == gy, 28), r.renderMode_ = o, r.setPreload(n.preload ? n.preload : 0), r.setUseInterimTilesOnError(void 0 === n.useInterimTilesOnError || n.useInterimTilesOnError), r
  19952. }
  19953. return sm(e, t), e.prototype.createRenderer = function () {
  19954. return new _y(this)
  19955. }, e.prototype.getFeatures = function (e) {
  19956. return t.prototype.getFeatures.call(this, e)
  19957. }, e.prototype.getRenderMode = function () {
  19958. return this.renderMode_
  19959. }, e.prototype.getPreload = function () {
  19960. return this.get(gd)
  19961. }, e.prototype.getUseInterimTilesOnError = function () {
  19962. return this.get(yd)
  19963. }, e.prototype.setPreload = function (t) {
  19964. this.set(gd, t)
  19965. }, e.prototype.setUseInterimTilesOnError = function (t) {
  19966. this.set(yd, t)
  19967. }, e
  19968. }(wg), um = r(2), cm = r.n(um), hm = r(0);
  19969. "function" == typeof Object.assign && Object.assign;
  19970. function pm(t) {
  19971. return t * Math.PI / 180
  19972. }
  19973. var fm = function () {
  19974. for (var t = [], e = 78271.51696402048; t.length <= 24; e /= 2) t.push(e);
  19975. return t
  19976. }();
  19977. function dm(t, e) {
  19978. if ("undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope && "undefined" != typeof OffscreenCanvas) return new OffscreenCanvas(t, e);
  19979. var r = document.createElement("canvas");
  19980. return r.width = t, r.height = e, r
  19981. }
  19982. var gm, ym = Array(256).join(" ");
  19983. function mm(t, e) {
  19984. if (e >= .05) {
  19985. for (var r = "", n = t.split("\n"), i = ym.slice(0, Math.round(e / .1)), o = 0, a = n.length; o < a; ++o) o > 0 && (r += "\n"), r += n[o].split("").join(i);
  19986. return r
  19987. }
  19988. return t
  19989. }
  19990. function vm() {
  19991. return gm || (gm = dm(1, 1).getContext("2d")), gm
  19992. }
  19993. function _m(t, e) {
  19994. return vm().measureText(t).width + (t.length - 1) * e
  19995. }
  19996. var bm = {};
  19997. ga && Z(ga, k, (function () {
  19998. bm = {}
  19999. }));
  20000. var xm, wm, Sm = hm.e.isFunction, Em = hm.e.convertFunction, Tm = hm.c.isExpression,
  20001. Cm = hm.c.createPropertyExpression,
  20002. Om = {Point: 1, MultiPoint: 1, LineString: 2, MultiLineString: 2, Polygon: 3, MultiPolygon: 3}, Pm = {
  20003. center: [.5, .5],
  20004. left: [0, .5],
  20005. right: [1, .5],
  20006. top: [.5, 0],
  20007. bottom: [.5, 1],
  20008. "top-left": [0, 0],
  20009. "top-right": [1, 0],
  20010. "bottom-left": [0, 1],
  20011. "bottom-right": [1, 1]
  20012. }, Rm = {}, Im = {zoom: 0}, Lm = {};
  20013. function Mm(t, e, r, n, i) {
  20014. var o = t.id;
  20015. Lm[o] || (Lm[o] = {});
  20016. var a = Lm[o];
  20017. if (!a[r]) {
  20018. var s = (t[e] || Rm)[r], l = hm.f[e + "_" + t.type][r];
  20019. void 0 === s && (s = l.default);
  20020. var u = Tm(s);
  20021. if (!u && Sm(s) && (s = Em(s, l), u = !0), u) {
  20022. var c = function (t, e) {
  20023. var r = Cm(t, e);
  20024. if ("error" === r.result) throw new Error(r.value.map((function (t) {
  20025. return t.key + ": " + t.message
  20026. })).join(", "));
  20027. return r.value
  20028. }(s, l);
  20029. a[r] = c.evaluate.bind(c)
  20030. } else "color" == l.type && (s = hm.a.parse(s)), a[r] = function () {
  20031. return s
  20032. }
  20033. }
  20034. return Im.zoom = n, a[r](Im, i)
  20035. }
  20036. var Fm = {};
  20037. function Am(t, e) {
  20038. if (t) {
  20039. if (0 === t.a || 0 === e) return;
  20040. var r = t.a;
  20041. return e = void 0 === e ? 1 : e, "rgba(" + Math.round(255 * t.r / r) + "," + Math.round(255 * t.g / r) + "," + Math.round(255 * t.b / r) + "," + r * e + ")"
  20042. }
  20043. return t
  20044. }
  20045. var km = /^([^]*)\{(.*)\}([^]*)$/;
  20046. function jm(t, e) {
  20047. var r;
  20048. do {
  20049. if (r = t.match(km)) {
  20050. var n = e[r[2]] || "";
  20051. t = r[1] + n + r[3]
  20052. }
  20053. } while (r);
  20054. return t
  20055. }
  20056. var Nm = !1;
  20057. var Dm = function (t, e, r, n, i, o, a) {
  20058. if (void 0 === n && (n = fm), "string" == typeof e && (e = JSON.parse(e)), 8 != e.version) throw new Error("glStyle version 8 required.");
  20059. var s, l;
  20060. if (o) if ("undefined" != typeof Image) {
  20061. var u = new Image;
  20062. u.crossOrigin = "anonymous", u.onload = function () {
  20063. s = u, l = [u.width, u.height], t.changed(), u.onload = null
  20064. }, u.src = o
  20065. } else if ("undefined" != typeof WorkerGlobalScope && self instanceof WorkerGlobalScope) {
  20066. var c = self;
  20067. c.postMessage({action: "loadImage", src: o}), c.addEventListener("message", (function (t) {
  20068. "imageLoaded" === t.data.action && t.data.src === o && (s = t.data.image, l = [s.width, s.height])
  20069. }))
  20070. }
  20071. for (var h, p = Object(hm.b)(e.layers), f = {}, d = [], g = 0, y = p.length; g < y; ++g) {
  20072. var m = p[g], v = m.id;
  20073. if ("string" == typeof r && m.source == r || -1 !== r.indexOf(v)) {
  20074. var _ = m["source-layer"];
  20075. if (!h) {
  20076. h = m.source;
  20077. var b = e.sources[h];
  20078. if (!b) throw new Error('Source "' + h + '" is not defined');
  20079. var x = b.type;
  20080. if ("vector" !== x && "geojson" !== x) throw new Error('Source "' + h + '" is not of type "vector" or "geojson", but "' + x + '"')
  20081. }
  20082. var w = f[_];
  20083. w || (w = f[_] = []), w.push({layer: m, index: g}), d.push(v)
  20084. }
  20085. delete Lm[v], delete Fm[v]
  20086. }
  20087. var S = new gp, E = new ep, T = {}, C = {}, O = [], P = function (t, e) {
  20088. var r = t.getProperties(), o = f[r.layer];
  20089. if (o) {
  20090. var u = n.indexOf(e);
  20091. -1 == u && (u = function (t, e) {
  20092. for (var r = 0, n = e.length; r < n; ++r) {
  20093. if (e[r] < t && r + 1 < n) {
  20094. var i = e[r] / e[r + 1];
  20095. return r + Math.log(e[r] / t) / Math.log(i)
  20096. }
  20097. }
  20098. return n - 1
  20099. }(e, n));
  20100. for (var c, h = Om[t.getGeometry().getType()], p = {properties: r, type: h}, d = -1, g = function (n, f) {
  20101. var g = o[n], y = g.layer, m = y.id, v = y.layout || Rm, _ = y.paint || Rm;
  20102. if ("none" === v.visibility || "minzoom" in y && u < y.minzoom || "maxzoom" in y && u >= y.maxzoom) return "continue";
  20103. var b = y.filter;
  20104. if (!b || function (t, e, r, n) {
  20105. return t in Fm || (Fm[t] = Object(hm.d)(e).filter), Im.zoom = n, Fm[t](Im, r)
  20106. }(m, b, p, u)) {
  20107. c = y;
  20108. var x = void 0, w = void 0, P = void 0, R = void 0, I = void 0, L = void 0, M = g.index;
  20109. if (3 == h && ("fill" == y.type || "fill-extrusion" == y.type)) if (w = Mm(y, "paint", y.type + "-opacity", u, p), y.type + "-pattern" in _) {
  20110. var F = Mm(y, "paint", y.type + "-pattern", u, p);
  20111. if (F) {
  20112. var A = "string" == typeof F ? jm(F, r) : F.toString();
  20113. if (s && i && i[A]) {
  20114. ++d, (L = O[d]) && L.getFill() && !L.getStroke() && !L.getText() || (L = O[d] = new wp({fill: new ep})), P = L.getFill(), L.setZIndex(M);
  20115. var k = C[ut = A + "." + w];
  20116. if (!k) (pt = (ht = dm((ct = i[A]).width, ct.height)).getContext("2d")).globalAlpha = w, pt.drawImage(s, ct.x, ct.y, ct.width, ct.height, 0, 0, ct.width, ct.height), k = pt.createPattern(ht, "repeat"), C[ut] = k;
  20117. P.setColor(k)
  20118. }
  20119. }
  20120. } else (x = Am(Mm(y, "paint", y.type + "-color", u, p), w)) && (y.type + "-outline-color" in _ && (I = Am(Mm(y, "paint", y.type + "-outline-color", u, p), w)), I || (I = x), ++d, (L = O[d]) && L.getFill() && L.getStroke() && !L.getText() || (L = O[d] = new wp({
  20121. fill: new ep,
  20122. stroke: new gp
  20123. })), (P = L.getFill()).setColor(x), (R = L.getStroke()).setColor(I), R.setWidth(1), L.setZIndex(M));
  20124. if (1 != h && "line" == y.type) {
  20125. x = !("line-pattern" in _) && "line-color" in _ ? Am(Mm(y, "paint", "line-color", u, p), Mm(y, "paint", "line-opacity", u, p)) : void 0;
  20126. var j = Mm(y, "paint", "line-width", u, p);
  20127. x && j > 0 && (++d, (L = O[d]) && L.getStroke() && !L.getFill() && !L.getText() || (L = O[d] = new wp({stroke: new gp})), (R = L.getStroke()).setLineCap(Mm(y, "layout", "line-cap", u, p)), R.setLineJoin(Mm(y, "layout", "line-join", u, p)), R.setMiterLimit(Mm(y, "layout", "line-miter-limit", u, p)), R.setColor(x), R.setWidth(j), R.setLineDash(_["line-dasharray"] ? Mm(y, "paint", "line-dasharray", u, p).map((function (t) {
  20128. return t * j
  20129. })) : null), L.setZIndex(M))
  20130. }
  20131. var N = !1, D = null, G = 0, z = void 0, U = void 0, B = void 0;
  20132. if ((1 == h || 2 == h) && "icon-image" in v) {
  20133. var V = Mm(y, "layout", "icon-image", u, p);
  20134. if (V) {
  20135. z = "string" == typeof V ? jm(V, r) : V.toString();
  20136. var Y = void 0;
  20137. if (s && i && i[z]) {
  20138. var W = Mm(y, "layout", "icon-rotation-alignment", u, p);
  20139. if (2 == h) {
  20140. var q = t.getGeometry();
  20141. if (q.getFlatMidpoint || q.getFlatMidpoints) {
  20142. var X = q.getExtent();
  20143. if (Math.sqrt(Math.max(Math.pow((X[2] - X[0]) / e, 2), Math.pow((X[3] - X[1]) / e, 2))) > 150) {
  20144. var Z = "MultiLineString" === q.getType() ? q.getFlatMidpoints() : q.getFlatMidpoint();
  20145. if (wm || (wm = new Cy("Point", xm = [NaN, NaN], [], {}, null)), Y = wm, xm[0] = Z[0], xm[1] = Z[1], "line" === (Mt = Mm(y, "layout", "symbol-placement", u, p)) && "map" === W) for (var K = q.getStride(), H = q.getFlatCoordinates(), $ = 0, J = H.length - K; $ < J; $ += K) {
  20146. var Q = H[$], tt = H[$ + 1], et = H[$ + K], rt = H[$ + K + 1], nt = Math.min(Q, et),
  20147. it = Math.min(tt, rt), ot = Math.max(Q, et), at = Math.max(tt, rt);
  20148. if (Z[0] >= nt && Z[0] <= ot && Z[1] >= it && Z[1] <= at) {
  20149. G = Math.atan2(tt - rt, et - Q);
  20150. break
  20151. }
  20152. }
  20153. }
  20154. }
  20155. }
  20156. if (2 !== h || Y) {
  20157. ++d, (L = O[d]) && L.getImage() && !L.getFill() && !L.getStroke() || (L = O[d] = new wp), L.setGeometry(Y);
  20158. var st = Mm(y, "layout", "icon-size", u, p),
  20159. lt = void 0 !== _["icon-color"] ? Mm(y, "paint", "icon-color", u, p) : null, ut = z + "." + st;
  20160. if (null !== lt && (ut += "." + lt), !(U = T[ut])) {
  20161. var ct = i[z];
  20162. if (null !== lt) {
  20163. var ht, pt;
  20164. (pt = (ht = dm(ct.width, ct.height)).getContext("2d")).drawImage(s, ct.x, ct.y, ct.width, ct.height, 0, 0, ct.width, ct.height);
  20165. for (var ft = pt.getImageData(0, 0, ht.width, ht.height), dt = 0, gt = ft.data.length; dt < gt; dt += 4) {
  20166. var yt = lt.a;
  20167. 0 !== yt && (ft.data[dt] = 255 * lt.r / yt, ft.data[dt + 1] = 255 * lt.g / yt, ft.data[dt + 2] = 255 * lt.b / yt), ft.data[dt + 3] = yt
  20168. }
  20169. pt.putImageData(ft, 0, 0), U = T[ut] = new dp({
  20170. img: ht,
  20171. imgSize: [ht.width, ht.height],
  20172. scale: st / ct.pixelRatio
  20173. })
  20174. } else U = T[ut] = new dp({
  20175. img: s,
  20176. imgSize: l,
  20177. size: [ct.width, ct.height],
  20178. offset: [ct.x, ct.y],
  20179. rotateWithView: "map" === W,
  20180. scale: st / ct.pixelRatio
  20181. })
  20182. }
  20183. U.setRotation(G + pm(Mm(y, "layout", "icon-rotate", u, p))), U.setOpacity(Mm(y, "paint", "icon-opacity", u, p)), U.setAnchor(Pm[Mm(y, "layout", "icon-anchor", u, p)]), L.setImage(U), D = L.getText(), L.setText(void 0), L.setZIndex(M), N = !0, B = !1
  20184. } else B = !0
  20185. }
  20186. }
  20187. }
  20188. if (1 == h && "circle-radius" in _) {
  20189. ++d, (L = O[d]) && L.getImage() && !L.getFill() && !L.getStroke() || (L = O[d] = new wp);
  20190. var mt = Mm(y, "paint", "circle-radius", u, p),
  20191. vt = Am(Mm(y, "paint", "circle-stroke-color", u, p), Mm(y, "paint", "circle-stroke-opacity", u, p)),
  20192. _t = Am(Mm(y, "paint", "circle-color", u, p), Mm(y, "paint", "circle-opacity", u, p)),
  20193. bt = Mm(y, "paint", "circle-stroke-width", u, p), xt = mt + "." + vt + "." + _t + "." + bt;
  20194. (U = T[xt]) || (U = T[xt] = new tp({
  20195. radius: mt,
  20196. stroke: vt && bt > 0 ? new gp({width: bt, color: vt}) : void 0,
  20197. fill: _t ? new ep({color: _t}) : void 0
  20198. })), L.setImage(U), D = L.getText(), L.setText(void 0), L.setGeometry(void 0), L.setZIndex(M), N = !0
  20199. }
  20200. var wt = void 0;
  20201. if ("text-field" in v) wt = jm(Mm(y, "layout", "text-field", u, p).toString(), r).trim(), w = Mm(y, "paint", "text-opacity", u, p);
  20202. if (wt && w && !B) {
  20203. N || (++d, (L = O[d]) && L.getText() && !L.getFill() && !L.getStroke() || (L = O[d] = new wp), L.setImage(void 0), L.setGeometry(void 0)), L.getText() || L.setText(D || new Tp({padding: [2, 2, 2, 2]})), D = L.getText();
  20204. var St = Math.round(Mm(y, "layout", "text-size", u, p)), Et = Mm(y, "layout", "text-font", u, p),
  20205. Tt = Mm(y, "layout", "text-line-height", u, p), Ct = cm()(a ? a(Et) : Et, St, Tt),
  20206. Ot = v["text-transform"];
  20207. "uppercase" == Ot ? wt = wt.toUpperCase() : "lowercase" == Ot && (wt = wt.toLowerCase());
  20208. var Pt = Mm(y, "layout", "text-max-width", u, p), Rt = Mm(y, "layout", "text-letter-spacing", u, p),
  20209. It = 2 == h ? mm(wt, Rt) : function t(e, r, n, i) {
  20210. if (-1 !== e.indexOf("\n")) {
  20211. for (var o = e.split("\n"), a = [], s = 0, l = o.length; s < l; ++s) a.push(t(o[s], r, n, i));
  20212. return a.join("\n")
  20213. }
  20214. var u = n + "," + r + "," + e + "," + i, c = bm[u];
  20215. if (!c) {
  20216. var h = e.split(" ");
  20217. if (h.length > 1) {
  20218. var p = vm();
  20219. p.font = r;
  20220. var f = p.measureText("M").width * n, d = "";
  20221. for (a = [], s = 0, l = h.length; s < l; ++s) {
  20222. var g = h[s], y = d + (d ? " " : "") + g;
  20223. _m(y, i) <= f ? d = y : (d && a.push(d), d = g)
  20224. }
  20225. d && a.push(d);
  20226. for (s = 0, l = a.length; s < l && l > 1; ++s) {
  20227. var m = a[s];
  20228. if (_m(m, i) < .35 * f) {
  20229. var v = s > 0 ? _m(a[s - 1], i) : 1 / 0, _ = s < l - 1 ? _m(a[s + 1], i) : 1 / 0;
  20230. a.splice(s, 1), l -= 1, v < _ ? (a[s - 1] += " " + m, s -= 1) : a[s] = m + " " + a[s]
  20231. }
  20232. }
  20233. for (s = 0, l = a.length - 1; s < l; ++s) {
  20234. var b = a[s], x = a[s + 1];
  20235. if (_m(b, i) > .7 * f && _m(x, i) < .6 * f) {
  20236. var w = b.split(" "), S = w.pop();
  20237. _m(S, i) < .2 * f && (a[s] = w.join(" "), a[s + 1] = S + " " + x), l -= 1
  20238. }
  20239. }
  20240. c = a.join("\n")
  20241. } else c = e;
  20242. c = mm(c, i), bm[u] = c
  20243. }
  20244. return c
  20245. }(wt, Ct, Pt, Rt);
  20246. D.setText(It), D.setFont(Ct), D.setRotation(pm(Mm(y, "layout", "text-rotate", u, p)));
  20247. var Lt = Mm(y, "layout", "text-anchor", u, p),
  20248. Mt = N || 1 == h ? "point" : Mm(y, "layout", "symbol-placement", u, p);
  20249. D.setPlacement(Mt);
  20250. var Ft = Mm(y, "paint", "text-halo-width", u, p), At = Mm(y, "layout", "text-offset", u, p),
  20251. kt = Mm(y, "paint", "text-translate", u, p), jt = 0, Nt = 0;
  20252. if ("point" == Mt) {
  20253. var Dt = "center";
  20254. -1 !== Lt.indexOf("left") ? (Dt = "left", Nt = Ft) : -1 !== Lt.indexOf("right") && (Dt = "right", Nt = -Ft), D.setTextAlign(Dt);
  20255. var Gt = Mm(y, "layout", "text-rotation-alignment", u, p);
  20256. D.setRotateWithView("map" == Gt)
  20257. } else D.setMaxAngle(pm(Mm(y, "layout", "text-max-angle", u, p)) * wt.length / It.length), D.setTextAlign(), D.setRotateWithView(!1);
  20258. var zt = "middle";
  20259. 0 == Lt.indexOf("bottom") ? (zt = "bottom", jt = -Ft - .5 * (Tt - 1) * St) : 0 == Lt.indexOf("top") && (zt = "top", jt = Ft + .5 * (Tt - 1) * St), D.setTextBaseline(zt), D.setOffsetX(At[0] * St + Nt + kt[0]), D.setOffsetY(At[1] * St + jt + kt[1]), E.setColor(Am(Mm(y, "paint", "text-color", u, p), w)), D.setFill(E);
  20260. var Ut = Am(Mm(y, "paint", "text-halo-color", u, p), w);
  20261. if (Ut) {
  20262. S.setColor(Ut), Ft *= 2;
  20263. var Bt = .5 * St;
  20264. S.setWidth(Ft <= Bt ? Ft : Bt), D.setStroke(S)
  20265. } else D.setStroke(void 0);
  20266. var Vt = Mm(y, "layout", "text-padding", u, p), Yt = D.getPadding();
  20267. Vt !== Yt[0] && (Yt[0] = Yt[1] = Yt[2] = Yt[3] = Vt), L.setZIndex(M)
  20268. }
  20269. }
  20270. }, y = 0, m = o.length; y < m; ++y) g(y);
  20271. return d > -1 ? (O.length = d + 1, Nm && ("function" == typeof t.set ? t.set("mapbox-layer", c) : t.getProperties()["mapbox-layer"] = c), O) : void 0
  20272. }
  20273. };
  20274. return t.setStyle(P), t.set("mapbox-source", h), t.set("mapbox-layers", d), P
  20275. }, Gm = r(6), zm = r.n(Gm), Um = function () {
  20276. var t = function (e, r) {
  20277. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20278. t.__proto__ = e
  20279. } || function (t, e) {
  20280. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20281. })(e, r)
  20282. };
  20283. return function (e, r) {
  20284. function n() {
  20285. this.constructor = e
  20286. }
  20287. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20288. }
  20289. }();
  20290. function Bm(t) {
  20291. for (var e = [], r = 0, n = t.length; r < n; ++r) e.push(t[r].clone());
  20292. return e
  20293. }
  20294. var Vm = function (t) {
  20295. function e(e) {
  20296. var r = t.call(this) || this;
  20297. return r.geometries_ = e || null, r.changeEventsKeys_ = [], r.listenGeometriesChange_(), r
  20298. }
  20299. return Um(e, t), e.prototype.unlistenGeometriesChange_ = function () {
  20300. this.changeEventsKeys_.forEach(H), this.changeEventsKeys_.length = 0
  20301. }, e.prototype.listenGeometriesChange_ = function () {
  20302. if (this.geometries_) for (var t = 0, e = this.geometries_.length; t < e; ++t) this.changeEventsKeys_.push(Z(this.geometries_[t], F, this.changed, this))
  20303. }, e.prototype.clone = function () {
  20304. var t = new e(null);
  20305. return t.setGeometries(this.geometries_), t.applyProperties(this), t
  20306. }, e.prototype.closestPointXY = function (t, e, r, n) {
  20307. if (n < Jt(this.getExtent(), t, e)) return n;
  20308. for (var i = this.geometries_, o = 0, a = i.length; o < a; ++o) n = i[o].closestPointXY(t, e, r, n);
  20309. return n
  20310. }, e.prototype.containsXY = function (t, e) {
  20311. for (var r = this.geometries_, n = 0, i = r.length; n < i; ++n) if (r[n].containsXY(t, e)) return !0;
  20312. return !1
  20313. }, e.prototype.computeExtent = function (t) {
  20314. oe(t);
  20315. for (var e = this.geometries_, r = 0, n = e.length; r < n; ++r) he(t, e[r].getExtent());
  20316. return t
  20317. }, e.prototype.getGeometries = function () {
  20318. return Bm(this.geometries_)
  20319. }, e.prototype.getGeometriesArray = function () {
  20320. return this.geometries_
  20321. }, e.prototype.getGeometriesArrayRecursive = function () {
  20322. for (var t = [], e = this.geometries_, r = 0, n = e.length; r < n; ++r) e[r].getType() === this.getType() ? t = t.concat(e[r].getGeometriesArrayRecursive()) : t.push(e[r]);
  20323. return t
  20324. }, e.prototype.getSimplifiedGeometry = function (t) {
  20325. if (this.simplifiedGeometryRevision !== this.getRevision() && (this.simplifiedGeometryMaxMinSquaredTolerance = 0, this.simplifiedGeometryRevision = this.getRevision()), t < 0 || 0 !== this.simplifiedGeometryMaxMinSquaredTolerance && t < this.simplifiedGeometryMaxMinSquaredTolerance) return this;
  20326. for (var r = [], n = this.geometries_, i = !1, o = 0, a = n.length; o < a; ++o) {
  20327. var s = n[o], l = s.getSimplifiedGeometry(t);
  20328. r.push(l), l !== s && (i = !0)
  20329. }
  20330. if (i) {
  20331. var u = new e(null);
  20332. return u.setGeometriesArray(r), u
  20333. }
  20334. return this.simplifiedGeometryMaxMinSquaredTolerance = t, this
  20335. }, e.prototype.getType = function () {
  20336. return bt.GEOMETRY_COLLECTION
  20337. }, e.prototype.intersectsExtent = function (t) {
  20338. for (var e = this.geometries_, r = 0, n = e.length; r < n; ++r) if (e[r].intersectsExtent(t)) return !0;
  20339. return !1
  20340. }, e.prototype.isEmpty = function () {
  20341. return 0 === this.geometries_.length
  20342. }, e.prototype.rotate = function (t, e) {
  20343. for (var r = this.geometries_, n = 0, i = r.length; n < i; ++n) r[n].rotate(t, e);
  20344. this.changed()
  20345. }, e.prototype.scale = function (t, e, r) {
  20346. var n = r;
  20347. n || (n = xe(this.getExtent()));
  20348. for (var i = this.geometries_, o = 0, a = i.length; o < a; ++o) i[o].scale(t, e, n);
  20349. this.changed()
  20350. }, e.prototype.setGeometries = function (t) {
  20351. this.setGeometriesArray(Bm(t))
  20352. }, e.prototype.setGeometriesArray = function (t) {
  20353. this.unlistenGeometriesChange_(), this.geometries_ = t, this.listenGeometriesChange_(), this.changed()
  20354. }, e.prototype.applyTransform = function (t) {
  20355. for (var e = this.geometries_, r = 0, n = e.length; r < n; ++r) e[r].applyTransform(t);
  20356. this.changed()
  20357. }, e.prototype.translate = function (t, e) {
  20358. for (var r = this.geometries_, n = 0, i = r.length; n < i; ++n) r[n].translate(t, e);
  20359. this.changed()
  20360. }, e.prototype.disposeInternal = function () {
  20361. this.unlistenGeometriesChange_(), t.prototype.disposeInternal.call(this)
  20362. }, e
  20363. }(dn), Ym = function () {
  20364. var t = function (e, r) {
  20365. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20366. t.__proto__ = e
  20367. } || function (t, e) {
  20368. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20369. })(e, r)
  20370. };
  20371. return function (e, r) {
  20372. function n() {
  20373. this.constructor = e
  20374. }
  20375. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20376. }
  20377. }();
  20378. function Wm(t) {
  20379. if ("string" == typeof t) {
  20380. var e = JSON.parse(t);
  20381. return e || null
  20382. }
  20383. return null !== t ? t : null
  20384. }
  20385. var qm = function (t) {
  20386. function e() {
  20387. return t.call(this) || this
  20388. }
  20389. return Ym(e, t), e.prototype.getType = function () {
  20390. return Ou
  20391. }, e.prototype.readFeature = function (t, e) {
  20392. return this.readFeatureFromObject(Wm(t), this.getReadOptions(t, e))
  20393. }, e.prototype.readFeatures = function (t, e) {
  20394. return this.readFeaturesFromObject(Wm(t), this.getReadOptions(t, e))
  20395. }, e.prototype.readFeatureFromObject = function (t, e) {
  20396. return n()
  20397. }, e.prototype.readFeaturesFromObject = function (t, e) {
  20398. return n()
  20399. }, e.prototype.readGeometry = function (t, e) {
  20400. return this.readGeometryFromObject(Wm(t), this.getReadOptions(t, e))
  20401. }, e.prototype.readGeometryFromObject = function (t, e) {
  20402. return n()
  20403. }, e.prototype.readProjection = function (t) {
  20404. return this.readProjectionFromObject(Wm(t))
  20405. }, e.prototype.readProjectionFromObject = function (t) {
  20406. return n()
  20407. }, e.prototype.writeFeature = function (t, e) {
  20408. return JSON.stringify(this.writeFeatureObject(t, e))
  20409. }, e.prototype.writeFeatureObject = function (t, e) {
  20410. return n()
  20411. }, e.prototype.writeFeatures = function (t, e) {
  20412. return JSON.stringify(this.writeFeaturesObject(t, e))
  20413. }, e.prototype.writeFeaturesObject = function (t, e) {
  20414. return n()
  20415. }, e.prototype.writeGeometry = function (t, e) {
  20416. return JSON.stringify(this.writeGeometryObject(t, e))
  20417. }, e.prototype.writeGeometryObject = function (t, e) {
  20418. return n()
  20419. }, e
  20420. }(Yy), Xm = function () {
  20421. var t = function (e, r) {
  20422. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20423. t.__proto__ = e
  20424. } || function (t, e) {
  20425. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20426. })(e, r)
  20427. };
  20428. return function (e, r) {
  20429. function n() {
  20430. this.constructor = e
  20431. }
  20432. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20433. }
  20434. }();
  20435. function Zm(t, e) {
  20436. if (!t) return null;
  20437. var r;
  20438. switch (t.type) {
  20439. case bt.POINT:
  20440. r = function (t) {
  20441. return new qn(t.coordinates)
  20442. }(t);
  20443. break;
  20444. case bt.LINE_STRING:
  20445. r = function (t) {
  20446. return new Py(t.coordinates)
  20447. }(t);
  20448. break;
  20449. case bt.POLYGON:
  20450. r = function (t) {
  20451. return new fi(t.coordinates)
  20452. }(t);
  20453. break;
  20454. case bt.MULTI_POINT:
  20455. r = function (t) {
  20456. return new Hy(t.coordinates)
  20457. }(t);
  20458. break;
  20459. case bt.MULTI_LINE_STRING:
  20460. r = function (t) {
  20461. return new Zy(t.coordinates)
  20462. }(t);
  20463. break;
  20464. case bt.MULTI_POLYGON:
  20465. r = function (t) {
  20466. return new Jy(t.coordinates)
  20467. }(t);
  20468. break;
  20469. case bt.GEOMETRY_COLLECTION:
  20470. r = function (t, e) {
  20471. var r = t.geometries.map((function (t) {
  20472. return Zm(t, e)
  20473. }));
  20474. return new Vm(r)
  20475. }(t);
  20476. break;
  20477. default:
  20478. throw new Error("Unsupported GeoJSON type: " + t.type)
  20479. }
  20480. return Wy(r, !1, e)
  20481. }
  20482. function Km(t, e) {
  20483. var r, n = (t = Wy(t, !0, e)).getType();
  20484. switch (n) {
  20485. case bt.POINT:
  20486. r = function (t, e) {
  20487. return {type: "Point", coordinates: t.getCoordinates()}
  20488. }(t);
  20489. break;
  20490. case bt.LINE_STRING:
  20491. r = function (t, e) {
  20492. return {type: "LineString", coordinates: t.getCoordinates()}
  20493. }(t);
  20494. break;
  20495. case bt.POLYGON:
  20496. r = function (t, e) {
  20497. var r;
  20498. e && (r = e.rightHanded);
  20499. return {type: "Polygon", coordinates: t.getCoordinates(r)}
  20500. }(t, e);
  20501. break;
  20502. case bt.MULTI_POINT:
  20503. r = function (t, e) {
  20504. return {type: "MultiPoint", coordinates: t.getCoordinates()}
  20505. }(t);
  20506. break;
  20507. case bt.MULTI_LINE_STRING:
  20508. r = function (t, e) {
  20509. return {type: "MultiLineString", coordinates: t.getCoordinates()}
  20510. }(t);
  20511. break;
  20512. case bt.MULTI_POLYGON:
  20513. r = function (t, e) {
  20514. var r;
  20515. e && (r = e.rightHanded);
  20516. return {type: "MultiPolygon", coordinates: t.getCoordinates(r)}
  20517. }(t, e);
  20518. break;
  20519. case bt.GEOMETRY_COLLECTION:
  20520. r = function (t, e) {
  20521. return {
  20522. type: "GeometryCollection", geometries: t.getGeometriesArray().map((function (t) {
  20523. var r = O({}, e);
  20524. return delete r.featureProjection, Km(t, r)
  20525. }))
  20526. }
  20527. }(t, e);
  20528. break;
  20529. case bt.CIRCLE:
  20530. r = {type: "GeometryCollection", geometries: []};
  20531. break;
  20532. default:
  20533. throw new Error("Unsupported geometry type: " + n)
  20534. }
  20535. return r
  20536. }
  20537. var Hm, $m = function (t) {
  20538. function e(e) {
  20539. var r = this, n = e || {};
  20540. return (r = t.call(this) || this).dataProjection = Gr(n.dataProjection ? n.dataProjection : "EPSG:4326"), n.featureProjection && (r.defaultFeatureProjection = Gr(n.featureProjection)), r.geometryName_ = n.geometryName, r.extractGeometryName_ = n.extractGeometryName, r
  20541. }
  20542. return Xm(e, t), e.prototype.readFeatureFromObject = function (t, e) {
  20543. var r = null,
  20544. n = Zm((r = "Feature" === t.type ? t : {type: "Feature", geometry: t, properties: null}).geometry, e),
  20545. i = new gt;
  20546. return this.geometryName_ ? i.setGeometryName(this.geometryName_) : this.extractGeometryName_ && "geometry_name" in r !== void 0 && i.setGeometryName(r.geometry_name), i.setGeometry(n), "id" in r && i.setId(r.id), r.properties && i.setProperties(r.properties, !0), i
  20547. }, e.prototype.readFeaturesFromObject = function (t, e) {
  20548. var r = null;
  20549. if ("FeatureCollection" === t.type) {
  20550. r = [];
  20551. for (var n = t.features, i = 0, o = n.length; i < o; ++i) r.push(this.readFeatureFromObject(n[i], e))
  20552. } else r = [this.readFeatureFromObject(t, e)];
  20553. return r
  20554. }, e.prototype.readGeometryFromObject = function (t, e) {
  20555. return Zm(t, e)
  20556. }, e.prototype.readProjectionFromObject = function (t) {
  20557. var e, r = t.crs;
  20558. return r ? "name" == r.type ? e = Gr(r.properties.name) : "EPSG" === r.type ? e = Gr("EPSG:" + r.properties.code) : pt(!1, 36) : e = this.dataProjection, e
  20559. }, e.prototype.writeFeatureObject = function (t, e) {
  20560. e = this.adaptOptions(e);
  20561. var r = {type: "Feature", geometry: null, properties: null}, n = t.getId();
  20562. if (void 0 !== n && (r.id = n), !t.hasProperties()) return r;
  20563. var i = t.getProperties(), o = t.getGeometry();
  20564. return o && (r.geometry = Km(o, e), delete i[t.getGeometryName()]), I(i) || (r.properties = i), r
  20565. }, e.prototype.writeFeaturesObject = function (t, e) {
  20566. e = this.adaptOptions(e);
  20567. for (var r = [], n = 0, i = t.length; n < i; ++n) r.push(this.writeFeatureObject(t[n], e));
  20568. return {type: "FeatureCollection", features: r}
  20569. }, e.prototype.writeGeometryObject = function (t, e) {
  20570. return Km(t, this.adaptOptions(e))
  20571. }, e
  20572. }(qm), Jm = /font-family: ?([^;]*);/, Qm = /("|')/g;
  20573. function tv(t) {
  20574. if (!Hm) {
  20575. Hm = {};
  20576. for (var e = document.styleSheets, r = 0, n = e.length; r < n; ++r) {
  20577. var i = e[r];
  20578. try {
  20579. var o = i.rules || i.cssRules;
  20580. if (o) for (var a = 0, s = o.length; a < s; ++a) {
  20581. var l = o[a];
  20582. if (5 == l.type) {
  20583. var u = l.cssText.match(Jm);
  20584. Hm[u[1].replace(Qm, "")] = !0
  20585. }
  20586. }
  20587. } catch (t) {
  20588. }
  20589. }
  20590. }
  20591. return t in Hm
  20592. }
  20593. var ev = {}, rv = zm.a.getNames();
  20594. function nv(t) {
  20595. var e = t.toString();
  20596. if (e in ev) return t;
  20597. for (var r = t.map((function (t) {
  20598. var e = cm()(t, 1).split(" ");
  20599. return [e.slice(3).join(" ").replace(/"/g, ""), e[1] + e[0]]
  20600. })), n = 0, i = r.length; n < i; ++n) {
  20601. var o = r[n], a = o[0];
  20602. if (!tv(a) && -1 !== rv.indexOf(a)) {
  20603. var s = "https://fonts.googleapis.com/css?family=" + a.replace(/ /g, "+") + ":" + o[1];
  20604. if (!document.querySelector('link[href="' + s + '"]')) {
  20605. var l = document.createElement("link");
  20606. l.href = s, l.rel = "stylesheet", document.head.appendChild(l)
  20607. }
  20608. }
  20609. }
  20610. return ev[e] = !0, t
  20611. }
  20612. var iv = /^(.*)(\?.*)$/;
  20613. function ov(t, e) {
  20614. return e && 0 === t.indexOf(".") && (t = e + t), t
  20615. }
  20616. function av(t, e, r) {
  20617. var n = (t = ov(t, e)).match(iv);
  20618. return n ? n[1] + r + (n.length > 2 ? n[2] : "") : t + r
  20619. }
  20620. function sv(t, e, r, n, i) {
  20621. return new Promise((function (o, a) {
  20622. if ("object" != typeof e && (e = JSON.parse(e)), 8 != e.version) return a(new Error("glStyle version 8 required."));
  20623. if (!(t instanceof Iy || t instanceof lm)) return a(new Error("Can only apply to VectorLayer or VectorTileLayer"));
  20624. var s, l, u;
  20625. function c() {
  20626. u || e.sprite && !s ? u ? (t.setStyle(u), o()) : a(new Error("Something went wrong trying to apply style.")) : (u = Dm(t, e, r, i, s, l, nv), t.getStyle() ? o() : a(new Error("Nothing to show for source [" + r + "]")))
  20627. }
  20628. if (e.sprite) {
  20629. var h = .5 == (window.devicePixelRatio >= 1.5 ? .5 : 1) ? "@2x" : "", p = av(e.sprite, n, h + ".json");
  20630. fetch(p, {credentials: "same-origin"}).then((function (t) {
  20631. return t.ok || "" === h ? t : (p = av(e.sprite, n, ".json"), fetch(p, {credentials: "same-origin"}))
  20632. })).then((function (t) {
  20633. if (t.ok) return t.json();
  20634. a(new Error("Problem fetching sprite from " + p + ": " + t.statusText))
  20635. })).then((function (t) {
  20636. if (void 0 === t) return a(new Error("No sprites found."));
  20637. s = t, l = av(e.sprite, n, h + ".png"), c()
  20638. })).catch((function (t) {
  20639. a(new Error("Sprites cannot be loaded: " + p + ": " + t.message))
  20640. }))
  20641. } else c()
  20642. }))
  20643. }
  20644. new $m;
  20645. var lv = function () {
  20646. var t = function (e, r) {
  20647. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20648. t.__proto__ = e
  20649. } || function (t, e) {
  20650. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20651. })(e, r)
  20652. };
  20653. return function (e, r) {
  20654. function n() {
  20655. this.constructor = e
  20656. }
  20657. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20658. }
  20659. }();
  20660. function uv(t) {
  20661. return 0 !== t.indexOf("mapbox://") ? "" : t.slice("mapbox://".length)
  20662. }
  20663. function cv(t, e) {
  20664. var r = uv(t);
  20665. if (!r) return t;
  20666. if (0 !== r.indexOf("sprites/")) throw new Error("unexpected sprites url: " + t);
  20667. return "https://api.mapbox.com/styles/v1/" + r.slice("sprites/".length) + "/sprite?access_token=" + e
  20668. }
  20669. function hv(t, e) {
  20670. var r = uv(t);
  20671. if (!r) return t;
  20672. if (0 !== r.indexOf("fonts/")) throw new Error("unexpected fonts url: " + t);
  20673. return "https://api.mapbox.com/fonts/v1/" + r.slice("fonts/".length) + "/0-255.pbf?access_token=" + e
  20674. }
  20675. function pv(t, e) {
  20676. var r = uv(t);
  20677. if (!r) return t;
  20678. if (0 !== r.indexOf("styles/")) throw new Error("unexpected style url: " + t);
  20679. return "https://api.mapbox.com/styles/v1/" + r.slice("styles/".length) + "?&access_token=" + e
  20680. }
  20681. function fv(t, e) {
  20682. var r = uv(t);
  20683. return r ? "https://{a-d}.tiles.mapbox.com/v4/" + r + "/{z}/{x}/{y}.vector.pbf?access_token=" + e : t
  20684. }
  20685. var dv = function (t) {
  20686. function e(e) {
  20687. var r = t.call(this, A) || this;
  20688. return r.error = e, r
  20689. }
  20690. return lv(e, t), e
  20691. }(c), gv = "vector", yv = function (t) {
  20692. function e(e) {
  20693. var r = this, n = !("declutter" in e) || e.declutter, i = new og({state: Jo, format: new am});
  20694. return (r = t.call(this, {
  20695. source: i,
  20696. declutter: n,
  20697. className: e.className,
  20698. opacity: e.opacity,
  20699. visible: e.visible,
  20700. zIndex: e.zIndex,
  20701. minResolution: e.minResolution,
  20702. maxResolution: e.maxResolution,
  20703. minZoom: e.minZoom,
  20704. maxZoom: e.maxZoom,
  20705. renderOrder: e.renderOrder,
  20706. renderBuffer: e.renderBuffer,
  20707. renderMode: e.renderMode,
  20708. map: e.map,
  20709. updateWhileAnimating: e.updateWhileAnimating,
  20710. updateWhileInteracting: e.updateWhileInteracting,
  20711. preload: e.preload,
  20712. useInterimTilesOnError: e.useInterimTilesOnError
  20713. }) || this).sourceId = e.source, r.layers = e.layers, r.accessToken = e.accessToken, r.fetchStyle(e.styleUrl), r
  20714. }
  20715. return lv(e, t), e.prototype.fetchStyle = function (t) {
  20716. var e = this, r = pv(t, this.accessToken);
  20717. fetch(r).then((function (t) {
  20718. if (!t.ok) throw new Error("unexpected response when fetching style: " + t.status);
  20719. return t.json()
  20720. })).then((function (t) {
  20721. e.onStyleLoad(t)
  20722. })).catch((function (t) {
  20723. e.handleError(t)
  20724. }))
  20725. }, e.prototype.onStyleLoad = function (t) {
  20726. var e, r, n = this;
  20727. if (this.layers) {
  20728. for (var i = {}, o = 0; o < t.layers.length; ++o) {
  20729. var a = t.layers[o];
  20730. a.source && (i[a.id] = a.source)
  20731. }
  20732. var s = void 0;
  20733. for (o = 0; o < this.layers.length; ++o) {
  20734. var l = i[this.layers[o]];
  20735. if (!l) return void this.handleError(new Error("could not find source for " + this.layers[o]));
  20736. if (s) {
  20737. if (s !== l) return void this.handleError(new Error("layers can only use a single source, found " + s + " and " + l))
  20738. } else s = l
  20739. }
  20740. e = s, r = this.layers
  20741. } else r = e = this.sourceId;
  20742. r || (r = e = Object.keys(t.sources)[0]), t.sprite && (t.sprite = cv(t.sprite, this.accessToken)), t.glyphs && (t.glyphs = hv(t.glyphs, this.accessToken));
  20743. var u = t.sources[e];
  20744. if (u.type === gv) {
  20745. var c = this.getSource();
  20746. c.setUrl(fv(u.url, this.accessToken)), sv(this, t, r).then((function () {
  20747. c.setState(Qo)
  20748. })).catch((function (t) {
  20749. n.handleError(t)
  20750. }))
  20751. } else this.handleError(new Error("only works for vector sources, found " + u.type))
  20752. }, e.prototype.handleError = function (t) {
  20753. this.dispatchEvent(new dv(t)), this.getSource().setState(ta)
  20754. }, e
  20755. }(lm), mv = function () {
  20756. var t = function (e, r) {
  20757. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20758. t.__proto__ = e
  20759. } || function (t, e) {
  20760. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20761. })(e, r)
  20762. };
  20763. return function (e, r) {
  20764. function n() {
  20765. this.constructor = e
  20766. }
  20767. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20768. }
  20769. }(), vv = function (t) {
  20770. function e(e) {
  20771. var r = this, n = e || {}, i = O({}, n);
  20772. return delete i.imageRatio, (r = t.call(this, i) || this).imageRatio_ = void 0 !== n.imageRatio ? n.imageRatio : 1, r
  20773. }
  20774. return mv(e, t), e.prototype.getImageRatio = function () {
  20775. return this.imageRatio_
  20776. }, e.prototype.createRenderer = function () {
  20777. return new py(this)
  20778. }, e
  20779. }(wg), _v = function () {
  20780. var t = function (e, r) {
  20781. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20782. t.__proto__ = e
  20783. } || function (t, e) {
  20784. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20785. })(e, r)
  20786. };
  20787. return function (e, r) {
  20788. function n() {
  20789. this.constructor = e
  20790. }
  20791. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20792. }
  20793. }(), bv = function (t) {
  20794. function e(e) {
  20795. var r = this, n = O({}, e);
  20796. return (r = t.call(this, n) || this).parseResult_ = Wh(e.style), r.hitDetectionDisabled_ = !!e.disableHitDetection, r
  20797. }
  20798. return _v(e, t), e.prototype.createRenderer = function () {
  20799. return new Eg(this, {
  20800. className: this.getClassName(),
  20801. vertexShader: this.parseResult_.builder.getSymbolVertexShader(),
  20802. fragmentShader: this.parseResult_.builder.getSymbolFragmentShader(),
  20803. hitVertexShader: !this.hitDetectionDisabled_ && this.parseResult_.builder.getSymbolVertexShader(!0),
  20804. hitFragmentShader: !this.hitDetectionDisabled_ && this.parseResult_.builder.getSymbolFragmentShader(!0),
  20805. uniforms: this.parseResult_.uniforms,
  20806. attributes: this.parseResult_.attributes
  20807. })
  20808. }, e.prototype.disposeInternal = function () {
  20809. this.getRenderer().disposeInternal(), t.prototype.disposeInternal.call(this)
  20810. }, e
  20811. }(na), xv = function () {
  20812. var t = function (e, r) {
  20813. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20814. t.__proto__ = e
  20815. } || function (t, e) {
  20816. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20817. })(e, r)
  20818. };
  20819. return function (e, r) {
  20820. function n() {
  20821. this.constructor = e
  20822. }
  20823. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20824. }
  20825. }(), wv = "addfeatures", Sv = function (t) {
  20826. function e(e, r, n, i) {
  20827. var o = t.call(this, e) || this;
  20828. return o.features = n, o.file = r, o.projection = i, o
  20829. }
  20830. return xv(e, t), e
  20831. }(c), Ev = function (t) {
  20832. function e(e) {
  20833. var r = this, n = e || {};
  20834. (r = t.call(this, {handleEvent: S}) || this).readAsBuffer_ = !1, r.formats_ = [];
  20835. for (var i = n.formatConstructors ? n.formatConstructors : [], o = 0, a = i.length; o < a; ++o) {
  20836. var s = i[o];
  20837. "function" == typeof s && (s = new s), r.formats_.push(s), r.readAsBuffer_ = r.readAsBuffer_ || s.getType() === Cu
  20838. }
  20839. return r.projection_ = n.projection ? Gr(n.projection) : null, r.dropListenKeys_ = null, r.source_ = n.source || null, r.target = n.target ? n.target : null, r
  20840. }
  20841. return xv(e, t), e.prototype.handleResult_ = function (t, e) {
  20842. var r, n = e.target.result, i = this.getMap(), o = this.projection_;
  20843. o || (o = i.getView().getProjection());
  20844. for (var a = this.formats_, s = 0, l = a.length; s < l; ++s) {
  20845. var u = a[s], c = n;
  20846. this.readAsBuffer_ && u.getType() !== Cu && (void 0 === r && (r = (new TextDecoder).decode(n)), c = r);
  20847. var h = this.tryReadFeatures_(u, c, {featureProjection: o});
  20848. if (h && h.length > 0) {
  20849. this.source_ && (this.source_.clear(), this.source_.addFeatures(h)), this.dispatchEvent(new Sv(wv, t, h, o));
  20850. break
  20851. }
  20852. }
  20853. }, e.prototype.registerListeners_ = function () {
  20854. var t = this.getMap();
  20855. if (t) {
  20856. var e = this.target ? this.target : t.getViewport();
  20857. this.dropListenKeys_ = [Z(e, U, this.handleDrop, this), Z(e, G, this.handleStop, this), Z(e, z, this.handleStop, this), Z(e, U, this.handleStop, this)]
  20858. }
  20859. }, e.prototype.setActive = function (e) {
  20860. !this.getActive() && e && this.registerListeners_(), this.getActive() && !e && this.unregisterListeners_(), t.prototype.setActive.call(this, e)
  20861. }, e.prototype.setMap = function (e) {
  20862. this.unregisterListeners_(), t.prototype.setMap.call(this, e), this.getActive() && this.registerListeners_()
  20863. }, e.prototype.tryReadFeatures_ = function (t, e, r) {
  20864. try {
  20865. return t.readFeatures(e, r)
  20866. } catch (t) {
  20867. return null
  20868. }
  20869. }, e.prototype.unregisterListeners_ = function () {
  20870. this.dropListenKeys_ && (this.dropListenKeys_.forEach(H), this.dropListenKeys_ = null)
  20871. }, e.prototype.handleDrop = function (t) {
  20872. for (var e = t.dataTransfer.files, r = 0, n = e.length; r < n; ++r) {
  20873. var i = e.item(r), o = new FileReader;
  20874. o.addEventListener(Y, this.handleResult_.bind(this, i)), this.readAsBuffer_ ? o.readAsArrayBuffer(i) : o.readAsText(i)
  20875. }
  20876. }, e.prototype.handleStop = function (t) {
  20877. t.stopPropagation(), t.preventDefault(), t.dataTransfer.dropEffect = "copy"
  20878. }, e
  20879. }(qs), Tv = function () {
  20880. var t = function (e, r) {
  20881. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20882. t.__proto__ = e
  20883. } || function (t, e) {
  20884. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20885. })(e, r)
  20886. };
  20887. return function (e, r) {
  20888. function n() {
  20889. this.constructor = e
  20890. }
  20891. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20892. }
  20893. }(), Cv = function (t) {
  20894. function e(e) {
  20895. var r = this, n = e || {};
  20896. return (r = t.call(this, n) || this).condition_ = n.condition ? n.condition : ll, r.lastAngle_ = void 0, r.lastMagnitude_ = void 0, r.lastScaleDelta_ = 0, r.duration_ = void 0 !== n.duration ? n.duration : 400, r
  20897. }
  20898. return Tv(e, t), e.prototype.handleDragEvent = function (t) {
  20899. if (cl(t)) {
  20900. var e = t.map, r = e.getSize(), n = t.pixel, i = n[0] - r[0] / 2, o = r[1] / 2 - n[1], a = Math.atan2(o, i),
  20901. s = Math.sqrt(i * i + o * o), l = e.getView();
  20902. if (void 0 !== this.lastAngle_) {
  20903. var u = this.lastAngle_ - a;
  20904. l.adjustRotationInternal(u)
  20905. }
  20906. this.lastAngle_ = a, void 0 !== this.lastMagnitude_ && l.adjustResolutionInternal(this.lastMagnitude_ / s), void 0 !== this.lastMagnitude_ && (this.lastScaleDelta_ = this.lastMagnitude_ / s), this.lastMagnitude_ = s
  20907. }
  20908. }, e.prototype.handleUpEvent = function (t) {
  20909. if (!cl(t)) return !0;
  20910. var e = t.map.getView(), r = this.lastScaleDelta_ > 1 ? 1 : -1;
  20911. return e.endInteraction(this.duration_, r), this.lastScaleDelta_ = 0, !1
  20912. }, e.prototype.handleDownEvent = function (t) {
  20913. return !!cl(t) && (!!this.condition_(t) && (t.map.getView().beginInteraction(), this.lastAngle_ = void 0, this.lastMagnitude_ = void 0, !0))
  20914. }, e
  20915. }($s), Ov = function () {
  20916. var t = function (e, r) {
  20917. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  20918. t.__proto__ = e
  20919. } || function (t, e) {
  20920. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  20921. })(e, r)
  20922. };
  20923. return function (e, r) {
  20924. function n() {
  20925. this.constructor = e
  20926. }
  20927. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  20928. }
  20929. }(), Pv = function (t) {
  20930. function e(e, r, n) {
  20931. var i = t.call(this) || this;
  20932. if (void 0 !== n && void 0 === r) i.setFlatCoordinates(n, e); else {
  20933. var o = r || 0;
  20934. i.setCenterAndRadius(e, o, n)
  20935. }
  20936. return i
  20937. }
  20938. return Ov(e, t), e.prototype.clone = function () {
  20939. var t = new e(this.flatCoordinates.slice(), void 0, this.layout);
  20940. return t.applyProperties(this), t
  20941. }, e.prototype.closestPointXY = function (t, e, r, n) {
  20942. var i = this.flatCoordinates, o = t - i[0], a = e - i[1], s = o * o + a * a;
  20943. if (s < n) {
  20944. if (0 === s) for (var l = 0; l < this.stride; ++l) r[l] = i[l]; else {
  20945. var u = this.getRadius() / Math.sqrt(s);
  20946. r[0] = i[0] + u * o, r[1] = i[1] + u * a;
  20947. for (l = 2; l < this.stride; ++l) r[l] = i[l]
  20948. }
  20949. return r.length = this.stride, s
  20950. }
  20951. return n
  20952. }, e.prototype.containsXY = function (t, e) {
  20953. var r = this.flatCoordinates, n = t - r[0], i = e - r[1];
  20954. return n * n + i * i <= this.getRadiusSquared_()
  20955. }, e.prototype.getCenter = function () {
  20956. return this.flatCoordinates.slice(0, this.stride)
  20957. }, e.prototype.computeExtent = function (t) {
  20958. var e = this.flatCoordinates, r = e[this.stride] - e[0];
  20959. return ie(e[0] - r, e[1] - r, e[0] + r, e[1] + r, t)
  20960. }, e.prototype.getRadius = function () {
  20961. return Math.sqrt(this.getRadiusSquared_())
  20962. }, e.prototype.getRadiusSquared_ = function () {
  20963. var t = this.flatCoordinates[this.stride] - this.flatCoordinates[0],
  20964. e = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];
  20965. return t * t + e * e
  20966. }, e.prototype.getType = function () {
  20967. return bt.CIRCLE
  20968. }, e.prototype.intersectsExtent = function (t) {
  20969. if (Re(t, this.getExtent())) {
  20970. var e = this.getCenter();
  20971. return t[0] <= e[0] && t[2] >= e[0] || (t[1] <= e[1] && t[3] >= e[1] || me(t, this.intersectsCoordinate.bind(this)))
  20972. }
  20973. return !1
  20974. }, e.prototype.setCenter = function (t) {
  20975. var e = this.stride, r = this.flatCoordinates[e] - this.flatCoordinates[0], n = t.slice();
  20976. n[e] = n[0] + r;
  20977. for (var i = 1; i < e; ++i) n[e + i] = t[i];
  20978. this.setFlatCoordinates(this.layout, n), this.changed()
  20979. }, e.prototype.setCenterAndRadius = function (t, e, r) {
  20980. this.setLayout(r, t, 0), this.flatCoordinates || (this.flatCoordinates = []);
  20981. var n = this.flatCoordinates, i = Cn(n, 0, t, this.stride);
  20982. n[i++] = n[0] + e;
  20983. for (var o = 1, a = this.stride; o < a; ++o) n[i++] = n[o];
  20984. n.length = i, this.changed()
  20985. }, e.prototype.getCoordinates = function () {
  20986. return null
  20987. }, e.prototype.setCoordinates = function (t, e) {
  20988. }, e.prototype.setRadius = function (t) {
  20989. this.flatCoordinates[this.stride] = this.flatCoordinates[0] + t, this.changed()
  20990. }, e.prototype.rotate = function (t, e) {
  20991. var r = this.getCenter(), n = this.getStride();
  20992. this.setCenter(un(r, 0, r.length, n, t, e, r)), this.changed()
  20993. }, e.prototype.translate = function (t, e) {
  20994. var r = this.getCenter(), n = this.getStride();
  20995. this.setCenter(hn(r, 0, r.length, n, t, e, r)), this.changed()
  20996. }, e
  20997. }(vn);
  20998. Pv.prototype.transform;
  20999. var Rv = Pv, Iv = function () {
  21000. var t = function (e, r) {
  21001. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  21002. t.__proto__ = e
  21003. } || function (t, e) {
  21004. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  21005. })(e, r)
  21006. };
  21007. return function (e, r) {
  21008. function n() {
  21009. this.constructor = e
  21010. }
  21011. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  21012. }
  21013. }(), Lv = "Point", Mv = "LineString", Fv = "Polygon", Av = "Circle", kv = "drawstart", jv = "drawend",
  21014. Nv = "drawabort", Dv = function (t) {
  21015. function e(e, r) {
  21016. var n = t.call(this, e) || this;
  21017. return n.feature = r, n
  21018. }
  21019. return Iv(e, t), e
  21020. }(c);
  21021. var Gv = function (t) {
  21022. function e(e) {
  21023. var r = this, n = e;
  21024. n.stopDown || (n.stopDown = E), (r = t.call(this, n) || this).shouldHandle_ = !1, r.downPx_ = null, r.downTimeout_, r.lastDragTime_, r.pointerType_, r.freehand_ = !1, r.source_ = e.source ? e.source : null, r.features_ = e.features ? e.features : null, r.snapTolerance_ = e.snapTolerance ? e.snapTolerance : 12, r.type_ = e.type, r.mode_ = function (t) {
  21025. var e;
  21026. t === bt.POINT || t === bt.MULTI_POINT ? e = Lv : t === bt.LINE_STRING || t === bt.MULTI_LINE_STRING ? e = Mv : t === bt.POLYGON || t === bt.MULTI_POLYGON ? e = Fv : t === bt.CIRCLE && (e = Av);
  21027. return e
  21028. }(r.type_), r.stopClick_ = !!e.stopClick, r.minPoints_ = e.minPoints ? e.minPoints : r.mode_ === Fv ? 3 : 2, r.maxPoints_ = r.mode_ === Av ? 2 : e.maxPoints ? e.maxPoints : 1 / 0, r.finishCondition_ = e.finishCondition ? e.finishCondition : S;
  21029. var i, o = e.geometryFunction;
  21030. if (!o) {
  21031. var a, s = r.mode_;
  21032. if (s === Av) o = function (t, e, r) {
  21033. var n = e || new Rv([NaN, NaN]), i = rn(t[0], r), o = Rr(i, rn(t[t.length - 1], r));
  21034. n.setCenterAndRadius(i, Math.sqrt(o));
  21035. var a = tn();
  21036. return a && n.transform(r, a), n
  21037. }; else s === Lv ? a = qn : s === Mv ? a = Py : s === Fv && (a = fi), o = function (t, e, r) {
  21038. return e ? s === Fv ? t[0].length ? e.setCoordinates([t[0].concat([t[0][0]])]) : e.setCoordinates([]) : e.setCoordinates(t) : e = new a(t), e
  21039. }
  21040. }
  21041. return r.geometryFunction_ = o, r.dragVertexDelay_ = void 0 !== e.dragVertexDelay ? e.dragVertexDelay : 500, r.finishCoordinate_ = null, r.sketchFeature_ = null, r.sketchPoint_ = null, r.sketchCoords_ = null, r.sketchLine_ = null, r.sketchLineCoords_ = null, r.squaredClickTolerance_ = e.clickTolerance ? e.clickTolerance * e.clickTolerance : 36, r.overlay_ = new Iy({
  21042. source: new hf({
  21043. useSpatialIndex: !1,
  21044. wrapX: !!e.wrapX && e.wrapX
  21045. }), style: e.style ? e.style : (i = bp(), function (t, e) {
  21046. return i[t.getGeometry().getType()]
  21047. }), updateWhileInteracting: !0
  21048. }), r.geometryName_ = e.geometryName, r.condition_ = e.condition ? e.condition : sl, r.freehandCondition_, e.freehand ? r.freehandCondition_ = nl : r.freehandCondition_ = e.freehandCondition ? e.freehandCondition : ll, r.addEventListener(it(Bs), r.updateState_), r
  21049. }
  21050. return Iv(e, t), e.prototype.setMap = function (e) {
  21051. t.prototype.setMap.call(this, e), this.updateState_()
  21052. }, e.prototype.getOverlay = function () {
  21053. return this.overlay_
  21054. }, e.prototype.handleEvent = function (e) {
  21055. e.originalEvent.type === j && e.originalEvent.preventDefault(), this.freehand_ = this.mode_ !== Lv && this.freehandCondition_(e);
  21056. var r = e.type === Ga.POINTERMOVE, n = !0;
  21057. !this.freehand_ && this.lastDragTime_ && e.type === Ga.POINTERDRAG && (Date.now() - this.lastDragTime_ >= this.dragVertexDelay_ ? (this.downPx_ = e.pixel, this.shouldHandle_ = !this.freehand_, r = !0) : this.lastDragTime_ = void 0, this.shouldHandle_ && void 0 !== this.downTimeout_ && (clearTimeout(this.downTimeout_), this.downTimeout_ = void 0));
  21058. return this.freehand_ && e.type === Ga.POINTERDRAG && null !== this.sketchFeature_ ? (this.addToDrawing_(e.coordinate), n = !1) : this.freehand_ && e.type === Ga.POINTERDOWN ? n = !1 : r && this.getPointerCount() < 2 ? (n = e.type === Ga.POINTERMOVE) && this.freehand_ ? (this.handlePointerMove_(e), this.shouldHandle_ && e.originalEvent.preventDefault()) : ("mouse" === e.originalEvent.pointerType || e.type === Ga.POINTERDRAG && void 0 === this.downTimeout_) && this.handlePointerMove_(e) : e.type === Ga.DBLCLICK && (n = !1), t.prototype.handleEvent.call(this, e) && n
  21059. }, e.prototype.handleDownEvent = function (t) {
  21060. return this.shouldHandle_ = !this.freehand_, this.freehand_ ? (this.downPx_ = t.pixel, this.finishCoordinate_ || this.startDrawing_(t.coordinate), !0) : this.condition_(t) ? (this.lastDragTime_ = Date.now(), this.downTimeout_ = setTimeout(function () {
  21061. this.handlePointerMove_(new Da(Ga.POINTERMOVE, t.map, t.originalEvent, !1, t.frameState))
  21062. }.bind(this), this.dragVertexDelay_), this.downPx_ = t.pixel, !0) : (this.lastDragTime_ = void 0, !1)
  21063. }, e.prototype.handleUpEvent = function (t) {
  21064. var e = !0;
  21065. if (0 === this.getPointerCount()) if (this.downTimeout_ && (clearTimeout(this.downTimeout_), this.downTimeout_ = void 0), this.handlePointerMove_(t), this.shouldHandle_) {
  21066. switch (!0) {
  21067. case!this.finishCoordinate_:
  21068. if (this.startDrawing_(t.coordinate), this.mode_ !== Lv) break;
  21069. case this.freehand_ || this.atFinish_(t.pixel) && this.finishCondition_(t):
  21070. this.finishDrawing();
  21071. break;
  21072. case!this.freehand_:
  21073. this.addToDrawing_(t.coordinate)
  21074. }
  21075. e = !1
  21076. } else this.freehand_ && this.abortDrawing();
  21077. return !e && this.stopClick_ && t.originalEvent.stopPropagation(), e
  21078. }, e.prototype.handlePointerMove_ = function (t) {
  21079. if (this.pointerType_ = t.originalEvent.pointerType, this.downPx_ && (!this.freehand_ && this.shouldHandle_ || this.freehand_ && !this.shouldHandle_)) {
  21080. var e = this.downPx_, r = t.pixel, n = e[0] - r[0], i = e[1] - r[1], o = n * n + i * i;
  21081. if (this.shouldHandle_ = this.freehand_ ? o > this.squaredClickTolerance_ : o <= this.squaredClickTolerance_, !this.shouldHandle_) return
  21082. }
  21083. this.finishCoordinate_ ? this.modifyDrawing_(t.coordinate) : this.createOrUpdateSketchPoint_(t)
  21084. }, e.prototype.atFinish_ = function (t) {
  21085. var e = !1;
  21086. if (this.sketchFeature_) {
  21087. var r = !1, n = [this.finishCoordinate_], i = this.mode_;
  21088. if (i === Lv) e = !0; else if (i === Av) e = 2 === this.sketchCoords_.length; else if (i === Mv) r = this.sketchCoords_.length > this.minPoints_; else if (i === Fv) {
  21089. var o = this.sketchCoords_;
  21090. r = o[0].length > this.minPoints_, n = [o[0][0], o[0][o[0].length - 2]]
  21091. }
  21092. if (r) for (var a = this.getMap(), s = 0, l = n.length; s < l; s++) {
  21093. var u = n[s], c = a.getPixelFromCoordinate(u), h = t[0] - c[0], p = t[1] - c[1],
  21094. f = this.freehand_ ? 1 : this.snapTolerance_;
  21095. if (e = Math.sqrt(h * h + p * p) <= f) {
  21096. this.finishCoordinate_ = u;
  21097. break
  21098. }
  21099. }
  21100. }
  21101. return e
  21102. }, e.prototype.createOrUpdateSketchPoint_ = function (t) {
  21103. var e = t.coordinate.slice();
  21104. this.sketchPoint_ ? this.sketchPoint_.getGeometry().setCoordinates(e) : (this.sketchPoint_ = new gt(new qn(e)), this.updateSketchFeatures_())
  21105. }, e.prototype.createOrUpdateCustomSketchLine_ = function (t) {
  21106. this.sketchLine_ || (this.sketchLine_ = new gt);
  21107. var e = t.getLinearRing(0), r = this.sketchLine_.getGeometry();
  21108. r ? (r.setFlatCoordinates(e.getLayout(), e.getFlatCoordinates()), r.changed()) : (r = new Py(e.getFlatCoordinates(), e.getLayout()), this.sketchLine_.setGeometry(r))
  21109. }, e.prototype.startDrawing_ = function (t) {
  21110. var e = this.getMap().getView().getProjection();
  21111. this.finishCoordinate_ = t, this.mode_ === Lv ? this.sketchCoords_ = t.slice() : this.mode_ === Fv ? (this.sketchCoords_ = [[t.slice(), t.slice()]], this.sketchLineCoords_ = this.sketchCoords_[0]) : this.sketchCoords_ = [t.slice(), t.slice()], this.sketchLineCoords_ && (this.sketchLine_ = new gt(new Py(this.sketchLineCoords_)));
  21112. var r = this.geometryFunction_(this.sketchCoords_, void 0, e);
  21113. this.sketchFeature_ = new gt, this.geometryName_ && this.sketchFeature_.setGeometryName(this.geometryName_), this.sketchFeature_.setGeometry(r), this.updateSketchFeatures_(), this.dispatchEvent(new Dv(kv, this.sketchFeature_))
  21114. }, e.prototype.modifyDrawing_ = function (t) {
  21115. var e, r, n = this.getMap(), i = this.sketchFeature_.getGeometry(), o = n.getView().getProjection();
  21116. (this.mode_ === Lv ? r = this.sketchCoords_ : this.mode_ === Fv ? (r = (e = this.sketchCoords_[0])[e.length - 1], this.atFinish_(n.getPixelFromCoordinate(t)) && (t = this.finishCoordinate_.slice())) : r = (e = this.sketchCoords_)[e.length - 1], r[0] = t[0], r[1] = t[1], this.geometryFunction_(this.sketchCoords_, i, o), this.sketchPoint_) && this.sketchPoint_.getGeometry().setCoordinates(t);
  21117. if (i.getType() === bt.POLYGON && this.mode_ !== Fv) this.createOrUpdateCustomSketchLine_(i); else if (this.sketchLineCoords_) {
  21118. this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)
  21119. }
  21120. this.updateSketchFeatures_()
  21121. }, e.prototype.addToDrawing_ = function (t) {
  21122. var e, r, n = this.sketchFeature_.getGeometry(), i = this.getMap().getView().getProjection(), o = this.mode_;
  21123. o === Mv || o === Av ? (this.finishCoordinate_ = t.slice(), (r = this.sketchCoords_).length >= this.maxPoints_ && (this.freehand_ ? r.pop() : e = !0), r.push(t.slice()), this.geometryFunction_(r, n, i)) : o === Fv && ((r = this.sketchCoords_[0]).length >= this.maxPoints_ && (this.freehand_ ? r.pop() : e = !0), r.push(t.slice()), e && (this.finishCoordinate_ = r[0]), this.geometryFunction_(this.sketchCoords_, n, i)), this.updateSketchFeatures_(), e && this.finishDrawing()
  21124. }, e.prototype.removeLastPoint = function () {
  21125. if (this.sketchFeature_) {
  21126. var t, e = this.sketchFeature_.getGeometry(), r = this.getMap().getView().getProjection(), n = this.mode_;
  21127. if (n === Mv || n === Av) {
  21128. if ((t = this.sketchCoords_).splice(-2, 1), t.length >= 2) {
  21129. this.finishCoordinate_ = t[t.length - 2].slice();
  21130. var i = this.finishCoordinate_.slice();
  21131. t[t.length - 1] = i, this.sketchPoint_.setGeometry(new qn(i))
  21132. }
  21133. this.geometryFunction_(t, e, r), e.getType() === bt.POLYGON && this.sketchLine_ && this.createOrUpdateCustomSketchLine_(e)
  21134. } else if (n === Fv) {
  21135. (t = this.sketchCoords_[0]).splice(-2, 1);
  21136. var o = this.sketchLine_.getGeometry();
  21137. if (t.length >= 2) {
  21138. i = t[t.length - 2].slice();
  21139. t[t.length - 1] = i, this.sketchPoint_.setGeometry(new qn(i))
  21140. }
  21141. o.setCoordinates(t), this.geometryFunction_(this.sketchCoords_, e, r)
  21142. }
  21143. 1 === t.length && this.abortDrawing(), this.updateSketchFeatures_()
  21144. }
  21145. }, e.prototype.finishDrawing = function () {
  21146. var t = this.abortDrawing_();
  21147. if (t) {
  21148. var e = this.sketchCoords_, r = t.getGeometry(), n = this.getMap().getView().getProjection();
  21149. this.mode_ === Mv ? (e.pop(), this.geometryFunction_(e, r, n)) : this.mode_ === Fv && (e[0].pop(), this.geometryFunction_(e, r, n), e = r.getCoordinates()), this.type_ === bt.MULTI_POINT ? t.setGeometry(new Hy([e])) : this.type_ === bt.MULTI_LINE_STRING ? t.setGeometry(new Zy([e])) : this.type_ === bt.MULTI_POLYGON && t.setGeometry(new Jy([e])), this.dispatchEvent(new Dv(jv, t)), this.features_ && this.features_.push(t), this.source_ && this.source_.addFeature(t)
  21150. }
  21151. }, e.prototype.abortDrawing_ = function () {
  21152. this.finishCoordinate_ = null;
  21153. var t = this.sketchFeature_;
  21154. return this.sketchFeature_ = null, this.sketchPoint_ = null, this.sketchLine_ = null, this.overlay_.getSource().clear(!0), t
  21155. }, e.prototype.abortDrawing = function () {
  21156. var t = this.abortDrawing_();
  21157. t && this.dispatchEvent(new Dv(Nv, t))
  21158. }, e.prototype.appendCoordinates = function (t) {
  21159. var e, r = this.mode_, n = !this.sketchFeature_;
  21160. if (n && this.startDrawing_(t[0]), r === Mv || r === Av) e = this.sketchCoords_; else {
  21161. if (r !== Fv) return;
  21162. e = this.sketchCoords_ && this.sketchCoords_.length ? this.sketchCoords_[0] : []
  21163. }
  21164. n && e.shift(), e.pop();
  21165. for (var i = 0; i < t.length; i++) this.addToDrawing_(t[i]);
  21166. var o = t[t.length - 1];
  21167. this.addToDrawing_(o), this.modifyDrawing_(o)
  21168. }, e.prototype.extend = function (t) {
  21169. var e = t.getGeometry();
  21170. this.sketchFeature_ = t, this.sketchCoords_ = e.getCoordinates();
  21171. var r = this.sketchCoords_[this.sketchCoords_.length - 1];
  21172. this.finishCoordinate_ = r.slice(), this.sketchCoords_.push(r.slice()), this.sketchPoint_ = new gt(new qn(r)), this.updateSketchFeatures_(), this.dispatchEvent(new Dv(kv, this.sketchFeature_))
  21173. }, e.prototype.updateSketchFeatures_ = function () {
  21174. var t = [];
  21175. this.sketchFeature_ && t.push(this.sketchFeature_), this.sketchLine_ && t.push(this.sketchLine_), this.sketchPoint_ && t.push(this.sketchPoint_);
  21176. var e = this.overlay_.getSource();
  21177. e.clear(!0), e.addFeatures(t)
  21178. }, e.prototype.updateState_ = function () {
  21179. var t = this.getMap(), e = this.getActive();
  21180. t && e || this.abortDrawing(), this.overlay_.setMap(e ? t : null)
  21181. }, e
  21182. }($s), zv = function () {
  21183. var t = function (e, r) {
  21184. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  21185. t.__proto__ = e
  21186. } || function (t, e) {
  21187. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  21188. })(e, r)
  21189. };
  21190. return function (e, r) {
  21191. function n() {
  21192. this.constructor = e
  21193. }
  21194. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  21195. }
  21196. }(), Uv = "extentchanged", Bv = function (t) {
  21197. function e(e) {
  21198. var r = t.call(this, Uv) || this;
  21199. return r.extent = e, r
  21200. }
  21201. return zv(e, t), e
  21202. }(c);
  21203. function Vv() {
  21204. var t = bp();
  21205. return function (e, r) {
  21206. return t[bt.POINT]
  21207. }
  21208. }
  21209. function Yv(t) {
  21210. return function (e) {
  21211. return Kt([t, e])
  21212. }
  21213. }
  21214. function Wv(t, e) {
  21215. return t[0] == e[0] ? function (r) {
  21216. return Kt([t, [r[0], e[1]]])
  21217. } : t[1] == e[1] ? function (r) {
  21218. return Kt([t, [e[0], r[1]]])
  21219. } : null
  21220. }
  21221. var qv = function (t) {
  21222. function e(e) {
  21223. var r, n = this, i = e || {};
  21224. return (n = t.call(this, i) || this).condition_ = i.condition ? i.condition : nl, n.extent_ = null, n.pointerHandler_ = null, n.pixelTolerance_ = void 0 !== i.pixelTolerance ? i.pixelTolerance : 10, n.snappedToVertex_ = !1, n.extentFeature_ = null, n.vertexFeature_ = null, e || (e = {}), n.extentOverlay_ = new Iy({
  21225. source: new hf({
  21226. useSpatialIndex: !1,
  21227. wrapX: !!e.wrapX
  21228. }), style: e.boxStyle ? e.boxStyle : (r = bp(), function (t, e) {
  21229. return r[bt.POLYGON]
  21230. }), updateWhileAnimating: !0, updateWhileInteracting: !0
  21231. }), n.vertexOverlay_ = new Iy({
  21232. source: new hf({useSpatialIndex: !1, wrapX: !!e.wrapX}),
  21233. style: e.pointerStyle ? e.pointerStyle : Vv(),
  21234. updateWhileAnimating: !0,
  21235. updateWhileInteracting: !0
  21236. }), e.extent && n.setExtent(e.extent), n
  21237. }
  21238. return zv(e, t), e.prototype.snapToVertex_ = function (t, e) {
  21239. var r = e.getCoordinateFromPixelInternal(t), n = this.getExtentInternal();
  21240. if (n) {
  21241. var i = function (t) {
  21242. return [[[t[0], t[1]], [t[0], t[3]]], [[t[0], t[3]], [t[2], t[3]]], [[t[2], t[3]], [t[2], t[1]]], [[t[2], t[1]], [t[0], t[1]]]]
  21243. }(n);
  21244. i.sort((function (t, e) {
  21245. return Lr(r, t) - Lr(r, e)
  21246. }));
  21247. var o = i[0], a = Sr(r, o), s = e.getPixelFromCoordinateInternal(a);
  21248. if (Ir(t, s) <= this.pixelTolerance_) {
  21249. var l = e.getPixelFromCoordinateInternal(o[0]), u = e.getPixelFromCoordinateInternal(o[1]), c = Rr(s, l),
  21250. h = Rr(s, u), p = Math.sqrt(Math.min(c, h));
  21251. return this.snappedToVertex_ = p <= this.pixelTolerance_, this.snappedToVertex_ && (a = c > h ? o[1] : o[0]), a
  21252. }
  21253. }
  21254. return null
  21255. }, e.prototype.handlePointerMove_ = function (t) {
  21256. var e = t.pixel, r = t.map, n = this.snapToVertex_(e, r);
  21257. n || (n = r.getCoordinateFromPixelInternal(e)), this.createOrUpdatePointerFeature_(n)
  21258. }, e.prototype.createOrUpdateExtentFeature_ = function (t) {
  21259. var e = this.extentFeature_;
  21260. return e ? t ? e.setGeometry(gi(t)) : e.setGeometry(void 0) : (e = new gt(t ? gi(t) : {}), this.extentFeature_ = e, this.extentOverlay_.getSource().addFeature(e)), e
  21261. }, e.prototype.createOrUpdatePointerFeature_ = function (t) {
  21262. var e = this.vertexFeature_;
  21263. e ? e.getGeometry().setCoordinates(t) : (e = new gt(new qn(t)), this.vertexFeature_ = e, this.vertexOverlay_.getSource().addFeature(e));
  21264. return e
  21265. }, e.prototype.handleEvent = function (e) {
  21266. return !e.originalEvent || !this.condition_(e) || (e.type != Ga.POINTERMOVE || this.handlingDownUpSequence || this.handlePointerMove_(e), t.prototype.handleEvent.call(this, e), !1)
  21267. }, e.prototype.handleDownEvent = function (t) {
  21268. var e = t.pixel, r = t.map, n = this.getExtentInternal(), i = this.snapToVertex_(e, r), o = function (t) {
  21269. var e = null, r = null;
  21270. return t[0] == n[0] ? e = n[2] : t[0] == n[2] && (e = n[0]), t[1] == n[1] ? r = n[3] : t[1] == n[3] && (r = n[1]), null !== e && null !== r ? [e, r] : null
  21271. };
  21272. if (i && n) {
  21273. var a = i[0] == n[0] || i[0] == n[2] ? i[0] : null, s = i[1] == n[1] || i[1] == n[3] ? i[1] : null;
  21274. null !== a && null !== s ? this.pointerHandler_ = Yv(o(i)) : null !== a ? this.pointerHandler_ = Wv(o([a, n[1]]), o([a, n[3]])) : null !== s && (this.pointerHandler_ = Wv(o([n[0], s]), o([n[2], s])))
  21275. } else i = r.getCoordinateFromPixelInternal(e), this.setExtent([i[0], i[1], i[0], i[1]]), this.pointerHandler_ = Yv(i);
  21276. return !0
  21277. }, e.prototype.handleDragEvent = function (t) {
  21278. if (this.pointerHandler_) {
  21279. var e = t.coordinate;
  21280. this.setExtent(this.pointerHandler_(e)), this.createOrUpdatePointerFeature_(e)
  21281. }
  21282. }, e.prototype.handleUpEvent = function (t) {
  21283. this.pointerHandler_ = null;
  21284. var e = this.getExtentInternal();
  21285. return e && 0 !== ve(e) || this.setExtent(null), !1
  21286. }, e.prototype.setMap = function (e) {
  21287. this.extentOverlay_.setMap(e), this.vertexOverlay_.setMap(e), t.prototype.setMap.call(this, e)
  21288. }, e.prototype.getExtent = function () {
  21289. return nn(this.getExtentInternal(), this.getMap().getView().getProjection())
  21290. }, e.prototype.getExtentInternal = function () {
  21291. return this.extent_
  21292. }, e.prototype.setExtent = function (t) {
  21293. this.extent_ = t || null, this.createOrUpdateExtentFeature_(t), this.dispatchEvent(new Bv(this.extent_))
  21294. }, e
  21295. }($s), Xv = function () {
  21296. var t = function (e, r) {
  21297. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  21298. t.__proto__ = e
  21299. } || function (t, e) {
  21300. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  21301. })(e, r)
  21302. };
  21303. return function (e, r) {
  21304. function n() {
  21305. this.constructor = e
  21306. }
  21307. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  21308. }
  21309. }(), Zv = [0, 0, 0, 0], Kv = [], Hv = "modifystart", $v = "modifyend", Jv = function (t) {
  21310. function e(e, r, n) {
  21311. var i = t.call(this, e) || this;
  21312. return i.features = r, i.mapBrowserEvent = n, i
  21313. }
  21314. return Xv(e, t), e
  21315. }(c);
  21316. function Qv(t, e) {
  21317. return t.index - e.index
  21318. }
  21319. function t_(t, e, r) {
  21320. var n = e.geometry;
  21321. if (n.getType() === bt.CIRCLE) {
  21322. var i = n;
  21323. if (1 === e.index) {
  21324. var o = tn();
  21325. o && (i = i.clone().transform(o, r));
  21326. var a = Rr(i.getCenter(), rn(t, r)), s = Math.sqrt(a) - i.getRadius();
  21327. return s * s
  21328. }
  21329. }
  21330. var l = rn(t, r);
  21331. return Kv[0] = rn(e.segment[0], r), Kv[1] = rn(e.segment[1], r), Lr(l, Kv)
  21332. }
  21333. function e_(t, e, r) {
  21334. var n = e.geometry;
  21335. if (n.getType() === bt.CIRCLE && 1 === e.index) {
  21336. var i = n, o = tn();
  21337. return o && (i = i.clone().transform(o, r)), en(i.getClosestPoint(rn(t, r)), r)
  21338. }
  21339. var a = rn(t, r);
  21340. return Kv[0] = rn(e.segment[0], r), Kv[1] = rn(e.segment[1], r), en(Sr(a, Kv), r)
  21341. }
  21342. var r_ = function (t) {
  21343. function e(e) {
  21344. var r, n, i = t.call(this, e) || this;
  21345. if (i.boundHandleFeatureChange_ = i.handleFeatureChange_.bind(i), i.condition_ = e.condition ? e.condition : hl, i.defaultDeleteCondition_ = function (t) {
  21346. return Qs(t) && al(t)
  21347. }, i.deleteCondition_ = e.deleteCondition ? e.deleteCondition : i.defaultDeleteCondition_, i.insertVertexCondition_ = e.insertVertexCondition ? e.insertVertexCondition : nl, i.vertexFeature_ = null, i.vertexSegments_ = null, i.lastPixel_ = [0, 0], i.ignoreNextSingleClick_ = !1, i.featuresBeingModified_ = null, i.rBush_ = new Rp, i.pixelTolerance_ = void 0 !== e.pixelTolerance ? e.pixelTolerance : 10, i.snappedToVertex_ = !1, i.changingFeature_ = !1, i.dragSegments_ = [], i.overlay_ = new Iy({
  21348. source: new hf({
  21349. useSpatialIndex: !1,
  21350. wrapX: !!e.wrapX
  21351. }), style: e.style ? e.style : (r = bp(), function (t, e) {
  21352. return r[bt.POINT]
  21353. }), updateWhileAnimating: !0, updateWhileInteracting: !0
  21354. }), i.SEGMENT_WRITERS_ = {
  21355. Point: i.writePointGeometry_.bind(i),
  21356. LineString: i.writeLineStringGeometry_.bind(i),
  21357. LinearRing: i.writeLineStringGeometry_.bind(i),
  21358. Polygon: i.writePolygonGeometry_.bind(i),
  21359. MultiPoint: i.writeMultiPointGeometry_.bind(i),
  21360. MultiLineString: i.writeMultiLineStringGeometry_.bind(i),
  21361. MultiPolygon: i.writeMultiPolygonGeometry_.bind(i),
  21362. Circle: i.writeCircleGeometry_.bind(i),
  21363. GeometryCollection: i.writeGeometryCollectionGeometry_.bind(i)
  21364. }, i.source_ = null, i.hitDetection_ = null, e.features ? n = e.features : e.source && (i.source_ = e.source, n = new ht(i.source_.getFeatures()), i.source_.addEventListener(ef, i.handleSourceAdd_.bind(i)), i.source_.addEventListener(of, i.handleSourceRemove_.bind(i))), !n) throw new Error("The modify interaction requires features, a source or a layer");
  21365. return e.hitDetection && (i.hitDetection_ = e.hitDetection), i.features_ = n, i.features_.forEach(i.addFeature_.bind(i)), i.features_.addEventListener(at, i.handleFeatureAdd_.bind(i)), i.features_.addEventListener(st, i.handleFeatureRemove_.bind(i)), i.lastPointerEvent_ = null, i.delta_ = [0, 0], i
  21366. }
  21367. return Xv(e, t), e.prototype.addFeature_ = function (t) {
  21368. var e = t.getGeometry();
  21369. if (e) {
  21370. var r = this.SEGMENT_WRITERS_[e.getType()];
  21371. r && r(t, e)
  21372. }
  21373. var n = this.getMap();
  21374. n && n.isRendered() && this.getActive() && this.handlePointerAtPixel_(this.lastPixel_, n), t.addEventListener(F, this.boundHandleFeatureChange_)
  21375. }, e.prototype.willModifyFeatures_ = function (t, e) {
  21376. if (!this.featuresBeingModified_) {
  21377. this.featuresBeingModified_ = new ht;
  21378. for (var r = this.featuresBeingModified_.getArray(), n = 0, i = e.length; n < i; ++n) {
  21379. var o = e[n][0].feature;
  21380. -1 === r.indexOf(o) && this.featuresBeingModified_.push(o)
  21381. }
  21382. this.dispatchEvent(new Jv(Hv, this.featuresBeingModified_, t))
  21383. }
  21384. }, e.prototype.removeFeature_ = function (t) {
  21385. this.removeFeatureSegmentData_(t), this.vertexFeature_ && 0 === this.features_.getLength() && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null), t.removeEventListener(F, this.boundHandleFeatureChange_)
  21386. }, e.prototype.removeFeatureSegmentData_ = function (t) {
  21387. var e = this.rBush_, r = [];
  21388. e.forEach((function (e) {
  21389. t === e.feature && r.push(e)
  21390. }));
  21391. for (var n = r.length - 1; n >= 0; --n) {
  21392. for (var i = r[n], o = this.dragSegments_.length - 1; o >= 0; --o) this.dragSegments_[o][0] === i && this.dragSegments_.splice(o, 1);
  21393. e.remove(i)
  21394. }
  21395. }, e.prototype.setActive = function (e) {
  21396. this.vertexFeature_ && !e && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null), t.prototype.setActive.call(this, e)
  21397. }, e.prototype.setMap = function (e) {
  21398. this.overlay_.setMap(e), t.prototype.setMap.call(this, e)
  21399. }, e.prototype.getOverlay = function () {
  21400. return this.overlay_
  21401. }, e.prototype.handleSourceAdd_ = function (t) {
  21402. t.feature && this.features_.push(t.feature)
  21403. }, e.prototype.handleSourceRemove_ = function (t) {
  21404. t.feature && this.features_.remove(t.feature)
  21405. }, e.prototype.handleFeatureAdd_ = function (t) {
  21406. this.addFeature_(t.element)
  21407. }, e.prototype.handleFeatureChange_ = function (t) {
  21408. if (!this.changingFeature_) {
  21409. var e = t.target;
  21410. this.removeFeature_(e), this.addFeature_(e)
  21411. }
  21412. }, e.prototype.handleFeatureRemove_ = function (t) {
  21413. var e = t.element;
  21414. this.removeFeature_(e)
  21415. }, e.prototype.writePointGeometry_ = function (t, e) {
  21416. var r = e.getCoordinates(), n = {feature: t, geometry: e, segment: [r, r]};
  21417. this.rBush_.insert(e.getExtent(), n)
  21418. }, e.prototype.writeMultiPointGeometry_ = function (t, e) {
  21419. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) {
  21420. var o = r[n], a = {feature: t, geometry: e, depth: [n], index: n, segment: [o, o]};
  21421. this.rBush_.insert(e.getExtent(), a)
  21422. }
  21423. }, e.prototype.writeLineStringGeometry_ = function (t, e) {
  21424. for (var r = e.getCoordinates(), n = 0, i = r.length - 1; n < i; ++n) {
  21425. var o = r.slice(n, n + 2), a = {feature: t, geometry: e, index: n, segment: o};
  21426. this.rBush_.insert(Kt(o), a)
  21427. }
  21428. }, e.prototype.writeMultiLineStringGeometry_ = function (t, e) {
  21429. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) for (var o = r[n], a = 0, s = o.length - 1; a < s; ++a) {
  21430. var l = o.slice(a, a + 2), u = {feature: t, geometry: e, depth: [n], index: a, segment: l};
  21431. this.rBush_.insert(Kt(l), u)
  21432. }
  21433. }, e.prototype.writePolygonGeometry_ = function (t, e) {
  21434. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) for (var o = r[n], a = 0, s = o.length - 1; a < s; ++a) {
  21435. var l = o.slice(a, a + 2), u = {feature: t, geometry: e, depth: [n], index: a, segment: l};
  21436. this.rBush_.insert(Kt(l), u)
  21437. }
  21438. }, e.prototype.writeMultiPolygonGeometry_ = function (t, e) {
  21439. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) for (var o = r[n], a = 0, s = o.length; a < s; ++a) for (var l = o[a], u = 0, c = l.length - 1; u < c; ++u) {
  21440. var h = l.slice(u, u + 2), p = {feature: t, geometry: e, depth: [a, n], index: u, segment: h};
  21441. this.rBush_.insert(Kt(h), p)
  21442. }
  21443. }, e.prototype.writeCircleGeometry_ = function (t, e) {
  21444. var r = e.getCenter(), n = {feature: t, geometry: e, index: 0, segment: [r, r]},
  21445. i = {feature: t, geometry: e, index: 1, segment: [r, r]}, o = [n, i];
  21446. n.featureSegments = o, i.featureSegments = o, this.rBush_.insert(ae(r), n);
  21447. var a = e, s = tn();
  21448. if (s && this.getMap()) {
  21449. var l = this.getMap().getView().getProjection();
  21450. a = yi(a = a.clone().transform(s, l)).transform(l, s)
  21451. }
  21452. this.rBush_.insert(a.getExtent(), i)
  21453. }, e.prototype.writeGeometryCollectionGeometry_ = function (t, e) {
  21454. for (var r = e.getGeometriesArray(), n = 0; n < r.length; ++n) {
  21455. var i = r[n];
  21456. (0, this.SEGMENT_WRITERS_[i.getType()])(t, i)
  21457. }
  21458. }, e.prototype.createOrUpdateVertexFeature_ = function (t, e, r) {
  21459. var n = this.vertexFeature_;
  21460. n ? n.getGeometry().setCoordinates(t) : (n = new gt(new qn(t)), this.vertexFeature_ = n, this.overlay_.getSource().addFeature(n));
  21461. return n.set("features", e), n.set("geometries", r), n
  21462. }, e.prototype.handleEvent = function (e) {
  21463. return !e.originalEvent || (this.lastPointerEvent_ = e, e.map.getView().getInteracting() || e.type != Ga.POINTERMOVE || this.handlingDownUpSequence || this.handlePointerMove_(e), this.vertexFeature_ && this.deleteCondition_(e) && (r = !(e.type != Ga.SINGLECLICK || !this.ignoreNextSingleClick_) || this.removePoint()), e.type == Ga.SINGLECLICK && (this.ignoreNextSingleClick_ = !1), t.prototype.handleEvent.call(this, e) && !r);
  21464. var r
  21465. }, e.prototype.handleDragEvent = function (t) {
  21466. this.ignoreNextSingleClick_ = !1, this.willModifyFeatures_(t, this.dragSegments_);
  21467. for (var e = [t.coordinate[0] + this.delta_[0], t.coordinate[1] + this.delta_[1]], r = [], n = [], i = 0, o = this.dragSegments_.length; i < o; ++i) {
  21468. var a = this.dragSegments_[i], s = a[0], l = s.feature;
  21469. -1 === r.indexOf(l) && r.push(l);
  21470. var u = s.geometry;
  21471. -1 === n.indexOf(u) && n.push(u);
  21472. for (var c = s.depth, h = void 0, p = s.segment, f = a[1]; e.length < u.getStride();) e.push(p[f][e.length]);
  21473. switch (u.getType()) {
  21474. case bt.POINT:
  21475. h = e, p[0] = e, p[1] = e;
  21476. break;
  21477. case bt.MULTI_POINT:
  21478. (h = u.getCoordinates())[s.index] = e, p[0] = e, p[1] = e;
  21479. break;
  21480. case bt.LINE_STRING:
  21481. (h = u.getCoordinates())[s.index + f] = e, p[f] = e;
  21482. break;
  21483. case bt.MULTI_LINE_STRING:
  21484. case bt.POLYGON:
  21485. (h = u.getCoordinates())[c[0]][s.index + f] = e, p[f] = e;
  21486. break;
  21487. case bt.MULTI_POLYGON:
  21488. (h = u.getCoordinates())[c[1]][c[0]][s.index + f] = e, p[f] = e;
  21489. break;
  21490. case bt.CIRCLE:
  21491. if (p[0] = e, p[1] = e, 0 === s.index) this.changingFeature_ = !0, u.setCenter(e), this.changingFeature_ = !1; else {
  21492. this.changingFeature_ = !0;
  21493. var d = t.map.getView().getProjection(), g = Ir(rn(u.getCenter(), d), rn(e, d)), y = tn();
  21494. if (y) {
  21495. var m = u.clone().transform(y, d);
  21496. m.setRadius(g), g = m.transform(d, y).getRadius()
  21497. }
  21498. u.setRadius(g), this.changingFeature_ = !1
  21499. }
  21500. }
  21501. h && this.setGeometryCoordinates_(u, h)
  21502. }
  21503. this.createOrUpdateVertexFeature_(e, r, n)
  21504. }, e.prototype.handleDownEvent = function (t) {
  21505. if (!this.condition_(t)) return !1;
  21506. var e = t.coordinate;
  21507. this.handlePointerAtPixel_(t.pixel, t.map, e), this.dragSegments_.length = 0, this.featuresBeingModified_ = null;
  21508. var r = this.vertexFeature_;
  21509. if (r) {
  21510. var n = t.map.getView().getProjection(), i = [], a = r.getGeometry().getCoordinates(), s = Kt([a]),
  21511. l = this.rBush_.getInExtent(s), u = {};
  21512. l.sort(Qv);
  21513. for (var c = 0, h = l.length; c < h; ++c) {
  21514. var p = l[c], f = p.segment, d = o(p.geometry), g = p.depth;
  21515. if (g && (d += "-" + g.join("-")), u[d] || (u[d] = new Array(2)), p.geometry.getType() !== bt.CIRCLE || 1 !== p.index) if (!Cr(f[0], a) || u[d][0]) if (!Cr(f[1], a) || u[d][1]) o(f) in this.vertexSegments_ && !u[d][0] && !u[d][1] && this.insertVertexCondition_(t) && i.push(p); else {
  21516. if ((p.geometry.getType() === bt.LINE_STRING || p.geometry.getType() === bt.MULTI_LINE_STRING) && u[d][0] && 0 === u[d][0].index) continue;
  21517. this.dragSegments_.push([p, 1]), u[d][1] = p
  21518. } else this.dragSegments_.push([p, 0]), u[d][0] = p; else Cr(e_(e, p, n), a) && !u[d][0] && (this.dragSegments_.push([p, 0]), u[d][0] = p)
  21519. }
  21520. i.length && this.willModifyFeatures_(t, [i]);
  21521. for (var y = i.length - 1; y >= 0; --y) this.insertVertex_(i[y], a)
  21522. }
  21523. return !!this.vertexFeature_
  21524. }, e.prototype.handleUpEvent = function (t) {
  21525. for (var e = this.dragSegments_.length - 1; e >= 0; --e) {
  21526. var r = this.dragSegments_[e][0], n = r.geometry;
  21527. if (n.getType() === bt.CIRCLE) {
  21528. var i = n.getCenter(), o = r.featureSegments[0], a = r.featureSegments[1];
  21529. o.segment[0] = i, o.segment[1] = i, a.segment[0] = i, a.segment[1] = i, this.rBush_.update(ae(i), o);
  21530. var s = n, l = tn();
  21531. if (l) {
  21532. var u = t.map.getView().getProjection();
  21533. s = yi(s = s.clone().transform(l, u)).transform(u, l)
  21534. }
  21535. this.rBush_.update(s.getExtent(), a)
  21536. } else this.rBush_.update(Kt(r.segment), r)
  21537. }
  21538. return this.featuresBeingModified_ && (this.dispatchEvent(new Jv($v, this.featuresBeingModified_, t)), this.featuresBeingModified_ = null), !1
  21539. }, e.prototype.handlePointerMove_ = function (t) {
  21540. this.lastPixel_ = t.pixel, this.handlePointerAtPixel_(t.pixel, t.map, t.coordinate)
  21541. }, e.prototype.handlePointerAtPixel_ = function (t, e, r) {
  21542. var n, i, a = this, s = r || e.getCoordinateFromPixel(t), l = e.getView().getProjection();
  21543. if (this.hitDetection_) {
  21544. var u = "object" == typeof this.hitDetection_ ? function (t) {
  21545. return t === a.hitDetection_
  21546. } : void 0;
  21547. e.forEachFeatureAtPixel(t, (function (t, e, r) {
  21548. if ((r = r || t.getGeometry()).getType() === bt.POINT) {
  21549. i = r;
  21550. var o = r.getCoordinates();
  21551. n = [{feature: t, geometry: r, segment: [o, o]}]
  21552. }
  21553. return !0
  21554. }), {layerFilter: u})
  21555. }
  21556. if (!n) {
  21557. var c = nn(Ht(on(ae(s, Zv), l), e.getView().getResolution() * this.pixelTolerance_, Zv), l);
  21558. n = this.rBush_.getInExtent(c)
  21559. }
  21560. if (n && n.length > 0) {
  21561. var h = n.sort((function (t, e) {
  21562. return t_(s, t, l) - t_(s, e, l)
  21563. }))[0], p = h.segment, f = e_(s, h, l), d = e.getPixelFromCoordinate(f), g = Ir(t, d);
  21564. if (i || g <= this.pixelTolerance_) {
  21565. var y = {};
  21566. if (y[o(p)] = !0, this.delta_[0] = f[0] - s[0], this.delta_[1] = f[1] - s[1], h.geometry.getType() === bt.CIRCLE && 1 === h.index) this.snappedToVertex_ = !0, this.createOrUpdateVertexFeature_(f, [h.feature], [h.geometry]); else {
  21567. var m = e.getPixelFromCoordinate(p[0]), v = e.getPixelFromCoordinate(p[1]), _ = Rr(d, m), b = Rr(d, v);
  21568. g = Math.sqrt(Math.min(_, b)), this.snappedToVertex_ = g <= this.pixelTolerance_, this.snappedToVertex_ && (f = _ > b ? p[1] : p[0]), this.createOrUpdateVertexFeature_(f, [h.feature], [h.geometry]);
  21569. var x = {};
  21570. x[o(h.geometry)] = !0;
  21571. for (var w = 1, S = n.length; w < S; ++w) {
  21572. var E = n[w].segment;
  21573. if (!(Cr(p[0], E[0]) && Cr(p[1], E[1]) || Cr(p[0], E[1]) && Cr(p[1], E[0]))) break;
  21574. var T = o(n[w].geometry);
  21575. T in x || (x[T] = !0, y[o(E)] = !0)
  21576. }
  21577. }
  21578. return void (this.vertexSegments_ = y)
  21579. }
  21580. }
  21581. this.vertexFeature_ && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null)
  21582. }, e.prototype.insertVertex_ = function (t, e) {
  21583. for (var r, n = t.segment, i = t.feature, o = t.geometry, a = t.depth, s = t.index; e.length < o.getStride();) e.push(0);
  21584. switch (o.getType()) {
  21585. case bt.MULTI_LINE_STRING:
  21586. case bt.POLYGON:
  21587. (r = o.getCoordinates())[a[0]].splice(s + 1, 0, e);
  21588. break;
  21589. case bt.MULTI_POLYGON:
  21590. (r = o.getCoordinates())[a[1]][a[0]].splice(s + 1, 0, e);
  21591. break;
  21592. case bt.LINE_STRING:
  21593. (r = o.getCoordinates()).splice(s + 1, 0, e);
  21594. break;
  21595. default:
  21596. return
  21597. }
  21598. this.setGeometryCoordinates_(o, r);
  21599. var l = this.rBush_;
  21600. l.remove(t), this.updateSegmentIndices_(o, s, a, 1);
  21601. var u = {segment: [n[0], e], feature: i, geometry: o, depth: a, index: s};
  21602. l.insert(Kt(u.segment), u), this.dragSegments_.push([u, 1]);
  21603. var c = {segment: [e, n[1]], feature: i, geometry: o, depth: a, index: s + 1};
  21604. l.insert(Kt(c.segment), c), this.dragSegments_.push([c, 0]), this.ignoreNextSingleClick_ = !0
  21605. }, e.prototype.removePoint = function () {
  21606. if (this.lastPointerEvent_ && this.lastPointerEvent_.type != Ga.POINTERDRAG) {
  21607. var t = this.lastPointerEvent_;
  21608. this.willModifyFeatures_(t, this.dragSegments_);
  21609. var e = this.removeVertex_();
  21610. return this.dispatchEvent(new Jv($v, this.featuresBeingModified_, t)), this.featuresBeingModified_ = null, e
  21611. }
  21612. return !1
  21613. }, e.prototype.removeVertex_ = function () {
  21614. var t, e, r, n, i, a, s, l, u, c, h, p = this.dragSegments_, f = {}, d = !1;
  21615. for (i = p.length - 1; i >= 0; --i) h = o((c = (r = p[i])[0]).feature), c.depth && (h += "-" + c.depth.join("-")), h in f || (f[h] = {}), 0 === r[1] ? (f[h].right = c, f[h].index = c.index) : 1 == r[1] && (f[h].left = c, f[h].index = c.index + 1);
  21616. for (h in f) {
  21617. switch (u = f[h].right, s = f[h].left, (l = (a = f[h].index) - 1) < 0 && (l = 0), t = e = (n = (c = void 0 !== s ? s : u).geometry).getCoordinates(), d = !1, n.getType()) {
  21618. case bt.MULTI_LINE_STRING:
  21619. e[c.depth[0]].length > 2 && (e[c.depth[0]].splice(a, 1), d = !0);
  21620. break;
  21621. case bt.LINE_STRING:
  21622. e.length > 2 && (e.splice(a, 1), d = !0);
  21623. break;
  21624. case bt.MULTI_POLYGON:
  21625. t = t[c.depth[1]];
  21626. case bt.POLYGON:
  21627. (t = t[c.depth[0]]).length > 4 && (a == t.length - 1 && (a = 0), t.splice(a, 1), d = !0, 0 === a && (t.pop(), t.push(t[0]), l = t.length - 1))
  21628. }
  21629. if (d) {
  21630. this.setGeometryCoordinates_(n, e);
  21631. var g = [];
  21632. if (void 0 !== s && (this.rBush_.remove(s), g.push(s.segment[0])), void 0 !== u && (this.rBush_.remove(u), g.push(u.segment[1])), void 0 !== s && void 0 !== u) {
  21633. var y = {depth: c.depth, feature: c.feature, geometry: c.geometry, index: l, segment: g};
  21634. this.rBush_.insert(Kt(y.segment), y)
  21635. }
  21636. this.updateSegmentIndices_(n, a, c.depth, -1), this.vertexFeature_ && (this.overlay_.getSource().removeFeature(this.vertexFeature_), this.vertexFeature_ = null), p.length = 0
  21637. }
  21638. }
  21639. return d
  21640. }, e.prototype.setGeometryCoordinates_ = function (t, e) {
  21641. this.changingFeature_ = !0, t.setCoordinates(e), this.changingFeature_ = !1
  21642. }, e.prototype.updateSegmentIndices_ = function (t, e, r, n) {
  21643. this.rBush_.forEachInExtent(t.getExtent(), (function (i) {
  21644. i.geometry === t && (void 0 === r || void 0 === i.depth || b(i.depth, r)) && i.index > e && (i.index += n)
  21645. }))
  21646. }, e
  21647. }($s), n_ = function () {
  21648. var t = function (e, r) {
  21649. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  21650. t.__proto__ = e
  21651. } || function (t, e) {
  21652. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  21653. })(e, r)
  21654. };
  21655. return function (e, r) {
  21656. function n() {
  21657. this.constructor = e
  21658. }
  21659. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  21660. }
  21661. }(), i_ = "select", o_ = function (t) {
  21662. function e(e, r, n, i) {
  21663. var o = t.call(this, e) || this;
  21664. return o.selected = r, o.deselected = n, o.mapBrowserEvent = i, o
  21665. }
  21666. return n_(e, t), e
  21667. }(c), a_ = {};
  21668. var s_ = function (t) {
  21669. function e(e) {
  21670. var r, n, i = t.call(this) || this, o = e || {};
  21671. if (i.boundAddFeature_ = i.addFeature_.bind(i), i.boundRemoveFeature_ = i.removeFeature_.bind(i), i.condition_ = o.condition ? o.condition : al, i.addCondition_ = o.addCondition ? o.addCondition : ol, i.removeCondition_ = o.removeCondition ? o.removeCondition : ol, i.toggleCondition_ = o.toggleCondition ? o.toggleCondition : ll, i.multi_ = !!o.multi && o.multi, i.filter_ = o.filter ? o.filter : S, i.hitTolerance_ = o.hitTolerance ? o.hitTolerance : 0, i.style_ = void 0 !== o.style ? o.style : (v((r = bp())[bt.POLYGON], r[bt.LINE_STRING]), v(r[bt.GEOMETRY_COLLECTION], r[bt.LINE_STRING]), function (t) {
  21672. return t.getGeometry() ? r[t.getGeometry().getType()] : null
  21673. }), i.features_ = o.features || new ht, o.layers) if ("function" == typeof o.layers) n = o.layers; else {
  21674. var a = o.layers;
  21675. n = function (t) {
  21676. return g(a, t)
  21677. }
  21678. } else n = S;
  21679. return i.layerFilter_ = n, i.featureLayerAssociation_ = {}, i
  21680. }
  21681. return n_(e, t), e.prototype.addFeatureLayerAssociation_ = function (t, e) {
  21682. this.featureLayerAssociation_[o(t)] = e
  21683. }, e.prototype.getFeatures = function () {
  21684. return this.features_
  21685. }, e.prototype.getHitTolerance = function () {
  21686. return this.hitTolerance_
  21687. }, e.prototype.getLayer = function (t) {
  21688. return this.featureLayerAssociation_[o(t)]
  21689. }, e.prototype.setHitTolerance = function (t) {
  21690. this.hitTolerance_ = t
  21691. }, e.prototype.setMap = function (e) {
  21692. this.getMap() && this.style_ && this.features_.forEach(this.restorePreviousStyle_.bind(this)), t.prototype.setMap.call(this, e), e ? (this.features_.addEventListener(at, this.boundAddFeature_), this.features_.addEventListener(st, this.boundRemoveFeature_), this.style_ && this.features_.forEach(this.applySelectedStyle_.bind(this))) : (this.features_.removeEventListener(at, this.boundAddFeature_), this.features_.removeEventListener(st, this.boundRemoveFeature_))
  21693. }, e.prototype.addFeature_ = function (t) {
  21694. var e = t.element;
  21695. this.style_ && this.applySelectedStyle_(e)
  21696. }, e.prototype.removeFeature_ = function (t) {
  21697. var e = t.element;
  21698. this.style_ && this.restorePreviousStyle_(e)
  21699. }, e.prototype.getStyle = function () {
  21700. return this.style_
  21701. }, e.prototype.applySelectedStyle_ = function (t) {
  21702. var e = o(t);
  21703. e in a_ || (a_[e] = t.getStyle()), t.setStyle(this.style_)
  21704. }, e.prototype.restorePreviousStyle_ = function (t) {
  21705. for (var r = this.getMap().getInteractions().getArray(), n = r.length - 1; n >= 0; --n) {
  21706. var i = r[n];
  21707. if (i !== this && i instanceof e && i.getStyle() && -1 !== i.getFeatures().getArray().lastIndexOf(t)) return void t.setStyle(i.getStyle())
  21708. }
  21709. var a = o(t);
  21710. t.setStyle(a_[a]), delete a_[a]
  21711. }, e.prototype.removeFeatureLayerAssociation_ = function (t) {
  21712. delete this.featureLayerAssociation_[o(t)]
  21713. }, e.prototype.handleEvent = function (t) {
  21714. if (!this.condition_(t)) return !0;
  21715. var e = this.addCondition_(t), r = this.removeCondition_(t), n = this.toggleCondition_(t), i = !e && !r && !n,
  21716. o = t.map, a = this.getFeatures(), s = [], l = [];
  21717. if (i) {
  21718. P(this.featureLayerAssociation_), o.forEachFeatureAtPixel(t.pixel, function (t, e) {
  21719. if (this.filter_(t, e)) return l.push(t), this.addFeatureLayerAssociation_(t, e), !this.multi_
  21720. }.bind(this), {layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_});
  21721. for (var u = a.getLength() - 1; u >= 0; --u) {
  21722. var c = a.item(u), h = l.indexOf(c);
  21723. h > -1 ? l.splice(h, 1) : (a.remove(c), s.push(c))
  21724. }
  21725. 0 !== l.length && a.extend(l)
  21726. } else {
  21727. o.forEachFeatureAtPixel(t.pixel, function (t, i) {
  21728. if (this.filter_(t, i)) return !e && !n || g(a.getArray(), t) ? (r || n) && g(a.getArray(), t) && (s.push(t), this.removeFeatureLayerAssociation_(t)) : (l.push(t), this.addFeatureLayerAssociation_(t, i)), !this.multi_
  21729. }.bind(this), {layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_});
  21730. for (var p = s.length - 1; p >= 0; --p) a.remove(s[p]);
  21731. a.extend(l)
  21732. }
  21733. return (l.length > 0 || s.length > 0) && this.dispatchEvent(new o_(i_, l, s, t)), !0
  21734. }, e
  21735. }(qs), l_ = function () {
  21736. var t = function (e, r) {
  21737. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  21738. t.__proto__ = e
  21739. } || function (t, e) {
  21740. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  21741. })(e, r)
  21742. };
  21743. return function (e, r) {
  21744. function n() {
  21745. this.constructor = e
  21746. }
  21747. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  21748. }
  21749. }();
  21750. function u_(t) {
  21751. return t.feature ? t.feature : t.element ? t.element : void 0
  21752. }
  21753. var c_ = [], h_ = function (t) {
  21754. function e(e) {
  21755. var r = this, n = e || {}, i = n;
  21756. return i.handleDownEvent || (i.handleDownEvent = S), i.stopDown || (i.stopDown = E), (r = t.call(this, i) || this).source_ = n.source ? n.source : null, r.vertex_ = void 0 === n.vertex || n.vertex, r.edge_ = void 0 === n.edge || n.edge, r.features_ = n.features ? n.features : null, r.featuresListenerKeys_ = [], r.featureChangeListenerKeys_ = {}, r.indexedFeaturesExtents_ = {}, r.pendingFeatures_ = {}, r.pixelTolerance_ = void 0 !== n.pixelTolerance ? n.pixelTolerance : 10, r.rBush_ = new Rp, r.SEGMENT_WRITERS_ = {
  21757. Point: r.writePointGeometry_.bind(r),
  21758. LineString: r.writeLineStringGeometry_.bind(r),
  21759. LinearRing: r.writeLineStringGeometry_.bind(r),
  21760. Polygon: r.writePolygonGeometry_.bind(r),
  21761. MultiPoint: r.writeMultiPointGeometry_.bind(r),
  21762. MultiLineString: r.writeMultiLineStringGeometry_.bind(r),
  21763. MultiPolygon: r.writeMultiPolygonGeometry_.bind(r),
  21764. GeometryCollection: r.writeGeometryCollectionGeometry_.bind(r),
  21765. Circle: r.writeCircleGeometry_.bind(r)
  21766. }, r
  21767. }
  21768. return l_(e, t), e.prototype.addFeature = function (t, e) {
  21769. var r = void 0 === e || e, n = o(t), i = t.getGeometry();
  21770. if (i) {
  21771. var a = this.SEGMENT_WRITERS_[i.getType()];
  21772. a && (this.indexedFeaturesExtents_[n] = i.getExtent([1 / 0, 1 / 0, -1 / 0, -1 / 0]), a(t, i))
  21773. }
  21774. r && (this.featureChangeListenerKeys_[n] = Z(t, F, this.handleFeatureChange_, this))
  21775. }, e.prototype.forEachFeatureAdd_ = function (t) {
  21776. this.addFeature(t)
  21777. }, e.prototype.forEachFeatureRemove_ = function (t) {
  21778. this.removeFeature(t)
  21779. }, e.prototype.getFeatures_ = function () {
  21780. var t;
  21781. return this.features_ ? t = this.features_ : this.source_ && (t = this.source_.getFeatures()), t
  21782. }, e.prototype.handleEvent = function (e) {
  21783. var r = this.snapTo(e.pixel, e.coordinate, e.map);
  21784. return r.snapped && (e.coordinate = r.vertex.slice(0, 2), e.pixel = r.vertexPixel), t.prototype.handleEvent.call(this, e)
  21785. }, e.prototype.handleFeatureAdd_ = function (t) {
  21786. var e = u_(t);
  21787. this.addFeature(e)
  21788. }, e.prototype.handleFeatureRemove_ = function (t) {
  21789. var e = u_(t);
  21790. this.removeFeature(e)
  21791. }, e.prototype.handleFeatureChange_ = function (t) {
  21792. var e = t.target;
  21793. if (this.handlingDownUpSequence) {
  21794. var r = o(e);
  21795. r in this.pendingFeatures_ || (this.pendingFeatures_[r] = e)
  21796. } else this.updateFeature_(e)
  21797. }, e.prototype.handleUpEvent = function (t) {
  21798. var e = R(this.pendingFeatures_);
  21799. return e.length && (e.forEach(this.updateFeature_.bind(this)), this.pendingFeatures_ = {}), !1
  21800. }, e.prototype.removeFeature = function (t, e) {
  21801. var r = void 0 === e || e, n = o(t), i = this.indexedFeaturesExtents_[n];
  21802. if (i) {
  21803. var a = this.rBush_, s = [];
  21804. a.forEachInExtent(i, (function (e) {
  21805. t === e.feature && s.push(e)
  21806. }));
  21807. for (var l = s.length - 1; l >= 0; --l) a.remove(s[l])
  21808. }
  21809. r && (H(this.featureChangeListenerKeys_[n]), delete this.featureChangeListenerKeys_[n])
  21810. }, e.prototype.setMap = function (e) {
  21811. var r = this.getMap(), n = this.featuresListenerKeys_, i = this.getFeatures_();
  21812. r && (n.forEach(H), n.length = 0, i.forEach(this.forEachFeatureRemove_.bind(this))), t.prototype.setMap.call(this, e), e && (this.features_ ? n.push(Z(this.features_, at, this.handleFeatureAdd_, this), Z(this.features_, st, this.handleFeatureRemove_, this)) : this.source_ && n.push(Z(this.source_, ef, this.handleFeatureAdd_, this), Z(this.source_, of, this.handleFeatureRemove_, this)), i.forEach(this.forEachFeatureAdd_.bind(this)))
  21813. }, e.prototype.snapTo = function (t, e, r) {
  21814. var n = Kt([r.getCoordinateFromPixel([t[0] - this.pixelTolerance_, t[1] + this.pixelTolerance_]), r.getCoordinateFromPixel([t[0] + this.pixelTolerance_, t[1] - this.pixelTolerance_])]),
  21815. i = this.rBush_.getInExtent(n);
  21816. this.vertex_ && !this.edge_ && (i = i.filter((function (t) {
  21817. return t.feature.getGeometry().getType() !== bt.CIRCLE
  21818. })));
  21819. var o = !1, a = null, s = null;
  21820. if (0 === i.length) return {snapped: o, vertex: a, vertexPixel: s};
  21821. for (var l, u = r.getView().getProjection(), c = rn(e, u), h = 1 / 0, p = 0; p < i.length; ++p) {
  21822. var f = i[p];
  21823. c_[0] = rn(f.segment[0], u), c_[1] = rn(f.segment[1], u);
  21824. var d = Lr(c, c_);
  21825. d < h && (l = f, h = d)
  21826. }
  21827. var g = l.segment;
  21828. if (this.vertex_ && !this.edge_) {
  21829. var y = r.getPixelFromCoordinate(g[0]), m = r.getPixelFromCoordinate(g[1]), v = Rr(t, y), _ = Rr(t, m);
  21830. Math.sqrt(Math.min(v, _)) <= this.pixelTolerance_ && (o = !0, a = v > _ ? g[1] : g[0], s = r.getPixelFromCoordinate(a))
  21831. } else if (this.edge_) {
  21832. var b = l.feature.getGeometry().getType() === bt.CIRCLE;
  21833. if (b) {
  21834. var x = l.feature.getGeometry(), w = tn();
  21835. w && (x = x.clone().transform(w, u)), a = en(wr(c, x), u)
  21836. } else c_[0] = rn(g[0], u), c_[1] = rn(g[1], u), a = en(Sr(c, c_), u);
  21837. if (Ir(t, s = r.getPixelFromCoordinate(a)) <= this.pixelTolerance_ && (o = !0, this.vertex_ && !b)) {
  21838. y = r.getPixelFromCoordinate(g[0]), m = r.getPixelFromCoordinate(g[1]), v = Rr(s, y), _ = Rr(s, m);
  21839. Math.sqrt(Math.min(v, _)) <= this.pixelTolerance_ && (a = v > _ ? g[1] : g[0], s = r.getPixelFromCoordinate(a))
  21840. }
  21841. }
  21842. return o && (s = [Math.round(s[0]), Math.round(s[1])]), {snapped: o, vertex: a, vertexPixel: s}
  21843. }, e.prototype.updateFeature_ = function (t) {
  21844. this.removeFeature(t, !1), this.addFeature(t, !1)
  21845. }, e.prototype.writeCircleGeometry_ = function (t, e) {
  21846. var r = this.getMap().getView().getProjection(), n = e, i = tn();
  21847. i && (n = n.clone().transform(i, r));
  21848. var o = yi(n);
  21849. i && o.transform(r, i);
  21850. for (var a = o.getCoordinates()[0], s = 0, l = a.length - 1; s < l; ++s) {
  21851. var u = a.slice(s, s + 2), c = {feature: t, segment: u};
  21852. this.rBush_.insert(Kt(u), c)
  21853. }
  21854. }, e.prototype.writeGeometryCollectionGeometry_ = function (t, e) {
  21855. for (var r = e.getGeometriesArray(), n = 0; n < r.length; ++n) {
  21856. var i = this.SEGMENT_WRITERS_[r[n].getType()];
  21857. i && i(t, r[n])
  21858. }
  21859. }, e.prototype.writeLineStringGeometry_ = function (t, e) {
  21860. for (var r = e.getCoordinates(), n = 0, i = r.length - 1; n < i; ++n) {
  21861. var o = r.slice(n, n + 2), a = {feature: t, segment: o};
  21862. this.rBush_.insert(Kt(o), a)
  21863. }
  21864. }, e.prototype.writeMultiLineStringGeometry_ = function (t, e) {
  21865. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) for (var o = r[n], a = 0, s = o.length - 1; a < s; ++a) {
  21866. var l = o.slice(a, a + 2), u = {feature: t, segment: l};
  21867. this.rBush_.insert(Kt(l), u)
  21868. }
  21869. }, e.prototype.writeMultiPointGeometry_ = function (t, e) {
  21870. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) {
  21871. var o = r[n], a = {feature: t, segment: [o, o]};
  21872. this.rBush_.insert(e.getExtent(), a)
  21873. }
  21874. }, e.prototype.writeMultiPolygonGeometry_ = function (t, e) {
  21875. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) for (var o = r[n], a = 0, s = o.length; a < s; ++a) for (var l = o[a], u = 0, c = l.length - 1; u < c; ++u) {
  21876. var h = l.slice(u, u + 2), p = {feature: t, segment: h};
  21877. this.rBush_.insert(Kt(h), p)
  21878. }
  21879. }, e.prototype.writePointGeometry_ = function (t, e) {
  21880. var r = e.getCoordinates(), n = {feature: t, segment: [r, r]};
  21881. this.rBush_.insert(e.getExtent(), n)
  21882. }, e.prototype.writePolygonGeometry_ = function (t, e) {
  21883. for (var r = e.getCoordinates(), n = 0, i = r.length; n < i; ++n) for (var o = r[n], a = 0, s = o.length - 1; a < s; ++a) {
  21884. var l = o.slice(a, a + 2), u = {feature: t, segment: l};
  21885. this.rBush_.insert(Kt(l), u)
  21886. }
  21887. }, e
  21888. }($s), p_ = function () {
  21889. var t = function (e, r) {
  21890. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  21891. t.__proto__ = e
  21892. } || function (t, e) {
  21893. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  21894. })(e, r)
  21895. };
  21896. return function (e, r) {
  21897. function n() {
  21898. this.constructor = e
  21899. }
  21900. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  21901. }
  21902. }(), f_ = "translatestart", d_ = "translating", g_ = "translateend", y_ = function (t) {
  21903. function e(e, r, n, i, o) {
  21904. var a = t.call(this, e) || this;
  21905. return a.features = r, a.coordinate = n, a.startCoordinate = i, a.mapBrowserEvent = o, a
  21906. }
  21907. return p_(e, t), e
  21908. }(c), m_ = function (t) {
  21909. function e(e) {
  21910. var r, n = this, i = e || {};
  21911. if ((n = t.call(this, i) || this).lastCoordinate_ = null, n.startCoordinate_ = null, n.features_ = void 0 !== i.features ? i.features : null, i.layers) if ("function" == typeof i.layers) r = i.layers; else {
  21912. var o = i.layers;
  21913. r = function (t) {
  21914. return g(o, t)
  21915. }
  21916. } else r = S;
  21917. return n.layerFilter_ = r, n.filter_ = i.filter ? i.filter : S, n.hitTolerance_ = i.hitTolerance ? i.hitTolerance : 0, n.lastFeature_ = null, n.addEventListener(it(Bs), n.handleActiveChanged_), n
  21918. }
  21919. return p_(e, t), e.prototype.handleDownEvent = function (t) {
  21920. if (this.lastFeature_ = this.featuresAtPixel_(t.pixel, t.map), !this.lastCoordinate_ && this.lastFeature_) {
  21921. this.startCoordinate_ = t.coordinate, this.lastCoordinate_ = t.coordinate, this.handleMoveEvent(t);
  21922. var e = this.features_ || new ht([this.lastFeature_]);
  21923. return this.dispatchEvent(new y_(f_, e, t.coordinate, this.startCoordinate_, t)), !0
  21924. }
  21925. return !1
  21926. }, e.prototype.handleUpEvent = function (t) {
  21927. if (this.lastCoordinate_) {
  21928. this.lastCoordinate_ = null, this.handleMoveEvent(t);
  21929. var e = this.features_ || new ht([this.lastFeature_]);
  21930. return this.dispatchEvent(new y_(g_, e, t.coordinate, this.startCoordinate_, t)), this.startCoordinate_ = null, !0
  21931. }
  21932. return !1
  21933. }, e.prototype.handleDragEvent = function (t) {
  21934. if (this.lastCoordinate_) {
  21935. var e = t.coordinate, r = e[0] - this.lastCoordinate_[0], n = e[1] - this.lastCoordinate_[1],
  21936. i = this.features_ || new ht([this.lastFeature_]);
  21937. i.forEach((function (t) {
  21938. var e = t.getGeometry();
  21939. e.translate(r, n), t.setGeometry(e)
  21940. })), this.lastCoordinate_ = e, this.dispatchEvent(new y_(d_, i, e, this.startCoordinate_, t))
  21941. }
  21942. }, e.prototype.handleMoveEvent = function (t) {
  21943. var e = t.map.getViewport();
  21944. this.featuresAtPixel_(t.pixel, t.map) ? (e.classList.remove(this.lastCoordinate_ ? "ol-grab" : "ol-grabbing"), e.classList.add(this.lastCoordinate_ ? "ol-grabbing" : "ol-grab")) : e.classList.remove("ol-grab", "ol-grabbing")
  21945. }, e.prototype.featuresAtPixel_ = function (t, e) {
  21946. return e.forEachFeatureAtPixel(t, function (t, e) {
  21947. if (this.filter_(t, e) && (!this.features_ || g(this.features_.getArray(), t))) return t
  21948. }.bind(this), {layerFilter: this.layerFilter_, hitTolerance: this.hitTolerance_})
  21949. }, e.prototype.getHitTolerance = function () {
  21950. return this.hitTolerance_
  21951. }, e.prototype.setHitTolerance = function (t) {
  21952. this.hitTolerance_ = t
  21953. }, e.prototype.setMap = function (e) {
  21954. var r = this.getMap();
  21955. t.prototype.setMap.call(this, e), this.updateState_(r)
  21956. }, e.prototype.handleActiveChanged_ = function () {
  21957. this.updateState_(null)
  21958. }, e.prototype.updateState_ = function (t) {
  21959. var e = this.getMap(), r = this.getActive();
  21960. e && r || (e = e || t) && e.getViewport().classList.remove("ol-grab", "ol-grabbing")
  21961. }, e
  21962. }($s);
  21963. function v_(t, e, r, n, i, o) {
  21964. var a, s;
  21965. void 0 !== i ? (a = i, s = void 0 !== o ? o : 0) : (a = [], s = 0);
  21966. for (var l = e; l < r;) {
  21967. var u = t[l++];
  21968. a[s++] = t[l++], a[s++] = u;
  21969. for (var c = 2; c < n; ++c) a[s++] = t[l++]
  21970. }
  21971. return a.length = s, a
  21972. }
  21973. var __ = function () {
  21974. var t = function (e, r) {
  21975. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  21976. t.__proto__ = e
  21977. } || function (t, e) {
  21978. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  21979. })(e, r)
  21980. };
  21981. return function (e, r) {
  21982. function n() {
  21983. this.constructor = e
  21984. }
  21985. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  21986. }
  21987. }(), b_ = {};
  21988. b_[bt.POINT] = function (t) {
  21989. var e;
  21990. e = void 0 !== t.m && void 0 !== t.z ? new qn([t.x, t.y, t.z, t.m], _t) : void 0 !== t.z ? new qn([t.x, t.y, t.z], mt) : void 0 !== t.m ? new qn([t.x, t.y, t.m], vt) : new qn([t.x, t.y]);
  21991. return e
  21992. }, b_[bt.LINE_STRING] = function (t) {
  21993. var e = S_(t);
  21994. return new Py(t.paths[0], e)
  21995. }, b_[bt.POLYGON] = function (t) {
  21996. var e = S_(t);
  21997. return new fi(t.rings, e)
  21998. }, b_[bt.MULTI_POINT] = function (t) {
  21999. var e = S_(t);
  22000. return new Hy(t.points, e)
  22001. }, b_[bt.MULTI_LINE_STRING] = function (t) {
  22002. var e = S_(t);
  22003. return new Zy(t.paths, e)
  22004. }, b_[bt.MULTI_POLYGON] = function (t) {
  22005. var e = S_(t);
  22006. return new Jy(t.rings, e)
  22007. };
  22008. var x_ = {};
  22009. function w_(t, e) {
  22010. var r, n, i;
  22011. if (!t) return null;
  22012. if ("number" == typeof t.x && "number" == typeof t.y) i = bt.POINT; else if (t.points) i = bt.MULTI_POINT; else if (t.paths) {
  22013. i = 1 === t.paths.length ? bt.LINE_STRING : bt.MULTI_LINE_STRING
  22014. } else if (t.rings) {
  22015. var o = t, a = S_(o), s = function (t, e) {
  22016. var r, n, i = [], o = [], a = [];
  22017. for (r = 0, n = t.length; r < n; ++r) {
  22018. i.length = 0, On(i, 0, t[r], e.length), ai(i, 0, i.length, e.length) ? o.push([t[r]]) : a.push(t[r])
  22019. }
  22020. for (; a.length;) {
  22021. var s = a.shift(), l = !1;
  22022. for (r = o.length - 1; r >= 0; r--) {
  22023. var u = o[r][0];
  22024. if (te(new Yn(u).getExtent(), new Yn(s).getExtent())) {
  22025. o[r].push(s), l = !0;
  22026. break
  22027. }
  22028. }
  22029. l || o.push([s.reverse()])
  22030. }
  22031. return o
  22032. }(o.rings, a);
  22033. 1 === s.length ? (i = bt.POLYGON, t = O({}, t, ((r = {}).rings = s[0], r))) : (i = bt.MULTI_POLYGON, t = O({}, t, ((n = {}).rings = s, n)))
  22034. }
  22035. return Wy((0, b_[i])(t), !1, e)
  22036. }
  22037. function S_(t) {
  22038. var e = yt;
  22039. return !0 === t.hasZ && !0 === t.hasM ? e = _t : !0 === t.hasZ ? e = mt : !0 === t.hasM && (e = vt), e
  22040. }
  22041. function E_(t) {
  22042. var e = t.getLayout();
  22043. return {hasZ: e === mt || e === _t, hasM: e === vt || e === _t}
  22044. }
  22045. function T_(t, e) {
  22046. return (0, x_[t.getType()])(Wy(t, !0, e), e)
  22047. }
  22048. x_[bt.POINT] = function (t, e) {
  22049. var r, n = t.getCoordinates(), i = t.getLayout();
  22050. i === mt ? r = {x: n[0], y: n[1], z: n[2]} : i === vt ? r = {x: n[0], y: n[1], m: n[2]} : i === _t ? r = {
  22051. x: n[0],
  22052. y: n[1],
  22053. z: n[2],
  22054. m: n[3]
  22055. } : i === yt ? r = {x: n[0], y: n[1]} : pt(!1, 34);
  22056. return r
  22057. }, x_[bt.LINE_STRING] = function (t, e) {
  22058. var r = E_(t);
  22059. return {hasZ: r.hasZ, hasM: r.hasM, paths: [t.getCoordinates()]}
  22060. }, x_[bt.POLYGON] = function (t, e) {
  22061. var r = E_(t);
  22062. return {hasZ: r.hasZ, hasM: r.hasM, rings: t.getCoordinates(!1)}
  22063. }, x_[bt.MULTI_POINT] = function (t, e) {
  22064. var r = E_(t);
  22065. return {hasZ: r.hasZ, hasM: r.hasM, points: t.getCoordinates()}
  22066. }, x_[bt.MULTI_LINE_STRING] = function (t, e) {
  22067. var r = E_(t);
  22068. return {hasZ: r.hasZ, hasM: r.hasM, paths: t.getCoordinates()}
  22069. }, x_[bt.MULTI_POLYGON] = function (t, e) {
  22070. for (var r = E_(t), n = t.getCoordinates(!1), i = [], o = 0; o < n.length; o++) for (var a = n[o].length - 1; a >= 0; a--) i.push(n[o][a]);
  22071. return {hasZ: r.hasZ, hasM: r.hasM, rings: i}
  22072. };
  22073. var C_ = function (t) {
  22074. function e(e) {
  22075. var r = this, n = e || {};
  22076. return (r = t.call(this) || this).geometryName_ = n.geometryName, r
  22077. }
  22078. return __(e, t), e.prototype.readFeatureFromObject = function (t, e, r) {
  22079. var n = t, i = w_(n.geometry, e), o = new gt;
  22080. if (this.geometryName_ && o.setGeometryName(this.geometryName_), o.setGeometry(i), n.attributes) {
  22081. o.setProperties(n.attributes, !0);
  22082. var a = n.attributes[r];
  22083. void 0 !== a && o.setId(a)
  22084. }
  22085. return o
  22086. }, e.prototype.readFeaturesFromObject = function (t, e) {
  22087. var r = e || {};
  22088. if (t.features) {
  22089. for (var n = [], i = t.features, o = 0, a = i.length; o < a; ++o) n.push(this.readFeatureFromObject(i[o], r, t.objectIdFieldName));
  22090. return n
  22091. }
  22092. return [this.readFeatureFromObject(t, r)]
  22093. }, e.prototype.readGeometryFromObject = function (t, e) {
  22094. return w_(t, e)
  22095. }, e.prototype.readProjectionFromObject = function (t) {
  22096. return t.spatialReference && void 0 !== t.spatialReference.wkid ? Gr("EPSG:" + t.spatialReference.wkid) : null
  22097. }, e.prototype.writeGeometryObject = function (t, e) {
  22098. return T_(t, this.adaptOptions(e))
  22099. }, e.prototype.writeFeatureObject = function (t, e) {
  22100. e = this.adaptOptions(e);
  22101. var r = {};
  22102. if (!t.hasProperties()) return r.attributes = {}, r;
  22103. var n = t.getProperties(), i = t.getGeometry();
  22104. if (i) {
  22105. r.geometry = T_(i, e);
  22106. var o = e && (e.dataProjection || e.featureProjection);
  22107. o && (r.geometry.spatialReference = {wkid: Number(Gr(o).getCode().split(":").pop())}), delete n[t.getGeometryName()]
  22108. }
  22109. return I(n) ? r.attributes = {} : r.attributes = n, r
  22110. }, e.prototype.writeFeaturesObject = function (t, e) {
  22111. e = this.adaptOptions(e);
  22112. for (var r = [], n = 0, i = t.length; n < i; ++n) r.push(this.writeFeatureObject(t[n], e));
  22113. return {features: r}
  22114. }, e
  22115. }(qm), O_ = function () {
  22116. var t = function (e, r) {
  22117. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  22118. t.__proto__ = e
  22119. } || function (t, e) {
  22120. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  22121. })(e, r)
  22122. };
  22123. return function (e, r) {
  22124. function n() {
  22125. this.constructor = e
  22126. }
  22127. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  22128. }
  22129. }(), P_ = function (t) {
  22130. function e() {
  22131. var e = t.call(this) || this;
  22132. return e.xmlSerializer_ = Wc(), e
  22133. }
  22134. return O_(e, t), e.prototype.getType = function () {
  22135. return Ru
  22136. }, e.prototype.readFeature = function (t, e) {
  22137. if (t) {
  22138. if ("string" == typeof t) {
  22139. var r = Pc(t);
  22140. return this.readFeatureFromDocument(r, e)
  22141. }
  22142. return Cc(t) ? this.readFeatureFromDocument(t, e) : this.readFeatureFromNode(t, e)
  22143. }
  22144. return null
  22145. }, e.prototype.readFeatureFromDocument = function (t, e) {
  22146. var r = this.readFeaturesFromDocument(t, e);
  22147. return r.length > 0 ? r[0] : null
  22148. }, e.prototype.readFeatureFromNode = function (t, e) {
  22149. return null
  22150. }, e.prototype.readFeatures = function (t, e) {
  22151. if (t) {
  22152. if ("string" == typeof t) {
  22153. var r = Pc(t);
  22154. return this.readFeaturesFromDocument(r, e)
  22155. }
  22156. return Cc(t) ? this.readFeaturesFromDocument(t, e) : this.readFeaturesFromNode(t, e)
  22157. }
  22158. return []
  22159. }, e.prototype.readFeaturesFromDocument = function (t, e) {
  22160. for (var r = [], n = t.firstChild; n; n = n.nextSibling) n.nodeType == Node.ELEMENT_NODE && v(r, this.readFeaturesFromNode(n, e));
  22161. return r
  22162. }, e.prototype.readFeaturesFromNode = function (t, e) {
  22163. return n()
  22164. }, e.prototype.readGeometry = function (t, e) {
  22165. if (t) {
  22166. if ("string" == typeof t) {
  22167. var r = Pc(t);
  22168. return this.readGeometryFromDocument(r, e)
  22169. }
  22170. return Cc(t) ? this.readGeometryFromDocument(t, e) : this.readGeometryFromNode(t, e)
  22171. }
  22172. return null
  22173. }, e.prototype.readGeometryFromDocument = function (t, e) {
  22174. return null
  22175. }, e.prototype.readGeometryFromNode = function (t, e) {
  22176. return null
  22177. }, e.prototype.readProjection = function (t) {
  22178. if (t) {
  22179. if ("string" == typeof t) {
  22180. var e = Pc(t);
  22181. return this.readProjectionFromDocument(e)
  22182. }
  22183. return Cc(t) ? this.readProjectionFromDocument(t) : this.readProjectionFromNode(t)
  22184. }
  22185. return null
  22186. }, e.prototype.readProjectionFromDocument = function (t) {
  22187. return this.dataProjection
  22188. }, e.prototype.readProjectionFromNode = function (t) {
  22189. return this.dataProjection
  22190. }, e.prototype.writeFeature = function (t, e) {
  22191. var r = this.writeFeatureNode(t, e);
  22192. return this.xmlSerializer_.serializeToString(r)
  22193. }, e.prototype.writeFeatureNode = function (t, e) {
  22194. return null
  22195. }, e.prototype.writeFeatures = function (t, e) {
  22196. var r = this.writeFeaturesNode(t, e);
  22197. return this.xmlSerializer_.serializeToString(r)
  22198. }, e.prototype.writeFeaturesNode = function (t, e) {
  22199. return null
  22200. }, e.prototype.writeGeometry = function (t, e) {
  22201. var r = this.writeGeometryNode(t, e);
  22202. return this.xmlSerializer_.serializeToString(r)
  22203. }, e.prototype.writeGeometryNode = function (t, e) {
  22204. return null
  22205. }, e
  22206. }(Yy), R_ = function () {
  22207. var t = function (e, r) {
  22208. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  22209. t.__proto__ = e
  22210. } || function (t, e) {
  22211. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  22212. })(e, r)
  22213. };
  22214. return function (e, r) {
  22215. function n() {
  22216. this.constructor = e
  22217. }
  22218. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  22219. }
  22220. }(), I_ = "http://www.opengis.net/gml", L_ = /^[\s\xa0]*$/, M_ = function (t) {
  22221. function e(e) {
  22222. var r = t.call(this) || this, n = e || {};
  22223. return r.featureType = n.featureType, r.featureNS = n.featureNS, r.srsName = n.srsName, r.schemaLocation = "", r.FEATURE_COLLECTION_PARSERS = {}, r.FEATURE_COLLECTION_PARSERS[r.namespace] = {
  22224. featureMember: Ic(r.readFeaturesInternal),
  22225. featureMembers: Lc(r.readFeaturesInternal)
  22226. }, r
  22227. }
  22228. return R_(e, t), e.prototype.readFeaturesInternal = function (t, e) {
  22229. var r = t.localName, n = null;
  22230. if ("FeatureCollection" == r) n = Uc([], this.FEATURE_COLLECTION_PARSERS, t, e, this); else if ("featureMembers" == r || "featureMember" == r || "member" == r) {
  22231. var i = e[0], o = i.featureType, a = i.featureNS;
  22232. if (!o && t.childNodes) {
  22233. o = [], a = {};
  22234. for (var s = 0, l = t.childNodes.length; s < l; ++s) {
  22235. var u = t.childNodes[s];
  22236. if (1 === u.nodeType) {
  22237. var c = u.nodeName.split(":").pop();
  22238. if (-1 === o.indexOf(c)) {
  22239. var h = "", p = 0, f = u.namespaceURI;
  22240. for (var d in a) {
  22241. if (a[d] === f) {
  22242. h = d;
  22243. break
  22244. }
  22245. ++p
  22246. }
  22247. h || (a[h = "p" + p] = f), o.push(h + ":" + c)
  22248. }
  22249. }
  22250. }
  22251. "featureMember" != r && (i.featureType = o, i.featureNS = a)
  22252. }
  22253. if ("string" == typeof a) {
  22254. var g = a;
  22255. (a = {}).p0 = g
  22256. }
  22257. var y = {}, m = Array.isArray(o) ? o : [o];
  22258. for (var v in a) {
  22259. var _ = {};
  22260. for (s = 0, l = m.length; s < l; ++s) {
  22261. (-1 === m[s].indexOf(":") ? "p0" : m[s].split(":")[0]) === v && (_[m[s].split(":").pop()] = "featureMembers" == r ? Ic(this.readFeatureElement, this) : Lc(this.readFeatureElement, this))
  22262. }
  22263. y[a[v]] = _
  22264. }
  22265. n = Uc("featureMember" == r || "member" == r ? void 0 : [], y, t, e)
  22266. }
  22267. return null === n && (n = []), n
  22268. }, e.prototype.readGeometryElement = function (t, e) {
  22269. var r = e[0];
  22270. r.srsName = t.firstElementChild.getAttribute("srsName"), r.srsDimension = t.firstElementChild.getAttribute("srsDimension");
  22271. var n = Uc(null, this.GEOMETRY_PARSERS, t, e, this);
  22272. return n ? Array.isArray(n) ? qy(n, r) : Wy(n, !1, r) : void 0
  22273. }, e.prototype.readFeatureElementInternal = function (t, e, r) {
  22274. for (var n, i = {}, o = t.firstElementChild; o; o = o.nextElementSibling) {
  22275. var a = void 0, s = o.localName;
  22276. 0 === o.childNodes.length || 1 === o.childNodes.length && (3 === o.firstChild.nodeType || 4 === o.firstChild.nodeType) ? (a = Ec(o, !1), L_.test(a) && (a = void 0)) : (r && (a = this.readGeometryElement(o, e)), a ? "boundedBy" !== s && (n = s) : a = this.readFeatureElementInternal(o, e, !1)), i[s] ? (i[s] instanceof Array || (i[s] = [i[s]]), i[s].push(a)) : i[s] = a;
  22277. var l = o.attributes.length;
  22278. if (l > 0) {
  22279. i[s] = {_content_: i[s]};
  22280. for (var u = 0; u < l; u++) {
  22281. var c = o.attributes[u].name;
  22282. i[s][c] = o.attributes[u].value
  22283. }
  22284. }
  22285. }
  22286. if (r) {
  22287. var h = new gt(i);
  22288. n && h.setGeometryName(n);
  22289. var p = t.getAttribute("fid") || Oc(t, this.namespace, "id");
  22290. return p && h.setId(p), h
  22291. }
  22292. return i
  22293. }, e.prototype.readFeatureElement = function (t, e) {
  22294. return this.readFeatureElementInternal(t, e, !0)
  22295. }, e.prototype.readPoint = function (t, e) {
  22296. var r = this.readFlatCoordinatesFromNode(t, e);
  22297. if (r) return new qn(r, mt)
  22298. }, e.prototype.readMultiPoint = function (t, e) {
  22299. var r = Uc([], this.MULTIPOINT_PARSERS, t, e, this);
  22300. return r ? new Hy(r) : void 0
  22301. }, e.prototype.readMultiLineString = function (t, e) {
  22302. var r = Uc([], this.MULTILINESTRING_PARSERS, t, e, this);
  22303. if (r) return new Zy(r)
  22304. }, e.prototype.readMultiPolygon = function (t, e) {
  22305. var r = Uc([], this.MULTIPOLYGON_PARSERS, t, e, this);
  22306. if (r) return new Jy(r)
  22307. }, e.prototype.pointMemberParser = function (t, e) {
  22308. zc(this.POINTMEMBER_PARSERS, t, e, this)
  22309. }, e.prototype.lineStringMemberParser = function (t, e) {
  22310. zc(this.LINESTRINGMEMBER_PARSERS, t, e, this)
  22311. }, e.prototype.polygonMemberParser = function (t, e) {
  22312. zc(this.POLYGONMEMBER_PARSERS, t, e, this)
  22313. }, e.prototype.readLineString = function (t, e) {
  22314. var r = this.readFlatCoordinatesFromNode(t, e);
  22315. return r ? new Py(r, mt) : void 0
  22316. }, e.prototype.readFlatLinearRing = function (t, e) {
  22317. var r = Uc(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS, t, e, this);
  22318. return r || void 0
  22319. }, e.prototype.readLinearRing = function (t, e) {
  22320. var r = this.readFlatCoordinatesFromNode(t, e);
  22321. if (r) return new Yn(r, mt)
  22322. }, e.prototype.readPolygon = function (t, e) {
  22323. var r = Uc([null], this.FLAT_LINEAR_RINGS_PARSERS, t, e, this);
  22324. if (r && r[0]) {
  22325. var n, i = r[0], o = [i.length], a = void 0;
  22326. for (a = 1, n = r.length; a < n; ++a) v(i, r[a]), o.push(i.length);
  22327. return new fi(i, mt, o)
  22328. }
  22329. }, e.prototype.readFlatCoordinatesFromNode = function (t, e) {
  22330. return Uc(null, this.GEOMETRY_FLAT_COORDINATES_PARSERS, t, e, this)
  22331. }, e.prototype.readGeometryFromNode = function (t, e) {
  22332. var r = this.readGeometryElement(t, [this.getReadOptions(t, e || {})]);
  22333. return r || null
  22334. }, e.prototype.readFeaturesFromNode = function (t, e) {
  22335. var r = {featureType: this.featureType, featureNS: this.featureNS};
  22336. return e && O(r, this.getReadOptions(t, e)), this.readFeaturesInternal(t, [r]) || []
  22337. }, e.prototype.readProjectionFromNode = function (t) {
  22338. return Gr(this.srsName ? this.srsName : t.firstElementChild.getAttribute("srsName"))
  22339. }, e
  22340. }(P_);
  22341. M_.prototype.namespace = I_, M_.prototype.FLAT_LINEAR_RINGS_PARSERS = {"http://www.opengis.net/gml": {}}, M_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {"http://www.opengis.net/gml": {}}, M_.prototype.GEOMETRY_PARSERS = {"http://www.opengis.net/gml": {}}, M_.prototype.MULTIPOINT_PARSERS = {
  22342. "http://www.opengis.net/gml": {
  22343. pointMember: Ic(M_.prototype.pointMemberParser),
  22344. pointMembers: Ic(M_.prototype.pointMemberParser)
  22345. }
  22346. }, M_.prototype.MULTILINESTRING_PARSERS = {
  22347. "http://www.opengis.net/gml": {
  22348. lineStringMember: Ic(M_.prototype.lineStringMemberParser),
  22349. lineStringMembers: Ic(M_.prototype.lineStringMemberParser)
  22350. }
  22351. }, M_.prototype.MULTIPOLYGON_PARSERS = {
  22352. "http://www.opengis.net/gml": {
  22353. polygonMember: Ic(M_.prototype.polygonMemberParser),
  22354. polygonMembers: Ic(M_.prototype.polygonMemberParser)
  22355. }
  22356. }, M_.prototype.POINTMEMBER_PARSERS = {"http://www.opengis.net/gml": {Point: Ic(M_.prototype.readFlatCoordinatesFromNode)}}, M_.prototype.LINESTRINGMEMBER_PARSERS = {"http://www.opengis.net/gml": {LineString: Ic(M_.prototype.readLineString)}}, M_.prototype.POLYGONMEMBER_PARSERS = {"http://www.opengis.net/gml": {Polygon: Ic(M_.prototype.readPolygon)}}, M_.prototype.RING_PARSERS = {"http://www.opengis.net/gml": {LinearRing: Lc(M_.prototype.readFlatLinearRing)}};
  22357. var F_ = M_;
  22358. function A_(t) {
  22359. return k_(Ec(t, !1))
  22360. }
  22361. function k_(t) {
  22362. var e = /^\s*(true|1)|(false|0)\s*$/.exec(t);
  22363. return e ? void 0 !== e[1] || !1 : void 0
  22364. }
  22365. function j_(t) {
  22366. var e = Ec(t, !1), r = Date.parse(e);
  22367. return isNaN(r) ? void 0 : r / 1e3
  22368. }
  22369. function N_(t) {
  22370. return D_(Ec(t, !1))
  22371. }
  22372. function D_(t) {
  22373. var e = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);
  22374. return e ? parseFloat(e[1]) : void 0
  22375. }
  22376. function G_(t) {
  22377. return z_(Ec(t, !1))
  22378. }
  22379. function z_(t) {
  22380. var e = /^\s*(\d+)\s*$/.exec(t);
  22381. return e ? parseInt(e[1], 10) : void 0
  22382. }
  22383. function U_(t) {
  22384. return Ec(t, !1).trim()
  22385. }
  22386. function B_(t, e) {
  22387. X_(t, e ? "1" : "0")
  22388. }
  22389. function V_(t, e) {
  22390. t.appendChild(Xc().createCDATASection(e))
  22391. }
  22392. function Y_(t, e) {
  22393. var r = new Date(1e3 * e),
  22394. n = r.getUTCFullYear() + "-" + _r(r.getUTCMonth() + 1, 2) + "-" + _r(r.getUTCDate(), 2) + "T" + _r(r.getUTCHours(), 2) + ":" + _r(r.getUTCMinutes(), 2) + ":" + _r(r.getUTCSeconds(), 2) + "Z";
  22395. t.appendChild(Xc().createTextNode(n))
  22396. }
  22397. function W_(t, e) {
  22398. var r = e.toPrecision();
  22399. t.appendChild(Xc().createTextNode(r))
  22400. }
  22401. function q_(t, e) {
  22402. var r = e.toString();
  22403. t.appendChild(Xc().createTextNode(r))
  22404. }
  22405. function X_(t, e) {
  22406. t.appendChild(Xc().createTextNode(e))
  22407. }
  22408. var Z_ = function () {
  22409. var t = function (e, r) {
  22410. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  22411. t.__proto__ = e
  22412. } || function (t, e) {
  22413. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  22414. })(e, r)
  22415. };
  22416. return function (e, r) {
  22417. function n() {
  22418. this.constructor = e
  22419. }
  22420. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  22421. }
  22422. }(), K_ = {
  22423. MultiLineString: "lineStringMember",
  22424. MultiCurve: "curveMember",
  22425. MultiPolygon: "polygonMember",
  22426. MultiSurface: "surfaceMember"
  22427. }, H_ = function (t) {
  22428. function e(e) {
  22429. var r = this, n = e || {};
  22430. return (r = t.call(this, n) || this).FEATURE_COLLECTION_PARSERS[I_].featureMember = Ic(r.readFeaturesInternal), r.schemaLocation = n.schemaLocation ? n.schemaLocation : "http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd", r
  22431. }
  22432. return Z_(e, t), e.prototype.readFlatCoordinates = function (t, e) {
  22433. var r = Ec(t, !1).replace(/^\s*|\s*$/g, ""), n = e[0].srsName, i = "enu";
  22434. if (n) {
  22435. var o = Gr(n);
  22436. o && (i = o.getAxisOrientation())
  22437. }
  22438. for (var a = r.trim().split(/\s+/), s = [], l = 0, u = a.length; l < u; l++) {
  22439. var c = a[l].split(/,+/), h = parseFloat(c[0]), p = parseFloat(c[1]),
  22440. f = 3 === c.length ? parseFloat(c[2]) : 0;
  22441. "en" === i.substr(0, 2) ? s.push(h, p, f) : s.push(p, h, f)
  22442. }
  22443. return s
  22444. }, e.prototype.readBox = function (t, e) {
  22445. var r = Uc([null], this.BOX_PARSERS_, t, e, this);
  22446. return ie(r[1][0], r[1][1], r[1][3], r[1][4])
  22447. }, e.prototype.innerBoundaryIsParser = function (t, e) {
  22448. var r = Uc(void 0, this.RING_PARSERS, t, e, this);
  22449. r && e[e.length - 1].push(r)
  22450. }, e.prototype.outerBoundaryIsParser = function (t, e) {
  22451. var r = Uc(void 0, this.RING_PARSERS, t, e, this);
  22452. r && (e[e.length - 1][0] = r)
  22453. }, e.prototype.GEOMETRY_NODE_FACTORY_ = function (t, e, r) {
  22454. var n, i = e[e.length - 1], o = i.multiSurface, a = i.surface, s = i.multiCurve;
  22455. return Array.isArray(t) ? n = "Envelope" : "MultiPolygon" === (n = t.getType()) && !0 === o ? n = "MultiSurface" : "Polygon" === n && !0 === a ? n = "Surface" : "MultiLineString" === n && !0 === s && (n = "MultiCurve"), Sc("http://www.opengis.net/gml", n)
  22456. }, e.prototype.writeFeatureElement = function (t, e, r) {
  22457. var n = e.getId();
  22458. n && t.setAttribute("fid", n);
  22459. var i = r[r.length - 1], o = i.featureNS, a = e.getGeometryName();
  22460. i.serializers || (i.serializers = {}, i.serializers[o] = {});
  22461. var s = [], l = [];
  22462. if (e.hasProperties()) {
  22463. var u = e.getProperties();
  22464. for (var c in u) {
  22465. var h = u[c];
  22466. null !== h && (s.push(c), l.push(h), c == a || "function" == typeof h.getSimplifiedGeometry ? c in i.serializers[o] || (i.serializers[o][c] = Ac(this.writeGeometryElement, this)) : c in i.serializers[o] || (i.serializers[o][c] = Ac(X_)))
  22467. }
  22468. }
  22469. var p = O({}, i);
  22470. p.node = t, Vc(p, i.serializers, jc(void 0, o), l, r, s)
  22471. }, e.prototype.writeCurveOrLineString = function (t, e, r) {
  22472. var n = r[r.length - 1].srsName;
  22473. if ("LineStringSegment" !== t.nodeName && n && t.setAttribute("srsName", n), "LineString" === t.nodeName || "LineStringSegment" === t.nodeName) {
  22474. var i = this.createCoordinatesNode_(t.namespaceURI);
  22475. t.appendChild(i), this.writeCoordinates_(i, e, r)
  22476. } else if ("Curve" === t.nodeName) {
  22477. var o = Sc(t.namespaceURI, "segments");
  22478. t.appendChild(o), this.writeCurveSegments_(o, e, r)
  22479. }
  22480. }, e.prototype.writeLineStringOrCurveMember = function (t, e, r) {
  22481. var n = this.GEOMETRY_NODE_FACTORY_(e, r);
  22482. n && (t.appendChild(n), this.writeCurveOrLineString(n, e, r))
  22483. }, e.prototype.writeMultiCurveOrLineString = function (t, e, r) {
  22484. var n = r[r.length - 1], i = n.hasZ, o = n.srsName, a = n.curve;
  22485. o && t.setAttribute("srsName", o);
  22486. var s = e.getLineStrings();
  22487. Vc({
  22488. node: t,
  22489. hasZ: i,
  22490. srsName: o,
  22491. curve: a
  22492. }, this.LINESTRINGORCURVEMEMBER_SERIALIZERS, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, s, r, void 0, this)
  22493. }, e.prototype.writeGeometryElement = function (t, e, r) {
  22494. var n, i = r[r.length - 1], o = O({}, i);
  22495. o.node = t, n = Array.isArray(e) ? qy(e, i) : Wy(e, !0, i), Vc(o, this.GEOMETRY_SERIALIZERS, this.GEOMETRY_NODE_FACTORY_, [n], r, void 0, this)
  22496. }, e.prototype.createCoordinatesNode_ = function (t) {
  22497. var e = Sc(t, "coordinates");
  22498. return e.setAttribute("decimal", "."), e.setAttribute("cs", ","), e.setAttribute("ts", " "), e
  22499. }, e.prototype.writeCoordinates_ = function (t, e, r) {
  22500. for (var n = r[r.length - 1], i = n.hasZ, o = n.srsName, a = e.getCoordinates(), s = a.length, l = new Array(s), u = 0; u < s; ++u) {
  22501. var c = a[u];
  22502. l[u] = this.getCoords_(c, o, i)
  22503. }
  22504. X_(t, l.join(" "))
  22505. }, e.prototype.writeCurveSegments_ = function (t, e, r) {
  22506. var n = Sc(t.namespaceURI, "LineStringSegment");
  22507. t.appendChild(n), this.writeCurveOrLineString(n, e, r)
  22508. }, e.prototype.writeSurfaceOrPolygon = function (t, e, r) {
  22509. var n = r[r.length - 1], i = n.hasZ, o = n.srsName;
  22510. if ("PolygonPatch" !== t.nodeName && o && t.setAttribute("srsName", o), "Polygon" === t.nodeName || "PolygonPatch" === t.nodeName) {
  22511. var a = e.getLinearRings();
  22512. Vc({node: t, hasZ: i, srsName: o}, this.RING_SERIALIZERS, this.RING_NODE_FACTORY_, a, r, void 0, this)
  22513. } else if ("Surface" === t.nodeName) {
  22514. var s = Sc(t.namespaceURI, "patches");
  22515. t.appendChild(s), this.writeSurfacePatches_(s, e, r)
  22516. }
  22517. }, e.prototype.RING_NODE_FACTORY_ = function (t, e, r) {
  22518. var n = e[e.length - 1], i = n.node, o = n.exteriorWritten;
  22519. return void 0 === o && (n.exteriorWritten = !0), Sc(i.namespaceURI, void 0 !== o ? "innerBoundaryIs" : "outerBoundaryIs")
  22520. }, e.prototype.writeSurfacePatches_ = function (t, e, r) {
  22521. var n = Sc(t.namespaceURI, "PolygonPatch");
  22522. t.appendChild(n), this.writeSurfaceOrPolygon(n, e, r)
  22523. }, e.prototype.writeRing = function (t, e, r) {
  22524. var n = Sc(t.namespaceURI, "LinearRing");
  22525. t.appendChild(n), this.writeLinearRing(n, e, r)
  22526. }, e.prototype.getCoords_ = function (t, e, r) {
  22527. var n = "enu";
  22528. e && (n = Gr(e).getAxisOrientation());
  22529. var i = "en" === n.substr(0, 2) ? t[0] + "," + t[1] : t[1] + "," + t[0];
  22530. r && (i += "," + (t[2] || 0));
  22531. return i
  22532. }, e.prototype.writePoint = function (t, e, r) {
  22533. var n = r[r.length - 1], i = n.hasZ, o = n.srsName;
  22534. o && t.setAttribute("srsName", o);
  22535. var a = this.createCoordinatesNode_(t.namespaceURI);
  22536. t.appendChild(a);
  22537. var s = e.getCoordinates();
  22538. X_(a, this.getCoords_(s, o, i))
  22539. }, e.prototype.writeMultiPoint = function (t, e, r) {
  22540. var n = r[r.length - 1], i = n.hasZ, o = n.srsName;
  22541. o && t.setAttribute("srsName", o);
  22542. var a = e.getPoints();
  22543. Vc({node: t, hasZ: i, srsName: o}, this.POINTMEMBER_SERIALIZERS, jc("pointMember"), a, r, void 0, this)
  22544. }, e.prototype.writePointMember = function (t, e, r) {
  22545. var n = Sc(t.namespaceURI, "Point");
  22546. t.appendChild(n), this.writePoint(n, e, r)
  22547. }, e.prototype.writeLinearRing = function (t, e, r) {
  22548. var n = r[r.length - 1].srsName;
  22549. n && t.setAttribute("srsName", n);
  22550. var i = this.createCoordinatesNode_(t.namespaceURI);
  22551. t.appendChild(i), this.writeCoordinates_(i, e, r)
  22552. }, e.prototype.writeMultiSurfaceOrPolygon = function (t, e, r) {
  22553. var n = r[r.length - 1], i = n.hasZ, o = n.srsName, a = n.surface;
  22554. o && t.setAttribute("srsName", o);
  22555. var s = e.getPolygons();
  22556. Vc({
  22557. node: t,
  22558. hasZ: i,
  22559. srsName: o,
  22560. surface: a
  22561. }, this.SURFACEORPOLYGONMEMBER_SERIALIZERS, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, s, r, void 0, this)
  22562. }, e.prototype.writeSurfaceOrPolygonMember = function (t, e, r) {
  22563. var n = this.GEOMETRY_NODE_FACTORY_(e, r);
  22564. n && (t.appendChild(n), this.writeSurfaceOrPolygon(n, e, r))
  22565. }, e.prototype.writeEnvelope = function (t, e, r) {
  22566. var n = r[r.length - 1].srsName;
  22567. n && t.setAttribute("srsName", n);
  22568. var i = [e[0] + " " + e[1], e[2] + " " + e[3]];
  22569. Vc({node: t}, this.ENVELOPE_SERIALIZERS, Nc, i, r, ["lowerCorner", "upperCorner"], this)
  22570. }, e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function (t, e, r) {
  22571. var n = e[e.length - 1].node;
  22572. return Sc("http://www.opengis.net/gml", K_[n.nodeName])
  22573. }, e
  22574. }(F_);
  22575. H_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {"http://www.opengis.net/gml": {coordinates: Lc(H_.prototype.readFlatCoordinates)}}, H_.prototype.FLAT_LINEAR_RINGS_PARSERS = {
  22576. "http://www.opengis.net/gml": {
  22577. innerBoundaryIs: H_.prototype.innerBoundaryIsParser,
  22578. outerBoundaryIs: H_.prototype.outerBoundaryIsParser
  22579. }
  22580. }, H_.prototype.BOX_PARSERS_ = {"http://www.opengis.net/gml": {coordinates: Ic(H_.prototype.readFlatCoordinates)}}, H_.prototype.GEOMETRY_PARSERS = {
  22581. "http://www.opengis.net/gml": {
  22582. Point: Lc(F_.prototype.readPoint),
  22583. MultiPoint: Lc(F_.prototype.readMultiPoint),
  22584. LineString: Lc(F_.prototype.readLineString),
  22585. MultiLineString: Lc(F_.prototype.readMultiLineString),
  22586. LinearRing: Lc(F_.prototype.readLinearRing),
  22587. Polygon: Lc(F_.prototype.readPolygon),
  22588. MultiPolygon: Lc(F_.prototype.readMultiPolygon),
  22589. Box: Lc(H_.prototype.readBox)
  22590. }
  22591. }, H_.prototype.GEOMETRY_SERIALIZERS = {
  22592. "http://www.opengis.net/gml": {
  22593. Curve: Ac(H_.prototype.writeCurveOrLineString),
  22594. MultiCurve: Ac(H_.prototype.writeMultiCurveOrLineString),
  22595. Point: Ac(H_.prototype.writePoint),
  22596. MultiPoint: Ac(H_.prototype.writeMultiPoint),
  22597. LineString: Ac(H_.prototype.writeCurveOrLineString),
  22598. MultiLineString: Ac(H_.prototype.writeMultiCurveOrLineString),
  22599. LinearRing: Ac(H_.prototype.writeLinearRing),
  22600. Polygon: Ac(H_.prototype.writeSurfaceOrPolygon),
  22601. MultiPolygon: Ac(H_.prototype.writeMultiSurfaceOrPolygon),
  22602. Surface: Ac(H_.prototype.writeSurfaceOrPolygon),
  22603. MultiSurface: Ac(H_.prototype.writeMultiSurfaceOrPolygon),
  22604. Envelope: Ac(H_.prototype.writeEnvelope)
  22605. }
  22606. }, H_.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS = {
  22607. "http://www.opengis.net/gml": {
  22608. lineStringMember: Ac(H_.prototype.writeLineStringOrCurveMember),
  22609. curveMember: Ac(H_.prototype.writeLineStringOrCurveMember)
  22610. }
  22611. }, H_.prototype.RING_SERIALIZERS = {
  22612. "http://www.opengis.net/gml": {
  22613. outerBoundaryIs: Ac(H_.prototype.writeRing),
  22614. innerBoundaryIs: Ac(H_.prototype.writeRing)
  22615. }
  22616. }, H_.prototype.POINTMEMBER_SERIALIZERS = {"http://www.opengis.net/gml": {pointMember: Ac(H_.prototype.writePointMember)}}, H_.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS = {
  22617. "http://www.opengis.net/gml": {
  22618. surfaceMember: Ac(H_.prototype.writeSurfaceOrPolygonMember),
  22619. polygonMember: Ac(H_.prototype.writeSurfaceOrPolygonMember)
  22620. }
  22621. }, H_.prototype.ENVELOPE_SERIALIZERS = {"http://www.opengis.net/gml": {lowerCorner: Ac(X_), upperCorner: Ac(X_)}};
  22622. var $_ = H_, J_ = function () {
  22623. var t = function (e, r) {
  22624. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  22625. t.__proto__ = e
  22626. } || function (t, e) {
  22627. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  22628. })(e, r)
  22629. };
  22630. return function (e, r) {
  22631. function n() {
  22632. this.constructor = e
  22633. }
  22634. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  22635. }
  22636. }(), Q_ = {
  22637. MultiLineString: "lineStringMember",
  22638. MultiCurve: "curveMember",
  22639. MultiPolygon: "polygonMember",
  22640. MultiSurface: "surfaceMember"
  22641. }, tb = function (t) {
  22642. function e(e) {
  22643. var r = this, n = e || {};
  22644. return (r = t.call(this, n) || this).surface_ = void 0 !== n.surface && n.surface, r.curve_ = void 0 !== n.curve && n.curve, r.multiCurve_ = void 0 === n.multiCurve || n.multiCurve, r.multiSurface_ = void 0 === n.multiSurface || n.multiSurface, r.schemaLocation = n.schemaLocation ? n.schemaLocation : "http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd", r.hasZ = void 0 !== n.hasZ && n.hasZ, r
  22645. }
  22646. return J_(e, t), e.prototype.readMultiCurve = function (t, e) {
  22647. var r = Uc([], this.MULTICURVE_PARSERS, t, e, this);
  22648. return r ? new Zy(r) : void 0
  22649. }, e.prototype.readMultiSurface = function (t, e) {
  22650. var r = Uc([], this.MULTISURFACE_PARSERS, t, e, this);
  22651. if (r) return new Jy(r)
  22652. }, e.prototype.curveMemberParser = function (t, e) {
  22653. zc(this.CURVEMEMBER_PARSERS, t, e, this)
  22654. }, e.prototype.surfaceMemberParser = function (t, e) {
  22655. zc(this.SURFACEMEMBER_PARSERS, t, e, this)
  22656. }, e.prototype.readPatch = function (t, e) {
  22657. return Uc([null], this.PATCHES_PARSERS, t, e, this)
  22658. }, e.prototype.readSegment = function (t, e) {
  22659. return Uc([null], this.SEGMENTS_PARSERS, t, e, this)
  22660. }, e.prototype.readPolygonPatch = function (t, e) {
  22661. return Uc([null], this.FLAT_LINEAR_RINGS_PARSERS, t, e, this)
  22662. }, e.prototype.readLineStringSegment = function (t, e) {
  22663. return Uc([null], this.GEOMETRY_FLAT_COORDINATES_PARSERS, t, e, this)
  22664. }, e.prototype.interiorParser = function (t, e) {
  22665. var r = Uc(void 0, this.RING_PARSERS, t, e, this);
  22666. r && e[e.length - 1].push(r)
  22667. }, e.prototype.exteriorParser = function (t, e) {
  22668. var r = Uc(void 0, this.RING_PARSERS, t, e, this);
  22669. r && (e[e.length - 1][0] = r)
  22670. }, e.prototype.readSurface = function (t, e) {
  22671. var r = Uc([null], this.SURFACE_PARSERS, t, e, this);
  22672. if (r && r[0]) {
  22673. var n, i = r[0], o = [i.length], a = void 0;
  22674. for (a = 1, n = r.length; a < n; ++a) v(i, r[a]), o.push(i.length);
  22675. return new fi(i, mt, o)
  22676. }
  22677. }, e.prototype.readCurve = function (t, e) {
  22678. var r = Uc([null], this.CURVE_PARSERS, t, e, this);
  22679. return r ? new Py(r, mt) : void 0
  22680. }, e.prototype.readEnvelope = function (t, e) {
  22681. var r = Uc([null], this.ENVELOPE_PARSERS, t, e, this);
  22682. return ie(r[1][0], r[1][1], r[2][0], r[2][1])
  22683. }, e.prototype.readFlatPos = function (t, e) {
  22684. for (var r, n = Ec(t, !1), i = /^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/, o = []; r = i.exec(n);) o.push(parseFloat(r[1])), n = n.substr(r[0].length);
  22685. if ("" === n) {
  22686. var a = e[0].srsName, s = "enu";
  22687. if (a) s = Gr(a).getAxisOrientation();
  22688. if ("neu" === s) {
  22689. var l, u = void 0;
  22690. for (u = 0, l = o.length; u < l; u += 3) {
  22691. var c = o[u], h = o[u + 1];
  22692. o[u] = h, o[u + 1] = c
  22693. }
  22694. }
  22695. var p = o.length;
  22696. if (2 == p && o.push(0), 0 !== p) return o
  22697. }
  22698. }, e.prototype.readFlatPosList = function (t, e) {
  22699. var r = Ec(t, !1).replace(/^\s*|\s*$/g, ""), n = e[0], i = n.srsName, o = n.srsDimension, a = "enu";
  22700. i && (a = Gr(i).getAxisOrientation());
  22701. var s, l, u, c = r.split(/\s+/), h = 2;
  22702. t.getAttribute("srsDimension") ? h = z_(t.getAttribute("srsDimension")) : t.getAttribute("dimension") ? h = z_(t.getAttribute("dimension")) : t.parentNode.getAttribute("srsDimension") ? h = z_(t.parentNode.getAttribute("srsDimension")) : o && (h = z_(o));
  22703. for (var p = [], f = 0, d = c.length; f < d; f += h) s = parseFloat(c[f]), l = parseFloat(c[f + 1]), u = 3 === h ? parseFloat(c[f + 2]) : 0, "en" === a.substr(0, 2) ? p.push(s, l, u) : p.push(l, s, u);
  22704. return p
  22705. }, e.prototype.writePos_ = function (t, e, r) {
  22706. var n = r[r.length - 1], i = n.hasZ, o = i ? "3" : "2";
  22707. t.setAttribute("srsDimension", o);
  22708. var a = n.srsName, s = "enu";
  22709. a && (s = Gr(a).getAxisOrientation());
  22710. var l, u = e.getCoordinates();
  22711. (l = "en" === s.substr(0, 2) ? u[0] + " " + u[1] : u[1] + " " + u[0], i) && (l += " " + (u[2] || 0));
  22712. X_(t, l)
  22713. }, e.prototype.getCoords_ = function (t, e, r) {
  22714. var n = "enu";
  22715. e && (n = Gr(e).getAxisOrientation());
  22716. var i = "en" === n.substr(0, 2) ? t[0] + " " + t[1] : t[1] + " " + t[0];
  22717. r && (i += " " + (t[2] || 0));
  22718. return i
  22719. }, e.prototype.writePosList_ = function (t, e, r) {
  22720. var n = r[r.length - 1], i = n.hasZ, o = i ? "3" : "2";
  22721. t.setAttribute("srsDimension", o);
  22722. for (var a, s = n.srsName, l = e.getCoordinates(), u = l.length, c = new Array(u), h = 0; h < u; ++h) a = l[h], c[h] = this.getCoords_(a, s, i);
  22723. X_(t, c.join(" "))
  22724. }, e.prototype.writePoint = function (t, e, r) {
  22725. var n = r[r.length - 1].srsName;
  22726. n && t.setAttribute("srsName", n);
  22727. var i = Sc(t.namespaceURI, "pos");
  22728. t.appendChild(i), this.writePos_(i, e, r)
  22729. }, e.prototype.writeEnvelope = function (t, e, r) {
  22730. var n = r[r.length - 1].srsName;
  22731. n && t.setAttribute("srsName", n);
  22732. var i = [e[0] + " " + e[1], e[2] + " " + e[3]];
  22733. Vc({node: t}, this.ENVELOPE_SERIALIZERS, Nc, i, r, ["lowerCorner", "upperCorner"], this)
  22734. }, e.prototype.writeLinearRing = function (t, e, r) {
  22735. var n = r[r.length - 1].srsName;
  22736. n && t.setAttribute("srsName", n);
  22737. var i = Sc(t.namespaceURI, "posList");
  22738. t.appendChild(i), this.writePosList_(i, e, r)
  22739. }, e.prototype.RING_NODE_FACTORY_ = function (t, e, r) {
  22740. var n = e[e.length - 1], i = n.node, o = n.exteriorWritten;
  22741. return void 0 === o && (n.exteriorWritten = !0), Sc(i.namespaceURI, void 0 !== o ? "interior" : "exterior")
  22742. }, e.prototype.writeSurfaceOrPolygon = function (t, e, r) {
  22743. var n = r[r.length - 1], i = n.hasZ, o = n.srsName;
  22744. if ("PolygonPatch" !== t.nodeName && o && t.setAttribute("srsName", o), "Polygon" === t.nodeName || "PolygonPatch" === t.nodeName) {
  22745. var a = e.getLinearRings();
  22746. Vc({node: t, hasZ: i, srsName: o}, this.RING_SERIALIZERS, this.RING_NODE_FACTORY_, a, r, void 0, this)
  22747. } else if ("Surface" === t.nodeName) {
  22748. var s = Sc(t.namespaceURI, "patches");
  22749. t.appendChild(s), this.writeSurfacePatches_(s, e, r)
  22750. }
  22751. }, e.prototype.writeCurveOrLineString = function (t, e, r) {
  22752. var n = r[r.length - 1].srsName;
  22753. if ("LineStringSegment" !== t.nodeName && n && t.setAttribute("srsName", n), "LineString" === t.nodeName || "LineStringSegment" === t.nodeName) {
  22754. var i = Sc(t.namespaceURI, "posList");
  22755. t.appendChild(i), this.writePosList_(i, e, r)
  22756. } else if ("Curve" === t.nodeName) {
  22757. var o = Sc(t.namespaceURI, "segments");
  22758. t.appendChild(o), this.writeCurveSegments_(o, e, r)
  22759. }
  22760. }, e.prototype.writeMultiSurfaceOrPolygon = function (t, e, r) {
  22761. var n = r[r.length - 1], i = n.hasZ, o = n.srsName, a = n.surface;
  22762. o && t.setAttribute("srsName", o);
  22763. var s = e.getPolygons();
  22764. Vc({
  22765. node: t,
  22766. hasZ: i,
  22767. srsName: o,
  22768. surface: a
  22769. }, this.SURFACEORPOLYGONMEMBER_SERIALIZERS, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, s, r, void 0, this)
  22770. }, e.prototype.writeMultiPoint = function (t, e, r) {
  22771. var n = r[r.length - 1], i = n.srsName, o = n.hasZ;
  22772. i && t.setAttribute("srsName", i);
  22773. var a = e.getPoints();
  22774. Vc({node: t, hasZ: o, srsName: i}, this.POINTMEMBER_SERIALIZERS, jc("pointMember"), a, r, void 0, this)
  22775. }, e.prototype.writeMultiCurveOrLineString = function (t, e, r) {
  22776. var n = r[r.length - 1], i = n.hasZ, o = n.srsName, a = n.curve;
  22777. o && t.setAttribute("srsName", o);
  22778. var s = e.getLineStrings();
  22779. Vc({
  22780. node: t,
  22781. hasZ: i,
  22782. srsName: o,
  22783. curve: a
  22784. }, this.LINESTRINGORCURVEMEMBER_SERIALIZERS, this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_, s, r, void 0, this)
  22785. }, e.prototype.writeRing = function (t, e, r) {
  22786. var n = Sc(t.namespaceURI, "LinearRing");
  22787. t.appendChild(n), this.writeLinearRing(n, e, r)
  22788. }, e.prototype.writeSurfaceOrPolygonMember = function (t, e, r) {
  22789. var n = this.GEOMETRY_NODE_FACTORY_(e, r);
  22790. n && (t.appendChild(n), this.writeSurfaceOrPolygon(n, e, r))
  22791. }, e.prototype.writePointMember = function (t, e, r) {
  22792. var n = Sc(t.namespaceURI, "Point");
  22793. t.appendChild(n), this.writePoint(n, e, r)
  22794. }, e.prototype.writeLineStringOrCurveMember = function (t, e, r) {
  22795. var n = this.GEOMETRY_NODE_FACTORY_(e, r);
  22796. n && (t.appendChild(n), this.writeCurveOrLineString(n, e, r))
  22797. }, e.prototype.writeSurfacePatches_ = function (t, e, r) {
  22798. var n = Sc(t.namespaceURI, "PolygonPatch");
  22799. t.appendChild(n), this.writeSurfaceOrPolygon(n, e, r)
  22800. }, e.prototype.writeCurveSegments_ = function (t, e, r) {
  22801. var n = Sc(t.namespaceURI, "LineStringSegment");
  22802. t.appendChild(n), this.writeCurveOrLineString(n, e, r)
  22803. }, e.prototype.writeGeometryElement = function (t, e, r) {
  22804. var n, i = r[r.length - 1], o = O({}, i);
  22805. o.node = t, n = Array.isArray(e) ? qy(e, i) : Wy(e, !0, i), Vc(o, this.GEOMETRY_SERIALIZERS, this.GEOMETRY_NODE_FACTORY_, [n], r, void 0, this)
  22806. }, e.prototype.writeFeatureElement = function (t, e, r) {
  22807. var n = e.getId();
  22808. n && t.setAttribute("fid", n);
  22809. var i = r[r.length - 1], o = i.featureNS, a = e.getGeometryName();
  22810. i.serializers || (i.serializers = {}, i.serializers[o] = {});
  22811. var s = [], l = [];
  22812. if (e.hasProperties()) {
  22813. var u = e.getProperties();
  22814. for (var c in u) {
  22815. var h = u[c];
  22816. null !== h && (s.push(c), l.push(h), c == a || "function" == typeof h.getSimplifiedGeometry ? c in i.serializers[o] || (i.serializers[o][c] = Ac(this.writeGeometryElement, this)) : c in i.serializers[o] || (i.serializers[o][c] = Ac(X_)))
  22817. }
  22818. }
  22819. var p = O({}, i);
  22820. p.node = t, Vc(p, i.serializers, jc(void 0, o), l, r, s)
  22821. }, e.prototype.writeFeatureMembers_ = function (t, e, r) {
  22822. var n = r[r.length - 1], i = n.featureType, o = n.featureNS, a = {};
  22823. a[o] = {}, a[o][i] = Ac(this.writeFeatureElement, this);
  22824. var s = O({}, n);
  22825. s.node = t, Vc(s, a, jc(i, o), e, r)
  22826. }, e.prototype.MULTIGEOMETRY_MEMBER_NODE_FACTORY_ = function (t, e, r) {
  22827. var n = e[e.length - 1].node;
  22828. return Sc(this.namespace, Q_[n.nodeName])
  22829. }, e.prototype.GEOMETRY_NODE_FACTORY_ = function (t, e, r) {
  22830. var n, i = e[e.length - 1], o = i.multiSurface, a = i.surface, s = i.curve, l = i.multiCurve;
  22831. return Array.isArray(t) ? n = "Envelope" : "MultiPolygon" === (n = t.getType()) && !0 === o ? n = "MultiSurface" : "Polygon" === n && !0 === a ? n = "Surface" : "LineString" === n && !0 === s ? n = "Curve" : "MultiLineString" === n && !0 === l && (n = "MultiCurve"), Sc(this.namespace, n)
  22832. }, e.prototype.writeGeometryNode = function (t, e) {
  22833. e = this.adaptOptions(e);
  22834. var r = Sc(this.namespace, "geom"), n = {
  22835. node: r,
  22836. hasZ: this.hasZ,
  22837. srsName: this.srsName,
  22838. curve: this.curve_,
  22839. surface: this.surface_,
  22840. multiSurface: this.multiSurface_,
  22841. multiCurve: this.multiCurve_
  22842. };
  22843. return e && O(n, e), this.writeGeometryElement(r, t, [n]), r
  22844. }, e.prototype.writeFeaturesNode = function (t, e) {
  22845. e = this.adaptOptions(e);
  22846. var r = Sc(this.namespace, "featureMembers");
  22847. r.setAttributeNS(wc, "xsi:schemaLocation", this.schemaLocation);
  22848. var n = {
  22849. srsName: this.srsName,
  22850. hasZ: this.hasZ,
  22851. curve: this.curve_,
  22852. surface: this.surface_,
  22853. multiSurface: this.multiSurface_,
  22854. multiCurve: this.multiCurve_,
  22855. featureNS: this.featureNS,
  22856. featureType: this.featureType
  22857. };
  22858. return e && O(n, e), this.writeFeatureMembers_(r, t, [n]), r
  22859. }, e
  22860. }(F_);
  22861. tb.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
  22862. "http://www.opengis.net/gml": {
  22863. pos: Lc(tb.prototype.readFlatPos),
  22864. posList: Lc(tb.prototype.readFlatPosList),
  22865. coordinates: Lc($_.prototype.readFlatCoordinates)
  22866. }
  22867. }, tb.prototype.FLAT_LINEAR_RINGS_PARSERS = {
  22868. "http://www.opengis.net/gml": {
  22869. interior: tb.prototype.interiorParser,
  22870. exterior: tb.prototype.exteriorParser
  22871. }
  22872. }, tb.prototype.GEOMETRY_PARSERS = {
  22873. "http://www.opengis.net/gml": {
  22874. Point: Lc(F_.prototype.readPoint),
  22875. MultiPoint: Lc(F_.prototype.readMultiPoint),
  22876. LineString: Lc(F_.prototype.readLineString),
  22877. MultiLineString: Lc(F_.prototype.readMultiLineString),
  22878. LinearRing: Lc(F_.prototype.readLinearRing),
  22879. Polygon: Lc(F_.prototype.readPolygon),
  22880. MultiPolygon: Lc(F_.prototype.readMultiPolygon),
  22881. Surface: Lc(tb.prototype.readSurface),
  22882. MultiSurface: Lc(tb.prototype.readMultiSurface),
  22883. Curve: Lc(tb.prototype.readCurve),
  22884. MultiCurve: Lc(tb.prototype.readMultiCurve),
  22885. Envelope: Lc(tb.prototype.readEnvelope)
  22886. }
  22887. }, tb.prototype.MULTICURVE_PARSERS = {
  22888. "http://www.opengis.net/gml": {
  22889. curveMember: Ic(tb.prototype.curveMemberParser),
  22890. curveMembers: Ic(tb.prototype.curveMemberParser)
  22891. }
  22892. }, tb.prototype.MULTISURFACE_PARSERS = {
  22893. "http://www.opengis.net/gml": {
  22894. surfaceMember: Ic(tb.prototype.surfaceMemberParser),
  22895. surfaceMembers: Ic(tb.prototype.surfaceMemberParser)
  22896. }
  22897. }, tb.prototype.CURVEMEMBER_PARSERS = {
  22898. "http://www.opengis.net/gml": {
  22899. LineString: Ic(F_.prototype.readLineString),
  22900. Curve: Ic(tb.prototype.readCurve)
  22901. }
  22902. }, tb.prototype.SURFACEMEMBER_PARSERS = {
  22903. "http://www.opengis.net/gml": {
  22904. Polygon: Ic(F_.prototype.readPolygon),
  22905. Surface: Ic(tb.prototype.readSurface)
  22906. }
  22907. }, tb.prototype.SURFACE_PARSERS = {"http://www.opengis.net/gml": {patches: Lc(tb.prototype.readPatch)}}, tb.prototype.CURVE_PARSERS = {"http://www.opengis.net/gml": {segments: Lc(tb.prototype.readSegment)}}, tb.prototype.ENVELOPE_PARSERS = {
  22908. "http://www.opengis.net/gml": {
  22909. lowerCorner: Ic(tb.prototype.readFlatPosList),
  22910. upperCorner: Ic(tb.prototype.readFlatPosList)
  22911. }
  22912. }, tb.prototype.PATCHES_PARSERS = {"http://www.opengis.net/gml": {PolygonPatch: Lc(tb.prototype.readPolygonPatch)}}, tb.prototype.SEGMENTS_PARSERS = {"http://www.opengis.net/gml": {LineStringSegment: Lc(tb.prototype.readLineStringSegment)}}, tb.prototype.writeFeatures, tb.prototype.RING_SERIALIZERS = {
  22913. "http://www.opengis.net/gml": {
  22914. exterior: Ac(tb.prototype.writeRing),
  22915. interior: Ac(tb.prototype.writeRing)
  22916. }
  22917. }, tb.prototype.ENVELOPE_SERIALIZERS = {
  22918. "http://www.opengis.net/gml": {
  22919. lowerCorner: Ac(X_),
  22920. upperCorner: Ac(X_)
  22921. }
  22922. }, tb.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS = {
  22923. "http://www.opengis.net/gml": {
  22924. surfaceMember: Ac(tb.prototype.writeSurfaceOrPolygonMember),
  22925. polygonMember: Ac(tb.prototype.writeSurfaceOrPolygonMember)
  22926. }
  22927. }, tb.prototype.POINTMEMBER_SERIALIZERS = {"http://www.opengis.net/gml": {pointMember: Ac(tb.prototype.writePointMember)}}, tb.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS = {
  22928. "http://www.opengis.net/gml": {
  22929. lineStringMember: Ac(tb.prototype.writeLineStringOrCurveMember),
  22930. curveMember: Ac(tb.prototype.writeLineStringOrCurveMember)
  22931. }
  22932. }, tb.prototype.GEOMETRY_SERIALIZERS = {
  22933. "http://www.opengis.net/gml": {
  22934. Curve: Ac(tb.prototype.writeCurveOrLineString),
  22935. MultiCurve: Ac(tb.prototype.writeMultiCurveOrLineString),
  22936. Point: Ac(tb.prototype.writePoint),
  22937. MultiPoint: Ac(tb.prototype.writeMultiPoint),
  22938. LineString: Ac(tb.prototype.writeCurveOrLineString),
  22939. MultiLineString: Ac(tb.prototype.writeMultiCurveOrLineString),
  22940. LinearRing: Ac(tb.prototype.writeLinearRing),
  22941. Polygon: Ac(tb.prototype.writeSurfaceOrPolygon),
  22942. MultiPolygon: Ac(tb.prototype.writeMultiSurfaceOrPolygon),
  22943. Surface: Ac(tb.prototype.writeSurfaceOrPolygon),
  22944. MultiSurface: Ac(tb.prototype.writeMultiSurfaceOrPolygon),
  22945. Envelope: Ac(tb.prototype.writeEnvelope)
  22946. }
  22947. };
  22948. var eb = tb, rb = eb;
  22949. rb.prototype.writeFeatures, rb.prototype.writeFeaturesNode;
  22950. var nb = rb, ib = function () {
  22951. var t = function (e, r) {
  22952. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  22953. t.__proto__ = e
  22954. } || function (t, e) {
  22955. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  22956. })(e, r)
  22957. };
  22958. return function (e, r) {
  22959. function n() {
  22960. this.constructor = e
  22961. }
  22962. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  22963. }
  22964. }(), ob = function (t) {
  22965. function e(e) {
  22966. var r = this, n = e || {};
  22967. return (r = t.call(this, n) || this).schemaLocation = n.schemaLocation ? n.schemaLocation : r.namespace + " http://schemas.opengis.net/gml/3.2.1/gml.xsd", r
  22968. }
  22969. return ib(e, t), e
  22970. }(eb);
  22971. ob.prototype.namespace = "http://www.opengis.net/gml/3.2", ob.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS = {
  22972. "http://www.opengis.net/gml/3.2": {
  22973. pos: Lc(eb.prototype.readFlatPos),
  22974. posList: Lc(eb.prototype.readFlatPosList),
  22975. coordinates: Lc($_.prototype.readFlatCoordinates)
  22976. }
  22977. }, ob.prototype.FLAT_LINEAR_RINGS_PARSERS = {
  22978. "http://www.opengis.net/gml/3.2": {
  22979. interior: eb.prototype.interiorParser,
  22980. exterior: eb.prototype.exteriorParser
  22981. }
  22982. }, ob.prototype.GEOMETRY_PARSERS = {
  22983. "http://www.opengis.net/gml/3.2": {
  22984. Point: Lc(F_.prototype.readPoint),
  22985. MultiPoint: Lc(F_.prototype.readMultiPoint),
  22986. LineString: Lc(F_.prototype.readLineString),
  22987. MultiLineString: Lc(F_.prototype.readMultiLineString),
  22988. LinearRing: Lc(F_.prototype.readLinearRing),
  22989. Polygon: Lc(F_.prototype.readPolygon),
  22990. MultiPolygon: Lc(F_.prototype.readMultiPolygon),
  22991. Surface: Lc(ob.prototype.readSurface),
  22992. MultiSurface: Lc(eb.prototype.readMultiSurface),
  22993. Curve: Lc(ob.prototype.readCurve),
  22994. MultiCurve: Lc(eb.prototype.readMultiCurve),
  22995. Envelope: Lc(ob.prototype.readEnvelope)
  22996. }
  22997. }, ob.prototype.MULTICURVE_PARSERS = {
  22998. "http://www.opengis.net/gml/3.2": {
  22999. curveMember: Ic(eb.prototype.curveMemberParser),
  23000. curveMembers: Ic(eb.prototype.curveMemberParser)
  23001. }
  23002. }, ob.prototype.MULTISURFACE_PARSERS = {
  23003. "http://www.opengis.net/gml/3.2": {
  23004. surfaceMember: Ic(eb.prototype.surfaceMemberParser),
  23005. surfaceMembers: Ic(eb.prototype.surfaceMemberParser)
  23006. }
  23007. }, ob.prototype.CURVEMEMBER_PARSERS = {
  23008. "http://www.opengis.net/gml/3.2": {
  23009. LineString: Ic(F_.prototype.readLineString),
  23010. Curve: Ic(eb.prototype.readCurve)
  23011. }
  23012. }, ob.prototype.SURFACEMEMBER_PARSERS = {
  23013. "http://www.opengis.net/gml/3.2": {
  23014. Polygon: Ic(F_.prototype.readPolygon),
  23015. Surface: Ic(eb.prototype.readSurface)
  23016. }
  23017. }, ob.prototype.SURFACE_PARSERS = {"http://www.opengis.net/gml/3.2": {patches: Lc(eb.prototype.readPatch)}}, ob.prototype.CURVE_PARSERS = {"http://www.opengis.net/gml/3.2": {segments: Lc(eb.prototype.readSegment)}}, ob.prototype.ENVELOPE_PARSERS = {
  23018. "http://www.opengis.net/gml/3.2": {
  23019. lowerCorner: Ic(eb.prototype.readFlatPosList),
  23020. upperCorner: Ic(eb.prototype.readFlatPosList)
  23021. }
  23022. }, ob.prototype.PATCHES_PARSERS = {"http://www.opengis.net/gml/3.2": {PolygonPatch: Lc(eb.prototype.readPolygonPatch)}}, ob.prototype.SEGMENTS_PARSERS = {"http://www.opengis.net/gml/3.2": {LineStringSegment: Lc(eb.prototype.readLineStringSegment)}}, ob.prototype.MULTIPOINT_PARSERS = {
  23023. "http://www.opengis.net/gml/3.2": {
  23024. pointMember: Ic(F_.prototype.pointMemberParser),
  23025. pointMembers: Ic(F_.prototype.pointMemberParser)
  23026. }
  23027. }, ob.prototype.MULTILINESTRING_PARSERS = {
  23028. "http://www.opengis.net/gml/3.2": {
  23029. lineStringMember: Ic(F_.prototype.lineStringMemberParser),
  23030. lineStringMembers: Ic(F_.prototype.lineStringMemberParser)
  23031. }
  23032. }, ob.prototype.MULTIPOLYGON_PARSERS = {
  23033. "http://www.opengis.net/gml/3.2": {
  23034. polygonMember: Ic(F_.prototype.polygonMemberParser),
  23035. polygonMembers: Ic(F_.prototype.polygonMemberParser)
  23036. }
  23037. }, ob.prototype.POINTMEMBER_PARSERS = {"http://www.opengis.net/gml/3.2": {Point: Ic(F_.prototype.readFlatCoordinatesFromNode)}}, ob.prototype.LINESTRINGMEMBER_PARSERS = {"http://www.opengis.net/gml/3.2": {LineString: Ic(F_.prototype.readLineString)}}, ob.prototype.POLYGONMEMBER_PARSERS = {"http://www.opengis.net/gml/3.2": {Polygon: Ic(F_.prototype.readPolygon)}}, ob.prototype.RING_PARSERS = {"http://www.opengis.net/gml/3.2": {LinearRing: Lc(F_.prototype.readFlatLinearRing)}}, ob.prototype.RING_SERIALIZERS = {
  23038. "http://www.opengis.net/gml/3.2": {
  23039. exterior: Ac(eb.prototype.writeRing),
  23040. interior: Ac(eb.prototype.writeRing)
  23041. }
  23042. }, ob.prototype.ENVELOPE_SERIALIZERS = {
  23043. "http://www.opengis.net/gml/3.2": {
  23044. lowerCorner: Ac(X_),
  23045. upperCorner: Ac(X_)
  23046. }
  23047. }, ob.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS = {
  23048. "http://www.opengis.net/gml/3.2": {
  23049. surfaceMember: Ac(eb.prototype.writeSurfaceOrPolygonMember),
  23050. polygonMember: Ac(eb.prototype.writeSurfaceOrPolygonMember)
  23051. }
  23052. }, ob.prototype.POINTMEMBER_SERIALIZERS = {"http://www.opengis.net/gml/3.2": {pointMember: Ac(eb.prototype.writePointMember)}}, ob.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS = {
  23053. "http://www.opengis.net/gml/3.2": {
  23054. lineStringMember: Ac(eb.prototype.writeLineStringOrCurveMember),
  23055. curveMember: Ac(eb.prototype.writeLineStringOrCurveMember)
  23056. }
  23057. }, ob.prototype.GEOMETRY_SERIALIZERS = {
  23058. "http://www.opengis.net/gml/3.2": {
  23059. Curve: Ac(eb.prototype.writeCurveOrLineString),
  23060. MultiCurve: Ac(eb.prototype.writeMultiCurveOrLineString),
  23061. Point: Ac(ob.prototype.writePoint),
  23062. MultiPoint: Ac(eb.prototype.writeMultiPoint),
  23063. LineString: Ac(eb.prototype.writeCurveOrLineString),
  23064. MultiLineString: Ac(eb.prototype.writeMultiCurveOrLineString),
  23065. LinearRing: Ac(eb.prototype.writeLinearRing),
  23066. Polygon: Ac(eb.prototype.writeSurfaceOrPolygon),
  23067. MultiPolygon: Ac(eb.prototype.writeMultiSurfaceOrPolygon),
  23068. Surface: Ac(eb.prototype.writeSurfaceOrPolygon),
  23069. MultiSurface: Ac(eb.prototype.writeMultiSurfaceOrPolygon),
  23070. Envelope: Ac(eb.prototype.writeEnvelope)
  23071. }
  23072. };
  23073. var ab = ob, sb = function () {
  23074. var t = function (e, r) {
  23075. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  23076. t.__proto__ = e
  23077. } || function (t, e) {
  23078. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  23079. })(e, r)
  23080. };
  23081. return function (e, r) {
  23082. function n() {
  23083. this.constructor = e
  23084. }
  23085. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  23086. }
  23087. }(), lb = [null, "http://www.topografix.com/GPX/1/0", "http://www.topografix.com/GPX/1/1"],
  23088. ub = {rte: Nb, trk: Db, wpt: Gb}, cb = Gc(lb, {rte: Ic(Nb), trk: Ic(Db), wpt: Ic(Gb)}),
  23089. hb = Gc(lb, {text: Fc(U_, "linkText"), type: Fc(U_, "linkType")}), pb = Gc(lb, {
  23090. rte: Ac((function (t, e, r) {
  23091. var n = r[0], i = e.getProperties(), o = {node: t};
  23092. o.properties = i;
  23093. var a = e.getGeometry();
  23094. if (a.getType() == bt.LINE_STRING) {
  23095. var s = Wy(a, !0, n);
  23096. o.geometryLayout = s.getLayout(), i.rtept = s.getCoordinates()
  23097. }
  23098. var l = r[r.length - 1].node, u = wb[l.namespaceURI], c = Dc(i, u);
  23099. Vc(o, Sb, Nc, c, r, u)
  23100. })), trk: Ac((function (t, e, r) {
  23101. var n = r[0], i = e.getProperties(), o = {node: t};
  23102. o.properties = i;
  23103. var a = e.getGeometry();
  23104. if (a.getType() == bt.MULTI_LINE_STRING) {
  23105. var s = Wy(a, !0, n);
  23106. i.trkseg = s.getLineStrings()
  23107. }
  23108. var l = r[r.length - 1].node, u = Tb[l.namespaceURI], c = Dc(i, u);
  23109. Vc(o, Cb, Nc, c, r, u)
  23110. })), wpt: Ac((function (t, e, r) {
  23111. var n = r[0], i = r[r.length - 1];
  23112. i.properties = e.getProperties();
  23113. var o = e.getGeometry();
  23114. if (o.getType() == bt.POINT) {
  23115. var a = Wy(o, !0, n);
  23116. i.geometryLayout = a.getLayout(), Ub(t, a.getCoordinates(), r)
  23117. }
  23118. }))
  23119. }), fb = function (t) {
  23120. function e(e) {
  23121. var r = t.call(this) || this, n = e || {};
  23122. return r.dataProjection = Gr("EPSG:4326"), r.readExtensions_ = n.readExtensions, r
  23123. }
  23124. return sb(e, t), e.prototype.handleReadExtensions_ = function (t) {
  23125. t || (t = []);
  23126. for (var e = 0, r = t.length; e < r; ++e) {
  23127. var n = t[e];
  23128. if (this.readExtensions_) {
  23129. var i = n.get("extensionsNode_") || null;
  23130. this.readExtensions_(n, i)
  23131. }
  23132. n.set("extensionsNode_", void 0)
  23133. }
  23134. }, e.prototype.readFeatureFromNode = function (t, e) {
  23135. if (!g(lb, t.namespaceURI)) return null;
  23136. var r = ub[t.localName];
  23137. if (!r) return null;
  23138. var n = r(t, [this.getReadOptions(t, e)]);
  23139. return n ? (this.handleReadExtensions_([n]), n) : null
  23140. }, e.prototype.readFeaturesFromNode = function (t, e) {
  23141. if (!g(lb, t.namespaceURI)) return [];
  23142. if ("gpx" == t.localName) {
  23143. var r = Uc([], cb, t, [this.getReadOptions(t, e)]);
  23144. return r ? (this.handleReadExtensions_(r), r) : []
  23145. }
  23146. return []
  23147. }, e.prototype.writeFeaturesNode = function (t, e) {
  23148. e = this.adaptOptions(e);
  23149. var r = Sc("http://www.topografix.com/GPX/1/1", "gpx");
  23150. return r.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xsi", wc), r.setAttributeNS(wc, "xsi:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"), r.setAttribute("version", "1.1"), r.setAttribute("creator", "OpenLayers"), Vc({node: r}, pb, Mb, t, [e]), r
  23151. }, e
  23152. }(P_), db = Gc(lb, {
  23153. name: Fc(U_),
  23154. cmt: Fc(U_),
  23155. desc: Fc(U_),
  23156. src: Fc(U_),
  23157. link: kb,
  23158. number: Fc(G_),
  23159. extensions: jb,
  23160. type: Fc(U_),
  23161. rtept: function (t, e) {
  23162. var r = Uc({}, gb, t, e);
  23163. if (r) {
  23164. var n = e[e.length - 1], i = n.flatCoordinates, o = n.layoutOptions;
  23165. Fb(i, o, t, r)
  23166. }
  23167. }
  23168. }), gb = Gc(lb, {ele: Fc(N_), time: Fc(j_)}), yb = Gc(lb, {
  23169. name: Fc(U_),
  23170. cmt: Fc(U_),
  23171. desc: Fc(U_),
  23172. src: Fc(U_),
  23173. link: kb,
  23174. number: Fc(G_),
  23175. type: Fc(U_),
  23176. extensions: jb,
  23177. trkseg: function (t, e) {
  23178. var r = e[e.length - 1];
  23179. zc(mb, t, e);
  23180. var n = r.flatCoordinates;
  23181. r.ends.push(n.length)
  23182. }
  23183. }), mb = Gc(lb, {
  23184. trkpt: function (t, e) {
  23185. var r = Uc({}, vb, t, e);
  23186. if (r) {
  23187. var n = e[e.length - 1], i = n.flatCoordinates, o = n.layoutOptions;
  23188. Fb(i, o, t, r)
  23189. }
  23190. }
  23191. }), vb = Gc(lb, {ele: Fc(N_), time: Fc(j_)}), _b = Gc(lb, {
  23192. ele: Fc(N_),
  23193. time: Fc(j_),
  23194. magvar: Fc(N_),
  23195. geoidheight: Fc(N_),
  23196. name: Fc(U_),
  23197. cmt: Fc(U_),
  23198. desc: Fc(U_),
  23199. src: Fc(U_),
  23200. link: kb,
  23201. sym: Fc(U_),
  23202. type: Fc(U_),
  23203. fix: Fc(U_),
  23204. sat: Fc(G_),
  23205. hdop: Fc(N_),
  23206. vdop: Fc(N_),
  23207. pdop: Fc(N_),
  23208. ageofdgpsdata: Fc(N_),
  23209. dgpsid: Fc(G_),
  23210. extensions: jb
  23211. }), bb = ["text", "type"], xb = Gc(lb, {text: Ac(X_), type: Ac(X_)}),
  23212. wb = Gc(lb, ["name", "cmt", "desc", "src", "link", "number", "type", "rtept"]), Sb = Gc(lb, {
  23213. name: Ac(X_),
  23214. cmt: Ac(X_),
  23215. desc: Ac(X_),
  23216. src: Ac(X_),
  23217. link: Ac(zb),
  23218. number: Ac(q_),
  23219. type: Ac(X_),
  23220. rtept: kc(Ac(Ub))
  23221. }), Eb = Gc(lb, ["ele", "time"]), Tb = Gc(lb, ["name", "cmt", "desc", "src", "link", "number", "type", "trkseg"]),
  23222. Cb = Gc(lb, {
  23223. name: Ac(X_),
  23224. cmt: Ac(X_),
  23225. desc: Ac(X_),
  23226. src: Ac(X_),
  23227. link: Ac(zb),
  23228. number: Ac(q_),
  23229. type: Ac(X_),
  23230. trkseg: kc(Ac((function (t, e, r) {
  23231. var n = {node: t};
  23232. n.geometryLayout = e.getLayout(), n.properties = {}, Vc(n, Pb, Ob, e.getCoordinates(), r)
  23233. })))
  23234. }), Ob = jc("trkpt"), Pb = Gc(lb, {trkpt: Ac(Ub)}),
  23235. Rb = Gc(lb, ["ele", "time", "magvar", "geoidheight", "name", "cmt", "desc", "src", "link", "sym", "type", "fix", "sat", "hdop", "vdop", "pdop", "ageofdgpsdata", "dgpsid"]),
  23236. Ib = Gc(lb, {
  23237. ele: Ac(W_),
  23238. time: Ac(Y_),
  23239. magvar: Ac(W_),
  23240. geoidheight: Ac(W_),
  23241. name: Ac(X_),
  23242. cmt: Ac(X_),
  23243. desc: Ac(X_),
  23244. src: Ac(X_),
  23245. link: Ac(zb),
  23246. sym: Ac(X_),
  23247. type: Ac(X_),
  23248. fix: Ac(X_),
  23249. sat: Ac(q_),
  23250. hdop: Ac(W_),
  23251. vdop: Ac(W_),
  23252. pdop: Ac(W_),
  23253. ageofdgpsdata: Ac(W_),
  23254. dgpsid: Ac(q_)
  23255. }), Lb = {Point: "wpt", LineString: "rte", MultiLineString: "trk"};
  23256. function Mb(t, e, r) {
  23257. var n = t.getGeometry();
  23258. if (n) {
  23259. var i = Lb[n.getType()];
  23260. if (i) return Sc(e[e.length - 1].node.namespaceURI, i)
  23261. }
  23262. }
  23263. function Fb(t, e, r, n) {
  23264. return t.push(parseFloat(r.getAttribute("lon")), parseFloat(r.getAttribute("lat"))), "ele" in n ? (t.push(n.ele), delete n.ele, e.hasZ = !0) : t.push(0), "time" in n ? (t.push(n.time), delete n.time, e.hasM = !0) : t.push(0), t
  23265. }
  23266. function Ab(t, e, r) {
  23267. var n = yt, i = 2;
  23268. if (t.hasZ && t.hasM ? (n = _t, i = 4) : t.hasZ ? (n = mt, i = 3) : t.hasM && (n = vt, i = 3), 4 !== i) {
  23269. for (var o = 0, a = e.length / 4; o < a; o++) e[o * i] = e[4 * o], e[o * i + 1] = e[4 * o + 1], t.hasZ && (e[o * i + 2] = e[4 * o + 2]), t.hasM && (e[o * i + 2] = e[4 * o + 3]);
  23270. if (e.length = e.length / 4 * i, r) for (o = 0, a = r.length; o < a; o++) r[o] = r[o] / 4 * i
  23271. }
  23272. return n
  23273. }
  23274. function kb(t, e) {
  23275. var r = e[e.length - 1], n = t.getAttribute("href");
  23276. null !== n && (r.link = n), zc(hb, t, e)
  23277. }
  23278. function jb(t, e) {
  23279. e[e.length - 1].extensionsNode_ = t
  23280. }
  23281. function Nb(t, e) {
  23282. var r = e[0], n = Uc({flatCoordinates: [], layoutOptions: {}}, db, t, e);
  23283. if (n) {
  23284. var i = n.flatCoordinates;
  23285. delete n.flatCoordinates;
  23286. var o = n.layoutOptions;
  23287. delete n.layoutOptions;
  23288. var a = Ab(o, i), s = new Py(i, a);
  23289. Wy(s, !1, r);
  23290. var l = new gt(s);
  23291. return l.setProperties(n, !0), l
  23292. }
  23293. }
  23294. function Db(t, e) {
  23295. var r = e[0], n = Uc({flatCoordinates: [], ends: [], layoutOptions: {}}, yb, t, e);
  23296. if (n) {
  23297. var i = n.flatCoordinates;
  23298. delete n.flatCoordinates;
  23299. var o = n.ends;
  23300. delete n.ends;
  23301. var a = n.layoutOptions;
  23302. delete n.layoutOptions;
  23303. var s = Ab(a, i, o), l = new Zy(i, s, o);
  23304. Wy(l, !1, r);
  23305. var u = new gt(l);
  23306. return u.setProperties(n, !0), u
  23307. }
  23308. }
  23309. function Gb(t, e) {
  23310. var r = e[0], n = Uc({}, _b, t, e);
  23311. if (n) {
  23312. var i = {}, o = Fb([], i, t, n), a = Ab(i, o), s = new qn(o, a);
  23313. Wy(s, !1, r);
  23314. var l = new gt(s);
  23315. return l.setProperties(n, !0), l
  23316. }
  23317. }
  23318. function zb(t, e, r) {
  23319. t.setAttribute("href", e);
  23320. var n = r[r.length - 1].properties, i = [n.linkText, n.linkType];
  23321. Vc({node: t}, xb, Nc, i, r, bb)
  23322. }
  23323. function Ub(t, e, r) {
  23324. var n = r[r.length - 1], i = n.node.namespaceURI, o = n.properties;
  23325. switch (t.setAttributeNS(null, "lat", String(e[1])), t.setAttributeNS(null, "lon", String(e[0])), n.geometryLayout) {
  23326. case _t:
  23327. 0 !== e[3] && (o.time = e[3]);
  23328. case mt:
  23329. 0 !== e[2] && (o.ele = e[2]);
  23330. break;
  23331. case vt:
  23332. 0 !== e[2] && (o.time = e[2])
  23333. }
  23334. var a = "rtept" == t.nodeName ? Eb[i] : Rb[i], s = Dc(o, a);
  23335. Vc({node: t, properties: o}, Ib, Nc, s, r, a)
  23336. }
  23337. var Bb = fb, Vb = function () {
  23338. var t = function (e, r) {
  23339. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  23340. t.__proto__ = e
  23341. } || function (t, e) {
  23342. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  23343. })(e, r)
  23344. };
  23345. return function (e, r) {
  23346. function n() {
  23347. this.constructor = e
  23348. }
  23349. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  23350. }
  23351. }();
  23352. function Yb(t) {
  23353. return "string" == typeof t ? t : ""
  23354. }
  23355. var Wb, qb, Xb, Zb, Kb, Hb, $b, Jb = function (t) {
  23356. function e() {
  23357. return t.call(this) || this
  23358. }
  23359. return Vb(e, t), e.prototype.getType = function () {
  23360. return Pu
  23361. }, e.prototype.readFeature = function (t, e) {
  23362. return this.readFeatureFromText(Yb(t), this.adaptOptions(e))
  23363. }, e.prototype.readFeatureFromText = function (t, e) {
  23364. return n()
  23365. }, e.prototype.readFeatures = function (t, e) {
  23366. return this.readFeaturesFromText(Yb(t), this.adaptOptions(e))
  23367. }, e.prototype.readFeaturesFromText = function (t, e) {
  23368. return n()
  23369. }, e.prototype.readGeometry = function (t, e) {
  23370. return this.readGeometryFromText(Yb(t), this.adaptOptions(e))
  23371. }, e.prototype.readGeometryFromText = function (t, e) {
  23372. return n()
  23373. }, e.prototype.readProjection = function (t) {
  23374. return this.readProjectionFromText(Yb(t))
  23375. }, e.prototype.readProjectionFromText = function (t) {
  23376. return this.dataProjection
  23377. }, e.prototype.writeFeature = function (t, e) {
  23378. return this.writeFeatureText(t, this.adaptOptions(e))
  23379. }, e.prototype.writeFeatureText = function (t, e) {
  23380. return n()
  23381. }, e.prototype.writeFeatures = function (t, e) {
  23382. return this.writeFeaturesText(t, this.adaptOptions(e))
  23383. }, e.prototype.writeFeaturesText = function (t, e) {
  23384. return n()
  23385. }, e.prototype.writeGeometry = function (t, e) {
  23386. return this.writeGeometryText(t, this.adaptOptions(e))
  23387. }, e.prototype.writeGeometryText = function (t, e) {
  23388. return n()
  23389. }, e
  23390. }(Yy), Qb = function () {
  23391. var t = function (e, r) {
  23392. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  23393. t.__proto__ = e
  23394. } || function (t, e) {
  23395. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  23396. })(e, r)
  23397. };
  23398. return function (e, r) {
  23399. function n() {
  23400. this.constructor = e
  23401. }
  23402. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  23403. }
  23404. }(), tx = "barometric", ex = "gps", rx = "none",
  23405. nx = /^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,
  23406. ix = /^H.([A-Z]{3}).*?:(.*)/, ox = /^HFDTE(\d{2})(\d{2})(\d{2})/, ax = /\r\n|\r|\n/, sx = function (t) {
  23407. function e(e) {
  23408. var r = t.call(this) || this, n = e || {};
  23409. return r.dataProjection = Gr("EPSG:4326"), r.altitudeMode_ = n.altitudeMode ? n.altitudeMode : rx, r
  23410. }
  23411. return Qb(e, t), e.prototype.readFeatureFromText = function (t, e) {
  23412. var r, n, i = this.altitudeMode_, o = t.split(ax), a = {}, s = [], l = 2e3, u = 0, c = 1, h = -1;
  23413. for (r = 0, n = o.length; r < n; ++r) {
  23414. var p = o[r], f = void 0;
  23415. if ("B" == p.charAt(0)) {
  23416. if (f = nx.exec(p)) {
  23417. var d = parseInt(f[1], 10), g = parseInt(f[2], 10), y = parseInt(f[3], 10),
  23418. m = parseInt(f[4], 10) + parseInt(f[5], 10) / 6e4;
  23419. "S" == f[6] && (m = -m);
  23420. var v = parseInt(f[7], 10) + parseInt(f[8], 10) / 6e4;
  23421. if ("W" == f[9] && (v = -v), s.push(v, m), i != rx) {
  23422. var _ = void 0;
  23423. _ = i == ex ? parseInt(f[11], 10) : i == tx ? parseInt(f[12], 10) : 0, s.push(_)
  23424. }
  23425. var b = Date.UTC(l, u, c, d, g, y);
  23426. b < h && (b = Date.UTC(l, u, c + 1, d, g, y)), s.push(b / 1e3), h = b
  23427. }
  23428. } else "H" == p.charAt(0) && ((f = ox.exec(p)) ? (c = parseInt(f[1], 10), u = parseInt(f[2], 10) - 1, l = 2e3 + parseInt(f[3], 10)) : (f = ix.exec(p)) && (a[f[1]] = f[2].trim()))
  23429. }
  23430. if (0 === s.length) return null;
  23431. var x = new Py(s, i == rx ? vt : _t), w = new gt(Wy(x, !1, e));
  23432. return w.setProperties(a, !0), w
  23433. }, e.prototype.readFeaturesFromText = function (t, e) {
  23434. var r = this.readFeatureFromText(t, e);
  23435. return r ? [r] : []
  23436. }, e
  23437. }(Jb), lx = function () {
  23438. var t = function (e, r) {
  23439. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  23440. t.__proto__ = e
  23441. } || function (t, e) {
  23442. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  23443. })(e, r)
  23444. };
  23445. return function (e, r) {
  23446. function n() {
  23447. this.constructor = e
  23448. }
  23449. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  23450. }
  23451. }(), ux = ["http://www.google.com/kml/ext/2.2"],
  23452. cx = [null, "http://earth.google.com/kml/2.0", "http://earth.google.com/kml/2.1", "http://earth.google.com/kml/2.2", "http://www.opengis.net/kml/2.2"],
  23453. hx = {fraction: rp, pixels: np, insetPixels: np}, px = Gc(cx, {
  23454. ExtendedData: sw,
  23455. Region: lw,
  23456. MultiGeometry: Fc(Jx, "geometry"),
  23457. LineString: Fc(Kx, "geometry"),
  23458. LinearRing: Fc(Hx, "geometry"),
  23459. Point: Fc(Qx, "geometry"),
  23460. Polygon: Fc(ew, "geometry"),
  23461. Style: Fc(nw),
  23462. StyleMap: function (t, e) {
  23463. var r = kx.call(this, t, e);
  23464. if (!r) return;
  23465. var n = e[e.length - 1];
  23466. Array.isArray(r) ? n.Style = r : "string" == typeof r ? n.styleUrl = r : pt(!1, 38)
  23467. },
  23468. address: Fc(U_),
  23469. description: Fc(U_),
  23470. name: Fc(U_),
  23471. open: Fc(A_),
  23472. phoneNumber: Fc(U_),
  23473. styleUrl: Fc(Mx),
  23474. visibility: Fc(A_)
  23475. }, Gc(ux, {
  23476. MultiTrack: Fc((function (t, e) {
  23477. var r = Uc([], Bx, t, e);
  23478. if (!r) return;
  23479. return new Zy(r)
  23480. }), "geometry"), Track: Fc(Yx, "geometry")
  23481. })), fx = Gc(cx, {
  23482. ExtendedData: sw, Region: lw, Link: function (t, e) {
  23483. zc(dx, t, e)
  23484. }, address: Fc(U_), description: Fc(U_), name: Fc(U_), open: Fc(A_), phoneNumber: Fc(U_), visibility: Fc(A_)
  23485. }), dx = Gc(cx, {href: Fc(Lx)}), gx = Gc(cx, {
  23486. LatLonAltBox: function (t, e) {
  23487. var r = Uc({}, hw, t, e);
  23488. if (!r) return;
  23489. var n = e[e.length - 1], i = [parseFloat(r.west), parseFloat(r.south), parseFloat(r.east), parseFloat(r.north)];
  23490. n.extent = i, n.altitudeMode = r.altitudeMode, n.minAltitude = parseFloat(r.minAltitude), n.maxAltitude = parseFloat(r.maxAltitude)
  23491. }, Lod: function (t, e) {
  23492. var r = Uc({}, pw, t, e);
  23493. if (!r) return;
  23494. var n = e[e.length - 1];
  23495. n.minLodPixels = parseFloat(r.minLodPixels), n.maxLodPixels = parseFloat(r.maxLodPixels), n.minFadeExtent = parseFloat(r.minFadeExtent), n.maxFadeExtent = parseFloat(r.maxFadeExtent)
  23496. }
  23497. }), yx = Gc(cx, ["Document", "Placemark"]), mx = Gc(cx, {
  23498. Document: Ac((function (t, e, r) {
  23499. Vc({node: t}, mw, vw, e, r, void 0, this)
  23500. })), Placemark: Ac(Bw)
  23501. }), vx = null;
  23502. var _x, bx = null;
  23503. var xx, wx = null;
  23504. var Sx = null;
  23505. var Ex = null;
  23506. var Tx, Cx = null;
  23507. function Ox(t) {
  23508. return t
  23509. }
  23510. var Px = function (t) {
  23511. function e(e) {
  23512. var r = t.call(this) || this, n = e || {};
  23513. return Cx || (vx = new ep({color: Wb = [255, 255, 255, 1]}), bx = new dp({
  23514. anchor: qb = [20, 2],
  23515. anchorOrigin: ip,
  23516. anchorXUnits: Xb = np,
  23517. anchorYUnits: Zb = np,
  23518. crossOrigin: "anonymous",
  23519. rotation: 0,
  23520. scale: $b = .5,
  23521. size: Kb = [64, 64],
  23522. src: Hb = "https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png"
  23523. }), _x = "NO_IMAGE", wx = new gp({color: Wb, width: 1}), xx = new gp({
  23524. color: [51, 51, 51, 1],
  23525. width: 2
  23526. }), Sx = new Tp({font: "bold 16px Helvetica", fill: vx, stroke: xx, scale: .8}), Ex = new wp({
  23527. fill: vx,
  23528. image: bx,
  23529. text: Sx,
  23530. stroke: wx,
  23531. zIndex: 0
  23532. }), Cx = [Ex]), r.dataProjection = Gr("EPSG:4326"), r.defaultStyle_ = n.defaultStyle ? n.defaultStyle : Cx, r.extractStyles_ = void 0 === n.extractStyles || n.extractStyles, r.writeStyles_ = void 0 === n.writeStyles || n.writeStyles, r.sharedStyles_ = {}, r.showPointNames_ = void 0 === n.showPointNames || n.showPointNames, r.crossOrigin_ = void 0 !== n.crossOrigin ? n.crossOrigin : "anonymous", r.iconUrlFunction_ = n.iconUrlFunction ? n.iconUrlFunction : Ox, r
  23533. }
  23534. return lx(e, t), e.prototype.readDocumentOrFolder_ = function (t, e) {
  23535. var r = Uc([], Gc(cx, {
  23536. Document: Rc(this.readDocumentOrFolder_, this),
  23537. Folder: Rc(this.readDocumentOrFolder_, this),
  23538. Placemark: Ic(this.readPlacemark_, this),
  23539. Style: this.readSharedStyle_.bind(this),
  23540. StyleMap: this.readSharedStyleMap_.bind(this)
  23541. }), t, e, this);
  23542. return r || void 0
  23543. }, e.prototype.readPlacemark_ = function (t, e) {
  23544. var r = Uc({geometry: null}, px, t, e, this);
  23545. if (r) {
  23546. var n = new gt, i = t.getAttribute("id");
  23547. null !== i && n.setId(i);
  23548. var o = e[0], a = r.geometry;
  23549. if (a && Wy(a, !1, o), n.setGeometry(a), delete r.geometry, this.extractStyles_) {
  23550. var s = function (t, e, r, n, i) {
  23551. return function (o, a) {
  23552. var s = i, l = "", u = [];
  23553. if (s) {
  23554. var c = o.getGeometry();
  23555. if (c) {
  23556. var h = c.getType();
  23557. s = h === bt.GEOMETRY_COLLECTION ? (u = c.getGeometriesArrayRecursive().filter((function (t) {
  23558. var e = t.getType();
  23559. return e === bt.POINT || e === bt.MULTI_POINT
  23560. }))).length > 0 : h === bt.POINT || h === bt.MULTI_POINT
  23561. }
  23562. }
  23563. s && (l = o.get("name"), (s = s && !!l) && l.search(/&[^&]+;/) > -1 && (Tx || (Tx = document.createElement("textarea")), Tx.innerHTML = l, l = Tx.value));
  23564. var p = r;
  23565. if (t ? p = t : e && (p = function t(e, r, n) {
  23566. return Array.isArray(e) ? e : "string" == typeof e ? t(n[e], r, n) : r
  23567. }(e, r, n)), s) {
  23568. var f = function (t, e) {
  23569. var r = [0, 0], n = "start", i = t.getImage();
  23570. if (i) {
  23571. var o = i.getImageSize();
  23572. if (null === o && (o = Kb), 2 == o.length) {
  23573. var a = i.getScaleArray();
  23574. r[0] = a[0] * o[0] / 2, r[1] = -a[1] * o[1] / 2, n = "left"
  23575. }
  23576. }
  23577. var s = t.getText();
  23578. s ? ((s = s.clone()).setFont(s.getFont() || Sx.getFont()), s.setScale(s.getScale() || Sx.getScale()), s.setFill(s.getFill() || Sx.getFill()), s.setStroke(s.getStroke() || xx)) : s = Sx.clone();
  23579. return s.setText(e), s.setOffsetX(r[0]), s.setOffsetY(r[1]), s.setTextAlign(n), new wp({
  23580. image: i,
  23581. text: s
  23582. })
  23583. }(p[0], l);
  23584. return u.length > 0 ? (f.setGeometry(new Vm(u)), [f, new wp({
  23585. geometry: p[0].getGeometry(),
  23586. image: null,
  23587. fill: p[0].getFill(),
  23588. stroke: p[0].getStroke(),
  23589. text: null
  23590. })].concat(p.slice(1))) : f
  23591. }
  23592. return p
  23593. }
  23594. }(r.Style, r.styleUrl, this.defaultStyle_, this.sharedStyles_, this.showPointNames_);
  23595. n.setStyle(s)
  23596. }
  23597. return delete r.Style, n.setProperties(r, !0), n
  23598. }
  23599. }, e.prototype.readSharedStyle_ = function (t, e) {
  23600. var r = t.getAttribute("id");
  23601. if (null !== r) {
  23602. var n = nw.call(this, t, e);
  23603. if (n) {
  23604. var i = void 0, o = t.baseURI;
  23605. if (o && "about:blank" != o || (o = window.location.href), o) i = new URL("#" + r, o).href; else i = "#" + r;
  23606. this.sharedStyles_[i] = n
  23607. }
  23608. }
  23609. }, e.prototype.readSharedStyleMap_ = function (t, e) {
  23610. var r = t.getAttribute("id");
  23611. if (null !== r) {
  23612. var n = kx.call(this, t, e);
  23613. if (n) {
  23614. var i, o = t.baseURI;
  23615. if (o && "about:blank" != o || (o = window.location.href), o) i = new URL("#" + r, o).href; else i = "#" + r;
  23616. this.sharedStyles_[i] = n
  23617. }
  23618. }
  23619. }, e.prototype.readFeatureFromNode = function (t, e) {
  23620. if (!g(cx, t.namespaceURI)) return null;
  23621. var r = this.readPlacemark_(t, [this.getReadOptions(t, e)]);
  23622. return r || null
  23623. }, e.prototype.readFeaturesFromNode = function (t, e) {
  23624. if (!g(cx, t.namespaceURI)) return [];
  23625. var r, n = t.localName;
  23626. if ("Document" == n || "Folder" == n) return (r = this.readDocumentOrFolder_(t, [this.getReadOptions(t, e)])) || [];
  23627. if ("Placemark" == n) {
  23628. var i = this.readPlacemark_(t, [this.getReadOptions(t, e)]);
  23629. return i ? [i] : []
  23630. }
  23631. if ("kml" == n) {
  23632. r = [];
  23633. for (var o = t.firstElementChild; o; o = o.nextElementSibling) {
  23634. var a = this.readFeaturesFromNode(o, e);
  23635. a && v(r, a)
  23636. }
  23637. return r
  23638. }
  23639. return []
  23640. }, e.prototype.readName = function (t) {
  23641. if (t) {
  23642. if ("string" == typeof t) {
  23643. var e = Pc(t);
  23644. return this.readNameFromDocument(e)
  23645. }
  23646. return Cc(t) ? this.readNameFromDocument(t) : this.readNameFromNode(t)
  23647. }
  23648. }, e.prototype.readNameFromDocument = function (t) {
  23649. for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) {
  23650. var r = this.readNameFromNode(e);
  23651. if (r) return r
  23652. }
  23653. }, e.prototype.readNameFromNode = function (t) {
  23654. for (var e = t.firstElementChild; e; e = e.nextElementSibling) if (g(cx, e.namespaceURI) && "name" == e.localName) return U_(e);
  23655. for (e = t.firstElementChild; e; e = e.nextElementSibling) {
  23656. var r = e.localName;
  23657. if (g(cx, e.namespaceURI) && ("Document" == r || "Folder" == r || "Placemark" == r || "kml" == r)) {
  23658. var n = this.readNameFromNode(e);
  23659. if (n) return n
  23660. }
  23661. }
  23662. }, e.prototype.readNetworkLinks = function (t) {
  23663. var e = [];
  23664. if ("string" == typeof t) {
  23665. var r = Pc(t);
  23666. v(e, this.readNetworkLinksFromDocument(r))
  23667. } else Cc(t) ? v(e, this.readNetworkLinksFromDocument(t)) : v(e, this.readNetworkLinksFromNode(t));
  23668. return e
  23669. }, e.prototype.readNetworkLinksFromDocument = function (t) {
  23670. for (var e = [], r = t.firstChild; r; r = r.nextSibling) r.nodeType == Node.ELEMENT_NODE && v(e, this.readNetworkLinksFromNode(r));
  23671. return e
  23672. }, e.prototype.readNetworkLinksFromNode = function (t) {
  23673. for (var e = [], r = t.firstElementChild; r; r = r.nextElementSibling) if (g(cx, r.namespaceURI) && "NetworkLink" == r.localName) {
  23674. var n = Uc({}, fx, r, []);
  23675. e.push(n)
  23676. }
  23677. for (r = t.firstElementChild; r; r = r.nextElementSibling) {
  23678. var i = r.localName;
  23679. !g(cx, r.namespaceURI) || "Document" != i && "Folder" != i && "kml" != i || v(e, this.readNetworkLinksFromNode(r))
  23680. }
  23681. return e
  23682. }, e.prototype.readRegion = function (t) {
  23683. var e = [];
  23684. if ("string" == typeof t) {
  23685. var r = Pc(t);
  23686. v(e, this.readRegionFromDocument(r))
  23687. } else Cc(t) ? v(e, this.readRegionFromDocument(t)) : v(e, this.readRegionFromNode(t));
  23688. return e
  23689. }, e.prototype.readRegionFromDocument = function (t) {
  23690. for (var e = [], r = t.firstChild; r; r = r.nextSibling) r.nodeType == Node.ELEMENT_NODE && v(e, this.readRegionFromNode(r));
  23691. return e
  23692. }, e.prototype.readRegionFromNode = function (t) {
  23693. for (var e = [], r = t.firstElementChild; r; r = r.nextElementSibling) if (g(cx, r.namespaceURI) && "Region" == r.localName) {
  23694. var n = Uc({}, gx, r, []);
  23695. e.push(n)
  23696. }
  23697. for (r = t.firstElementChild; r; r = r.nextElementSibling) {
  23698. var i = r.localName;
  23699. !g(cx, r.namespaceURI) || "Document" != i && "Folder" != i && "kml" != i || v(e, this.readRegionFromNode(r))
  23700. }
  23701. return e
  23702. }, e.prototype.writeFeaturesNode = function (t, e) {
  23703. e = this.adaptOptions(e);
  23704. var r = Sc(cx[4], "kml"), n = "http://www.w3.org/2000/xmlns/";
  23705. r.setAttributeNS(n, "xmlns:gx", ux[0]), r.setAttributeNS(n, "xmlns:xsi", wc), r.setAttributeNS(wc, "xsi:schemaLocation", "http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");
  23706. var i = {node: r}, o = {};
  23707. t.length > 1 ? o.Document = t : 1 == t.length && (o.Placemark = t[0]);
  23708. var a = yx[r.namespaceURI], s = Dc(o, a);
  23709. return Vc(i, mx, Nc, s, [e], a, this), r
  23710. }, e
  23711. }(P_);
  23712. function Rx(t) {
  23713. var e = Ec(t, !1), r = /^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);
  23714. if (r) {
  23715. var n = r[1];
  23716. return [parseInt(n.substr(6, 2), 16), parseInt(n.substr(4, 2), 16), parseInt(n.substr(2, 2), 16), parseInt(n.substr(0, 2), 16) / 255]
  23717. }
  23718. }
  23719. function Ix(t) {
  23720. var e = Ec(t, !1), r = [];
  23721. e = e.replace(/\s*,\s*/g, ",");
  23722. for (var n, i = /^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i; n = i.exec(e);) {
  23723. var o = parseFloat(n[1]), a = parseFloat(n[2]), s = n[3] ? parseFloat(n[3]) : 0;
  23724. r.push(o, a, s), e = e.substr(n[0].length)
  23725. }
  23726. if ("" === e) return r
  23727. }
  23728. function Lx(t) {
  23729. var e = Ec(t, !1).trim(), r = t.baseURI;
  23730. return r && "about:blank" != r || (r = window.location.href), r ? new URL(e, r).href : e
  23731. }
  23732. function Mx(t) {
  23733. var e = Ec(t, !1).trim().replace(/^(?!.*#)/, "#"), r = t.baseURI;
  23734. return r && "about:blank" != r || (r = window.location.href), r ? new URL(e, r).href : e
  23735. }
  23736. function Fx(t) {
  23737. return N_(t)
  23738. }
  23739. var Ax = Gc(cx, {
  23740. Pair: function (t, e) {
  23741. var r = Uc({}, uw, t, e, this);
  23742. if (!r) return;
  23743. var n = r.key;
  23744. if (n && "normal" == n) {
  23745. var i = r.styleUrl;
  23746. i && (e[e.length - 1] = i);
  23747. var o = r.Style;
  23748. o && (e[e.length - 1] = o)
  23749. }
  23750. }
  23751. });
  23752. function kx(t, e) {
  23753. return Uc(void 0, Ax, t, e, this)
  23754. }
  23755. var jx = Gc(cx, {
  23756. Icon: Fc((function (t, e) {
  23757. var r = Uc({}, Wx, t, e);
  23758. return r || null
  23759. })), color: Fc(Rx), heading: Fc(N_), hotSpot: Fc((function (t) {
  23760. var e, r = t.getAttribute("xunits"), n = t.getAttribute("yunits");
  23761. return e = "insetPixels" !== r ? "insetPixels" !== n ? ip : ap : "insetPixels" !== n ? op : sp, {
  23762. x: parseFloat(t.getAttribute("x")),
  23763. xunits: hx[r],
  23764. y: parseFloat(t.getAttribute("y")),
  23765. yunits: hx[n],
  23766. origin: e
  23767. }
  23768. })), scale: Fc(Fx)
  23769. });
  23770. var Nx = Gc(cx, {color: Fc(Rx), scale: Fc(Fx)});
  23771. var Dx = Gc(cx, {color: Fc(Rx), width: Fc(N_)});
  23772. var Gx = Gc(cx, {color: Fc(Rx), fill: Fc(A_), outline: Fc(A_)});
  23773. var zx = Gc(cx, {coordinates: Lc(Ix)});
  23774. function Ux(t, e) {
  23775. return Uc(null, zx, t, e)
  23776. }
  23777. var Bx = Gc(ux, {Track: Ic(Yx)});
  23778. var Vx = Gc(cx, {
  23779. when: function (t, e) {
  23780. var r = e[e.length - 1].whens, n = Ec(t, !1), i = Date.parse(n);
  23781. r.push(isNaN(i) ? 0 : i)
  23782. }
  23783. }, Gc(ux, {
  23784. coord: function (t, e) {
  23785. var r = e[e.length - 1].flatCoordinates, n = Ec(t, !1),
  23786. i = /^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);
  23787. if (i) {
  23788. var o = parseFloat(i[1]), a = parseFloat(i[2]), s = parseFloat(i[3]);
  23789. r.push(o, a, s, 0)
  23790. } else r.push(0, 0, 0, 0)
  23791. }
  23792. }));
  23793. function Yx(t, e) {
  23794. var r = Uc({flatCoordinates: [], whens: []}, Vx, t, e);
  23795. if (r) {
  23796. for (var n = r.flatCoordinates, i = r.whens, o = 0, a = Math.min(n.length, i.length); o < a; ++o) n[4 * o + 3] = i[o];
  23797. return new Py(n, _t)
  23798. }
  23799. }
  23800. var Wx = Gc(cx, {href: Fc(Lx)}, Gc(ux, {x: Fc(N_), y: Fc(N_), w: Fc(N_), h: Fc(N_)}));
  23801. var qx = Gc(cx, {coordinates: Lc(Ix)});
  23802. function Xx(t, e) {
  23803. return Uc(null, qx, t, e)
  23804. }
  23805. var Zx = Gc(cx, {extrude: Fc(A_), tessellate: Fc(A_), altitudeMode: Fc(U_)});
  23806. function Kx(t, e) {
  23807. var r = Uc({}, Zx, t, e), n = Xx(t, e);
  23808. if (n) {
  23809. var i = new Py(n, mt);
  23810. return i.setProperties(r, !0), i
  23811. }
  23812. }
  23813. function Hx(t, e) {
  23814. var r = Uc({}, Zx, t, e), n = Xx(t, e);
  23815. if (n) {
  23816. var i = new fi(n, mt, [n.length]);
  23817. return i.setProperties(r, !0), i
  23818. }
  23819. }
  23820. var $x = Gc(cx, {LineString: Ic(Kx), LinearRing: Ic(Hx), MultiGeometry: Ic(Jx), Point: Ic(Qx), Polygon: Ic(ew)});
  23821. function Jx(t, e) {
  23822. var r, n = Uc([], $x, t, e);
  23823. if (!n) return null;
  23824. if (0 === n.length) return new Vm(n);
  23825. for (var i = !0, o = n[0].getType(), a = 1, s = n.length; a < s; ++a) if (n[a].getType() != o) {
  23826. i = !1;
  23827. break
  23828. }
  23829. if (i) {
  23830. var l = void 0, u = void 0;
  23831. if (o == bt.POINT) {
  23832. var c = n[0];
  23833. l = c.getLayout(), u = c.getFlatCoordinates();
  23834. for (a = 1, s = n.length; a < s; ++a) v(u, n[a].getFlatCoordinates());
  23835. iw(r = new Hy(u, l), n)
  23836. } else o == bt.LINE_STRING ? iw(r = new Zy(n), n) : o == bt.POLYGON ? iw(r = new Jy(n), n) : o == bt.GEOMETRY_COLLECTION ? r = new Vm(n) : pt(!1, 37)
  23837. } else r = new Vm(n);
  23838. return r
  23839. }
  23840. function Qx(t, e) {
  23841. var r = Uc({}, Zx, t, e), n = Xx(t, e);
  23842. if (n) {
  23843. var i = new qn(n, mt);
  23844. return i.setProperties(r, !0), i
  23845. }
  23846. }
  23847. var tw = Gc(cx, {
  23848. innerBoundaryIs: function (t, e) {
  23849. var r = Uc(void 0, fw, t, e);
  23850. if (r) {
  23851. e[e.length - 1].push(r)
  23852. }
  23853. }, outerBoundaryIs: function (t, e) {
  23854. var r = Uc(void 0, dw, t, e);
  23855. if (r) {
  23856. e[e.length - 1][0] = r
  23857. }
  23858. }
  23859. });
  23860. function ew(t, e) {
  23861. var r = Uc({}, Zx, t, e), n = Uc([null], tw, t, e);
  23862. if (n && n[0]) {
  23863. for (var i = n[0], o = [i.length], a = 1, s = n.length; a < s; ++a) v(i, n[a]), o.push(i.length);
  23864. var l = new fi(i, mt, o);
  23865. return l.setProperties(r, !0), l
  23866. }
  23867. }
  23868. var rw = Gc(cx, {
  23869. IconStyle: function (t, e) {
  23870. var r = Uc({}, jx, t, e);
  23871. if (r) {
  23872. var n, i, o, a, s = e[e.length - 1], l = "Icon" in r ? r.Icon : {},
  23873. u = !("Icon" in r) || Object.keys(l).length > 0, c = l.href;
  23874. c ? n = c : u && (n = Hb);
  23875. var h, p = ip, f = r.hotSpot;
  23876. f ? (i = [f.x, f.y], o = f.xunits, a = f.yunits, p = f.origin) : n === Hb ? (i = qb, o = Xb, a = Zb) : /^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n) && (i = [.5, 0], o = rp, a = rp);
  23877. var d, g = l.x, y = l.y;
  23878. void 0 !== g && void 0 !== y && (h = [g, y]);
  23879. var m, v = l.w, _ = l.h;
  23880. void 0 !== v && void 0 !== _ && (d = [v, _]);
  23881. var b = r.heading;
  23882. void 0 !== b && (m = Ye(b));
  23883. var x = r.scale, w = r.color;
  23884. if (u) {
  23885. n == Hb && (d = Kb, void 0 === x && (x = $b));
  23886. var S = new dp({
  23887. anchor: i,
  23888. anchorOrigin: p,
  23889. anchorXUnits: o,
  23890. anchorYUnits: a,
  23891. crossOrigin: this.crossOrigin_,
  23892. offset: h,
  23893. offsetOrigin: ip,
  23894. rotation: m,
  23895. scale: x,
  23896. size: d,
  23897. src: this.iconUrlFunction_(n),
  23898. color: w
  23899. });
  23900. s.imageStyle = S
  23901. } else s.imageStyle = _x
  23902. }
  23903. }, LabelStyle: function (t, e) {
  23904. var r = Uc({}, Nx, t, e);
  23905. if (r) {
  23906. var n = e[e.length - 1], i = new Tp({fill: new ep({color: "color" in r ? r.color : Wb}), scale: r.scale});
  23907. n.textStyle = i
  23908. }
  23909. }, LineStyle: function (t, e) {
  23910. var r = Uc({}, Dx, t, e);
  23911. if (r) {
  23912. var n = e[e.length - 1], i = new gp({color: "color" in r ? r.color : Wb, width: "width" in r ? r.width : 1});
  23913. n.strokeStyle = i
  23914. }
  23915. }, PolyStyle: function (t, e) {
  23916. var r = Uc({}, Gx, t, e);
  23917. if (r) {
  23918. var n = e[e.length - 1], i = new ep({color: "color" in r ? r.color : Wb});
  23919. n.fillStyle = i;
  23920. var o = r.fill;
  23921. void 0 !== o && (n.fill = o);
  23922. var a = r.outline;
  23923. void 0 !== a && (n.outline = a)
  23924. }
  23925. }
  23926. });
  23927. function nw(t, e) {
  23928. var r = Uc({}, rw, t, e, this);
  23929. if (!r) return null;
  23930. var n, i = "fillStyle" in r ? r.fillStyle : vx, o = r.fill;
  23931. void 0 === o || o || (i = null), "imageStyle" in r ? r.imageStyle != _x && (n = r.imageStyle) : n = bx;
  23932. var a = "textStyle" in r ? r.textStyle : Sx, s = "strokeStyle" in r ? r.strokeStyle : wx, l = r.outline;
  23933. return void 0 === l || l ? [new wp({
  23934. fill: i,
  23935. image: n,
  23936. stroke: s,
  23937. text: a,
  23938. zIndex: void 0
  23939. })] : [new wp({
  23940. geometry: function (t) {
  23941. var e = t.getGeometry(), r = e.getType();
  23942. return r === bt.GEOMETRY_COLLECTION ? new Vm(e.getGeometriesArrayRecursive().filter((function (t) {
  23943. var e = t.getType();
  23944. return e !== bt.POLYGON && e !== bt.MULTI_POLYGON
  23945. }))) : r !== bt.POLYGON && r !== bt.MULTI_POLYGON ? e : void 0
  23946. }, fill: i, image: n, stroke: s, text: a, zIndex: void 0
  23947. }), new wp({
  23948. geometry: function (t) {
  23949. var e = t.getGeometry(), r = e.getType();
  23950. return r === bt.GEOMETRY_COLLECTION ? new Vm(e.getGeometriesArrayRecursive().filter((function (t) {
  23951. var e = t.getType();
  23952. return e === bt.POLYGON || e === bt.MULTI_POLYGON
  23953. }))) : r === bt.POLYGON || r === bt.MULTI_POLYGON ? e : void 0
  23954. }, fill: i, stroke: null, zIndex: void 0
  23955. })]
  23956. }
  23957. function iw(t, e) {
  23958. var r, n, i, o = e.length, a = new Array(e.length), s = new Array(e.length), l = new Array(e.length);
  23959. r = !1, n = !1, i = !1;
  23960. for (var u = 0; u < o; ++u) {
  23961. var c = e[u];
  23962. a[u] = c.get("extrude"), s[u] = c.get("tessellate"), l[u] = c.get("altitudeMode"), r = r || void 0 !== a[u], n = n || void 0 !== s[u], i = i || l[u]
  23963. }
  23964. r && t.set("extrude", a), n && t.set("tessellate", s), i && t.set("altitudeMode", l)
  23965. }
  23966. var ow = Gc(cx, {displayName: Fc(U_), value: Fc(U_)});
  23967. var aw = Gc(cx, {
  23968. Data: function (t, e) {
  23969. var r = t.getAttribute("name");
  23970. zc(ow, t, e);
  23971. var n = e[e.length - 1];
  23972. r && n.displayName ? n[r] = {
  23973. value: n.value, displayName: n.displayName, toString: function () {
  23974. return n.value
  23975. }
  23976. } : null !== r ? n[r] = n.value : null !== n.displayName && (n[n.displayName] = n.value), delete n.value
  23977. }, SchemaData: function (t, e) {
  23978. zc(cw, t, e)
  23979. }
  23980. });
  23981. function sw(t, e) {
  23982. zc(aw, t, e)
  23983. }
  23984. function lw(t, e) {
  23985. zc(gx, t, e)
  23986. }
  23987. var uw = Gc(cx, {Style: Fc(nw), key: Fc(U_), styleUrl: Fc(Mx)});
  23988. var cw = Gc(cx, {
  23989. SimpleData: function (t, e) {
  23990. var r = t.getAttribute("name");
  23991. if (null !== r) {
  23992. var n = U_(t);
  23993. e[e.length - 1][r] = n
  23994. }
  23995. }
  23996. });
  23997. var hw = Gc(cx, {
  23998. altitudeMode: Fc(U_),
  23999. minAltitude: Fc(N_),
  24000. maxAltitude: Fc(N_),
  24001. north: Fc(N_),
  24002. south: Fc(N_),
  24003. east: Fc(N_),
  24004. west: Fc(N_)
  24005. });
  24006. var pw = Gc(cx, {minLodPixels: Fc(N_), maxLodPixels: Fc(N_), minFadeExtent: Fc(N_), maxFadeExtent: Fc(N_)});
  24007. var fw = Gc(cx, {LinearRing: Lc(Ux)});
  24008. var dw = Gc(cx, {LinearRing: Lc(Ux)});
  24009. function gw(t, e) {
  24010. for (var r = Oo(e), n = [255 * (4 == r.length ? r[3] : 1), r[2], r[1], r[0]], i = 0; i < 4; ++i) {
  24011. var o = Math.floor(n[i]).toString(16);
  24012. n[i] = 1 == o.length ? "0" + o : o
  24013. }
  24014. X_(t, n.join(""))
  24015. }
  24016. var yw = Gc(cx, {
  24017. Data: Ac((function (t, e, r) {
  24018. t.setAttribute("name", e.name);
  24019. var n = {node: t}, i = e.value;
  24020. "object" == typeof i ? (null !== i && i.displayName && Vc(n, yw, Nc, [i.displayName], r, ["displayName"]), null !== i && i.value && Vc(n, yw, Nc, [i.value], r, ["value"])) : Vc(n, yw, Nc, [i], r, ["value"])
  24021. })), value: Ac((function (t, e) {
  24022. X_(t, e)
  24023. })), displayName: Ac((function (t, e) {
  24024. V_(t, e)
  24025. }))
  24026. });
  24027. var mw = Gc(cx, {Placemark: Ac(Bw)}), vw = function (t, e, r) {
  24028. return Sc(e[e.length - 1].node.namespaceURI, "Placemark")
  24029. };
  24030. var _w = jc("Data");
  24031. var bw = Gc(cx, ["href"], Gc(ux, ["x", "y", "w", "h"])),
  24032. xw = Gc(cx, {href: Ac(X_)}, Gc(ux, {x: Ac(W_), y: Ac(W_), w: Ac(W_), h: Ac(W_)})), ww = function (t, e, r) {
  24033. return Sc(ux[0], "gx:" + r)
  24034. };
  24035. var Sw = Gc(cx, ["scale", "heading", "Icon", "color", "hotSpot"]), Ew = Gc(cx, {
  24036. Icon: Ac((function (t, e, r) {
  24037. var n = {node: t}, i = r[r.length - 1].node, o = bw[i.namespaceURI], a = Dc(e, o);
  24038. Vc(n, xw, Nc, a, r, o), a = Dc(e, o = bw[ux[0]]), Vc(n, xw, ww, a, r, o)
  24039. })), color: Ac(gw), heading: Ac(W_), hotSpot: Ac((function (t, e) {
  24040. t.setAttribute("x", String(e.x)), t.setAttribute("y", String(e.y)), t.setAttribute("xunits", e.xunits), t.setAttribute("yunits", e.yunits)
  24041. })), scale: Ac(Jw)
  24042. });
  24043. var Tw = Gc(cx, ["color", "scale"]), Cw = Gc(cx, {color: Ac(gw), scale: Ac(Jw)});
  24044. var Ow = Gc(cx, ["color", "width"]), Pw = Gc(cx, {color: Ac(gw), width: Ac(W_)});
  24045. var Rw = {
  24046. Point: "Point",
  24047. LineString: "LineString",
  24048. LinearRing: "LinearRing",
  24049. Polygon: "Polygon",
  24050. MultiPoint: "MultiGeometry",
  24051. MultiLineString: "MultiGeometry",
  24052. MultiPolygon: "MultiGeometry",
  24053. GeometryCollection: "MultiGeometry"
  24054. }, Iw = function (t, e, r) {
  24055. if (t) return Sc(e[e.length - 1].node.namespaceURI, Rw[t.getType()])
  24056. }, Lw = jc("Point"), Mw = jc("LineString"), Fw = jc("LinearRing"), Aw = jc("Polygon"),
  24057. kw = Gc(cx, {LineString: Ac(Ww), Point: Ac(Ww), Polygon: Ac(Hw), GeometryCollection: Ac(jw)});
  24058. function jw(t, e, r) {
  24059. var n, i = {node: t}, o = e.getType(), a = [];
  24060. o === bt.GEOMETRY_COLLECTION ? (e.getGeometriesArrayRecursive().forEach((function (t) {
  24061. var e = t.getType();
  24062. e === bt.MULTI_POINT ? a = a.concat(t.getPoints()) : e === bt.MULTI_LINE_STRING ? a = a.concat(t.getLineStrings()) : e === bt.MULTI_POLYGON ? a = a.concat(t.getPolygons()) : e === bt.POINT || e === bt.LINE_STRING || e === bt.POLYGON ? a.push(t) : pt(!1, 39)
  24063. })), n = Iw) : o === bt.MULTI_POINT ? (a = e.getPoints(), n = Lw) : o === bt.MULTI_LINE_STRING ? (a = e.getLineStrings(), n = Mw) : o === bt.MULTI_POLYGON ? (a = e.getPolygons(), n = Aw) : pt(!1, 39), Vc(i, kw, n, a, r)
  24064. }
  24065. var Nw = Gc(cx, {LinearRing: Ac(Ww)});
  24066. function Dw(t, e, r) {
  24067. Vc({node: t}, Nw, Fw, [e], r)
  24068. }
  24069. var Gw = Gc(cx, {
  24070. ExtendedData: Ac((function (t, e, r) {
  24071. for (var n = {node: t}, i = e.names, o = e.values, a = i.length, s = 0; s < a; s++) Vc(n, yw, _w, [{
  24072. name: i[s],
  24073. value: o[s]
  24074. }], r)
  24075. })),
  24076. MultiGeometry: Ac(jw),
  24077. LineString: Ac(Ww),
  24078. LinearRing: Ac(Ww),
  24079. Point: Ac(Ww),
  24080. Polygon: Ac(Hw),
  24081. Style: Ac((function (t, e, r) {
  24082. var n = {node: t}, i = {};
  24083. if (e.pointStyles.length) {
  24084. var o = e.pointStyles[0].getText();
  24085. o && (i.LabelStyle = o);
  24086. var a = e.pointStyles[0].getImage();
  24087. a && "function" == typeof a.getSrc && (i.IconStyle = a)
  24088. }
  24089. if (e.lineStyles.length) {
  24090. (s = e.lineStyles[0].getStroke()) && (i.LineStyle = s)
  24091. }
  24092. if (e.polyStyles.length) {
  24093. var s;
  24094. (s = e.polyStyles[0].getStroke()) && !i.LineStyle && (i.LineStyle = s), i.PolyStyle = e.polyStyles[0]
  24095. }
  24096. var l = r[r.length - 1].node, u = Qw[l.namespaceURI], c = Dc(i, u);
  24097. Vc(n, tS, Nc, c, r, u)
  24098. })),
  24099. address: Ac(X_),
  24100. description: Ac(X_),
  24101. name: Ac(X_),
  24102. open: Ac(B_),
  24103. phoneNumber: Ac(X_),
  24104. styleUrl: Ac(X_),
  24105. visibility: Ac(B_)
  24106. }), zw = Gc(cx, ["name", "open", "visibility", "address", "phoneNumber", "description", "styleUrl", "Style"]),
  24107. Uw = jc("ExtendedData");
  24108. function Bw(t, e, r) {
  24109. var n = {node: t};
  24110. e.getId() && t.setAttribute("id", e.getId());
  24111. var i = e.getProperties(),
  24112. o = {address: 1, description: 1, name: 1, open: 1, phoneNumber: 1, styleUrl: 1, visibility: 1};
  24113. o[e.getGeometryName()] = 1;
  24114. var a = Object.keys(i || {}).sort().filter((function (t) {
  24115. return !o[t]
  24116. })), s = e.getStyleFunction();
  24117. if (s) {
  24118. var l = s(e, 0);
  24119. if (l) {
  24120. var u = Array.isArray(l) ? l : [l], c = u;
  24121. if (e.getGeometry() && (c = u.filter((function (t) {
  24122. var r = t.getGeometryFunction()(e);
  24123. if (r) {
  24124. var n = r.getType();
  24125. return n === bt.GEOMETRY_COLLECTION ? r.getGeometriesArrayRecursive().filter((function (t) {
  24126. var e = t.getType();
  24127. return e === bt.POINT || e === bt.MULTI_POINT
  24128. })).length : n === bt.POINT || n === bt.MULTI_POINT
  24129. }
  24130. }))), this.writeStyles_) {
  24131. var h = u, p = u;
  24132. e.getGeometry() && (h = u.filter((function (t) {
  24133. var r = t.getGeometryFunction()(e);
  24134. if (r) {
  24135. var n = r.getType();
  24136. return n === bt.GEOMETRY_COLLECTION ? r.getGeometriesArrayRecursive().filter((function (t) {
  24137. var e = t.getType();
  24138. return e === bt.LINE_STRING || e === bt.MULTI_LINE_STRING
  24139. })).length : n === bt.LINE_STRING || n === bt.MULTI_LINE_STRING
  24140. }
  24141. })), p = u.filter((function (t) {
  24142. var r = t.getGeometryFunction()(e);
  24143. if (r) {
  24144. var n = r.getType();
  24145. return n === bt.GEOMETRY_COLLECTION ? r.getGeometriesArrayRecursive().filter((function (t) {
  24146. var e = t.getType();
  24147. return e === bt.POLYGON || e === bt.MULTI_POLYGON
  24148. })).length : n === bt.POLYGON || n === bt.MULTI_POLYGON
  24149. }
  24150. }))), i.Style = {pointStyles: c, lineStyles: h, polyStyles: p}
  24151. }
  24152. if (c.length && void 0 === i.name) {
  24153. var f = c[0].getText();
  24154. f && (i.name = f.getText())
  24155. }
  24156. }
  24157. }
  24158. var d = r[r.length - 1].node, g = zw[d.namespaceURI], y = Dc(i, g);
  24159. if (Vc(n, Gw, Nc, y, r, g), a.length > 0) {
  24160. var m = Dc(i, a);
  24161. Vc(n, Gw, Uw, [{names: a, values: m}], r)
  24162. }
  24163. var v = r[0], _ = e.getGeometry();
  24164. _ && (_ = Wy(_, !0, v)), Vc(n, Gw, Iw, [_], r)
  24165. }
  24166. var Vw = Gc(cx, ["extrude", "tessellate", "altitudeMode", "coordinates"]), Yw = Gc(cx, {
  24167. extrude: Ac(B_), tessellate: Ac(B_), altitudeMode: Ac(X_), coordinates: Ac((function (t, e, r) {
  24168. var n, i = r[r.length - 1], o = i.layout, a = i.stride;
  24169. o == yt || o == vt ? n = 2 : o == mt || o == _t ? n = 3 : pt(!1, 34);
  24170. var s = e.length, l = "";
  24171. if (s > 0) {
  24172. l += e[0];
  24173. for (var u = 1; u < n; ++u) l += "," + e[u];
  24174. for (var c = a; c < s; c += a) {
  24175. l += " " + e[c];
  24176. for (u = 1; u < n; ++u) l += "," + e[c + u]
  24177. }
  24178. }
  24179. X_(t, l)
  24180. }))
  24181. });
  24182. function Ww(t, e, r) {
  24183. var n = e.getFlatCoordinates(), i = {node: t};
  24184. i.layout = e.getLayout(), i.stride = e.getStride();
  24185. var o = e.getProperties();
  24186. o.coordinates = n;
  24187. var a = r[r.length - 1].node, s = Vw[a.namespaceURI], l = Dc(o, s);
  24188. Vc(i, Yw, Nc, l, r, s)
  24189. }
  24190. var qw = Gc(cx, ["color", "fill", "outline"]), Xw = Gc(cx, {outerBoundaryIs: Ac(Dw), innerBoundaryIs: Ac(Dw)}),
  24191. Zw = jc("innerBoundaryIs"), Kw = jc("outerBoundaryIs");
  24192. function Hw(t, e, r) {
  24193. var n = e.getLinearRings(), i = n.shift(), o = {node: t};
  24194. Vc(o, Xw, Zw, n, r), Vc(o, Xw, Kw, [i], r)
  24195. }
  24196. var $w = Gc(cx, {color: Ac(gw), fill: Ac(B_), outline: Ac(B_)});
  24197. function Jw(t, e) {
  24198. W_(t, Math.round(1e6 * e) / 1e6)
  24199. }
  24200. var Qw = Gc(cx, ["IconStyle", "LabelStyle", "LineStyle", "PolyStyle"]), tS = Gc(cx, {
  24201. IconStyle: Ac((function (t, e, r) {
  24202. var n = {node: t}, i = {}, o = e.getSrc(), a = e.getSize(), s = e.getImageSize(), l = {href: o};
  24203. if (a) {
  24204. l.w = a[0], l.h = a[1];
  24205. var u = e.getAnchor(), c = e.getOrigin();
  24206. if (c && s && 0 !== c[0] && c[1] !== a[1] && (l.x = c[0], l.y = s[1] - (c[1] + a[1])), u && (u[0] !== a[0] / 2 || u[1] !== a[1] / 2)) {
  24207. var h = {x: u[0], xunits: np, y: a[1] - u[1], yunits: np};
  24208. i.hotSpot = h
  24209. }
  24210. }
  24211. i.Icon = l;
  24212. var p = e.getScale();
  24213. 1 !== p && (i.scale = p);
  24214. var f = e.getRotation();
  24215. 0 !== f && (i.heading = f);
  24216. var d = e.getColor();
  24217. d && (i.color = d);
  24218. var g = r[r.length - 1].node, y = Sw[g.namespaceURI], m = Dc(i, y);
  24219. Vc(n, Ew, Nc, m, r, y)
  24220. })), LabelStyle: Ac((function (t, e, r) {
  24221. var n = {node: t}, i = {}, o = e.getFill();
  24222. o && (i.color = o.getColor());
  24223. var a = e.getScale();
  24224. a && 1 !== a && (i.scale = a);
  24225. var s = r[r.length - 1].node, l = Tw[s.namespaceURI], u = Dc(i, l);
  24226. Vc(n, Cw, Nc, u, r, l)
  24227. })), LineStyle: Ac((function (t, e, r) {
  24228. var n = {node: t}, i = {color: e.getColor(), width: Number(e.getWidth()) || 1}, o = r[r.length - 1].node,
  24229. a = Ow[o.namespaceURI], s = Dc(i, a);
  24230. Vc(n, Pw, Nc, s, r, a)
  24231. })), PolyStyle: Ac((function (t, e, r) {
  24232. var n = {node: t}, i = e.getFill(), o = e.getStroke(),
  24233. a = {color: i ? i.getColor() : void 0, fill: !!i && void 0, outline: !!o && void 0}, s = r[r.length - 1].node,
  24234. l = qw[s.namespaceURI], u = Dc(a, l);
  24235. Vc(n, $w, Nc, u, r, l)
  24236. }))
  24237. });
  24238. var eS = Px, rS = function () {
  24239. var t = function (e, r) {
  24240. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24241. t.__proto__ = e
  24242. } || function (t, e) {
  24243. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24244. })(e, r)
  24245. };
  24246. return function (e, r) {
  24247. function n() {
  24248. this.constructor = e
  24249. }
  24250. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24251. }
  24252. }(), nS = [null], iS = Gc(nS, {
  24253. nd: function (t, e) {
  24254. e[e.length - 1].ndrefs.push(t.getAttribute("ref"))
  24255. }, tag: lS
  24256. }), oS = Gc(nS, {
  24257. node: function (t, e) {
  24258. var r = e[0], n = e[e.length - 1], i = t.getAttribute("id"),
  24259. o = [parseFloat(t.getAttribute("lon")), parseFloat(t.getAttribute("lat"))];
  24260. n.nodes[i] = o;
  24261. var a = Uc({tags: {}}, sS, t, e);
  24262. if (!I(a.tags)) {
  24263. var s = new qn(o);
  24264. Wy(s, !1, r);
  24265. var l = new gt(s);
  24266. l.setId(i), l.setProperties(a.tags, !0), n.features.push(l)
  24267. }
  24268. }, way: function (t, e) {
  24269. var r = Uc({id: t.getAttribute("id"), ndrefs: [], tags: {}}, iS, t, e);
  24270. e[e.length - 1].ways.push(r)
  24271. }
  24272. }), aS = function (t) {
  24273. function e() {
  24274. var e = t.call(this) || this;
  24275. return e.dataProjection = Gr("EPSG:4326"), e
  24276. }
  24277. return rS(e, t), e.prototype.readFeaturesFromNode = function (t, e) {
  24278. var r = this.getReadOptions(t, e);
  24279. if ("osm" == t.localName) {
  24280. for (var n = Uc({nodes: {}, ways: [], features: []}, oS, t, [r]), i = 0; i < n.ways.length; i++) {
  24281. for (var o = n.ways[i], a = [], s = 0, l = o.ndrefs.length; s < l; s++) {
  24282. v(a, n.nodes[o.ndrefs[s]])
  24283. }
  24284. var u = void 0;
  24285. Wy(u = o.ndrefs[0] == o.ndrefs[o.ndrefs.length - 1] ? new fi(a, yt, [a.length]) : new Py(a, yt), !1, r);
  24286. var c = new gt(u);
  24287. c.setId(o.id), c.setProperties(o.tags, !0), n.features.push(c)
  24288. }
  24289. if (n.features) return n.features
  24290. }
  24291. return []
  24292. }, e
  24293. }(P_), sS = Gc(nS, {tag: lS});
  24294. function lS(t, e) {
  24295. e[e.length - 1].tags[t.getAttribute("k")] = t.getAttribute("v")
  24296. }
  24297. var uS = aS, cS = function () {
  24298. function t() {
  24299. }
  24300. return t.prototype.read = function (t) {
  24301. if (t) {
  24302. if ("string" == typeof t) {
  24303. var e = Pc(t);
  24304. return this.readFromDocument(e)
  24305. }
  24306. return Cc(t) ? this.readFromDocument(t) : this.readFromNode(t)
  24307. }
  24308. return null
  24309. }, t.prototype.readFromDocument = function (t) {
  24310. for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readFromNode(e);
  24311. return null
  24312. }, t.prototype.readFromNode = function (t) {
  24313. }, t
  24314. }();
  24315. function hS(t) {
  24316. return t.getAttributeNS("http://www.w3.org/1999/xlink", "href")
  24317. }
  24318. var pS = function () {
  24319. var t = function (e, r) {
  24320. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24321. t.__proto__ = e
  24322. } || function (t, e) {
  24323. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24324. })(e, r)
  24325. };
  24326. return function (e, r) {
  24327. function n() {
  24328. this.constructor = e
  24329. }
  24330. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24331. }
  24332. }(), fS = [null, "http://www.opengis.net/ows/1.1"], dS = Gc(fS, {
  24333. ServiceIdentification: Fc((function (t, e) {
  24334. return Uc({}, OS, t, e)
  24335. })), ServiceProvider: Fc((function (t, e) {
  24336. return Uc({}, PS, t, e)
  24337. })), OperationsMetadata: Fc((function (t, e) {
  24338. return Uc({}, SS, t, e)
  24339. }))
  24340. }), gS = function (t) {
  24341. function e() {
  24342. return t.call(this) || this
  24343. }
  24344. return pS(e, t), e.prototype.readFromNode = function (t) {
  24345. var e = Uc({}, dS, t, []);
  24346. return e || null
  24347. }, e
  24348. }(cS), yS = Gc(fS, {
  24349. DeliveryPoint: Fc(U_),
  24350. City: Fc(U_),
  24351. AdministrativeArea: Fc(U_),
  24352. PostalCode: Fc(U_),
  24353. Country: Fc(U_),
  24354. ElectronicMailAddress: Fc(U_)
  24355. }), mS = Gc(fS, {
  24356. Value: Mc((function (t, e) {
  24357. return U_(t)
  24358. }))
  24359. }), vS = Gc(fS, {
  24360. AllowedValues: Fc((function (t, e) {
  24361. return Uc({}, mS, t, e)
  24362. }))
  24363. }), _S = Gc(fS, {
  24364. Phone: Fc((function (t, e) {
  24365. return Uc({}, ES, t, e)
  24366. })), Address: Fc((function (t, e) {
  24367. return Uc({}, yS, t, e)
  24368. }))
  24369. }), bS = Gc(fS, {
  24370. HTTP: Fc((function (t, e) {
  24371. return Uc({}, xS, t, e)
  24372. }))
  24373. }), xS = Gc(fS, {
  24374. Get: Mc((function (t, e) {
  24375. var r = hS(t);
  24376. if (!r) return;
  24377. return Uc({href: r}, TS, t, e)
  24378. })), Post: void 0
  24379. }), wS = Gc(fS, {
  24380. DCP: Fc((function (t, e) {
  24381. return Uc({}, bS, t, e)
  24382. }))
  24383. }), SS = Gc(fS, {
  24384. Operation: function (t, e) {
  24385. var r = t.getAttribute("name"), n = Uc({}, wS, t, e);
  24386. if (!n) return;
  24387. e[e.length - 1][r] = n
  24388. }
  24389. }), ES = Gc(fS, {Voice: Fc(U_), Facsimile: Fc(U_)}), TS = Gc(fS, {
  24390. Constraint: Mc((function (t, e) {
  24391. var r = t.getAttribute("name");
  24392. if (!r) return;
  24393. return Uc({name: r}, vS, t, e)
  24394. }))
  24395. }), CS = Gc(fS, {
  24396. IndividualName: Fc(U_), PositionName: Fc(U_), ContactInfo: Fc((function (t, e) {
  24397. return Uc({}, _S, t, e)
  24398. }))
  24399. }), OS = Gc(fS, {
  24400. Abstract: Fc(U_),
  24401. AccessConstraints: Fc(U_),
  24402. Fees: Fc(U_),
  24403. Title: Fc(U_),
  24404. ServiceTypeVersion: Fc(U_),
  24405. ServiceType: Fc(U_)
  24406. }), PS = Gc(fS, {
  24407. ProviderName: Fc(U_), ProviderSite: Fc(hS), ServiceContact: Fc((function (t, e) {
  24408. return Uc({}, CS, t, e)
  24409. }))
  24410. });
  24411. var RS = gS, IS = function () {
  24412. var t = function (e, r) {
  24413. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24414. t.__proto__ = e
  24415. } || function (t, e) {
  24416. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24417. })(e, r)
  24418. };
  24419. return function (e, r) {
  24420. function n() {
  24421. this.constructor = e
  24422. }
  24423. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24424. }
  24425. }();
  24426. function LS(t, e, r) {
  24427. var n, i = r || 1e5, o = new Array(e);
  24428. for (n = 0; n < e; ++n) o[n] = 0;
  24429. for (var a = 0, s = t.length; a < s;) for (n = 0; n < e; ++n, ++a) {
  24430. var l = t[a], u = l - o[n];
  24431. o[n] = l, t[a] = u
  24432. }
  24433. return FS(t, i)
  24434. }
  24435. function MS(t, e, r) {
  24436. var n, i = r || 1e5, o = new Array(e);
  24437. for (n = 0; n < e; ++n) o[n] = 0;
  24438. for (var a = AS(t, i), s = 0, l = a.length; s < l;) for (n = 0; n < e; ++n, ++s) o[n] += a[s], a[s] = o[n];
  24439. return a
  24440. }
  24441. function FS(t, e) {
  24442. for (var r = e || 1e5, n = 0, i = t.length; n < i; ++n) t[n] = Math.round(t[n] * r);
  24443. return kS(t)
  24444. }
  24445. function AS(t, e) {
  24446. for (var r = e || 1e5, n = jS(t), i = 0, o = n.length; i < o; ++i) n[i] /= r;
  24447. return n
  24448. }
  24449. function kS(t) {
  24450. for (var e = 0, r = t.length; e < r; ++e) {
  24451. var n = t[e];
  24452. t[e] = n < 0 ? ~(n << 1) : n << 1
  24453. }
  24454. return NS(t)
  24455. }
  24456. function jS(t) {
  24457. for (var e = DS(t), r = 0, n = e.length; r < n; ++r) {
  24458. var i = e[r];
  24459. e[r] = 1 & i ? ~(i >> 1) : i >> 1
  24460. }
  24461. return e
  24462. }
  24463. function NS(t) {
  24464. for (var e = "", r = 0, n = t.length; r < n; ++r) e += GS(t[r]);
  24465. return e
  24466. }
  24467. function DS(t) {
  24468. for (var e = [], r = 0, n = 0, i = 0, o = t.length; i < o; ++i) {
  24469. var a = t.charCodeAt(i) - 63;
  24470. r |= (31 & a) << n, a < 32 ? (e.push(r), r = 0, n = 0) : n += 5
  24471. }
  24472. return e
  24473. }
  24474. function GS(t) {
  24475. for (var e, r = ""; t >= 32;) e = 63 + (32 | 31 & t), r += String.fromCharCode(e), t >>= 5;
  24476. return e = t + 63, r += String.fromCharCode(e)
  24477. }
  24478. var zS = function (t) {
  24479. function e(e) {
  24480. var r = t.call(this) || this, n = e || {};
  24481. return r.dataProjection = Gr("EPSG:4326"), r.factor_ = n.factor ? n.factor : 1e5, r.geometryLayout_ = n.geometryLayout ? n.geometryLayout : yt, r
  24482. }
  24483. return IS(e, t), e.prototype.readFeatureFromText = function (t, e) {
  24484. var r = this.readGeometryFromText(t, e);
  24485. return new gt(r)
  24486. }, e.prototype.readFeaturesFromText = function (t, e) {
  24487. return [this.readFeatureFromText(t, e)]
  24488. }, e.prototype.readGeometryFromText = function (t, e) {
  24489. var r = yn(this.geometryLayout_), n = MS(t, r, this.factor_);
  24490. v_(n, 0, n.length, r, n);
  24491. var i = Nn(n, 0, n.length, r);
  24492. return Wy(new Py(i, this.geometryLayout_), !1, this.adaptOptions(e))
  24493. }, e.prototype.writeFeatureText = function (t, e) {
  24494. var r = t.getGeometry();
  24495. return r ? this.writeGeometryText(r, e) : (pt(!1, 40), "")
  24496. }, e.prototype.writeFeaturesText = function (t, e) {
  24497. return this.writeFeatureText(t[0], e)
  24498. }, e.prototype.writeGeometryText = function (t, e) {
  24499. var r = (t = Wy(t, !0, this.adaptOptions(e))).getFlatCoordinates(), n = t.getStride();
  24500. return v_(r, 0, r.length, n, r), LS(r, n, this.factor_)
  24501. }, e
  24502. }(Jb), US = function () {
  24503. var t = function (e, r) {
  24504. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24505. t.__proto__ = e
  24506. } || function (t, e) {
  24507. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24508. })(e, r)
  24509. };
  24510. return function (e, r) {
  24511. function n() {
  24512. this.constructor = e
  24513. }
  24514. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24515. }
  24516. }(), BS = function (t) {
  24517. function e(e) {
  24518. var r = t.call(this) || this, n = e || {};
  24519. return r.layerName_ = n.layerName, r.layers_ = n.layers ? n.layers : null, r.dataProjection = Gr(n.dataProjection ? n.dataProjection : "EPSG:4326"), r
  24520. }
  24521. return US(e, t), e.prototype.readFeaturesFromObject = function (t, e) {
  24522. if ("Topology" == t.type) {
  24523. var r = t, n = void 0, i = null, o = null;
  24524. r.transform && (i = (n = r.transform).scale, o = n.translate);
  24525. var a = r.arcs;
  24526. n && function (t, e, r) {
  24527. for (var n = 0, i = t.length; n < i; ++n) XS(t[n], e, r)
  24528. }(a, i, o);
  24529. var s = [], l = r.objects, u = this.layerName_, c = void 0;
  24530. for (var h in l) this.layers_ && -1 == this.layers_.indexOf(h) || ("GeometryCollection" === l[h].type ? (c = l[h], s.push.apply(s, WS(c, a, i, o, u, h, e))) : (c = l[h], s.push(qS(c, a, i, o, u, h, e))));
  24531. return s
  24532. }
  24533. return []
  24534. }, e.prototype.readProjectionFromObject = function (t) {
  24535. return this.dataProjection
  24536. }, e
  24537. }(qm), VS = {
  24538. Point: function (t, e, r) {
  24539. var n = t.coordinates;
  24540. e && r && ZS(n, e, r);
  24541. return new qn(n)
  24542. }, LineString: function (t, e) {
  24543. var r = YS(t.arcs, e);
  24544. return new Py(r)
  24545. }, Polygon: function (t, e) {
  24546. for (var r = [], n = 0, i = t.arcs.length; n < i; ++n) r[n] = YS(t.arcs[n], e);
  24547. return new fi(r)
  24548. }, MultiPoint: function (t, e, r) {
  24549. var n = t.coordinates;
  24550. if (e && r) for (var i = 0, o = n.length; i < o; ++i) ZS(n[i], e, r);
  24551. return new Hy(n)
  24552. }, MultiLineString: function (t, e) {
  24553. for (var r = [], n = 0, i = t.arcs.length; n < i; ++n) r[n] = YS(t.arcs[n], e);
  24554. return new Zy(r)
  24555. }, MultiPolygon: function (t, e) {
  24556. for (var r = [], n = 0, i = t.arcs.length; n < i; ++n) {
  24557. for (var o = t.arcs[n], a = [], s = 0, l = o.length; s < l; ++s) a[s] = YS(o[s], e);
  24558. r[n] = a
  24559. }
  24560. return new Jy(r)
  24561. }
  24562. };
  24563. function YS(t, e) {
  24564. for (var r, n, i = [], o = 0, a = t.length; o < a; ++o) r = t[o], o > 0 && i.pop(), n = r >= 0 ? e[r] : e[~r].slice().reverse(), i.push.apply(i, n);
  24565. for (var s = 0, l = i.length; s < l; ++s) i[s] = i[s].slice();
  24566. return i
  24567. }
  24568. function WS(t, e, r, n, i, o, a) {
  24569. for (var s = t.geometries, l = [], u = 0, c = s.length; u < c; ++u) l[u] = qS(s[u], e, r, n, i, o, a);
  24570. return l
  24571. }
  24572. function qS(t, e, r, n, i, o, a) {
  24573. var s, l = t.type, u = VS[l];
  24574. s = "Point" === l || "MultiPoint" === l ? u(t, r, n) : u(t, e);
  24575. var c = new gt;
  24576. c.setGeometry(Wy(s, !1, a)), void 0 !== t.id && c.setId(t.id);
  24577. var h = t.properties;
  24578. return i && (h || (h = {}), h[i] = o), h && c.setProperties(h, !0), c
  24579. }
  24580. function XS(t, e, r) {
  24581. for (var n = 0, i = 0, o = 0, a = t.length; o < a; ++o) {
  24582. var s = t[o];
  24583. n += s[0], i += s[1], s[0] = n, s[1] = i, ZS(s, e, r)
  24584. }
  24585. }
  24586. function ZS(t, e, r) {
  24587. t[0] = t[0] * e[0] + r[0], t[1] = t[1] * e[1] + r[1]
  24588. }
  24589. var KS = BS, HS = function () {
  24590. function t(t) {
  24591. this.tagName_ = t
  24592. }
  24593. return t.prototype.getTagName = function () {
  24594. return this.tagName_
  24595. }, t
  24596. }(), $S = function () {
  24597. var t = function (e, r) {
  24598. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24599. t.__proto__ = e
  24600. } || function (t, e) {
  24601. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24602. })(e, r)
  24603. };
  24604. return function (e, r) {
  24605. function n() {
  24606. this.constructor = e
  24607. }
  24608. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24609. }
  24610. }(), JS = function (t) {
  24611. function e(e, r) {
  24612. var n = t.call(this, e) || this;
  24613. return n.conditions = r, pt(n.conditions.length >= 2, 57), n
  24614. }
  24615. return $S(e, t), e
  24616. }(HS), QS = function () {
  24617. var t = function (e, r) {
  24618. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24619. t.__proto__ = e
  24620. } || function (t, e) {
  24621. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24622. })(e, r)
  24623. };
  24624. return function (e, r) {
  24625. function n() {
  24626. this.constructor = e
  24627. }
  24628. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24629. }
  24630. }(), tE = function (t) {
  24631. function e(e) {
  24632. return t.call(this, "And", Array.prototype.slice.call(arguments)) || this
  24633. }
  24634. return QS(e, t), e
  24635. }(JS), eE = function () {
  24636. var t = function (e, r) {
  24637. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24638. t.__proto__ = e
  24639. } || function (t, e) {
  24640. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24641. })(e, r)
  24642. };
  24643. return function (e, r) {
  24644. function n() {
  24645. this.constructor = e
  24646. }
  24647. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24648. }
  24649. }(), rE = function (t) {
  24650. function e(e, r, n) {
  24651. var i = t.call(this, "BBOX") || this;
  24652. if (i.geometryName = e, i.extent = r, 4 !== r.length) throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");
  24653. return i.srsName = n, i
  24654. }
  24655. return eE(e, t), e
  24656. }(HS), nE = function () {
  24657. var t = function (e, r) {
  24658. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24659. t.__proto__ = e
  24660. } || function (t, e) {
  24661. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24662. })(e, r)
  24663. };
  24664. return function (e, r) {
  24665. function n() {
  24666. this.constructor = e
  24667. }
  24668. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24669. }
  24670. }(), iE = function (t) {
  24671. function e(e, r, n, i) {
  24672. var o = t.call(this, e) || this;
  24673. return o.geometryName = r || "the_geom", o.geometry = n, o.srsName = i, o
  24674. }
  24675. return nE(e, t), e
  24676. }(HS), oE = function () {
  24677. var t = function (e, r) {
  24678. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24679. t.__proto__ = e
  24680. } || function (t, e) {
  24681. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24682. })(e, r)
  24683. };
  24684. return function (e, r) {
  24685. function n() {
  24686. this.constructor = e
  24687. }
  24688. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24689. }
  24690. }(), aE = function (t) {
  24691. function e(e, r, n) {
  24692. return t.call(this, "Contains", e, r, n) || this
  24693. }
  24694. return oE(e, t), e
  24695. }(iE), sE = function () {
  24696. var t = function (e, r) {
  24697. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24698. t.__proto__ = e
  24699. } || function (t, e) {
  24700. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24701. })(e, r)
  24702. };
  24703. return function (e, r) {
  24704. function n() {
  24705. this.constructor = e
  24706. }
  24707. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24708. }
  24709. }(), lE = function (t) {
  24710. function e(e, r, n, i, o) {
  24711. var a = t.call(this, "DWithin", e, r, o) || this;
  24712. return a.distance = n, a.unit = i, a
  24713. }
  24714. return sE(e, t), e
  24715. }(iE), uE = function () {
  24716. var t = function (e, r) {
  24717. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24718. t.__proto__ = e
  24719. } || function (t, e) {
  24720. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24721. })(e, r)
  24722. };
  24723. return function (e, r) {
  24724. function n() {
  24725. this.constructor = e
  24726. }
  24727. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24728. }
  24729. }(), cE = function (t) {
  24730. function e(e, r, n) {
  24731. return t.call(this, "Disjoint", e, r, n) || this
  24732. }
  24733. return uE(e, t), e
  24734. }(iE), hE = function () {
  24735. var t = function (e, r) {
  24736. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24737. t.__proto__ = e
  24738. } || function (t, e) {
  24739. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24740. })(e, r)
  24741. };
  24742. return function (e, r) {
  24743. function n() {
  24744. this.constructor = e
  24745. }
  24746. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24747. }
  24748. }(), pE = function (t) {
  24749. function e(e, r) {
  24750. var n = t.call(this, e) || this;
  24751. return n.propertyName = r, n
  24752. }
  24753. return hE(e, t), e
  24754. }(HS), fE = function () {
  24755. var t = function (e, r) {
  24756. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24757. t.__proto__ = e
  24758. } || function (t, e) {
  24759. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24760. })(e, r)
  24761. };
  24762. return function (e, r) {
  24763. function n() {
  24764. this.constructor = e
  24765. }
  24766. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24767. }
  24768. }(), dE = function (t) {
  24769. function e(e, r, n) {
  24770. var i = t.call(this, "During", e) || this;
  24771. return i.begin = r, i.end = n, i
  24772. }
  24773. return fE(e, t), e
  24774. }(pE), gE = function () {
  24775. var t = function (e, r) {
  24776. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24777. t.__proto__ = e
  24778. } || function (t, e) {
  24779. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24780. })(e, r)
  24781. };
  24782. return function (e, r) {
  24783. function n() {
  24784. this.constructor = e
  24785. }
  24786. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24787. }
  24788. }(), yE = function (t) {
  24789. function e(e, r, n, i) {
  24790. var o = t.call(this, e, r) || this;
  24791. return o.expression = n, o.matchCase = i, o
  24792. }
  24793. return gE(e, t), e
  24794. }(pE), mE = function () {
  24795. var t = function (e, r) {
  24796. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24797. t.__proto__ = e
  24798. } || function (t, e) {
  24799. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24800. })(e, r)
  24801. };
  24802. return function (e, r) {
  24803. function n() {
  24804. this.constructor = e
  24805. }
  24806. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24807. }
  24808. }(), vE = function (t) {
  24809. function e(e, r, n) {
  24810. return t.call(this, "PropertyIsEqualTo", e, r, n) || this
  24811. }
  24812. return mE(e, t), e
  24813. }(yE), _E = function () {
  24814. var t = function (e, r) {
  24815. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24816. t.__proto__ = e
  24817. } || function (t, e) {
  24818. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24819. })(e, r)
  24820. };
  24821. return function (e, r) {
  24822. function n() {
  24823. this.constructor = e
  24824. }
  24825. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24826. }
  24827. }(), bE = function (t) {
  24828. function e(e, r) {
  24829. return t.call(this, "PropertyIsGreaterThan", e, r) || this
  24830. }
  24831. return _E(e, t), e
  24832. }(yE), xE = function () {
  24833. var t = function (e, r) {
  24834. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24835. t.__proto__ = e
  24836. } || function (t, e) {
  24837. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24838. })(e, r)
  24839. };
  24840. return function (e, r) {
  24841. function n() {
  24842. this.constructor = e
  24843. }
  24844. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24845. }
  24846. }(), wE = function (t) {
  24847. function e(e, r) {
  24848. return t.call(this, "PropertyIsGreaterThanOrEqualTo", e, r) || this
  24849. }
  24850. return xE(e, t), e
  24851. }(yE), SE = function () {
  24852. var t = function (e, r) {
  24853. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24854. t.__proto__ = e
  24855. } || function (t, e) {
  24856. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24857. })(e, r)
  24858. };
  24859. return function (e, r) {
  24860. function n() {
  24861. this.constructor = e
  24862. }
  24863. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24864. }
  24865. }(), EE = function (t) {
  24866. function e(e, r, n) {
  24867. return t.call(this, "Intersects", e, r, n) || this
  24868. }
  24869. return SE(e, t), e
  24870. }(iE), TE = function () {
  24871. var t = function (e, r) {
  24872. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24873. t.__proto__ = e
  24874. } || function (t, e) {
  24875. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24876. })(e, r)
  24877. };
  24878. return function (e, r) {
  24879. function n() {
  24880. this.constructor = e
  24881. }
  24882. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24883. }
  24884. }(), CE = function (t) {
  24885. function e(e, r, n) {
  24886. var i = t.call(this, "PropertyIsBetween", e) || this;
  24887. return i.lowerBoundary = r, i.upperBoundary = n, i
  24888. }
  24889. return TE(e, t), e
  24890. }(pE), OE = function () {
  24891. var t = function (e, r) {
  24892. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24893. t.__proto__ = e
  24894. } || function (t, e) {
  24895. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24896. })(e, r)
  24897. };
  24898. return function (e, r) {
  24899. function n() {
  24900. this.constructor = e
  24901. }
  24902. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24903. }
  24904. }(), PE = function (t) {
  24905. function e(e, r, n, i, o, a) {
  24906. var s = t.call(this, "PropertyIsLike", e) || this;
  24907. return s.pattern = r, s.wildCard = void 0 !== n ? n : "*", s.singleChar = void 0 !== i ? i : ".", s.escapeChar = void 0 !== o ? o : "!", s.matchCase = a, s
  24908. }
  24909. return OE(e, t), e
  24910. }(pE), RE = function () {
  24911. var t = function (e, r) {
  24912. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24913. t.__proto__ = e
  24914. } || function (t, e) {
  24915. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24916. })(e, r)
  24917. };
  24918. return function (e, r) {
  24919. function n() {
  24920. this.constructor = e
  24921. }
  24922. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24923. }
  24924. }(), IE = function (t) {
  24925. function e(e) {
  24926. return t.call(this, "PropertyIsNull", e) || this
  24927. }
  24928. return RE(e, t), e
  24929. }(pE), LE = function () {
  24930. var t = function (e, r) {
  24931. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24932. t.__proto__ = e
  24933. } || function (t, e) {
  24934. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24935. })(e, r)
  24936. };
  24937. return function (e, r) {
  24938. function n() {
  24939. this.constructor = e
  24940. }
  24941. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24942. }
  24943. }(), ME = function (t) {
  24944. function e(e, r) {
  24945. return t.call(this, "PropertyIsLessThan", e, r) || this
  24946. }
  24947. return LE(e, t), e
  24948. }(yE), FE = function () {
  24949. var t = function (e, r) {
  24950. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24951. t.__proto__ = e
  24952. } || function (t, e) {
  24953. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24954. })(e, r)
  24955. };
  24956. return function (e, r) {
  24957. function n() {
  24958. this.constructor = e
  24959. }
  24960. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24961. }
  24962. }(), AE = function (t) {
  24963. function e(e, r) {
  24964. return t.call(this, "PropertyIsLessThanOrEqualTo", e, r) || this
  24965. }
  24966. return FE(e, t), e
  24967. }(yE), kE = function () {
  24968. var t = function (e, r) {
  24969. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24970. t.__proto__ = e
  24971. } || function (t, e) {
  24972. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24973. })(e, r)
  24974. };
  24975. return function (e, r) {
  24976. function n() {
  24977. this.constructor = e
  24978. }
  24979. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  24980. }
  24981. }(), jE = function (t) {
  24982. function e(e) {
  24983. var r = t.call(this, "Not") || this;
  24984. return r.condition = e, r
  24985. }
  24986. return kE(e, t), e
  24987. }(HS), NE = function () {
  24988. var t = function (e, r) {
  24989. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  24990. t.__proto__ = e
  24991. } || function (t, e) {
  24992. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  24993. })(e, r)
  24994. };
  24995. return function (e, r) {
  24996. function n() {
  24997. this.constructor = e
  24998. }
  24999. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25000. }
  25001. }(), DE = function (t) {
  25002. function e(e, r, n) {
  25003. return t.call(this, "PropertyIsNotEqualTo", e, r, n) || this
  25004. }
  25005. return NE(e, t), e
  25006. }(yE), GE = function () {
  25007. var t = function (e, r) {
  25008. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25009. t.__proto__ = e
  25010. } || function (t, e) {
  25011. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25012. })(e, r)
  25013. };
  25014. return function (e, r) {
  25015. function n() {
  25016. this.constructor = e
  25017. }
  25018. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25019. }
  25020. }(), zE = function (t) {
  25021. function e(e) {
  25022. return t.call(this, "Or", Array.prototype.slice.call(arguments)) || this
  25023. }
  25024. return GE(e, t), e
  25025. }(JS), UE = function () {
  25026. var t = function (e, r) {
  25027. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25028. t.__proto__ = e
  25029. } || function (t, e) {
  25030. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25031. })(e, r)
  25032. };
  25033. return function (e, r) {
  25034. function n() {
  25035. this.constructor = e
  25036. }
  25037. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25038. }
  25039. }(), BE = function (t) {
  25040. function e(e) {
  25041. var r = t.call(this, "ResourceId") || this;
  25042. return r.rid = e, r
  25043. }
  25044. return UE(e, t), e
  25045. }(HS), VE = function () {
  25046. var t = function (e, r) {
  25047. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25048. t.__proto__ = e
  25049. } || function (t, e) {
  25050. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25051. })(e, r)
  25052. };
  25053. return function (e, r) {
  25054. function n() {
  25055. this.constructor = e
  25056. }
  25057. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25058. }
  25059. }(), YE = function (t) {
  25060. function e(e, r, n) {
  25061. return t.call(this, "Within", e, r, n) || this
  25062. }
  25063. return VE(e, t), e
  25064. }(iE);
  25065. function WE(t) {
  25066. var e = [null].concat(Array.prototype.slice.call(arguments));
  25067. return new (Function.prototype.bind.apply(tE, e))
  25068. }
  25069. function qE(t, e, r) {
  25070. return new rE(t, e, r)
  25071. }
  25072. var XE = function () {
  25073. var t = function (e, r) {
  25074. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25075. t.__proto__ = e
  25076. } || function (t, e) {
  25077. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25078. })(e, r)
  25079. };
  25080. return function (e, r) {
  25081. function n() {
  25082. this.constructor = e
  25083. }
  25084. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25085. }
  25086. }(), ZE = {
  25087. "http://www.opengis.net/gml": {boundedBy: Fc(F_.prototype.readGeometryElement, "bounds")},
  25088. "http://www.opengis.net/wfs/2.0": {member: Ic(F_.prototype.readFeaturesInternal)}
  25089. }, KE = {
  25090. "http://www.opengis.net/wfs": {totalInserted: Fc(G_), totalUpdated: Fc(G_), totalDeleted: Fc(G_)},
  25091. "http://www.opengis.net/wfs/2.0": {totalInserted: Fc(G_), totalUpdated: Fc(G_), totalDeleted: Fc(G_)}
  25092. }, HE = {
  25093. "http://www.opengis.net/wfs": {
  25094. TransactionSummary: Fc(sT, "transactionSummary"),
  25095. InsertResults: Fc(hT, "insertIds")
  25096. },
  25097. "http://www.opengis.net/wfs/2.0": {
  25098. TransactionSummary: Fc(sT, "transactionSummary"),
  25099. InsertResults: Fc(hT, "insertIds")
  25100. }
  25101. }, $E = {
  25102. "http://www.opengis.net/wfs": {PropertyName: Ac(X_)},
  25103. "http://www.opengis.net/wfs/2.0": {PropertyName: Ac(X_)}
  25104. }, JE = {
  25105. "http://www.opengis.net/wfs": {
  25106. Insert: Ac(pT),
  25107. Update: Ac(yT),
  25108. Delete: Ac(gT),
  25109. Property: Ac(mT),
  25110. Native: Ac(vT)
  25111. },
  25112. "http://www.opengis.net/wfs/2.0": {
  25113. Insert: Ac(pT),
  25114. Update: Ac(yT),
  25115. Delete: Ac(gT),
  25116. Property: Ac(mT),
  25117. Native: Ac(vT)
  25118. }
  25119. }, QE = "http://www.w3.org/2000/xmlns/", tT = {
  25120. "2.0.0": "http://www.opengis.net/ogc/1.1",
  25121. "1.1.0": "http://www.opengis.net/ogc",
  25122. "1.0.0": "http://www.opengis.net/ogc"
  25123. }, eT = {
  25124. "2.0.0": "http://www.opengis.net/wfs/2.0",
  25125. "1.1.0": "http://www.opengis.net/wfs",
  25126. "1.0.0": "http://www.opengis.net/wfs"
  25127. }, rT = {
  25128. "2.0.0": "http://www.opengis.net/fes/2.0",
  25129. "1.1.0": "http://www.opengis.net/fes",
  25130. "1.0.0": "http://www.opengis.net/fes"
  25131. }, nT = {
  25132. "2.0.0": "http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd",
  25133. "1.1.0": "http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd",
  25134. "1.0.0": "http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"
  25135. }, iT = {"2.0.0": ab, "1.1.0": eb, "1.0.0": $_}, oT = function (t) {
  25136. function e(e) {
  25137. var r = t.call(this) || this, n = e || {};
  25138. return r.version_ = n.version ? n.version : "1.1.0", r.featureType_ = n.featureType, r.featureNS_ = n.featureNS, r.gmlFormat_ = n.gmlFormat ? n.gmlFormat : new iT[r.version_], r.schemaLocation_ = n.schemaLocation ? n.schemaLocation : nT[r.version_], r
  25139. }
  25140. return XE(e, t), e.prototype.getFeatureType = function () {
  25141. return this.featureType_
  25142. }, e.prototype.setFeatureType = function (t) {
  25143. this.featureType_ = t
  25144. }, e.prototype.readFeaturesFromNode = function (t, e) {
  25145. var r = {node: t};
  25146. O(r, {featureType: this.featureType_, featureNS: this.featureNS_}), O(r, this.getReadOptions(t, e || {}));
  25147. var n = [r],
  25148. i = Uc([], "2.0.0" === this.version_ ? ZE : this.gmlFormat_.FEATURE_COLLECTION_PARSERS, t, n, this.gmlFormat_);
  25149. return i || (i = []), i
  25150. }, e.prototype.readTransactionResponse = function (t) {
  25151. if (t) {
  25152. if ("string" == typeof t) {
  25153. var e = Pc(t);
  25154. return this.readTransactionResponseFromDocument(e)
  25155. }
  25156. return Cc(t) ? this.readTransactionResponseFromDocument(t) : this.readTransactionResponseFromNode(t)
  25157. }
  25158. }, e.prototype.readFeatureCollectionMetadata = function (t) {
  25159. if (t) {
  25160. if ("string" == typeof t) {
  25161. var e = Pc(t);
  25162. return this.readFeatureCollectionMetadataFromDocument(e)
  25163. }
  25164. return Cc(t) ? this.readFeatureCollectionMetadataFromDocument(t) : this.readFeatureCollectionMetadataFromNode(t)
  25165. }
  25166. }, e.prototype.readFeatureCollectionMetadataFromDocument = function (t) {
  25167. for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readFeatureCollectionMetadataFromNode(e)
  25168. }, e.prototype.readFeatureCollectionMetadataFromNode = function (t) {
  25169. var e = {}, r = z_(t.getAttribute("numberOfFeatures"));
  25170. return e.numberOfFeatures = r, Uc(e, ZE, t, [], this.gmlFormat_)
  25171. }, e.prototype.readTransactionResponseFromDocument = function (t) {
  25172. for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readTransactionResponseFromNode(e)
  25173. }, e.prototype.readTransactionResponseFromNode = function (t) {
  25174. return Uc({}, HE, t, [])
  25175. }, e.prototype.writeGetFeature = function (t) {
  25176. var e = this, r = Sc(eT[this.version_], "GetFeature");
  25177. r.setAttribute("service", "WFS"), r.setAttribute("version", this.version_), t.handle && r.setAttribute("handle", t.handle), t.outputFormat && r.setAttribute("outputFormat", t.outputFormat), void 0 !== t.maxFeatures && r.setAttribute("maxFeatures", String(t.maxFeatures)), t.resultType && r.setAttribute("resultType", t.resultType), void 0 !== t.startIndex && r.setAttribute("startIndex", String(t.startIndex)), void 0 !== t.count && r.setAttribute("count", String(t.count)), void 0 !== t.viewParams && r.setAttribute("viewParams", t.viewParams), r.setAttributeNS(wc, "xsi:schemaLocation", this.schemaLocation_);
  25178. var n = {node: r};
  25179. if (O(n, {
  25180. version: this.version_,
  25181. srsName: t.srsName,
  25182. featureNS: t.featureNS ? t.featureNS : this.featureNS_,
  25183. featurePrefix: t.featurePrefix,
  25184. propertyNames: t.propertyNames ? t.propertyNames : []
  25185. }), pt(Array.isArray(t.featureTypes), 11), "string" == typeof t.featureTypes[0]) {
  25186. var i = t.filter;
  25187. t.bbox && (pt(t.geometryName, 12), i = this.combineBboxAndFilter(t.geometryName, t.bbox, t.srsName, i)), O(n, {
  25188. geometryName: t.geometryName,
  25189. filter: i
  25190. }), jT(r, t.featureTypes, [n])
  25191. } else t.featureTypes.forEach((function (i) {
  25192. var o = e.combineBboxAndFilter(i.geometryName, i.bbox, t.srsName, t.filter);
  25193. O(n, {geometryName: i.geometryName, filter: o}), jT(r, [i.name], [n])
  25194. }));
  25195. return r
  25196. }, e.prototype.combineBboxAndFilter = function (t, e, r, n) {
  25197. var i = qE(t, e, r);
  25198. return n ? WE(n, i) : i
  25199. }, e.prototype.writeTransaction = function (t, e, r, n) {
  25200. var i, o = [], a = n.version ? n.version : this.version_, s = Sc(eT[a], "Transaction");
  25201. s.setAttribute("service", "WFS"), s.setAttribute("version", a), n && (i = n.gmlOptions ? n.gmlOptions : {}, n.handle && s.setAttribute("handle", n.handle)), s.setAttributeNS(wc, "xsi:schemaLocation", nT[a]);
  25202. var l = function (t, e, r, n) {
  25203. var i, o = n.featurePrefix ? n.featurePrefix : "feature";
  25204. "1.0.0" === r ? i = 2 : "1.1.0" === r ? i = 3 : "2.0.0" === r && (i = 3.2);
  25205. return O({node: t}, {
  25206. version: r,
  25207. featureNS: n.featureNS,
  25208. featureType: n.featureType,
  25209. featurePrefix: o,
  25210. gmlVersion: i,
  25211. hasZ: n.hasZ,
  25212. srsName: n.srsName
  25213. }, e)
  25214. }(s, i, a, n);
  25215. return t && aT("Insert", t, o, l), e && aT("Update", e, o, l), r && aT("Delete", r, o, l), n.nativeElements && aT("Native", n.nativeElements, o, l), s
  25216. }, e.prototype.readProjectionFromDocument = function (t) {
  25217. for (var e = t.firstChild; e; e = e.nextSibling) if (e.nodeType == Node.ELEMENT_NODE) return this.readProjectionFromNode(e);
  25218. return null
  25219. }, e.prototype.readProjectionFromNode = function (t) {
  25220. if (t.firstElementChild && t.firstElementChild.firstElementChild) for (var e = (t = t.firstElementChild.firstElementChild).firstElementChild; e; e = e.nextElementSibling) if (0 !== e.childNodes.length && (1 !== e.childNodes.length || 3 !== e.firstChild.nodeType)) {
  25221. var r = [{}];
  25222. return this.gmlFormat_.readGeometryElement(e, r), Gr(r.pop().srsName)
  25223. }
  25224. return null
  25225. }, e
  25226. }(P_);
  25227. function aT(t, e, r, n) {
  25228. Vc(n, JE, jc(t), e, r)
  25229. }
  25230. function sT(t, e) {
  25231. return Uc({}, KE, t, e)
  25232. }
  25233. var lT = {
  25234. "http://www.opengis.net/ogc": {
  25235. FeatureId: Ic((function (t, e) {
  25236. return t.getAttribute("fid")
  25237. }))
  25238. }, "http://www.opengis.net/ogc/1.1": {
  25239. FeatureId: Ic((function (t, e) {
  25240. return t.getAttribute("fid")
  25241. }))
  25242. }
  25243. };
  25244. function uT(t, e) {
  25245. zc(lT, t, e)
  25246. }
  25247. var cT = {"http://www.opengis.net/wfs": {Feature: uT}, "http://www.opengis.net/wfs/2.0": {Feature: uT}};
  25248. function hT(t, e) {
  25249. return Uc([], cT, t, e)
  25250. }
  25251. function pT(t, e, r) {
  25252. var n = r[r.length - 1], i = n.featureType, o = n.featureNS, a = n.gmlVersion, s = Sc(o, i);
  25253. t.appendChild(s), 2 === a ? $_.prototype.writeFeatureElement(s, e, r) : 3 === a ? eb.prototype.writeFeatureElement(s, e, r) : ab.prototype.writeFeatureElement(s, e, r)
  25254. }
  25255. function fT(t, e, r) {
  25256. var n = r[r.length - 1].version, i = tT[n], o = Sc(i, "Filter"), a = Sc(i, "FeatureId");
  25257. o.appendChild(a), a.setAttribute("fid", e), t.appendChild(o)
  25258. }
  25259. function dT(t, e) {
  25260. var r = (t = t || "feature") + ":";
  25261. return 0 === e.indexOf(r) ? e : r + e
  25262. }
  25263. function gT(t, e, r) {
  25264. var n = r[r.length - 1];
  25265. pt(void 0 !== e.getId(), 26);
  25266. var i = n.featureType, o = n.featurePrefix, a = n.featureNS, s = dT(o, i);
  25267. t.setAttribute("typeName", s), t.setAttributeNS(QE, "xmlns:" + o, a);
  25268. var l = e.getId();
  25269. void 0 !== l && fT(t, l, r)
  25270. }
  25271. function yT(t, e, r) {
  25272. var n = r[r.length - 1];
  25273. pt(void 0 !== e.getId(), 27);
  25274. var i = n.version, o = n.featureType, a = n.featurePrefix, s = n.featureNS, l = dT(a, o), u = e.getGeometryName();
  25275. t.setAttribute("typeName", l), t.setAttributeNS(QE, "xmlns:" + a, s);
  25276. var c = e.getId();
  25277. if (void 0 !== c) {
  25278. for (var h = e.getKeys(), p = [], f = 0, d = h.length; f < d; f++) {
  25279. var g = e.get(h[f]);
  25280. if (void 0 !== g) {
  25281. var y = h[f];
  25282. g && "function" == typeof g.getSimplifiedGeometry && (y = u), p.push({name: y, value: g})
  25283. }
  25284. }
  25285. Vc({
  25286. version: i,
  25287. gmlVersion: n.gmlVersion,
  25288. node: t,
  25289. hasZ: n.hasZ,
  25290. srsName: n.srsName
  25291. }, JE, jc("Property"), p, r), fT(t, c, r)
  25292. }
  25293. }
  25294. function mT(t, e, r) {
  25295. var n = r[r.length - 1], i = n.version, o = eT[i], a = Sc(o, "Name"), s = n.gmlVersion;
  25296. if (t.appendChild(a), X_(a, e.name), void 0 !== e.value && null !== e.value) {
  25297. var l = Sc(o, "Value");
  25298. t.appendChild(l), e.value && "function" == typeof e.value.getSimplifiedGeometry ? 2 === s ? $_.prototype.writeGeometryElement(l, e.value, r) : 3 === s ? eb.prototype.writeGeometryElement(l, e.value, r) : ab.prototype.writeGeometryElement(l, e.value, r) : X_(l, e.value)
  25299. }
  25300. }
  25301. function vT(t, e, r) {
  25302. e.vendorId && t.setAttribute("vendorId", e.vendorId), void 0 !== e.safeToIgnore && t.setAttribute("safeToIgnore", String(e.safeToIgnore)), void 0 !== e.value && X_(t, e.value)
  25303. }
  25304. var _T = {
  25305. "http://www.opengis.net/wfs": {Query: Ac(bT)},
  25306. "http://www.opengis.net/wfs/2.0": {Query: Ac(bT)},
  25307. "http://www.opengis.net/ogc": {
  25308. During: Ac(TT),
  25309. And: Ac(CT),
  25310. Or: Ac(CT),
  25311. Not: Ac(OT),
  25312. BBOX: Ac(wT),
  25313. Contains: Ac(ST),
  25314. Intersects: Ac(ST),
  25315. Within: Ac(ST),
  25316. DWithin: Ac(ET),
  25317. PropertyIsEqualTo: Ac(PT),
  25318. PropertyIsNotEqualTo: Ac(PT),
  25319. PropertyIsLessThan: Ac(PT),
  25320. PropertyIsLessThanOrEqualTo: Ac(PT),
  25321. PropertyIsGreaterThan: Ac(PT),
  25322. PropertyIsGreaterThanOrEqualTo: Ac(PT),
  25323. PropertyIsNull: Ac(RT),
  25324. PropertyIsBetween: Ac(IT),
  25325. PropertyIsLike: Ac(LT)
  25326. },
  25327. "http://www.opengis.net/fes/2.0": {
  25328. During: Ac(TT),
  25329. And: Ac(CT),
  25330. Or: Ac(CT),
  25331. Not: Ac(OT),
  25332. BBOX: Ac(wT),
  25333. Contains: Ac(ST),
  25334. Disjoint: Ac(ST),
  25335. Intersects: Ac(ST),
  25336. ResourceId: Ac((function (t, e, r) {
  25337. t.setAttribute("rid", e.rid)
  25338. })),
  25339. Within: Ac(ST),
  25340. DWithin: Ac(ET),
  25341. PropertyIsEqualTo: Ac(PT),
  25342. PropertyIsNotEqualTo: Ac(PT),
  25343. PropertyIsLessThan: Ac(PT),
  25344. PropertyIsLessThanOrEqualTo: Ac(PT),
  25345. PropertyIsGreaterThan: Ac(PT),
  25346. PropertyIsGreaterThanOrEqualTo: Ac(PT),
  25347. PropertyIsNull: Ac(RT),
  25348. PropertyIsBetween: Ac(IT),
  25349. PropertyIsLike: Ac(LT)
  25350. }
  25351. };
  25352. function bT(t, e, r) {
  25353. var n, i, o = r[r.length - 1], a = o.version, s = o.featurePrefix, l = o.featureNS, u = o.propertyNames,
  25354. c = o.srsName;
  25355. n = s ? dT(s, e) : e, i = "2.0.0" === a ? "typeNames" : "typeName", t.setAttribute(i, n), c && t.setAttribute("srsName", c), l && t.setAttributeNS(QE, "xmlns:" + s, l);
  25356. var h = O({}, o);
  25357. h.node = t, Vc(h, $E, jc("PropertyName"), u, r);
  25358. var p = o.filter;
  25359. if (p) {
  25360. var f = Sc(NT(a), "Filter");
  25361. t.appendChild(f), xT(f, p, r)
  25362. }
  25363. }
  25364. function xT(t, e, r) {
  25365. var n = r[r.length - 1], i = {node: t};
  25366. O(i, {context: n}), Vc(i, _T, jc(e.getTagName()), [e], r)
  25367. }
  25368. function wT(t, e, r) {
  25369. var n = r[r.length - 1], i = n.context.version;
  25370. n.srsName = e.srsName;
  25371. var o = iT[i];
  25372. AT(i, t, e.geometryName), o.prototype.writeGeometryElement(t, e.extent, r)
  25373. }
  25374. function ST(t, e, r) {
  25375. var n = r[r.length - 1], i = n.context.version;
  25376. n.srsName = e.srsName;
  25377. var o = iT[i];
  25378. AT(i, t, e.geometryName), o.prototype.writeGeometryElement(t, e.geometry, r)
  25379. }
  25380. function ET(t, e, r) {
  25381. var n = r[r.length - 1].context.version;
  25382. ST(t, e, r);
  25383. var i = Sc(NT(n), "Distance");
  25384. X_(i, e.distance.toString()), "2.0.0" === n ? i.setAttribute("uom", e.unit) : i.setAttribute("units", e.unit), t.appendChild(i)
  25385. }
  25386. function TT(t, e, r) {
  25387. var n = r[r.length - 1].context.version;
  25388. MT(rT[n], "ValueReference", t, e.propertyName);
  25389. var i = Sc(I_, "TimePeriod");
  25390. t.appendChild(i);
  25391. var o = Sc(I_, "begin");
  25392. i.appendChild(o), kT(o, e.begin);
  25393. var a = Sc(I_, "end");
  25394. i.appendChild(a), kT(a, e.end)
  25395. }
  25396. function CT(t, e, r) {
  25397. var n = r[r.length - 1].context, i = {node: t};
  25398. O(i, {context: n});
  25399. for (var o = e.conditions, a = 0, s = o.length; a < s; ++a) {
  25400. var l = o[a];
  25401. Vc(i, _T, jc(l.getTagName()), [l], r)
  25402. }
  25403. }
  25404. function OT(t, e, r) {
  25405. var n = r[r.length - 1].context, i = {node: t};
  25406. O(i, {context: n});
  25407. var o = e.condition;
  25408. Vc(i, _T, jc(o.getTagName()), [o], r)
  25409. }
  25410. function PT(t, e, r) {
  25411. var n = r[r.length - 1].context.version;
  25412. void 0 !== e.matchCase && t.setAttribute("matchCase", e.matchCase.toString()), AT(n, t, e.propertyName), FT(n, t, "" + e.expression)
  25413. }
  25414. function RT(t, e, r) {
  25415. AT(r[r.length - 1].context.version, t, e.propertyName)
  25416. }
  25417. function IT(t, e, r) {
  25418. var n = r[r.length - 1].context.version, i = NT(n);
  25419. AT(n, t, e.propertyName);
  25420. var o = Sc(i, "LowerBoundary");
  25421. t.appendChild(o), FT(n, o, "" + e.lowerBoundary);
  25422. var a = Sc(i, "UpperBoundary");
  25423. t.appendChild(a), FT(n, a, "" + e.upperBoundary)
  25424. }
  25425. function LT(t, e, r) {
  25426. var n = r[r.length - 1].context.version;
  25427. t.setAttribute("wildCard", e.wildCard), t.setAttribute("singleChar", e.singleChar), t.setAttribute("escapeChar", e.escapeChar), void 0 !== e.matchCase && t.setAttribute("matchCase", e.matchCase.toString()), AT(n, t, e.propertyName), FT(n, t, "" + e.pattern)
  25428. }
  25429. function MT(t, e, r, n) {
  25430. var i = Sc(t, e);
  25431. X_(i, n), r.appendChild(i)
  25432. }
  25433. function FT(t, e, r) {
  25434. MT(NT(t), "Literal", e, r)
  25435. }
  25436. function AT(t, e, r) {
  25437. "2.0.0" === t ? MT(rT[t], "ValueReference", e, r) : MT(tT[t], "PropertyName", e, r)
  25438. }
  25439. function kT(t, e) {
  25440. var r = Sc(I_, "TimeInstant");
  25441. t.appendChild(r);
  25442. var n = Sc(I_, "timePosition");
  25443. r.appendChild(n), X_(n, e)
  25444. }
  25445. function jT(t, e, r) {
  25446. var n = r[r.length - 1], i = O({}, n);
  25447. i.node = t, Vc(i, _T, jc("Query"), e, r)
  25448. }
  25449. function NT(t) {
  25450. return "2.0.0" === t ? rT[t] : tT[t]
  25451. }
  25452. var DT = oT, GT = function () {
  25453. var t = function (e, r) {
  25454. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25455. t.__proto__ = e
  25456. } || function (t, e) {
  25457. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25458. })(e, r)
  25459. };
  25460. return function (e, r) {
  25461. function n() {
  25462. this.constructor = e
  25463. }
  25464. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25465. }
  25466. }(), zT = {POINT: qn, LINESTRING: Py, POLYGON: fi, MULTIPOINT: Hy, MULTILINESTRING: Zy, MULTIPOLYGON: Jy}, UT = 1,
  25467. BT = 2, VT = 3, YT = 4, WT = 5, qT = 6, XT = {};
  25468. for (var ZT in bt) XT[ZT] = bt[ZT].toUpperCase();
  25469. var KT = function () {
  25470. function t(t) {
  25471. this.wkt = t, this.index_ = -1
  25472. }
  25473. return t.prototype.isAlpha_ = function (t) {
  25474. return t >= "a" && t <= "z" || t >= "A" && t <= "Z"
  25475. }, t.prototype.isNumeric_ = function (t, e) {
  25476. return t >= "0" && t <= "9" || "." == t && !(void 0 !== e && e)
  25477. }, t.prototype.isWhiteSpace_ = function (t) {
  25478. return " " == t || "\t" == t || "\r" == t || "\n" == t
  25479. }, t.prototype.nextChar_ = function () {
  25480. return this.wkt.charAt(++this.index_)
  25481. }, t.prototype.nextToken = function () {
  25482. var t, e = this.nextChar_(), r = this.index_, n = e;
  25483. if ("(" == e) t = BT; else if ("," == e) t = WT; else if (")" == e) t = VT; else if (this.isNumeric_(e) || "-" == e) t = YT, n = this.readNumber_(); else if (this.isAlpha_(e)) t = UT, n = this.readText_(); else {
  25484. if (this.isWhiteSpace_(e)) return this.nextToken();
  25485. if ("" !== e) throw new Error("Unexpected character: " + e);
  25486. t = qT
  25487. }
  25488. return {position: r, value: n, type: t}
  25489. }, t.prototype.readNumber_ = function () {
  25490. var t, e = this.index_, r = !1, n = !1;
  25491. do {
  25492. "." == t ? r = !0 : "e" != t && "E" != t || (n = !0), t = this.nextChar_()
  25493. } while (this.isNumeric_(t, r) || !n && ("e" == t || "E" == t) || n && ("-" == t || "+" == t));
  25494. return parseFloat(this.wkt.substring(e, this.index_--))
  25495. }, t.prototype.readText_ = function () {
  25496. var t, e = this.index_;
  25497. do {
  25498. t = this.nextChar_()
  25499. } while (this.isAlpha_(t));
  25500. return this.wkt.substring(e, this.index_--).toUpperCase()
  25501. }, t
  25502. }(), HT = function () {
  25503. function t(t) {
  25504. this.lexer_ = t, this.token_, this.layout_ = yt
  25505. }
  25506. return t.prototype.consume_ = function () {
  25507. this.token_ = this.lexer_.nextToken()
  25508. }, t.prototype.isTokenType = function (t) {
  25509. return this.token_.type == t
  25510. }, t.prototype.match = function (t) {
  25511. var e = this.isTokenType(t);
  25512. return e && this.consume_(), e
  25513. }, t.prototype.parse = function () {
  25514. return this.consume_(), this.parseGeometry_()
  25515. }, t.prototype.parseGeometryLayout_ = function () {
  25516. var t = yt, e = this.token_;
  25517. if (this.isTokenType(UT)) {
  25518. var r = e.value;
  25519. "Z" === r ? t = mt : "M" === r ? t = vt : "ZM" === r && (t = _t), t !== yt && this.consume_()
  25520. }
  25521. return t
  25522. }, t.prototype.parseGeometryCollectionText_ = function () {
  25523. if (this.match(BT)) {
  25524. var t = [];
  25525. do {
  25526. t.push(this.parseGeometry_())
  25527. } while (this.match(WT));
  25528. if (this.match(VT)) return t
  25529. } else if (this.isEmptyGeometry_()) return [];
  25530. throw new Error(this.formatErrorMessage_())
  25531. }, t.prototype.parsePointText_ = function () {
  25532. if (this.match(BT)) {
  25533. var t = this.parsePoint_();
  25534. if (this.match(VT)) return t
  25535. } else if (this.isEmptyGeometry_()) return null;
  25536. throw new Error(this.formatErrorMessage_())
  25537. }, t.prototype.parseLineStringText_ = function () {
  25538. if (this.match(BT)) {
  25539. var t = this.parsePointList_();
  25540. if (this.match(VT)) return t
  25541. } else if (this.isEmptyGeometry_()) return [];
  25542. throw new Error(this.formatErrorMessage_())
  25543. }, t.prototype.parsePolygonText_ = function () {
  25544. if (this.match(BT)) {
  25545. var t = this.parseLineStringTextList_();
  25546. if (this.match(VT)) return t
  25547. } else if (this.isEmptyGeometry_()) return [];
  25548. throw new Error(this.formatErrorMessage_())
  25549. }, t.prototype.parseMultiPointText_ = function () {
  25550. if (this.match(BT)) {
  25551. var t = void 0;
  25552. if (t = this.token_.type == BT ? this.parsePointTextList_() : this.parsePointList_(), this.match(VT)) return t
  25553. } else if (this.isEmptyGeometry_()) return [];
  25554. throw new Error(this.formatErrorMessage_())
  25555. }, t.prototype.parseMultiLineStringText_ = function () {
  25556. if (this.match(BT)) {
  25557. var t = this.parseLineStringTextList_();
  25558. if (this.match(VT)) return t
  25559. } else if (this.isEmptyGeometry_()) return [];
  25560. throw new Error(this.formatErrorMessage_())
  25561. }, t.prototype.parseMultiPolygonText_ = function () {
  25562. if (this.match(BT)) {
  25563. var t = this.parsePolygonTextList_();
  25564. if (this.match(VT)) return t
  25565. } else if (this.isEmptyGeometry_()) return [];
  25566. throw new Error(this.formatErrorMessage_())
  25567. }, t.prototype.parsePoint_ = function () {
  25568. for (var t = [], e = this.layout_.length, r = 0; r < e; ++r) {
  25569. var n = this.token_;
  25570. if (!this.match(YT)) break;
  25571. t.push(n.value)
  25572. }
  25573. if (t.length == e) return t;
  25574. throw new Error(this.formatErrorMessage_())
  25575. }, t.prototype.parsePointList_ = function () {
  25576. for (var t = [this.parsePoint_()]; this.match(WT);) t.push(this.parsePoint_());
  25577. return t
  25578. }, t.prototype.parsePointTextList_ = function () {
  25579. for (var t = [this.parsePointText_()]; this.match(WT);) t.push(this.parsePointText_());
  25580. return t
  25581. }, t.prototype.parseLineStringTextList_ = function () {
  25582. for (var t = [this.parseLineStringText_()]; this.match(WT);) t.push(this.parseLineStringText_());
  25583. return t
  25584. }, t.prototype.parsePolygonTextList_ = function () {
  25585. for (var t = [this.parsePolygonText_()]; this.match(WT);) t.push(this.parsePolygonText_());
  25586. return t
  25587. }, t.prototype.isEmptyGeometry_ = function () {
  25588. var t = this.isTokenType(UT) && "EMPTY" == this.token_.value;
  25589. return t && this.consume_(), t
  25590. }, t.prototype.formatErrorMessage_ = function () {
  25591. return "Unexpected `" + this.token_.value + "` at position " + this.token_.position + " in `" + this.lexer_.wkt + "`"
  25592. }, t.prototype.parseGeometry_ = function () {
  25593. var t = this.token_;
  25594. if (this.match(UT)) {
  25595. var e = t.value;
  25596. if (this.layout_ = this.parseGeometryLayout_(), "GEOMETRYCOLLECTION" == e) {
  25597. var r = this.parseGeometryCollectionText_();
  25598. return new Vm(r)
  25599. }
  25600. var n = zT[e];
  25601. if (!n) throw new Error("Invalid geometry type: " + e);
  25602. var i = void 0;
  25603. switch (e) {
  25604. case"POINT":
  25605. i = this.parsePointText_();
  25606. break;
  25607. case"LINESTRING":
  25608. i = this.parseLineStringText_();
  25609. break;
  25610. case"POLYGON":
  25611. i = this.parsePolygonText_();
  25612. break;
  25613. case"MULTIPOINT":
  25614. i = this.parseMultiPointText_();
  25615. break;
  25616. case"MULTILINESTRING":
  25617. i = this.parseMultiLineStringText_();
  25618. break;
  25619. case"MULTIPOLYGON":
  25620. i = this.parseMultiPolygonText_();
  25621. break;
  25622. default:
  25623. throw new Error("Invalid geometry type: " + e)
  25624. }
  25625. return i || (i = n === zT.POINT ? [NaN, NaN] : []), new n(i, this.layout_)
  25626. }
  25627. throw new Error(this.formatErrorMessage_())
  25628. }, t
  25629. }(), $T = function (t) {
  25630. function e(e) {
  25631. var r = t.call(this) || this, n = e || {};
  25632. return r.splitCollection_ = void 0 !== n.splitCollection && n.splitCollection, r
  25633. }
  25634. return GT(e, t), e.prototype.parse_ = function (t) {
  25635. var e = new KT(t);
  25636. return new HT(e).parse()
  25637. }, e.prototype.readFeatureFromText = function (t, e) {
  25638. var r = this.readGeometryFromText(t, e);
  25639. if (r) {
  25640. var n = new gt;
  25641. return n.setGeometry(r), n
  25642. }
  25643. return null
  25644. }, e.prototype.readFeaturesFromText = function (t, e) {
  25645. for (var r = [], n = this.readGeometryFromText(t, e), i = [], o = 0, a = (r = this.splitCollection_ && n.getType() == bt.GEOMETRY_COLLECTION ? n.getGeometriesArray() : [n]).length; o < a; ++o) {
  25646. var s = new gt;
  25647. s.setGeometry(r[o]), i.push(s)
  25648. }
  25649. return i
  25650. }, e.prototype.readGeometryFromText = function (t, e) {
  25651. var r = this.parse_(t);
  25652. return r ? Wy(r, !1, e) : null
  25653. }, e.prototype.writeFeatureText = function (t, e) {
  25654. var r = t.getGeometry();
  25655. return r ? this.writeGeometryText(r, e) : ""
  25656. }, e.prototype.writeFeaturesText = function (t, e) {
  25657. if (1 == t.length) return this.writeFeatureText(t[0], e);
  25658. for (var r = [], n = 0, i = t.length; n < i; ++n) r.push(t[n].getGeometry());
  25659. var o = new Vm(r);
  25660. return this.writeGeometryText(o, e)
  25661. }, e.prototype.writeGeometryText = function (t, e) {
  25662. return rC(Wy(t, !0, e))
  25663. }, e
  25664. }(Jb);
  25665. function JT(t) {
  25666. var e = t.getCoordinates();
  25667. return 0 === e.length ? "" : e.join(" ")
  25668. }
  25669. function QT(t) {
  25670. for (var e = t.getCoordinates(), r = [], n = 0, i = e.length; n < i; ++n) r.push(e[n].join(" "));
  25671. return r.join(",")
  25672. }
  25673. function tC(t) {
  25674. for (var e = [], r = t.getLinearRings(), n = 0, i = r.length; n < i; ++n) e.push("(" + QT(r[n]) + ")");
  25675. return e.join(",")
  25676. }
  25677. var eC = {
  25678. Point: JT, LineString: QT, Polygon: tC, MultiPoint: function (t) {
  25679. for (var e = [], r = t.getPoints(), n = 0, i = r.length; n < i; ++n) e.push("(" + JT(r[n]) + ")");
  25680. return e.join(",")
  25681. }, MultiLineString: function (t) {
  25682. for (var e = [], r = t.getLineStrings(), n = 0, i = r.length; n < i; ++n) e.push("(" + QT(r[n]) + ")");
  25683. return e.join(",")
  25684. }, MultiPolygon: function (t) {
  25685. for (var e = [], r = t.getPolygons(), n = 0, i = r.length; n < i; ++n) e.push("(" + tC(r[n]) + ")");
  25686. return e.join(",")
  25687. }, GeometryCollection: function (t) {
  25688. for (var e = [], r = t.getGeometries(), n = 0, i = r.length; n < i; ++n) e.push(rC(r[n]));
  25689. return e.join(",")
  25690. }
  25691. };
  25692. function rC(t) {
  25693. var e = t.getType(), r = (0, eC[e])(t);
  25694. if (e = e.toUpperCase(), "function" == typeof t.getFlatCoordinates) {
  25695. var n = function (t) {
  25696. var e = t.getLayout(), r = "";
  25697. return e !== mt && e !== _t || (r += "Z"), e !== vt && e !== _t || (r += "M"), r
  25698. }(t);
  25699. n.length > 0 && (e += " " + n)
  25700. }
  25701. return 0 === r.length ? e + " EMPTY" : e + "(" + r + ")"
  25702. }
  25703. var nC = $T, iC = function () {
  25704. var t = function (e, r) {
  25705. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25706. t.__proto__ = e
  25707. } || function (t, e) {
  25708. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25709. })(e, r)
  25710. };
  25711. return function (e, r) {
  25712. function n() {
  25713. this.constructor = e
  25714. }
  25715. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25716. }
  25717. }(), oC = [null, "http://www.opengis.net/wms"], aC = Gc(oC, {
  25718. Service: Fc((function (t, e) {
  25719. return Uc({}, uC, t, e)
  25720. })), Capability: Fc((function (t, e) {
  25721. return Uc({}, sC, t, e)
  25722. }))
  25723. }), sC = Gc(oC, {
  25724. Request: Fc((function (t, e) {
  25725. return Uc({}, mC, t, e)
  25726. })), Exception: Fc((function (t, e) {
  25727. return Uc([], fC, t, e)
  25728. })), Layer: Fc((function (t, e) {
  25729. var r = Uc({}, dC, t, e);
  25730. if (void 0 === r.Layer) return Object.assign(r, EC(t, e));
  25731. return r
  25732. }))
  25733. }), lC = function (t) {
  25734. function e() {
  25735. var e = t.call(this) || this;
  25736. return e.version = void 0, e
  25737. }
  25738. return iC(e, t), e.prototype.readFromNode = function (t) {
  25739. this.version = t.getAttribute("version").trim();
  25740. var e = Uc({version: this.version}, aC, t, []);
  25741. return e || null
  25742. }, e
  25743. }(cS), uC = Gc(oC, {
  25744. Name: Fc(U_),
  25745. Title: Fc(U_),
  25746. Abstract: Fc(U_),
  25747. KeywordList: Fc(PC),
  25748. OnlineResource: Fc(hS),
  25749. ContactInformation: Fc((function (t, e) {
  25750. return Uc({}, cC, t, e)
  25751. })),
  25752. Fees: Fc(U_),
  25753. AccessConstraints: Fc(U_),
  25754. LayerLimit: Fc(G_),
  25755. MaxWidth: Fc(G_),
  25756. MaxHeight: Fc(G_)
  25757. }), cC = Gc(oC, {
  25758. ContactPersonPrimary: Fc((function (t, e) {
  25759. return Uc({}, hC, t, e)
  25760. })), ContactPosition: Fc(U_), ContactAddress: Fc((function (t, e) {
  25761. return Uc({}, pC, t, e)
  25762. })), ContactVoiceTelephone: Fc(U_), ContactFacsimileTelephone: Fc(U_), ContactElectronicMailAddress: Fc(U_)
  25763. }), hC = Gc(oC, {ContactPerson: Fc(U_), ContactOrganization: Fc(U_)}), pC = Gc(oC, {
  25764. AddressType: Fc(U_),
  25765. Address: Fc(U_),
  25766. City: Fc(U_),
  25767. StateOrProvince: Fc(U_),
  25768. PostCode: Fc(U_),
  25769. Country: Fc(U_)
  25770. }), fC = Gc(oC, {Format: Ic(U_)}), dC = Gc(oC, {
  25771. Name: Fc(U_),
  25772. Title: Fc(U_),
  25773. Abstract: Fc(U_),
  25774. KeywordList: Fc(PC),
  25775. CRS: Mc(U_),
  25776. EX_GeographicBoundingBox: Fc((function (t, e) {
  25777. var r = Uc({}, yC, t, e);
  25778. if (!r) return;
  25779. var n = r.westBoundLongitude, i = r.southBoundLatitude, o = r.eastBoundLongitude, a = r.northBoundLatitude;
  25780. if (void 0 === n || void 0 === i || void 0 === o || void 0 === a) return;
  25781. return [n, i, o, a]
  25782. })),
  25783. BoundingBox: Mc((function (t, e) {
  25784. var r = [D_(t.getAttribute("minx")), D_(t.getAttribute("miny")), D_(t.getAttribute("maxx")), D_(t.getAttribute("maxy"))],
  25785. n = [D_(t.getAttribute("resx")), D_(t.getAttribute("resy"))];
  25786. return {crs: t.getAttribute("CRS"), extent: r, res: n}
  25787. })),
  25788. Dimension: Mc((function (t, e) {
  25789. return {
  25790. name: t.getAttribute("name"),
  25791. units: t.getAttribute("units"),
  25792. unitSymbol: t.getAttribute("unitSymbol"),
  25793. default: t.getAttribute("default"),
  25794. multipleValues: k_(t.getAttribute("multipleValues")),
  25795. nearestValue: k_(t.getAttribute("nearestValue")),
  25796. current: k_(t.getAttribute("current")),
  25797. values: U_(t)
  25798. }
  25799. })),
  25800. Attribution: Fc((function (t, e) {
  25801. return Uc({}, gC, t, e)
  25802. })),
  25803. AuthorityURL: Mc((function (t, e) {
  25804. var r = TC(t, e);
  25805. if (r) return r.name = t.getAttribute("name"), r;
  25806. return
  25807. })),
  25808. Identifier: Mc(U_),
  25809. MetadataURL: Mc((function (t, e) {
  25810. var r = TC(t, e);
  25811. if (r) return r.type = t.getAttribute("type"), r;
  25812. return
  25813. })),
  25814. DataURL: Mc(TC),
  25815. FeatureListURL: Mc(TC),
  25816. Style: Mc((function (t, e) {
  25817. return Uc({}, xC, t, e)
  25818. })),
  25819. MinScaleDenominator: Fc(N_),
  25820. MaxScaleDenominator: Fc(N_),
  25821. Layer: Mc(EC)
  25822. }), gC = Gc(oC, {Title: Fc(U_), OnlineResource: Fc(hS), LogoURL: Fc(OC)}), yC = Gc(oC, {
  25823. westBoundLongitude: Fc(N_),
  25824. eastBoundLongitude: Fc(N_),
  25825. southBoundLatitude: Fc(N_),
  25826. northBoundLatitude: Fc(N_)
  25827. }), mC = Gc(oC, {GetCapabilities: Fc(CC), GetMap: Fc(CC), GetFeatureInfo: Fc(CC)}), vC = Gc(oC, {
  25828. Format: Mc(U_), DCPType: Mc((function (t, e) {
  25829. return Uc({}, _C, t, e)
  25830. }))
  25831. }), _C = Gc(oC, {
  25832. HTTP: Fc((function (t, e) {
  25833. return Uc({}, bC, t, e)
  25834. }))
  25835. }), bC = Gc(oC, {Get: Fc(TC), Post: Fc(TC)}), xC = Gc(oC, {
  25836. Name: Fc(U_),
  25837. Title: Fc(U_),
  25838. Abstract: Fc(U_),
  25839. LegendURL: Mc(OC),
  25840. StyleSheetURL: Fc(TC),
  25841. StyleURL: Fc(TC)
  25842. }), wC = Gc(oC, {Format: Fc(U_), OnlineResource: Fc(hS)}), SC = Gc(oC, {Keyword: Ic(U_)});
  25843. function EC(t, e) {
  25844. var r = e[e.length - 1], n = Uc({}, dC, t, e);
  25845. if (n) {
  25846. var i = k_(t.getAttribute("queryable"));
  25847. void 0 === i && (i = r.queryable), n.queryable = void 0 !== i && i;
  25848. var o = z_(t.getAttribute("cascaded"));
  25849. void 0 === o && (o = r.cascaded), n.cascaded = o;
  25850. var a = k_(t.getAttribute("opaque"));
  25851. void 0 === a && (a = r.opaque), n.opaque = void 0 !== a && a;
  25852. var s = k_(t.getAttribute("noSubsets"));
  25853. void 0 === s && (s = r.noSubsets), n.noSubsets = void 0 !== s && s;
  25854. var l = D_(t.getAttribute("fixedWidth"));
  25855. l || (l = r.fixedWidth), n.fixedWidth = l;
  25856. var u = D_(t.getAttribute("fixedHeight"));
  25857. u || (u = r.fixedHeight), n.fixedHeight = u;
  25858. ["Style", "CRS", "AuthorityURL"].forEach((function (t) {
  25859. if (t in r) {
  25860. var e = n[t] || [];
  25861. n[t] = e.concat(r[t])
  25862. }
  25863. }));
  25864. return ["EX_GeographicBoundingBox", "BoundingBox", "Dimension", "Attribution", "MinScaleDenominator", "MaxScaleDenominator"].forEach((function (t) {
  25865. if (!(t in n)) {
  25866. var e = r[t];
  25867. n[t] = e
  25868. }
  25869. })), n
  25870. }
  25871. }
  25872. function TC(t, e) {
  25873. return Uc({}, wC, t, e)
  25874. }
  25875. function CC(t, e) {
  25876. return Uc({}, vC, t, e)
  25877. }
  25878. function OC(t, e) {
  25879. var r = TC(t, e);
  25880. if (r) {
  25881. var n = [z_(t.getAttribute("width")), z_(t.getAttribute("height"))];
  25882. return r.size = n, r
  25883. }
  25884. }
  25885. function PC(t, e) {
  25886. return Uc([], SC, t, e)
  25887. }
  25888. var RC = lC, IC = function () {
  25889. var t = function (e, r) {
  25890. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25891. t.__proto__ = e
  25892. } || function (t, e) {
  25893. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25894. })(e, r)
  25895. };
  25896. return function (e, r) {
  25897. function n() {
  25898. this.constructor = e
  25899. }
  25900. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25901. }
  25902. }(), LC = function (t) {
  25903. function e(e) {
  25904. var r = t.call(this) || this, n = e || {};
  25905. return r.featureNS_ = "http://mapserver.gis.umn.edu/mapserver", r.gmlFormat_ = new $_, r.layers_ = n.layers ? n.layers : null, r
  25906. }
  25907. return IC(e, t), e.prototype.getLayers = function () {
  25908. return this.layers_
  25909. }, e.prototype.setLayers = function (t) {
  25910. this.layers_ = t
  25911. }, e.prototype.readFeatures_ = function (t, e) {
  25912. t.setAttribute("namespaceURI", this.featureNS_);
  25913. var r = t.localName, n = [];
  25914. if (0 === t.childNodes.length) return n;
  25915. if ("msGMLOutput" == r) for (var i = 0, o = t.childNodes.length; i < o; i++) {
  25916. var a = t.childNodes[i];
  25917. if (a.nodeType === Node.ELEMENT_NODE) {
  25918. var s = a, l = e[0], u = s.localName.replace("_layer", "");
  25919. if (!this.layers_ || g(this.layers_, u)) {
  25920. var c = u + "_feature";
  25921. l.featureType = c, l.featureNS = this.featureNS_;
  25922. var h = {};
  25923. h[c] = Ic(this.gmlFormat_.readFeatureElement, this.gmlFormat_);
  25924. var p = Gc([l.featureNS, null], h);
  25925. s.setAttribute("namespaceURI", this.featureNS_);
  25926. var f = Uc([], p, s, e, this.gmlFormat_);
  25927. f && v(n, f)
  25928. }
  25929. }
  25930. }
  25931. if ("FeatureCollection" == r) {
  25932. var d = Uc([], this.gmlFormat_.FEATURE_COLLECTION_PARSERS, t, [{}], this.gmlFormat_);
  25933. d && (n = d)
  25934. }
  25935. return n
  25936. }, e.prototype.readFeaturesFromNode = function (t, e) {
  25937. var r = {};
  25938. return e && O(r, this.getReadOptions(t, e)), this.readFeatures_(t, [r])
  25939. }, e
  25940. }(P_), MC = function () {
  25941. var t = function (e, r) {
  25942. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  25943. t.__proto__ = e
  25944. } || function (t, e) {
  25945. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  25946. })(e, r)
  25947. };
  25948. return function (e, r) {
  25949. function n() {
  25950. this.constructor = e
  25951. }
  25952. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  25953. }
  25954. }(), FC = [null, "http://www.opengis.net/wmts/1.0"], AC = [null, "http://www.opengis.net/ows/1.1"], kC = Gc(FC, {
  25955. Contents: Fc((function (t, e) {
  25956. return Uc({}, NC, t, e)
  25957. }))
  25958. }), jC = function (t) {
  25959. function e() {
  25960. var e = t.call(this) || this;
  25961. return e.owsParser_ = new RS, e
  25962. }
  25963. return MC(e, t), e.prototype.readFromNode = function (t) {
  25964. var e = t.getAttribute("version");
  25965. e && (e = e.trim());
  25966. var r = this.owsParser_.readFromNode(t);
  25967. return r ? (r.version = e, (r = Uc(r, kC, t, [])) || null) : null
  25968. }, e
  25969. }(cS), NC = Gc(FC, {
  25970. Layer: Mc((function (t, e) {
  25971. return Uc({}, DC, t, e)
  25972. })), TileMatrixSet: Mc((function (t, e) {
  25973. return Uc({}, WC, t, e)
  25974. }))
  25975. }), DC = Gc(FC, {
  25976. Style: Mc((function (t, e) {
  25977. var r = Uc({}, GC, t, e);
  25978. if (!r) return;
  25979. var n = "true" === t.getAttribute("isDefault");
  25980. return r.isDefault = n, r
  25981. })), Format: Mc(U_), TileMatrixSetLink: Mc((function (t, e) {
  25982. return Uc({}, zC, t, e)
  25983. })), Dimension: Mc((function (t, e) {
  25984. return Uc({}, VC, t, e)
  25985. })), ResourceURL: Mc((function (t, e) {
  25986. var r = t.getAttribute("format"), n = t.getAttribute("template"), i = t.getAttribute("resourceType"), o = {};
  25987. r && (o.format = r);
  25988. n && (o.template = n);
  25989. i && (o.resourceType = i);
  25990. return o
  25991. }))
  25992. }, Gc(AC, {
  25993. Title: Fc(U_), Abstract: Fc(U_), WGS84BoundingBox: Fc((function (t, e) {
  25994. var r = Uc([], YC, t, e);
  25995. if (2 != r.length) return;
  25996. return Kt(r)
  25997. })), Identifier: Fc(U_)
  25998. })), GC = Gc(FC, {
  25999. LegendURL: Mc((function (t, e) {
  26000. var r = {};
  26001. return r.format = t.getAttribute("format"), r.href = hS(t), r
  26002. }))
  26003. }, Gc(AC, {Title: Fc(U_), Identifier: Fc(U_)})), zC = Gc(FC, {
  26004. TileMatrixSet: Fc(U_), TileMatrixSetLimits: Fc((function (t, e) {
  26005. return Uc([], UC, t, e)
  26006. }))
  26007. }), UC = Gc(FC, {
  26008. TileMatrixLimits: Ic((function (t, e) {
  26009. return Uc({}, BC, t, e)
  26010. }))
  26011. }),
  26012. BC = Gc(FC, {TileMatrix: Fc(U_), MinTileRow: Fc(G_), MaxTileRow: Fc(G_), MinTileCol: Fc(G_), MaxTileCol: Fc(G_)}),
  26013. VC = Gc(FC, {Default: Fc(U_), Value: Mc(U_)}, Gc(AC, {Identifier: Fc(U_)})),
  26014. YC = Gc(AC, {LowerCorner: Ic(XC), UpperCorner: Ic(XC)}), WC = Gc(FC, {
  26015. WellKnownScaleSet: Fc(U_), TileMatrix: Mc((function (t, e) {
  26016. return Uc({}, qC, t, e)
  26017. }))
  26018. }, Gc(AC, {SupportedCRS: Fc(U_), Identifier: Fc(U_)})), qC = Gc(FC, {
  26019. TopLeftCorner: Fc(XC),
  26020. ScaleDenominator: Fc(N_),
  26021. TileWidth: Fc(G_),
  26022. TileHeight: Fc(G_),
  26023. MatrixWidth: Fc(G_),
  26024. MatrixHeight: Fc(G_)
  26025. }, Gc(AC, {Identifier: Fc(U_)}));
  26026. function XC(t, e) {
  26027. var r = U_(t).split(/\s+/);
  26028. if (r && 2 == r.length) {
  26029. var n = +r[0], i = +r[1];
  26030. if (!isNaN(n) && !isNaN(i)) return [n, i]
  26031. }
  26032. }
  26033. var ZC = jC, KC = function () {
  26034. var t = function (e, r) {
  26035. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  26036. t.__proto__ = e
  26037. } || function (t, e) {
  26038. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  26039. })(e, r)
  26040. };
  26041. return function (e, r) {
  26042. function n() {
  26043. this.constructor = e
  26044. }
  26045. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  26046. }
  26047. }(), HC = ["fullscreenchange", "webkitfullscreenchange", "MSFullscreenChange"], $C = "enterfullscreen",
  26048. JC = "leavefullscreen";
  26049. function QC() {
  26050. var t = document.body;
  26051. return !!(t.webkitRequestFullscreen || t.msRequestFullscreen && document.msFullscreenEnabled || t.requestFullscreen && document.fullscreenEnabled)
  26052. }
  26053. function tO() {
  26054. return !!(document.webkitIsFullScreen || document.msFullscreenElement || document.fullscreenElement)
  26055. }
  26056. function eO(t) {
  26057. t.requestFullscreen ? t.requestFullscreen() : t.msRequestFullscreen ? t.msRequestFullscreen() : t.webkitRequestFullscreen && t.webkitRequestFullscreen()
  26058. }
  26059. var rO = function (t) {
  26060. function e(e) {
  26061. var r = this, n = e || {};
  26062. (r = t.call(this, {
  26063. element: document.createElement("div"),
  26064. target: n.target
  26065. }) || this).cssClassName_ = void 0 !== n.className ? n.className : "ol-full-screen", r.activeClassName_ = void 0 !== n.activeClassName ? n.activeClassName.split(" ") : [r.cssClassName_ + "-true"], r.inactiveClassName_ = void 0 !== n.inactiveClassName ? n.inactiveClassName.split(" ") : [r.cssClassName_ + "-false"];
  26066. var i = void 0 !== n.label ? n.label : "⤢";
  26067. r.labelNode_ = "string" == typeof i ? document.createTextNode(i) : i;
  26068. var o = void 0 !== n.labelActive ? n.labelActive : "×";
  26069. r.labelActiveNode_ = "string" == typeof o ? document.createTextNode(o) : o, r.button_ = document.createElement("button");
  26070. var a = n.tipLabel ? n.tipLabel : "Toggle full-screen";
  26071. r.setClassName_(r.button_, tO()), r.button_.setAttribute("type", "button"), r.button_.title = a, r.button_.appendChild(r.labelNode_), r.button_.addEventListener(N, r.handleClick_.bind(r), !1);
  26072. var s = r.cssClassName_ + " ol-unselectable ol-control " + (QC() ? "" : "ol-unsupported"), l = r.element;
  26073. return l.className = s, l.appendChild(r.button_), r.keys_ = void 0 !== n.keys && n.keys, r.source_ = n.source, r
  26074. }
  26075. return KC(e, t), e.prototype.handleClick_ = function (t) {
  26076. t.preventDefault(), this.handleFullScreen_()
  26077. }, e.prototype.handleFullScreen_ = function () {
  26078. if (QC()) {
  26079. var t = this.getMap();
  26080. if (t) if (tO()) document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.webkitExitFullscreen && document.webkitExitFullscreen(); else {
  26081. var e = void 0;
  26082. e = this.source_ ? "string" == typeof this.source_ ? document.getElementById(this.source_) : this.source_ : t.getTargetElement(), this.keys_ ? function (t) {
  26083. t.webkitRequestFullscreen ? t.webkitRequestFullscreen() : eO(t)
  26084. }(e) : eO(e)
  26085. }
  26086. }
  26087. }, e.prototype.handleFullScreenChange_ = function () {
  26088. var t = this.getMap();
  26089. tO() ? (this.setClassName_(this.button_, !0), po(this.labelActiveNode_, this.labelNode_), this.dispatchEvent($C)) : (this.setClassName_(this.button_, !1), po(this.labelNode_, this.labelActiveNode_), this.dispatchEvent(JC)), t && t.updateSize()
  26090. }, e.prototype.setClassName_ = function (t, e) {
  26091. var r, n, i, o = this.activeClassName_, a = this.inactiveClassName_, s = e ? o : a;
  26092. (r = t.classList).remove.apply(r, o), (n = t.classList).remove.apply(n, a), (i = t.classList).add.apply(i, s)
  26093. }, e.prototype.setMap = function (e) {
  26094. if (t.prototype.setMap.call(this, e), e) for (var r = 0, n = HC.length; r < n; ++r) this.listenerKeys.push(Z(document, HC[r], this.handleFullScreenChange_, this))
  26095. }, e
  26096. }(As), nO = function () {
  26097. var t = function (e, r) {
  26098. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  26099. t.__proto__ = e
  26100. } || function (t, e) {
  26101. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  26102. })(e, r)
  26103. };
  26104. return function (e, r) {
  26105. function n() {
  26106. this.constructor = e
  26107. }
  26108. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  26109. }
  26110. }(), iO = function (t) {
  26111. function e(e) {
  26112. var r = this, n = e || {}, i = document.createElement("div");
  26113. return i.className = void 0 !== n.className ? n.className : "ol-mouse-position", (r = t.call(this, {
  26114. element: i,
  26115. render: n.render,
  26116. target: n.target
  26117. }) || this).addEventListener(it("projection"), r.handleProjectionChanged_), n.coordinateFormat && r.setCoordinateFormat(n.coordinateFormat), n.projection && r.setProjection(n.projection), r.undefinedHTML_ = void 0 !== n.undefinedHTML ? n.undefinedHTML : "&#160;", r.renderOnMouseOut_ = !!r.undefinedHTML_, r.renderedHTML_ = i.innerHTML, r.mapProjection_ = null, r.transform_ = null, r
  26118. }
  26119. return nO(e, t), e.prototype.handleProjectionChanged_ = function () {
  26120. this.transform_ = null
  26121. }, e.prototype.getCoordinateFormat = function () {
  26122. return this.get("coordinateFormat")
  26123. }, e.prototype.getProjection = function () {
  26124. return this.get("projection")
  26125. }, e.prototype.handleMouseMove = function (t) {
  26126. var e = this.getMap();
  26127. this.updateHTML_(e.getEventPixel(t))
  26128. }, e.prototype.handleMouseOut = function (t) {
  26129. this.updateHTML_(null)
  26130. }, e.prototype.setMap = function (e) {
  26131. if (t.prototype.setMap.call(this, e), e) {
  26132. var r = e.getViewport();
  26133. this.listenerKeys.push(Z(r, za, this.handleMouseMove, this)), this.renderOnMouseOut_ && this.listenerKeys.push(Z(r, Va, this.handleMouseOut, this))
  26134. }
  26135. }, e.prototype.setCoordinateFormat = function (t) {
  26136. this.set("coordinateFormat", t)
  26137. }, e.prototype.setProjection = function (t) {
  26138. this.set("projection", Gr(t))
  26139. }, e.prototype.updateHTML_ = function (t) {
  26140. var e = this.undefinedHTML_;
  26141. if (t && this.mapProjection_) {
  26142. if (!this.transform_) {
  26143. var r = this.getProjection();
  26144. this.transform_ = r ? Zr(this.mapProjection_, r) : jr
  26145. }
  26146. var n = this.getMap().getCoordinateFromPixelInternal(t);
  26147. if (n) {
  26148. var i = tn();
  26149. i && (this.transform_ = Zr(this.mapProjection_, i)), this.transform_(n, n);
  26150. var o = this.getCoordinateFormat();
  26151. e = o ? o(n) : n.toString()
  26152. }
  26153. }
  26154. this.renderedHTML_ && e === this.renderedHTML_ || (this.element.innerHTML = e, this.renderedHTML_ = e)
  26155. }, e.prototype.render = function (t) {
  26156. var e = t.frameState;
  26157. e ? this.mapProjection_ != e.viewState.projection && (this.mapProjection_ = e.viewState.projection, this.transform_ = null) : this.mapProjection_ = null
  26158. }, e
  26159. }(As), oO = function () {
  26160. var t = function (e, r) {
  26161. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  26162. t.__proto__ = e
  26163. } || function (t, e) {
  26164. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  26165. })(e, r)
  26166. };
  26167. return function (e, r) {
  26168. function n() {
  26169. this.constructor = e
  26170. }
  26171. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  26172. }
  26173. }(), aO = function (t) {
  26174. function e() {
  26175. return null !== t && t.apply(this, arguments) || this
  26176. }
  26177. return oO(e, t), e.prototype.createRenderer = function () {
  26178. return new La(this)
  26179. }, e
  26180. }(Ms), sO = function (t) {
  26181. function e(e) {
  26182. var r = this, n = e || {};
  26183. (r = t.call(this, {
  26184. element: document.createElement("div"),
  26185. render: n.render,
  26186. target: n.target
  26187. }) || this).boundHandleRotationChanged_ = r.handleRotationChanged_.bind(r), r.collapsed_ = void 0 === n.collapsed || n.collapsed, r.collapsible_ = void 0 === n.collapsible || n.collapsible, r.collapsible_ || (r.collapsed_ = !1), r.rotateWithView_ = void 0 !== n.rotateWithView && n.rotateWithView, r.viewExtent_ = void 0;
  26188. var i = void 0 !== n.className ? n.className : "ol-overviewmap",
  26189. o = void 0 !== n.tipLabel ? n.tipLabel : "Overview map",
  26190. a = void 0 !== n.collapseLabel ? n.collapseLabel : "«";
  26191. "string" == typeof a ? (r.collapseLabel_ = document.createElement("span"), r.collapseLabel_.textContent = a) : r.collapseLabel_ = a;
  26192. var s = void 0 !== n.label ? n.label : "»";
  26193. "string" == typeof s ? (r.label_ = document.createElement("span"), r.label_.textContent = s) : r.label_ = s;
  26194. var l = r.collapsible_ && !r.collapsed_ ? r.collapseLabel_ : r.label_, u = document.createElement("button");
  26195. u.setAttribute("type", "button"), u.title = o, u.appendChild(l), u.addEventListener(N, r.handleClick_.bind(r), !1), r.ovmapDiv_ = document.createElement("div"), r.ovmapDiv_.className = "ol-overviewmap-map", r.view_ = n.view, r.ovmap_ = new aO({view: n.view});
  26196. var c = r.ovmap_;
  26197. n.layers && n.layers.forEach((function (t) {
  26198. c.addLayer(t)
  26199. }));
  26200. var h = document.createElement("div");
  26201. h.className = "ol-overviewmap-box", h.style.boxSizing = "border-box", r.boxOverlay_ = new su({
  26202. position: [0, 0],
  26203. positioning: Hl,
  26204. element: h
  26205. }), r.ovmap_.addOverlay(r.boxOverlay_);
  26206. var p = i + " ol-unselectable ol-control" + (r.collapsed_ && r.collapsible_ ? " ol-collapsed" : "") + (r.collapsible_ ? "" : " ol-uncollapsible"),
  26207. f = r.element;
  26208. f.className = p, f.appendChild(r.ovmapDiv_), f.appendChild(u);
  26209. var d = r, g = r.boxOverlay_, y = r.boxOverlay_.getElement(), m = function (t) {
  26210. var e, r = {clientX: (e = t).clientX, clientY: e.clientY}, n = c.getEventCoordinateInternal(r);
  26211. g.setPosition(n)
  26212. }, v = function (t) {
  26213. var e = c.getEventCoordinateInternal(t);
  26214. d.getMap().getView().setCenterInternal(e), window.removeEventListener("mousemove", m), window.removeEventListener("mouseup", v)
  26215. };
  26216. return y.addEventListener("mousedown", (function () {
  26217. window.addEventListener("mousemove", m), window.addEventListener("mouseup", v)
  26218. })), r
  26219. }
  26220. return oO(e, t), e.prototype.setMap = function (e) {
  26221. var r = this.getMap();
  26222. if (e !== r) {
  26223. if (r) {
  26224. var n = r.getView();
  26225. n && this.unbindView_(n), this.ovmap_.setTarget(null)
  26226. }
  26227. if (t.prototype.setMap.call(this, e), e) {
  26228. this.ovmap_.setTarget(this.ovmapDiv_), this.listenerKeys.push(Z(e, h, this.handleMapPropertyChange_, this));
  26229. var i = e.getView();
  26230. i && (this.bindView_(i), i.isDef() && (this.ovmap_.updateSize(), this.resetExtent_()))
  26231. }
  26232. }
  26233. }, e.prototype.handleMapPropertyChange_ = function (t) {
  26234. if (t.key === Ja) {
  26235. var e = t.oldValue;
  26236. e && this.unbindView_(e);
  26237. var r = this.getMap().getView();
  26238. this.bindView_(r)
  26239. }
  26240. }, e.prototype.bindView_ = function (t) {
  26241. if (!this.view_) {
  26242. var e = new Cs({projection: t.getProjection()});
  26243. this.ovmap_.setView(e)
  26244. }
  26245. t.addEventListener(it(ss), this.boundHandleRotationChanged_), this.handleRotationChanged_()
  26246. }, e.prototype.unbindView_ = function (t) {
  26247. t.removeEventListener(it(ss), this.boundHandleRotationChanged_)
  26248. }, e.prototype.handleRotationChanged_ = function () {
  26249. this.rotateWithView_ && this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())
  26250. }, e.prototype.validateExtent_ = function () {
  26251. var t = this.getMap(), e = this.ovmap_;
  26252. if (t.isRendered() && e.isRendered()) {
  26253. var r = t.getSize(), n = t.getView().calculateExtentInternal(r);
  26254. if (!this.viewExtent_ || !ue(n, this.viewExtent_)) {
  26255. this.viewExtent_ = n;
  26256. var i = e.getSize(), o = e.getView().calculateExtentInternal(i),
  26257. a = e.getPixelFromCoordinateInternal(Ce(n)), s = e.getPixelFromCoordinateInternal(be(n)),
  26258. l = Math.abs(a[0] - s[0]), u = Math.abs(a[1] - s[1]), c = i[0], h = i[1];
  26259. l < .1 * c || u < .1 * h || l > .75 * c || u > .75 * h ? this.resetExtent_() : te(o, n) || this.recenter_()
  26260. }
  26261. }
  26262. }, e.prototype.resetExtent_ = function () {
  26263. var t = this.getMap(), e = this.ovmap_, r = t.getSize(), n = t.getView().calculateExtentInternal(r),
  26264. i = e.getView(), o = Math.log(7.5) / Math.LN2;
  26265. Me(n, 1 / (.1 * Math.pow(2, o / 2))), i.fitInternal(gi(n))
  26266. }, e.prototype.recenter_ = function () {
  26267. var t = this.getMap(), e = this.ovmap_, r = t.getView();
  26268. e.getView().setCenterInternal(r.getCenterInternal())
  26269. }, e.prototype.updateBox_ = function () {
  26270. var t = this.getMap(), e = this.ovmap_;
  26271. if (t.isRendered() && e.isRendered()) {
  26272. var r = t.getSize(), n = t.getView(), i = e.getView(), o = this.rotateWithView_ ? 0 : -n.getRotation(),
  26273. a = this.boxOverlay_, s = this.boxOverlay_.getElement(), l = n.getCenterInternal(), u = n.getResolution(),
  26274. c = i.getResolution(), h = r[0] * u / c, p = r[1] * u / c;
  26275. if (a.setPosition(l), s) {
  26276. s.style.width = h + "px", s.style.height = p + "px";
  26277. var f = "rotate(" + o + "rad)";
  26278. s.style.transform = f
  26279. }
  26280. }
  26281. }, e.prototype.handleClick_ = function (t) {
  26282. t.preventDefault(), this.handleToggle_()
  26283. }, e.prototype.handleToggle_ = function () {
  26284. this.element.classList.toggle("ol-collapsed"), this.collapsed_ ? po(this.collapseLabel_, this.label_) : po(this.label_, this.collapseLabel_), this.collapsed_ = !this.collapsed_;
  26285. var t = this.ovmap_;
  26286. if (!this.collapsed_) {
  26287. if (t.isRendered()) return this.viewExtent_ = void 0, void t.render();
  26288. t.updateSize(), this.resetExtent_(), K(t, qa, (function (t) {
  26289. this.updateBox_()
  26290. }), this)
  26291. }
  26292. }, e.prototype.getCollapsible = function () {
  26293. return this.collapsible_
  26294. }, e.prototype.setCollapsible = function (t) {
  26295. this.collapsible_ !== t && (this.collapsible_ = t, this.element.classList.toggle("ol-uncollapsible"), !t && this.collapsed_ && this.handleToggle_())
  26296. }, e.prototype.setCollapsed = function (t) {
  26297. this.collapsible_ && this.collapsed_ !== t && this.handleToggle_()
  26298. }, e.prototype.getCollapsed = function () {
  26299. return this.collapsed_
  26300. }, e.prototype.getRotateWithView = function () {
  26301. return this.rotateWithView_
  26302. }, e.prototype.setRotateWithView = function (t) {
  26303. this.rotateWithView_ !== t && (this.rotateWithView_ = t, 0 !== this.getMap().getView().getRotation() && (this.rotateWithView_ ? this.handleRotationChanged_() : this.ovmap_.getView().setRotation(0), this.viewExtent_ = void 0, this.validateExtent_(), this.updateBox_()))
  26304. }, e.prototype.getOverviewMap = function () {
  26305. return this.ovmap_
  26306. }, e.prototype.render = function (t) {
  26307. this.validateExtent_(), this.updateBox_()
  26308. }, e
  26309. }(As), lO = function () {
  26310. var t = function (e, r) {
  26311. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  26312. t.__proto__ = e
  26313. } || function (t, e) {
  26314. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  26315. })(e, r)
  26316. };
  26317. return function (e, r) {
  26318. function n() {
  26319. this.constructor = e
  26320. }
  26321. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  26322. }
  26323. }(), uO = "degrees", cO = "imperial", hO = "nautical", pO = "metric", fO = "us", dO = [1, 2, 5], gO = function (t) {
  26324. function e(e) {
  26325. var r = this, n = e || {}, i = void 0 !== n.className ? n.className : n.bar ? "ol-scale-bar" : "ol-scale-line";
  26326. return (r = t.call(this, {
  26327. element: document.createElement("div"),
  26328. render: n.render,
  26329. target: n.target
  26330. }) || this).innerElement_ = document.createElement("div"), r.innerElement_.className = i + "-inner", r.element.className = i + " ol-unselectable", r.element.appendChild(r.innerElement_), r.viewState_ = null, r.minWidth_ = void 0 !== n.minWidth ? n.minWidth : 64, r.renderedVisible_ = !1, r.renderedWidth_ = void 0, r.renderedHTML_ = "", r.addEventListener(it("units"), r.handleUnitsChanged_), r.setUnits(n.units || pO), r.scaleBar_ = n.bar || !1, r.scaleBarSteps_ = n.steps || 4, r.scaleBarText_ = n.text || !1, r.dpi_ = n.dpi || void 0, r
  26331. }
  26332. return lO(e, t), e.prototype.getUnits = function () {
  26333. return this.get("units")
  26334. }, e.prototype.handleUnitsChanged_ = function () {
  26335. this.updateElement_()
  26336. }, e.prototype.setUnits = function (t) {
  26337. this.set("units", t)
  26338. }, e.prototype.setDpi = function (t) {
  26339. this.dpi_ = t
  26340. }, e.prototype.updateElement_ = function () {
  26341. var t = this.viewState_;
  26342. if (t) {
  26343. var e = t.center, r = t.projection, n = this.getUnits(), i = n == uO ? St.DEGREES : St.METERS,
  26344. o = zr(r, t.resolution, e, i), a = this.minWidth_ * (this.dpi_ || 25.4 / .28) / (25.4 / .28), s = a * o,
  26345. l = "";
  26346. if (n == uO) {
  26347. var u = wt[St.DEGREES];
  26348. (s *= u) < u / 60 ? (l = "″", o *= 3600) : s < u ? (l = "′", o *= 60) : l = "°"
  26349. } else n == cO ? s < .9144 ? (l = "in", o /= .0254) : s < 1609.344 ? (l = "ft", o /= .3048) : (l = "mi", o /= 1609.344) : n == hO ? (o /= 1852, l = "nm") : n == pO ? s < .001 ? (l = "μm", o *= 1e6) : s < 1 ? (l = "mm", o *= 1e3) : s < 1e3 ? l = "m" : (l = "km", o /= 1e3) : n == fO ? s < .9144 ? (l = "in", o *= 39.37) : s < 1609.344 ? (l = "ft", o /= .30480061) : (l = "mi", o /= 1609.3472) : pt(!1, 33);
  26350. for (var c, h, p, f, d = 3 * Math.floor(Math.log(a * o) / Math.log(10)); ;) {
  26351. p = Math.floor(d / 3);
  26352. var g = Math.pow(10, p);
  26353. if (c = dO[(d % 3 + 3) % 3] * g, h = Math.round(c / o), isNaN(h)) return this.element.style.display = "none", void (this.renderedVisible_ = !1);
  26354. if (h >= a) break;
  26355. ++d
  26356. }
  26357. f = this.scaleBar_ ? this.createScaleBar(h, c, l) : c.toFixed(p < 0 ? -p : 0) + " " + l, this.renderedHTML_ != f && (this.innerElement_.innerHTML = f, this.renderedHTML_ = f), this.renderedWidth_ != h && (this.innerElement_.style.width = h + "px", this.renderedWidth_ = h), this.renderedVisible_ || (this.element.style.display = "", this.renderedVisible_ = !0)
  26358. } else this.renderedVisible_ && (this.element.style.display = "none", this.renderedVisible_ = !1)
  26359. }, e.prototype.createScaleBar = function (t, e, r) {
  26360. for (var n = "1 : " + Math.round(this.getScaleForResolution()).toLocaleString(), i = [], o = t / this.scaleBarSteps_, a = "#ffffff", s = 0; s < this.scaleBarSteps_; s++) 0 === s && i.push(this.createMarker("absolute", s)), i.push('<div><div class="ol-scale-singlebar" style="width: ' + o + "px;background-color: " + a + ';"></div>' + this.createMarker("relative", s) + (s % 2 == 0 || 2 === this.scaleBarSteps_ ? this.createStepText(s, t, !1, e, r) : "") + "</div>"), s === this.scaleBarSteps_ - 1 && i.push(this.createStepText(s + 1, t, !0, e, r)), a = "#ffffff" === a ? "#000000" : "#ffffff";
  26361. return '<div style="display: flex;">' + (this.scaleBarText_ ? '<div class="ol-scale-text" style="width: ' + t + 'px;">' + n + "</div>" : "") + i.join("") + "</div>"
  26362. }, e.prototype.createMarker = function (t, e) {
  26363. return '<div class="ol-scale-step-marker" style="position: ' + t + ";top: " + ("absolute" === t ? 3 : -10) + 'px;"></div>'
  26364. }, e.prototype.createStepText = function (t, e, r, n, i) {
  26365. var o = (0 === t ? 0 : Math.round(n / this.scaleBarSteps_ * t * 100) / 100) + (0 === t ? "" : " " + i);
  26366. return '<div class="ol-scale-step-text" style="margin-left: ' + (0 === t ? -3 : e / this.scaleBarSteps_ * -1) + "px;text-align: " + (0 === t ? "left" : "center") + "; min-width: " + (0 === t ? 0 : e / this.scaleBarSteps_ * 2) + "px;left: " + (r ? e + "px" : "unset") + ';">' + o + "</div>"
  26367. }, e.prototype.getScaleForResolution = function () {
  26368. var t = zr(this.viewState_.projection, this.viewState_.resolution, this.viewState_.center),
  26369. e = this.dpi_ || 25.4 / .28, r = this.viewState_.projection.getMetersPerUnit();
  26370. return parseFloat(t.toString()) * r * (1e3 / 25.4) * e
  26371. }, e.prototype.render = function (t) {
  26372. var e = t.frameState;
  26373. this.viewState_ = e ? e.viewState : null, this.updateElement_()
  26374. }, e
  26375. }(As), yO = function () {
  26376. var t = function (e, r) {
  26377. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  26378. t.__proto__ = e
  26379. } || function (t, e) {
  26380. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  26381. })(e, r)
  26382. };
  26383. return function (e, r) {
  26384. function n() {
  26385. this.constructor = e
  26386. }
  26387. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  26388. }
  26389. }(), mO = 0, vO = 1, _O = function (t) {
  26390. function e(e) {
  26391. var r = this, n = e || {};
  26392. (r = t.call(this, {
  26393. element: document.createElement("div"),
  26394. render: n.render
  26395. }) || this).dragListenerKeys_ = [], r.currentResolution_ = void 0, r.direction_ = mO, r.dragging_, r.heightLimit_ = 0, r.widthLimit_ = 0, r.startX_, r.startY_, r.thumbSize_ = null, r.sliderInitialized_ = !1, r.duration_ = void 0 !== n.duration ? n.duration : 200;
  26396. var i = void 0 !== n.className ? n.className : "ol-zoomslider", o = document.createElement("button");
  26397. o.setAttribute("type", "button"), o.className = i + "-thumb ol-unselectable";
  26398. var a = r.element;
  26399. return a.className = i + " ol-unselectable ol-control", a.appendChild(o), a.addEventListener(Ua, r.handleDraggerStart_.bind(r), !1), a.addEventListener(za, r.handleDraggerDrag_.bind(r), !1), a.addEventListener(Ba, r.handleDraggerEnd_.bind(r), !1), a.addEventListener(N, r.handleContainerClick_.bind(r), !1), o.addEventListener(N, u, !1), r
  26400. }
  26401. return yO(e, t), e.prototype.setMap = function (e) {
  26402. t.prototype.setMap.call(this, e), e && e.render()
  26403. }, e.prototype.initSlider_ = function () {
  26404. var t = this.element, e = t.offsetWidth, r = t.offsetHeight;
  26405. if (0 === e && 0 === r) return this.sliderInitialized_ = !1;
  26406. var n = t.firstElementChild, i = getComputedStyle(n),
  26407. o = n.offsetWidth + parseFloat(i.marginRight) + parseFloat(i.marginLeft),
  26408. a = n.offsetHeight + parseFloat(i.marginTop) + parseFloat(i.marginBottom);
  26409. return this.thumbSize_ = [o, a], e > r ? (this.direction_ = vO, this.widthLimit_ = e - o) : (this.direction_ = mO, this.heightLimit_ = r - a), this.sliderInitialized_ = !0
  26410. }, e.prototype.handleContainerClick_ = function (t) {
  26411. var e = this.getMap().getView(),
  26412. r = this.getRelativePosition_(t.offsetX - this.thumbSize_[0] / 2, t.offsetY - this.thumbSize_[1] / 2),
  26413. n = this.getResolutionForPosition_(r), i = e.getConstrainedZoom(e.getZoomForResolution(n));
  26414. e.animateInternal({zoom: i, duration: this.duration_, easing: io})
  26415. }, e.prototype.handleDraggerStart_ = function (t) {
  26416. if (!this.dragging_ && t.target === this.element.firstElementChild) {
  26417. var e = this.element.firstElementChild;
  26418. if (this.getMap().getView().beginInteraction(), this.startX_ = t.clientX - parseFloat(e.style.left), this.startY_ = t.clientY - parseFloat(e.style.top), this.dragging_ = !0, 0 === this.dragListenerKeys_.length) {
  26419. var r = this.handleDraggerDrag_, n = this.handleDraggerEnd_, i = this.getMap().getOwnerDocument();
  26420. this.dragListenerKeys_.push(Z(i, za, r, this), Z(i, Ba, n, this))
  26421. }
  26422. }
  26423. }, e.prototype.handleDraggerDrag_ = function (t) {
  26424. if (this.dragging_) {
  26425. var e = t.clientX - this.startX_, r = t.clientY - this.startY_, n = this.getRelativePosition_(e, r);
  26426. this.currentResolution_ = this.getResolutionForPosition_(n), this.getMap().getView().setResolution(this.currentResolution_)
  26427. }
  26428. }, e.prototype.handleDraggerEnd_ = function (t) {
  26429. this.dragging_ && (this.getMap().getView().endInteraction(), this.dragging_ = !1, this.startX_ = void 0, this.startY_ = void 0, this.dragListenerKeys_.forEach(H), this.dragListenerKeys_.length = 0)
  26430. }, e.prototype.setThumbPosition_ = function (t) {
  26431. var e = this.getPositionForResolution_(t), r = this.element.firstElementChild;
  26432. this.direction_ == vO ? r.style.left = this.widthLimit_ * e + "px" : r.style.top = this.heightLimit_ * e + "px"
  26433. }, e.prototype.getRelativePosition_ = function (t, e) {
  26434. return Ne(this.direction_ === vO ? t / this.widthLimit_ : e / this.heightLimit_, 0, 1)
  26435. }, e.prototype.getResolutionForPosition_ = function (t) {
  26436. return this.getMap().getView().getResolutionForValueFunction()(1 - t)
  26437. }, e.prototype.getPositionForResolution_ = function (t) {
  26438. return Ne(1 - this.getMap().getView().getValueForResolutionFunction()(t), 0, 1)
  26439. }, e.prototype.render = function (t) {
  26440. if (t.frameState && (this.sliderInitialized_ || this.initSlider_())) {
  26441. var e = t.frameState.viewState.resolution;
  26442. this.currentResolution_ = e, this.setThumbPosition_(e)
  26443. }
  26444. }, e
  26445. }(As), bO = function () {
  26446. var t = function (e, r) {
  26447. return (t = Object.setPrototypeOf || {__proto__: []} instanceof Array && function (t, e) {
  26448. t.__proto__ = e
  26449. } || function (t, e) {
  26450. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r])
  26451. })(e, r)
  26452. };
  26453. return function (e, r) {
  26454. function n() {
  26455. this.constructor = e
  26456. }
  26457. t(e, r), e.prototype = null === r ? Object.create(r) : (n.prototype = r.prototype, new n)
  26458. }
  26459. }(), xO = function (t) {
  26460. function e(e) {
  26461. var r = this, n = e || {};
  26462. (r = t.call(this, {
  26463. element: document.createElement("div"),
  26464. target: n.target
  26465. }) || this).extent = n.extent ? n.extent : null;
  26466. var i = void 0 !== n.className ? n.className : "ol-zoom-extent", o = void 0 !== n.label ? n.label : "E",
  26467. a = void 0 !== n.tipLabel ? n.tipLabel : "Fit to extent", s = document.createElement("button");
  26468. s.setAttribute("type", "button"), s.title = a, s.appendChild("string" == typeof o ? document.createTextNode(o) : o), s.addEventListener(N, r.handleClick_.bind(r), !1);
  26469. var l = i + " ol-unselectable ol-control", u = r.element;
  26470. return u.className = l, u.appendChild(s), r
  26471. }
  26472. return bO(e, t), e.prototype.handleClick_ = function (t) {
  26473. t.preventDefault(), this.handleZoomToExtent()
  26474. }, e.prototype.handleZoomToExtent = function () {
  26475. var t = this.getMap().getView(), e = this.extent ? this.extent : t.getProjection().getExtent();
  26476. t.fitInternal(gi(e))
  26477. }, e
  26478. }(As), wO = {};
  26479. wO.AssertionError = l || {}, wO.Collection = ht || {}, wO.Collection.CollectionEvent = ct || {}, wO.Disposable = p || {}, wO.Feature = gt || {}, wO.Feature.createStyleFunction = dt || {}, wO.Geolocation = Ii || {}, wO.Image = Ki || {}, wO.Image.listenImage = Zi || {}, wO.ImageBase = Mi || {}, wO.ImageCanvas = $i || {}, wO.ImageTile = vo || {}, wO.Kinetic = _o || {}, wO.Map = Wl || {}, wO.MapBrowserEvent = Da || {}, wO.MapBrowserEventHandler = Wa || {}, wO.MapEvent = ja || {}, wO.Object = ot || {}, wO.Object.ObjectEvent = et || {}, wO.Object.getChangeEventType = it || {}, wO.Observable = Q || {}, wO.Observable.unByKey = J || {}, wO.Overlay = su || {}, wO.PluggableMap = Ms || {}, wO.Tile = lo || {}, wO.TileCache = yu || {}, wO.TileQueue = es || {}, wO.TileQueue.getTilePriority = rs || {}, wO.TileRange = _u || {}, wO.TileRange.createOrUpdate = vu || {}, wO.VectorRenderTile = wu || {}, wO.VectorTile = Eu || {}, wO.View = Cs || {}, wO.View.createCenterConstraint = xs || {}, wO.View.createResolutionConstraint = ws || {}, wO.View.createRotationConstraint = Ss || {}, wO.View.isNoopAnimation = Es || {}, wO.array = {}, wO.array.binarySearch = f || {}, wO.array.equals = b || {}, wO.array.extend = v || {}, wO.array.find = _ || {}, wO.array.findIndex = x || {}, wO.array.includes = g || {}, wO.array.isSorted = w || {}, wO.array.linearFindNearest = y || {}, wO.array.numberSafeCompareFunction = d || {}, wO.array.remove = function (t, e) {
  26480. var r = t.indexOf(e), n = r > -1;
  26481. return n && t.splice(r, 1), n
  26482. } || {}, wO.array.reverseSubArray = m || {}, wO.array.stableSort = function (t, e) {
  26483. var r, n = t.length, i = Array(t.length);
  26484. for (r = 0; r < n; r++) i[r] = {index: r, value: t[r]};
  26485. for (i.sort((function (t, r) {
  26486. return e(t.value, r.value) || t.index - r.index
  26487. })), r = 0; r < t.length; r++) t[r] = i[r].value
  26488. } || {}, wO.asserts = {}, wO.asserts.assert = pt || {}, wO.centerconstraint = {}, wO.centerconstraint.createExtent = ls || {}, wO.centerconstraint.none = us || {}, wO.color = {}, wO.color.asArray = Oo || {}, wO.color.asString = wo || {}, wO.color.fromString = Co || {}, wO.color.isStringColor = Io || {}, wO.color.normalize = Po || {}, wO.color.toString = Ro || {}, wO.colorlike = {}, wO.colorlike.asColorLike = Tu || {}, wO.control = {}, wO.control.Attribution = js || {}, wO.control.Control = As || {}, wO.control.FullScreen = rO || {}, wO.control.MousePosition = iO || {}, wO.control.OverviewMap = sO || {}, wO.control.Rotate = Ds || {}, wO.control.ScaleLine = gO || {}, wO.control.Zoom = zs || {}, wO.control.ZoomSlider = _O || {}, wO.control.ZoomToExtent = xO || {}, wO.control.defaults = Us || {}, wO.coordinate = {}, wO.coordinate.add = xr || {}, wO.coordinate.closestOnCircle = wr || {}, wO.coordinate.closestOnSegment = Sr || {}, wO.coordinate.createStringXY = function (t) {
  26489. return function (e) {
  26490. return Mr(e, t)
  26491. }
  26492. } || {}, wO.coordinate.degreesToStringHDMS = Er || {}, wO.coordinate.distance = Ir || {}, wO.coordinate.equals = Cr || {}, wO.coordinate.format = Tr || {}, wO.coordinate.getWorldsAway = Ar || {}, wO.coordinate.rotate = Or || {}, wO.coordinate.scale = Pr || {}, wO.coordinate.squaredDistance = Rr || {}, wO.coordinate.squaredDistanceToSegment = Lr || {}, wO.coordinate.toStringHDMS = function (t, e) {
  26493. return t ? Er("NS", t[1], e) + " " + Er("EW", t[0], e) : ""
  26494. } || {}, wO.coordinate.toStringXY = Mr || {}, wO.coordinate.wrapX = Fr || {}, wO.css = {}, wO.css.CLASS_COLLAPSED = "ol-collapsed", wO.css.CLASS_CONTROL = "ol-control", wO.css.CLASS_HIDDEN = "ol-hidden", wO.css.CLASS_SELECTABLE = "ol-selectable", wO.css.CLASS_UNSELECTABLE = "ol-unselectable", wO.css.CLASS_UNSUPPORTED = "ol-unsupported", wO.css.getFontParameters = ha || {},wO.dom = {},wO.dom.createCanvasContext2D = uo || {},wO.dom.outerHeight = ho || {},wO.dom.outerWidth = co || {},wO.dom.removeChildren = go || {},wO.dom.removeNode = fo || {},wO.dom.replaceChildren = yo || {},wO.dom.replaceNode = po || {},wO.easing = {},wO.easing.easeIn = no || {},wO.easing.easeOut = io || {},wO.easing.inAndOut = oo || {},wO.easing.linear = ao || {},wO.easing.upAndDown = function (t) {
  26495. return t < .5 ? oo(2 * t) : 1 - oo(2 * (t - .5))
  26496. } || {},wO.events = {},wO.events.Event = c || {},wO.events.Event.preventDefault = function (t) {
  26497. t.preventDefault()
  26498. } || {},wO.events.Event.stopPropagation = u || {},wO.events.Target = M || {},wO.events.condition = {},wO.events.condition.all = Js || {},wO.events.condition.altKeyOnly = Qs || {},wO.events.condition.altShiftKeysOnly = tl || {},wO.events.condition.always = nl || {},wO.events.condition.click = function (t) {
  26499. return t.type == Ga.CLICK
  26500. } || {},wO.events.condition.doubleClick = function (t) {
  26501. return t.type == Ga.DBLCLICK
  26502. } || {},wO.events.condition.focus = el || {},wO.events.condition.focusWithTabindex = rl || {},wO.events.condition.mouseActionButton = il || {},wO.events.condition.mouseOnly = cl || {},wO.events.condition.never = ol || {},wO.events.condition.noModifierKeys = sl || {},wO.events.condition.penOnly = function (t) {
  26503. var e = t.originalEvent;
  26504. return pt(void 0 !== e, 56), "pen" === e.pointerType
  26505. } || {},wO.events.condition.platformModifierKeyOnly = function (t) {
  26506. var e = t.originalEvent;
  26507. return !e.altKey && (Bi ? e.metaKey : e.ctrlKey) && !e.shiftKey
  26508. } || {},wO.events.condition.pointerMove = function (t) {
  26509. return "pointermove" == t.type
  26510. } || {},wO.events.condition.primaryAction = hl || {},wO.events.condition.shiftKeyOnly = ll || {},wO.events.condition.singleClick = al || {},wO.events.condition.targetNotEditable = ul || {},wO.events.condition.touchOnly = function (t) {
  26511. var e = t.originalEvent;
  26512. return pt(void 0 !== e, 56), "touch" === e.pointerType
  26513. } || {},wO.events.listen = Z || {},wO.events.listenOnce = K || {},wO.events.unlistenByKey = H || {},wO.extent = {},wO.extent.applyTransform = Ae || {},wO.extent.approximatelyEquals = ce || {},wO.extent.boundingExtent = Kt || {},wO.extent.buffer = Ht || {},wO.extent.clone = $t || {},wO.extent.closestSquaredDistanceXY = Jt || {},wO.extent.containsCoordinate = Qt || {},wO.extent.containsExtent = te || {},wO.extent.containsXY = ee || {},wO.extent.coordinateRelationship = re || {},wO.extent.createEmpty = ne || {},wO.extent.createOrUpdate = ie || {},wO.extent.createOrUpdateEmpty = oe || {},wO.extent.createOrUpdateFromCoordinate = ae || {},wO.extent.createOrUpdateFromCoordinates = se || {},wO.extent.createOrUpdateFromFlatCoordinates = le || {},wO.extent.createOrUpdateFromRings = function (t, e) {
  26514. return ge(oe(e), t)
  26515. } || {},wO.extent.equals = ue || {},wO.extent.extend = he || {},wO.extent.extendCoordinate = pe || {},wO.extent.extendCoordinates = fe || {},wO.extent.extendFlatCoordinates = de || {},wO.extent.extendRings = ge || {},wO.extent.extendXY = ye || {},wO.extent.forEachCorner = me || {},wO.extent.getArea = ve || {},wO.extent.getBottomLeft = _e || {},wO.extent.getBottomRight = be || {},wO.extent.getCenter = xe || {},wO.extent.getCorner = we || {},wO.extent.getEnlargedArea = function (t, e) {
  26516. var r = Math.min(t[0], e[0]), n = Math.min(t[1], e[1]);
  26517. return (Math.max(t[2], e[2]) - r) * (Math.max(t[3], e[3]) - n)
  26518. } || {},wO.extent.getForViewAndSize = Se || {},wO.extent.getHeight = Ee || {},wO.extent.getIntersection = Te || {},wO.extent.getIntersectionArea = function (t, e) {
  26519. return ve(Te(t, e))
  26520. } || {},wO.extent.getMargin = function (t) {
  26521. return Pe(t) + Ee(t)
  26522. } || {},wO.extent.getSize = function (t) {
  26523. return [t[2] - t[0], t[3] - t[1]]
  26524. } || {},wO.extent.getTopLeft = Ce || {},wO.extent.getTopRight = Oe || {},wO.extent.getWidth = Pe || {},wO.extent.intersects = Re || {},wO.extent.intersectsSegment = Fe || {},wO.extent.isEmpty = Ie || {},wO.extent.returnOrUpdate = Le || {},wO.extent.scaleFromCenter = Me || {},wO.extent.wrapX = ke || {},wO.featureloader = {},wO.featureloader.loadFeaturesXhr = Lu || {},wO.featureloader.setWithCredentials = function (t) {
  26525. Iu = t
  26526. } || {},wO.featureloader.xhr = Mu || {},wO.format = {},wO.format.EsriJSON = C_ || {},wO.format.Feature = Yy || {},wO.format.Feature.transformExtentWithOptions = qy || {},wO.format.Feature.transformGeometryWithOptions = Wy || {},wO.format.GML = nb || {},wO.format.GML2 = $_ || {},wO.format.GML3 = eb || {},wO.format.GML32 = ab || {},wO.format.GMLBase = F_ || {},wO.format.GMLBase.GMLNS = I_,wO.format.GPX = Bb || {},wO.format.GeoJSON = $m || {},wO.format.IGC = sx || {},wO.format.IIIFInfo = Pf || {},wO.format.JSONFeature = qm || {},wO.format.KML = eS || {},wO.format.KML.getDefaultFillStyle = function () {
  26527. return vx
  26528. } || {},wO.format.KML.getDefaultImageStyle = function () {
  26529. return bx
  26530. } || {},wO.format.KML.getDefaultStrokeStyle = function () {
  26531. return wx
  26532. } || {},wO.format.KML.getDefaultStyle = function () {
  26533. return Ex
  26534. } || {},wO.format.KML.getDefaultStyleArray = function () {
  26535. return Cx
  26536. } || {},wO.format.KML.getDefaultTextStyle = function () {
  26537. return Sx
  26538. } || {},wO.format.KML.readFlatCoordinates = Ix || {},wO.format.MVT = am || {},wO.format.OSMXML = uS || {},wO.format.OWS = RS || {},wO.format.Polyline = zS || {},wO.format.Polyline.decodeDeltas = MS || {},wO.format.Polyline.decodeFloats = AS || {},wO.format.Polyline.decodeSignedIntegers = jS || {},wO.format.Polyline.decodeUnsignedIntegers = DS || {},wO.format.Polyline.encodeDeltas = LS || {},wO.format.Polyline.encodeFloats = FS || {},wO.format.Polyline.encodeSignedIntegers = kS || {},wO.format.Polyline.encodeUnsignedInteger = GS || {},wO.format.Polyline.encodeUnsignedIntegers = NS || {},wO.format.TextFeature = Jb || {},wO.format.TopoJSON = KS || {},wO.format.WFS = DT || {},wO.format.WFS.writeFilter = function (t, e) {
  26539. var r = Sc(tT[e], "Filter"), n = {node: r};
  26540. return O(n, {version: e, filter: t}), xT(r, t, [n]), r
  26541. } || {},wO.format.WKT = nC || {},wO.format.WMSCapabilities = RC || {},wO.format.WMSGetFeatureInfo = LC || {},wO.format.WMTSCapabilities = ZC || {},wO.format.XLink = {},wO.format.XLink.readHref = hS || {},wO.format.XML = cS || {},wO.format.XMLFeature = P_ || {},wO.format.filter = {},wO.format.filter.And = tE || {},wO.format.filter.Bbox = rE || {},wO.format.filter.Comparison = pE || {},wO.format.filter.ComparisonBinary = yE || {},wO.format.filter.Contains = aE || {},wO.format.filter.DWithin = lE || {},wO.format.filter.Disjoint = cE || {},wO.format.filter.During = dE || {},wO.format.filter.EqualTo = vE || {},wO.format.filter.Filter = HS || {},wO.format.filter.GreaterThan = bE || {},wO.format.filter.GreaterThanOrEqualTo = wE || {},wO.format.filter.Intersects = EE || {},wO.format.filter.IsBetween = CE || {},wO.format.filter.IsLike = PE || {},wO.format.filter.IsNull = IE || {},wO.format.filter.LessThan = ME || {},wO.format.filter.LessThanOrEqualTo = AE || {},wO.format.filter.LogicalNary = JS || {},wO.format.filter.Not = jE || {},wO.format.filter.NotEqualTo = DE || {},wO.format.filter.Or = zE || {},wO.format.filter.ResourceId = BE || {},wO.format.filter.Spatial = iE || {},wO.format.filter.Within = YE || {},wO.format.filter.and = WE || {},wO.format.filter.bbox = qE || {},wO.format.filter.between = function (t, e, r) {
  26542. return new CE(t, e, r)
  26543. } || {},wO.format.filter.contains = function (t, e, r) {
  26544. return new aE(t, e, r)
  26545. } || {},wO.format.filter.disjoint = function (t, e, r) {
  26546. return new cE(t, e, r)
  26547. } || {},wO.format.filter.during = function (t, e, r) {
  26548. return new dE(t, e, r)
  26549. } || {},wO.format.filter.dwithin = function (t, e, r, n, i) {
  26550. return new lE(t, e, r, n, i)
  26551. } || {},wO.format.filter.equalTo = function (t, e, r) {
  26552. return new vE(t, e, r)
  26553. } || {},wO.format.filter.greaterThan = function (t, e) {
  26554. return new bE(t, e)
  26555. } || {},wO.format.filter.greaterThanOrEqualTo = function (t, e) {
  26556. return new wE(t, e)
  26557. } || {},wO.format.filter.intersects = function (t, e, r) {
  26558. return new EE(t, e, r)
  26559. } || {},wO.format.filter.isNull = function (t) {
  26560. return new IE(t)
  26561. } || {},wO.format.filter.lessThan = function (t, e) {
  26562. return new ME(t, e)
  26563. } || {},wO.format.filter.lessThanOrEqualTo = function (t, e) {
  26564. return new AE(t, e)
  26565. } || {},wO.format.filter.like = function (t, e, r, n, i, o) {
  26566. return new PE(t, e, r, n, i, o)
  26567. } || {},wO.format.filter.not = function (t) {
  26568. return new jE(t)
  26569. } || {},wO.format.filter.notEqualTo = function (t, e, r) {
  26570. return new DE(t, e, r)
  26571. } || {},wO.format.filter.or = function (t) {
  26572. var e = [null].concat(Array.prototype.slice.call(arguments));
  26573. return new (Function.prototype.bind.apply(zE, e))
  26574. } || {},wO.format.filter.resourceId = function (t) {
  26575. return new BE(t)
  26576. } || {},wO.format.filter.within = function (t, e, r) {
  26577. return new YE(t, e, r)
  26578. } || {},wO.format.xsd = {},wO.format.xsd.readBoolean = A_ || {},wO.format.xsd.readBooleanString = k_ || {},wO.format.xsd.readDateTime = j_ || {},wO.format.xsd.readDecimal = N_ || {},wO.format.xsd.readDecimalString = D_ || {},wO.format.xsd.readNonNegativeInteger = G_ || {},wO.format.xsd.readNonNegativeIntegerString = z_ || {},wO.format.xsd.readString = U_ || {},wO.format.xsd.writeBooleanTextNode = B_ || {},wO.format.xsd.writeCDATASection = V_ || {},wO.format.xsd.writeDateTimeTextNode = Y_ || {},wO.format.xsd.writeDecimalTextNode = W_ || {},wO.format.xsd.writeNonNegativeIntegerTextNode = q_ || {},wO.format.xsd.writeStringTextNode = X_ || {},wO.functions = {},wO.functions.FALSE = E || {},wO.functions.TRUE = S || {},wO.functions.VOID = T || {},wO.functions.memoizeOne = C || {},wO.geom = {},wO.geom.Circle = Rv || {},wO.geom.Geometry = dn || {},wO.geom.GeometryCollection = Vm || {},wO.geom.LineString = Py || {},wO.geom.LinearRing = Yn || {},wO.geom.MultiLineString = Zy || {},wO.geom.MultiPoint = Hy || {},wO.geom.MultiPolygon = Jy || {},wO.geom.Point = qn || {},wO.geom.Polygon = fi || {},wO.geom.Polygon.circular = di || {},wO.geom.Polygon.fromCircle = yi || {},wO.geom.Polygon.fromExtent = gi || {},wO.geom.Polygon.makeRegular = mi || {},wO.geom.SimpleGeometry = vn || {},wO.geom.SimpleGeometry.getStrideForLayout = yn || {},wO.geom.SimpleGeometry.transformGeom2D = mn || {},wO.geom.flat = {},wO.geom.flat.area = {},wO.geom.flat.area.linearRing = zn || {},wO.geom.flat.area.linearRings = Un || {},wO.geom.flat.area.linearRingss = Bn || {},wO.geom.flat.center = {},wO.geom.flat.center.linearRingss = Sy || {},wO.geom.flat.closest = {},wO.geom.flat.closest.arrayMaxSquaredDelta = xn || {},wO.geom.flat.closest.assignClosestArrayPoint = En || {},wO.geom.flat.closest.assignClosestMultiArrayPoint = Tn || {},wO.geom.flat.closest.assignClosestPoint = Sn || {},wO.geom.flat.closest.maxSquaredDelta = bn || {},wO.geom.flat.closest.multiArrayMaxSquaredDelta = wn || {},wO.geom.flat.contains = {},wO.geom.flat.contains.linearRingContainsExtent = Xn || {},wO.geom.flat.contains.linearRingContainsXY = Zn || {},wO.geom.flat.contains.linearRingsContainsXY = Kn || {},wO.geom.flat.contains.linearRingssContainsXY = Hn || {},wO.geom.flat.deflate = {},wO.geom.flat.deflate.deflateCoordinate = Cn || {},wO.geom.flat.deflate.deflateCoordinates = On || {},wO.geom.flat.deflate.deflateCoordinatesArray = Pn || {},wO.geom.flat.deflate.deflateMultiCoordinatesArray = Rn || {},wO.geom.flat.flip = {},wO.geom.flat.flip.flipXY = v_ || {},wO.geom.flat.geodesic = {},wO.geom.flat.geodesic.greatCircleArc = function (t, e, r, n, i, o) {
  26579. var a = Gr("EPSG:4326"), s = Math.cos(Ye(e)), l = Math.sin(Ye(e)), u = Math.cos(Ye(n)), c = Math.sin(Ye(n)),
  26580. h = Math.cos(Ye(r - t)), p = Math.sin(Ye(r - t)), f = l * c + s * u * h;
  26581. return Ly((function (e) {
  26582. if (1 <= f) return [r, n];
  26583. var i = e * Math.acos(f), o = Math.cos(i), a = Math.sin(i), d = p * u, g = s * c - l * u * h,
  26584. y = Math.atan2(d, g), m = Math.asin(l * o + s * a * Math.cos(y));
  26585. return [Ve(Ye(t) + Math.atan2(Math.sin(y) * a * s, o - l * Math.sin(m))), Ve(m)]
  26586. }), Kr(a, i), o)
  26587. } || {},wO.geom.flat.geodesic.meridian = My || {},wO.geom.flat.geodesic.parallel = Fy || {},wO.geom.flat.inflate = {},wO.geom.flat.inflate.inflateCoordinates = Nn || {},wO.geom.flat.inflate.inflateCoordinatesArray = Dn || {},wO.geom.flat.inflate.inflateMultiCoordinatesArray = Gn || {},wO.geom.flat.interiorpoint = {},wO.geom.flat.interiorpoint.getInteriorPointOfArray = $n || {},wO.geom.flat.interiorpoint.getInteriorPointsOfMultiArray = Jn || {},wO.geom.flat.interpolate = {},wO.geom.flat.interpolate.interpolatePoint = by || {},wO.geom.flat.interpolate.lineStringCoordinateAtM = xy || {},wO.geom.flat.interpolate.lineStringsCoordinateAtM = wy || {},wO.geom.flat.intersectsextent = {},wO.geom.flat.intersectsextent.intersectsLineString = ti || {},wO.geom.flat.intersectsextent.intersectsLineStringArray = ei || {},wO.geom.flat.intersectsextent.intersectsLinearRing = ri || {},wO.geom.flat.intersectsextent.intersectsLinearRingArray = ni || {},wO.geom.flat.intersectsextent.intersectsLinearRingMultiArray = ii || {},wO.geom.flat.length = {},wO.geom.flat.length.lineStringLength = qg || {},wO.geom.flat.length.linearRingLength = function (t, e, r, n) {
  26588. var i = qg(t, e, r, n), o = t[r - n] - t[e], a = t[r - n + 1] - t[e + 1];
  26589. return i += Math.sqrt(o * o + a * a)
  26590. } || {},wO.geom.flat.orient = {},wO.geom.flat.orient.linearRingIsClockwise = ai || {},wO.geom.flat.orient.linearRingsAreOriented = si || {},wO.geom.flat.orient.linearRingssAreOriented = li || {},wO.geom.flat.orient.orientLinearRings = ui || {},wO.geom.flat.orient.orientLinearRingsArray = ci || {},wO.geom.flat.reverse = {},wO.geom.flat.reverse.coordinates = oi || {},wO.geom.flat.segments = {},wO.geom.flat.segments.forEach = Qn || {},wO.geom.flat.simplify = {},wO.geom.flat.simplify.douglasPeucker = In || {},wO.geom.flat.simplify.douglasPeuckerArray = Ln || {},wO.geom.flat.simplify.douglasPeuckerMultiArray = function (t, e, r, n, i, o, a, s) {
  26591. for (var l = 0, u = r.length; l < u; ++l) {
  26592. var c = r[l], h = [];
  26593. a = Ln(t, e, c, n, i, o, a, h), s.push(h), e = c[c.length - 1]
  26594. }
  26595. return a
  26596. } || {},wO.geom.flat.simplify.quantize = An || {},wO.geom.flat.simplify.quantizeArray = kn || {},wO.geom.flat.simplify.quantizeMultiArray = jn || {},wO.geom.flat.simplify.radialDistance = Mn || {},wO.geom.flat.simplify.simplifyLineString = function (t, e, r, n, i, o, a) {
  26597. var s = void 0 !== a ? a : [];
  26598. return o || (r = Mn(t, e, r, n, i, s, 0), t = s, e = 0, n = 2), s.length = In(t, e, r, n, i, s, 0), s
  26599. } || {},wO.geom.flat.simplify.snap = Fn || {},wO.geom.flat.straightchunk = {},wO.geom.flat.straightchunk.matchingChunk = Gg || {},wO.geom.flat.textpath = {},wO.geom.flat.textpath.drawTextOnPath = Wg || {},wO.geom.flat.topology = {},wO.geom.flat.topology.lineStringIsClosed = function (t, e, r, n) {
  26600. var i = r - n;
  26601. return t[e] === t[i] && t[e + 1] === t[i + 1] && (r - e) / n > 3 && !!zn(t, e, r, n)
  26602. } || {},wO.geom.flat.transform = {},wO.geom.flat.transform.rotate = un || {},wO.geom.flat.transform.scale = cn || {},wO.geom.flat.transform.transform2D = ln || {},wO.geom.flat.transform.translate = hn || {},wO.has = {},wO.has.DEVICE_PIXEL_RATIO = Vi || {},wO.has.FIREFOX = Gi || {},wO.has.IMAGE_DECODE = Wi || {},wO.has.MAC = Bi || {},wO.has.PASSIVE_EVENT_LISTENERS = qi || {},wO.has.SAFARI = zi || {},wO.has.WEBKIT = Ui || {},wO.has.WORKER_OFFSCREEN_CANVAS = Yi || {},wO.interaction = {},wO.interaction.DoubleClickZoom = Zs || {},wO.interaction.DragAndDrop = Ev || {},wO.interaction.DragAndDrop.DragAndDropEvent = Sv || {},wO.interaction.DragBox = El || {},wO.interaction.DragBox.DragBoxEvent = Sl || {},wO.interaction.DragPan = fl || {},wO.interaction.DragRotate = gl || {},wO.interaction.DragRotateAndZoom = Cv || {},wO.interaction.DragZoom = Cl || {},wO.interaction.Draw = Gv || {},wO.interaction.Draw.DrawEvent = Dv || {},wO.interaction.Draw.createBox = function () {
  26603. return function (t, e, r) {
  26604. var n = Kt([t[0], t[t.length - 1]].map((function (t) {
  26605. return rn(t, r)
  26606. }))), i = [[_e(n), be(n), Oe(n), Ce(n), _e(n)]], o = e;
  26607. o ? o.setCoordinates(i) : o = new fi(i);
  26608. var a = tn();
  26609. return a && o.transform(r, a), o
  26610. }
  26611. } || {},wO.interaction.Draw.createRegularPolygon = function (t, e) {
  26612. return function (r, n, i) {
  26613. var o = rn(r[0], i), a = rn(r[r.length - 1], i), s = Math.sqrt(Rr(o, a)), l = n || yi(new Rv(o), t), u = e;
  26614. if (!e && 0 !== e) {
  26615. var c = a[0] - o[0], h = a[1] - o[1];
  26616. u = Math.atan2(h, c)
  26617. }
  26618. mi(l, o, s, u);
  26619. var p = tn();
  26620. return p && l.transform(i, p), l
  26621. }
  26622. } || {},wO.interaction.Extent = qv || {},wO.interaction.Extent.ExtentEvent = Bv || {},wO.interaction.Interaction = qs || {},wO.interaction.Interaction.pan = Ys || {},wO.interaction.Interaction.zoomByDelta = Ws || {},wO.interaction.KeyboardPan = Ml || {},wO.interaction.KeyboardZoom = Al || {},wO.interaction.Modify = r_ || {},wO.interaction.Modify.ModifyEvent = Jv || {},wO.interaction.MouseWheelZoom = Dl || {},wO.interaction.PinchRotate = zl || {},wO.interaction.PinchZoom = Bl || {},wO.interaction.Pointer = $s || {},wO.interaction.Pointer.centroid = Hs || {},wO.interaction.Select = s_ || {},wO.interaction.Select.SelectEvent = o_ || {},wO.interaction.Snap = h_ || {},wO.interaction.Translate = m_ || {},wO.interaction.Translate.TranslateEvent = y_ || {},wO.interaction.defaults = Vl || {},wO.layer = {},wO.layer.Base = Wo || {},wO.layer.BaseImage = ad || {},wO.layer.BaseTile = vd || {},wO.layer.BaseVector = wg || {},wO.layer.Graticule = Ny || {},wO.layer.Group = Aa || {},wO.layer.Heatmap = Vy || {},wO.layer.Image = dd || {},wO.layer.Layer = na || {},wO.layer.Layer.inView = ra || {},wO.layer.MapboxVector = yv || {},wO.layer.MapboxVector.getMapboxPath = uv || {},wO.layer.MapboxVector.normalizeGlyphsUrl = hv || {},wO.layer.MapboxVector.normalizeSourceUrl = fv || {},wO.layer.MapboxVector.normalizeSpriteUrl = cv || {},wO.layer.MapboxVector.normalizeStyleUrl = pv || {},wO.layer.Tile = Sd || {},wO.layer.Vector = Iy || {},wO.layer.VectorImage = vv || {},wO.layer.VectorTile = lm || {},wO.layer.WebGLPoints = bv || {},wO.loadingstrategy = {},wO.loadingstrategy.all = Fu || {},wO.loadingstrategy.bbox = function (t, e) {
  26623. return [t]
  26624. } || {},wO.loadingstrategy.tile = function (t) {
  26625. return function (e, r) {
  26626. var n = t.getZForResolution(r), i = t.getTileRangeForExtentAndZ(e, n), o = [], a = [n, 0, 0];
  26627. for (a[1] = i.minX; a[1] <= i.maxX; ++a[1]) for (a[2] = i.minY; a[2] <= i.maxY; ++a[2]) o.push(t.getTileCoordExtent(a));
  26628. return o
  26629. }
  26630. } || {},wO.math = {},wO.math.clamp = Ne || {},wO.math.cosh = De || {},wO.math.lerp = qe || {},wO.math.log2 = Ge || {},wO.math.modulo = We || {},wO.math.solveLinearSystem = Be || {},wO.math.squaredDistance = Ue || {},wO.math.squaredSegmentDistance = ze || {},wO.math.toDegrees = Ve || {},wO.math.toRadians = Ye || {},wO.net = {},wO.net.jsonp = Au || {},wO.obj = {},wO.obj.assign = O || {},wO.obj.clear = P || {},wO.obj.getValues = R || {},wO.obj.isEmpty = I || {},wO.proj = {},wO.proj.Projection = je || {},wO.proj.Units = St || {},wO.proj.Units.METERS_PER_UNIT = wt || {},wO.proj.addCommon = sn || {},wO.proj.addCoordinateTransforms = Wr || {},wO.proj.addEquivalentProjections = Ur || {},wO.proj.addEquivalentTransforms = Br || {},wO.proj.addProjection = Nr || {},wO.proj.addProjections = Dr || {},wO.proj.clearAllProjections = function () {
  26631. lr(), pr()
  26632. } || {},wO.proj.clearUserProjection = function () {
  26633. Jr = null
  26634. } || {},wO.proj.cloneTransform = kr || {},wO.proj.createProjection = Vr || {},wO.proj.createSafeCoordinateTransform = an || {},wO.proj.createTransformFromCoordinateTransform = Yr || {},wO.proj.epsg3857 = {},wO.proj.epsg3857.EXTENT = Ke || {},wO.proj.epsg3857.HALF_SIZE = Ze || {},wO.proj.epsg3857.MAX_SAFE_Y = $e || {},wO.proj.epsg3857.PROJECTIONS = Qe || {},wO.proj.epsg3857.RADIUS = 6378137,wO.proj.epsg3857.WORLD_EXTENT = He || {},wO.proj.epsg3857.fromEPSG4326 = tr || {},wO.proj.epsg3857.toEPSG4326 = er || {},wO.proj.epsg4326 = {},wO.proj.epsg4326.EXTENT = nr || {},wO.proj.epsg4326.METERS_PER_UNIT = ir || {},wO.proj.epsg4326.PROJECTIONS = ar || {},wO.proj.epsg4326.RADIUS = 6378137,wO.proj.equivalent = Xr || {},wO.proj.fromLonLat = qr || {},wO.proj.fromUserCoordinate = rn || {},wO.proj.fromUserExtent = on || {},wO.proj.get = Gr || {},wO.proj.getPointResolution = zr || {},wO.proj.getTransform = Kr || {},wO.proj.getTransformFromProjections = Zr || {},wO.proj.getUserProjection = tn || {},wO.proj.identityTransform = jr || {},wO.proj.proj4 = {},wO.proj.proj4.register = function (t) {
  26635. var e, r, n = Object.keys(t.defs), i = n.length;
  26636. for (e = 0; e < i; ++e) {
  26637. var o = n[e];
  26638. if (!Gr(o)) {
  26639. var a = t.defs(o), s = a.units;
  26640. s || "longlat" !== a.projName || (s = St.DEGREES), Nr(new je({
  26641. code: o,
  26642. axisOrientation: a.axis,
  26643. metersPerUnit: a.to_meter,
  26644. units: s
  26645. }))
  26646. }
  26647. }
  26648. for (e = 0; e < i; ++e) {
  26649. var l = n[e], u = Gr(l);
  26650. for (r = 0; r < i; ++r) {
  26651. var c = n[r], h = Gr(c);
  26652. if (!dr(l, c)) {
  26653. var p = t.defs(l), f = t.defs(c);
  26654. if (p === f) Ur([u, h]); else {
  26655. var d = t(O({}, p, {axis: void 0}), O({}, f, {axis: void 0}));
  26656. Wr(u, h, an(u, h, d.forward), an(h, u, d.inverse))
  26657. }
  26658. }
  26659. }
  26660. }
  26661. } || {},wO.proj.projections = {},wO.proj.projections.add = cr || {},wO.proj.projections.clear = lr || {},wO.proj.projections.get = ur || {},wO.proj.setUserProjection = Qr || {},wO.proj.toLonLat = function (t, e) {
  26662. var r = Hr(t, void 0 !== e ? e : "EPSG:3857", "EPSG:4326"), n = r[0];
  26663. return (n < -180 || n > 180) && (r[0] = We(n + 180, 360) - 180), r
  26664. } || {},wO.proj.toUserCoordinate = en || {},wO.proj.toUserExtent = nn || {},wO.proj.transform = Hr || {},wO.proj.transformExtent = $r || {},wO.proj.transformWithProjections = function (t, e, r) {
  26665. return Zr(e, r)(t)
  26666. } || {},wO.proj.transforms = {},wO.proj.transforms.add = fr || {},wO.proj.transforms.clear = pr || {},wO.proj.transforms.get = dr || {},wO.proj.transforms.remove = function (t, e) {
  26667. var r = t.getCode(), n = e.getCode(), i = hr[r][n];
  26668. return delete hr[r][n], I(hr[r]) && delete hr[r], i
  26669. } || {},wO.proj.useGeographic = function () {
  26670. Qr("EPSG:4326")
  26671. } || {},wO.render = {},wO.render.Box = ml || {},wO.render.Event = la || {},wO.render.Feature = Cy || {},wO.render.VectorContext = ku || {},wO.render.canvas = {},wO.render.canvas.Builder = Mg || {},wO.render.canvas.BuilderGroup = Yg || {},wO.render.canvas.Executor = ey || {},wO.render.canvas.ExecutorGroup = ay || {},wO.render.canvas.ExecutorGroup.getPixelIndexArray = oy || {},wO.render.canvas.ImageBuilder = Ag || {},wO.render.canvas.Immediate = Nu || {},wO.render.canvas.Instruction = Ig || {},wO.render.canvas.Instruction.beginPathInstruction = Pg || {},wO.render.canvas.Instruction.closePathInstruction = Rg || {},wO.render.canvas.Instruction.fillInstruction = Cg || {},wO.render.canvas.Instruction.strokeInstruction = Og || {},wO.render.canvas.LineStringBuilder = jg || {},wO.render.canvas.PolygonBuilder = Dg || {},wO.render.canvas.TextBuilder = Bg || {},wO.render.canvas.checkedFonts = da || {},wO.render.canvas.createTransformString = Ra || {},wO.render.canvas.defaultFillStyle = "#000",wO.render.canvas.defaultFont = "10px sans-serif",wO.render.canvas.defaultLineCap = "round",wO.render.canvas.defaultLineDash = pa || {},wO.render.canvas.defaultLineDashOffset = {},wO.render.canvas.defaultLineJoin = "round",wO.render.canvas.defaultLineWidth = 1,wO.render.canvas.defaultMiterLimit = 10,wO.render.canvas.defaultPadding = fa || {},wO.render.canvas.defaultStrokeStyle = "#000",wO.render.canvas.defaultTextAlign = "center",wO.render.canvas.defaultTextBaseline = "middle",wO.render.canvas.drawImageOrLabel = Oa || {},wO.render.canvas.hitdetect = {},wO.render.canvas.hitdetect.createHitDetectionImageData = sy || {},wO.render.canvas.hitdetect.hitDetect = ly || {},wO.render.canvas.labelCache = ga || {},wO.render.canvas.measureAndCacheTextWidth = Ea || {},wO.render.canvas.measureTextHeight = xa || {},wO.render.canvas.measureTextWidth = Sa || {},wO.render.canvas.measureTextWidths = Ta || {},wO.render.canvas.registerFont = ba || {},wO.render.canvas.rotateAtOffset = Ca || {},wO.render.canvas.textHeights = _a || {},wO.render.getRenderPixel = function (t, e) {
  26672. var r = e.slice(0);
  26673. return It(t.inversePixelTransform.slice(), r), r
  26674. } || {},wO.render.getVectorContext = Ku || {},wO.render.toContext = function (t, e) {
  26675. var r = t.canvas, n = e || {}, i = n.pixelRatio || Vi, o = n.size;
  26676. o && (r.width = o[0] * i, r.height = o[1] * i, r.style.width = o[0] + "px", r.style.height = o[1] + "px");
  26677. var a = [0, 0, r.width, r.height], s = Mt([1, 0, 0, 1, 0, 0], i, i);
  26678. return new Nu(t, i, a, s, 0)
  26679. } || {},wO.renderer = {},wO.renderer.Composite = La || {},wO.renderer.Layer = ld || {},wO.renderer.Map = aa || {},wO.renderer.canvas = {},wO.renderer.canvas.ImageLayer = pd || {},wO.renderer.canvas.Layer = cd || {},wO.renderer.canvas.TileLayer = xd || {},wO.renderer.canvas.VectorImageLayer = py || {},wO.renderer.canvas.VectorLayer = cy || {},wO.renderer.canvas.VectorTileLayer = _y || {},wO.renderer.vector = {},wO.renderer.vector.defaultOrder = Wu || {},wO.renderer.vector.getSquaredTolerance = qu || {},wO.renderer.vector.getTolerance = Xu || {},wO.renderer.vector.renderFeature = Zu || {},wO.renderer.webgl = {},wO.renderer.webgl.Layer = _g || {},wO.renderer.webgl.Layer.colorDecodeId = vg || {},wO.renderer.webgl.Layer.colorEncodeId = mg || {},wO.renderer.webgl.Layer.getBlankImageData = function () {
  26680. var t = document.createElement("canvas").getContext("2d").createImageData(1, 1);
  26681. return t.data[0] = 255, t.data[1] = 255, t.data[2] = 255, t.data[3] = 255, t
  26682. } || {},wO.renderer.webgl.Layer.writePointFeatureToBuffers = function (t, e, r, n, i, o) {
  26683. var a = 3 + i, s = t[e + 0], l = t[e + 1], u = dg;
  26684. u.length = i;
  26685. for (var c = 0; c < u.length; c++) u[c] = t[e + 2 + c];
  26686. var h = o ? o.vertexPosition : 0, p = o ? o.indexPosition : 0, f = h / a;
  26687. return yg(r, h, s, l, 0), u.length && r.set(u, h + 3), yg(r, h += a, s, l, 1), u.length && r.set(u, h + 3), yg(r, h += a, s, l, 2), u.length && r.set(u, h + 3), yg(r, h += a, s, l, 3), u.length && r.set(u, h + 3), h += a, n[p++] = f, n[p++] = f + 1, n[p++] = f + 3, n[p++] = f + 1, n[p++] = f + 2, n[p++] = f + 3, gg.vertexPosition = h, gg.indexPosition = p, gg
  26688. } || {},wO.renderer.webgl.PointsLayer = Eg || {},wO.reproj = {},wO.reproj.Image = Ff || {},wO.reproj.Tile = Mp || {},wO.reproj.Triangulation = Ip || {},wO.reproj.calculateSourceExtentResolution = ec || {},wO.reproj.calculateSourceResolution = tc || {},wO.reproj.common = {},wO.reproj.common.ENABLE_RASTER_REPROJECTION = !0,wO.reproj.common.ERROR_THRESHOLD = .5,wO.reproj.render = rc || {},wO.resolutionconstraint = {},wO.resolutionconstraint.createMinMaxResolution = ds || {},wO.resolutionconstraint.createSnapToPower = fs || {},wO.resolutionconstraint.createSnapToResolutions = ps || {},wO.rotationconstraint = {},wO.rotationconstraint.createSnapToN = ms || {},wO.rotationconstraint.createSnapToZero = vs || {},wO.rotationconstraint.disable = gs || {},wO.rotationconstraint.none = ys || {},wO.size = {},wO.size.buffer = Os || {},wO.size.hasArea = Ps || {},wO.size.scale = Rs || {},wO.size.toSize = Is || {},wO.source = {},wO.source.BingMaps = Hp || {},wO.source.BingMaps.quadKey = Kp || {},wO.source.CartoDB = tf || {},wO.source.Cluster = ff || {},wO.source.IIIF = Lf || {},wO.source.Image = zf || {},wO.source.Image.ImageSourceEvent = Df || {},wO.source.Image.defaultImageLoadFunction = Gf || {},wO.source.ImageArcGISRest = Bf || {},wO.source.ImageCanvas = Yf || {},wO.source.ImageMapGuide = qf || {},wO.source.ImageStatic = Zf || {},wO.source.ImageWMS = ed || {},wO.source.OSM = id || {},wO.source.OSM.ATTRIBUTION = nd,wO.source.Raster = zd || {},wO.source.Raster.Processor = Id || {},wO.source.Raster.RasterSourceEvent = kd || {},wO.source.Raster.newImageData = Od || {},wO.source.Source = Dp || {},wO.source.Stamen = Wd || {},wO.source.Tile = Bp || {},wO.source.Tile.TileSourceEvent = Up || {},wO.source.TileArcGISRest = Xd || {},wO.source.TileDebug = Hd || {},wO.source.TileImage = Xp || {},wO.source.TileJSON = Jd || {},wO.source.TileWMS = tg || {},wO.source.UTFGrid = ng || {},wO.source.UTFGrid.CustomTile = rg || {},wO.source.UrlTile = Yp || {},wO.source.Vector = hf || {},wO.source.Vector.VectorSourceEvent = cf || {},wO.source.VectorTile = og || {},wO.source.VectorTile.defaultLoadFunction = ag || {},wO.source.WMTS = cg || {},wO.source.WMTS.optionsFromCapabilities = function (t, e) {
  26689. var r = _(t.Contents.Layer, (function (t, r, n) {
  26690. return t.Identifier == e.layer
  26691. }));
  26692. if (null === r) return null;
  26693. var n, i = t.Contents.TileMatrixSet;
  26694. (n = r.TileMatrixSetLink.length > 1 ? x(r.TileMatrixSetLink, "projection" in e ? function (t, r, n) {
  26695. var o = _(i, (function (e) {
  26696. return e.Identifier == t.TileMatrixSet
  26697. })).SupportedCRS, a = Gr(o), s = Gr(e.projection);
  26698. return a && s ? Xr(a, s) : o == e.projection
  26699. } : function (t, r, n) {
  26700. return t.TileMatrixSet == e.matrixSet
  26701. }) : 0) < 0 && (n = 0);
  26702. var o = r.TileMatrixSetLink[n].TileMatrixSet, a = r.TileMatrixSetLink[n].TileMatrixSetLimits, s = r.Format[0];
  26703. "format" in e && (s = e.format), (n = x(r.Style, (function (t, r, n) {
  26704. return "style" in e ? t.Title == e.style : t.isDefault
  26705. }))) < 0 && (n = 0);
  26706. var l = r.Style[n].Identifier, u = {};
  26707. "Dimension" in r && r.Dimension.forEach((function (t, e, r) {
  26708. var n = t.Identifier, i = t.Default;
  26709. void 0 === i && (i = t.Value[0]), u[n] = i
  26710. }));
  26711. var c, h = _(t.Contents.TileMatrixSet, (function (t, e, r) {
  26712. return t.Identifier == o
  26713. })), p = h.SupportedCRS;
  26714. if (p && (c = Gr(p)), "projection" in e) {
  26715. var f = Gr(e.projection);
  26716. f && (c && !Xr(f, c) || (c = f))
  26717. }
  26718. var d = "ne" == c.getAxisOrientation().substr(0, 2), y = h.TileMatrix[0],
  26719. m = {MinTileCol: 0, MinTileRow: 0, MaxTileCol: y.MatrixWidth - 1, MaxTileRow: y.MatrixHeight - 1};
  26720. if (a) {
  26721. m = a[a.length - 1];
  26722. var v = _(h.TileMatrix, (function (t) {
  26723. return t.Identifier === m.TileMatrix || h.Identifier + ":" + t.Identifier === m.TileMatrix
  26724. }));
  26725. v && (y = v)
  26726. }
  26727. var b = 28e-5 * y.ScaleDenominator / c.getMetersPerUnit(),
  26728. w = d ? [y.TopLeftCorner[1], y.TopLeftCorner[0]] : y.TopLeftCorner, S = y.TileWidth * b, E = y.TileHeight * b,
  26729. T = [w[0] + S * m.MinTileCol, w[1] - E * (1 + m.MaxTileRow), w[0] + S * (1 + m.MaxTileCol), w[1] - E * m.MinTileRow];
  26730. null === c.getExtent() && c.setExtent(T);
  26731. var C = Kh(h, T, a), O = [], P = e.requestEncoding;
  26732. if (P = void 0 !== P ? P : "", "OperationsMetadata" in t && "GetTile" in t.OperationsMetadata) for (var R = t.OperationsMetadata.GetTile.DCP.HTTP.Get, I = 0, L = R.length; I < L; ++I) if (R[I].Constraint) {
  26733. var M = _(R[I].Constraint, (function (t) {
  26734. return "GetEncoding" == t.name
  26735. })).AllowedValues.Value;
  26736. if ("" === P && (P = M[0]), P !== sg) break;
  26737. g(M, sg) && O.push(R[I].href)
  26738. } else R[I].href && (P = sg, O.push(R[I].href));
  26739. return 0 === O.length && (P = lg, r.ResourceURL.forEach((function (t) {
  26740. "tile" === t.resourceType && (s = t.format, O.push(t.template))
  26741. }))), {
  26742. urls: O,
  26743. layer: e.layer,
  26744. matrixSet: o,
  26745. format: s,
  26746. projection: c,
  26747. requestEncoding: P,
  26748. tileGrid: C,
  26749. style: l,
  26750. dimensions: u,
  26751. wrapX: !1,
  26752. crossOrigin: e.crossOrigin
  26753. }
  26754. } || {},wO.source.XYZ = Jp || {},wO.source.Zoomify = vf || {},wO.source.Zoomify.CustomTile = mf || {},wO.source.common = {},wO.source.common.DEFAULT_WMS_VERSION = "1.3.0",wO.source.common.IMAGE_SMOOTHING_DISABLED = $u || {},wO.sphere = {},wO.sphere.DEFAULT_RADIUS = 6371008.8,wO.sphere.getArea = function t(e, r) {
  26755. var n = r || {}, i = n.radius || 6371008.8, o = n.projection || "EPSG:3857", a = e.getType();
  26756. a !== bt.GEOMETRY_COLLECTION && (e = e.clone().transform(o, "EPSG:4326"));
  26757. var s, l, u, c, h, p, f = 0;
  26758. switch (a) {
  26759. case bt.POINT:
  26760. case bt.MULTI_POINT:
  26761. case bt.LINE_STRING:
  26762. case bt.MULTI_LINE_STRING:
  26763. case bt.LINEAR_RING:
  26764. break;
  26765. case bt.POLYGON:
  26766. for (s = e.getCoordinates(), f = Math.abs(mr(s[0], i)), u = 1, c = s.length; u < c; ++u) f -= Math.abs(mr(s[u], i));
  26767. break;
  26768. case bt.MULTI_POLYGON:
  26769. for (u = 0, c = (s = e.getCoordinates()).length; u < c; ++u) for (l = s[u], f += Math.abs(mr(l[0], i)), h = 1, p = l.length; h < p; ++h) f -= Math.abs(mr(l[h], i));
  26770. break;
  26771. case bt.GEOMETRY_COLLECTION:
  26772. var d = e.getGeometries();
  26773. for (u = 0, c = d.length; u < c; ++u) f += t(d[u], r);
  26774. break;
  26775. default:
  26776. throw new Error("Unsupported geometry type: " + a)
  26777. }
  26778. return f
  26779. } || {},wO.sphere.getDistance = gr || {},wO.sphere.getLength = function t(e, r) {
  26780. var n = r || {}, i = n.radius || 6371008.8, o = n.projection || "EPSG:3857", a = e.getType();
  26781. a !== bt.GEOMETRY_COLLECTION && (e = e.clone().transform(o, "EPSG:4326"));
  26782. var s, l, u, c, h, p, f = 0;
  26783. switch (a) {
  26784. case bt.POINT:
  26785. case bt.MULTI_POINT:
  26786. break;
  26787. case bt.LINE_STRING:
  26788. case bt.LINEAR_RING:
  26789. f = yr(s = e.getCoordinates(), i);
  26790. break;
  26791. case bt.MULTI_LINE_STRING:
  26792. case bt.POLYGON:
  26793. for (u = 0, c = (s = e.getCoordinates()).length; u < c; ++u) f += yr(s[u], i);
  26794. break;
  26795. case bt.MULTI_POLYGON:
  26796. for (u = 0, c = (s = e.getCoordinates()).length; u < c; ++u) for (h = 0, p = (l = s[u]).length; h < p; ++h) f += yr(l[h], i);
  26797. break;
  26798. case bt.GEOMETRY_COLLECTION:
  26799. var d = e.getGeometries();
  26800. for (u = 0, c = d.length; u < c; ++u) f += t(d[u], r);
  26801. break;
  26802. default:
  26803. throw new Error("Unsupported geometry type: " + a)
  26804. }
  26805. return f
  26806. } || {},wO.sphere.offset = vr || {},wO.string = {},wO.string.compareVersions = br || {},wO.string.padNumber = _r || {},wO.structs = {},wO.structs.LRUCache = lu || {},wO.structs.LinkedList = Cp || {},wO.structs.PriorityQueue = Qa || {},wO.structs.PriorityQueue.DROP = 1 / 0,wO.structs.RBush = Rp || {},wO.style = {},wO.style.Circle = tp || {},wO.style.Fill = ep || {},wO.style.Icon = dp || {},wO.style.IconImage = pp || {},wO.style.IconImage.get = hp || {},wO.style.IconImageCache = Fo || {},wO.style.IconImageCache.shared = Ao || {},wO.style.Image = Hh || {},wO.style.LiteralStyle = {},wO.style.RegularShape = Jh || {},wO.style.Stroke = gp || {},wO.style.Style = wp || {},wO.style.Style.createDefaultStyle = _p || {},wO.style.Style.createEditingStyle = bp || {},wO.style.Style.toFunction = mp || {},wO.style.Text = Tp || {},wO.style.expressions = {},wO.style.expressions.Operators = Eh || {},wO.style.expressions.arrayToGlsl = Ph || {},wO.style.expressions.colorToGlsl = Rh || {},wO.style.expressions.expressionToGlsl = Mh || {},wO.style.expressions.getStringNumberEquivalent = Ih || {},wO.style.expressions.getValueType = Th || {},wO.style.expressions.isTypeUnique = Ch || {},wO.style.expressions.numberToGlsl = Oh || {},wO.style.expressions.stringToGlsl = Lh || {},wO.tilecoord = {},wO.tilecoord.createOrUpdate = uu || {},wO.tilecoord.fromKey = pu || {},wO.tilecoord.getKey = hu || {},wO.tilecoord.getKeyZXY = cu || {},wO.tilecoord.hash = fu || {},wO.tilecoord.withinExtentAndZ = du || {},wO.tilegrid = {},wO.tilegrid.TileGrid = ic || {},wO.tilegrid.WMTS = Zh || {},wO.tilegrid.WMTS.createFromCapabilitiesMatrixSet = Kh || {},wO.tilegrid.common = {},wO.tilegrid.common.DEFAULT_MAX_ZOOM = 42,wO.tilegrid.common.DEFAULT_TILE_SIZE = 256,wO.tilegrid.createForExtent = sc || {},wO.tilegrid.createForProjection = cc || {},wO.tilegrid.createXYZ = lc || {},wO.tilegrid.extentFromProjection = hc || {},wO.tilegrid.getForProjection = oc || {},wO.tilegrid.wrapX = ac || {},wO.tileurlfunction = {},wO.tileurlfunction.createFromTemplate = pc || {},wO.tileurlfunction.createFromTemplates = fc || {},wO.tileurlfunction.createFromTileUrlFunctions = dc || {},wO.tileurlfunction.expandUrl = yc || {},wO.tileurlfunction.nullTileUrlFunction = gc || {},wO.transform = {},wO.transform.apply = It || {},wO.transform.compose = kt || {},wO.transform.composeCssTransform = function (t, e, r, n, i, o, a) {
  26807. return Dt(kt([1, 0, 0, 1, 0, 0], t, e, r, n, i, o, a))
  26808. } || {},wO.transform.create = Tt || {},wO.transform.determinant = Nt || {},wO.transform.invert = function (t) {
  26809. return jt(t, t)
  26810. } || {},wO.transform.makeInverse = jt || {},wO.transform.makeScale = Ft || {},wO.transform.multiply = Ot || {},wO.transform.reset = Ct || {},wO.transform.rotate = Lt || {},wO.transform.scale = Mt || {},wO.transform.set = Pt || {},wO.transform.setFromArray = Rt || {},wO.transform.toString = Dt || {},wO.transform.translate = At || {},wO.uri = {},wO.uri.appendParams = mc || {},wO.util = {},wO.util.VERSION = "6.5.0",wO.util.abstract = n || {},wO.util.getUid = o || {},wO.vec = {},wO.vec.mat4 = {},wO.vec.mat4.create = nh || {},wO.vec.mat4.fromTransform = ih || {},wO.webgl = {},wO.webgl.ARRAY_BUFFER = 34962,wO.webgl.Buffer = Qc || {},wO.webgl.Buffer.getArrayClassForType = Jc || {},wO.webgl.DYNAMIC_DRAW = 35048,wO.webgl.ELEMENT_ARRAY_BUFFER = 34963,wO.webgl.FLOAT = 5126,wO.webgl.Helper = gh || {},wO.webgl.Helper.computeAttributesStride = fh || {};
  26811. wO.webgl.PostProcessingPass = rh || {}, wO.webgl.RenderTarget = mh || {}, wO.webgl.STATIC_DRAW = 35044, wO.webgl.STREAM_DRAW = 35040, wO.webgl.ShaderBuilder = {}, wO.webgl.ShaderBuilder.ShaderBuilder = Yh || {}, wO.webgl.ShaderBuilder.parseLiteralStyle = Wh || {}, wO.webgl.UNSIGNED_BYTE = 5121, wO.webgl.UNSIGNED_INT = 5125, wO.webgl.UNSIGNED_SHORT = 5123, wO.webgl.getContext = bc || {}, wO.webgl.getSupportedExtensions = xc || {}, wO.worker = {}, wO.worker.version = {}, wO.worker.webgl = {}, wO.xml = {}, wO.xml.OBJECT_PROPERTY_NODE_FACTORY = Nc || {}, wO.xml.XML_SCHEMA_INSTANCE_URI = wc, wO.xml.createElementNS = Sc || {}, wO.xml.getAllTextContent = Ec || {}, wO.xml.getAllTextContent_ = Tc || {}, wO.xml.getAttributeNS = Oc || {}, wO.xml.getDocument = Xc || {}, wO.xml.getXMLSerializer = Wc || {}, wO.xml.isDocument = Cc || {}, wO.xml.makeArrayExtender = Rc || {}, wO.xml.makeArrayPusher = Ic || {}, wO.xml.makeArraySerializer = kc || {}, wO.xml.makeChildAppender = Ac || {}, wO.xml.makeObjectPropertyPusher = Mc || {}, wO.xml.makeObjectPropertySetter = Fc || {}, wO.xml.makeReplacer = Lc || {}, wO.xml.makeSequence = Dc || {}, wO.xml.makeSimpleNodeFactory = jc || {}, wO.xml.makeStructureNS = Gc || {}, wO.xml.parse = Pc || {}, wO.xml.parseNode = zc || {}, wO.xml.pushParseAndPop = Uc || {}, wO.xml.pushSerializeAndPop = Vc || {}, wO.xml.registerDocument = function (t) {
  26812. qc = t
  26813. } || {}, wO.xml.registerXMLSerializer = function (t) {
  26814. Yc = t
  26815. } || {}, wO.xml.serialize = Bc || {};
  26816. e.default = wO
  26817. }]).default
  26818. }));
  26819. //# sourceMappingURL=ol.js.map