@nextgis/ngw-leaflet 1.16.9 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- var NgwLeaflet=function(){"use strict";var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function n(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i}function o(t,e,i,n){return new(i||(i=Promise))((function(o,r){function s(t){try{u(n.next(t))}catch(e){r(e)}}function a(t){try{u(n.throw(t))}catch(e){r(e)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,n=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(a){r=[6,a],n=0}finally{i=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e,i){if(i||2===arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function u(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t=s(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=t[i]&&function(e){return new Promise((function(n,o){(function(t,e,i,n){Promise.resolve(n).then((function(e){t({value:e,done:i})}),e)})(n,o,(e=t[i](e)).done,e.value)}))}}}function h(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}h('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}');h(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}");"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var l={exports:{}};(function(t){var e="1.7.1";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function o(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function a(t,e,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)},r}function u(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function h(){return!1}function l(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return c(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?n(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var m=/\{ *([\w_-]+) *\}/g;function _(t,e){return t.replace(m,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var g="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,C=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function M(t,e,i){if(!i||P!==x)return P.call(window,o(t,e));t.call(e)}function T(t){t&&C.call(window,t)}var O={extend:i,create:n,bind:o,lastId:r,stamp:s,throttle:a,wrapNum:u,falseFn:h,formatNum:l,trim:c,splitWords:p,setOptions:d,getParamString:f,template:_,isArray:y,indexOf:v,emptyImageUrl:g,requestFn:P,cancelFn:C,requestAnimFrame:M,cancelAnimFrame:T};function A(){}function k(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=e.__super__=this.prototype,r=n(o);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(k(t.includes),i.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=i(n(r.options),t.options)),i(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},A.include=function(t){return i(this.prototype,t),this},A.mergeOptions=function(t){return i(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var E={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=p(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,r=(t=p(t)).length;o<r;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(this._events[t]=n=[]),i===this&&(i=void 0);for(var o={fn:e,ctx:i},r=n,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===i)return;r.push(o)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,r=n.length;o<r;o++){var s=n[o];if(s.ctx===i&&s.fn===e)return s.fn=h,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,r=n.length;o<r;o++)n[o].fn=h;delete this._events[t]}},fire:function(t,e,n){if(!this.listens(t,n))return this;var o=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var u=r[s];u.fn.call(u.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var r=o((function(){this.off(t,e,i).off(t,r,i)}),this);return this.on(t,e,i).on(t,r,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};E.addEventListener=E.on,E.removeEventListener=E.clearAllEventListeners=E.off,E.addOneTimeEventListener=E.once,E.fireEvent=E.fire,E.hasEventListeners=E.listens;var z=A.extend(E);function S(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function B(t,e,i){return t instanceof S?t:y(t)?new S(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new S(t.x,t.y):new S(t,e,i)}function Z(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof Z?t:new Z(t,e)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function D(t,e){return t instanceof N?t:new N(t,e)}function j(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof j?t:y(t)&&"object"!=typeof t[0]?3===t.length?new j(t[0],t[1],t[2]):2===t.length?new j(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new j(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new j(t,e,i)}S.prototype={clone:function(){return new S(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new S(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new S(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=B(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=B(t)).x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+l(this.x)+", "+l(this.y)+")"}},Z.prototype={extend:function(t){return t=B(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new S((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new S(this.min.x,this.max.y)},getTopRight:function(){return new S(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof S?B(t):R(t))instanceof Z?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max;return o.x>=e.x&&n.x<=i.x&&o.y>=e.y&&n.y<=i.y},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max;return o.x>e.x&&n.x<i.x&&o.y>e.y&&n.y<i.y},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof j)e=t,i=t;else{if(!(t instanceof N))return t?this.extend(F(t)||D(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new j(e.lat,e.lng),this._northEast=new j(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new N(new j(e.lat-n,e.lng-o),new j(i.lat+n,i.lng+o))},getCenter:function(){return new j((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof j||"lat"in t?F(t):D(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof N?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=D(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&n.lat<=i.lat&&o.lng>=e.lng&&n.lng<=i.lng},overlaps:function(t){t=D(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&n.lat<i.lat&&o.lng>e.lng&&n.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=D(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},j.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+l(this.lat,t)+", "+l(this.lng,t)+")"},distanceTo:function(t){return H.distance(this,F(t))},wrap:function(){return H.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return D([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new j(this.lat,this.lng,this.alt)}};var U,W={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new Z(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?u(t.lng,this.wrapLng,!0):t.lng;return new j(this.wrapLat?u(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new N(new j(r.lat-n,r.lng-o),new j(s.lat-n,s.lng-o))}},H=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,u=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*u}}),V=6378137,q={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new S(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new j((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(U=V*Math.PI,new Z([-U,-U],[U,U]))};function G(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function J(t,e,i,n){return new G(t,e,i,n)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new S((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},H,{code:"EPSG:3857",projection:q,transformation:function(){var t=.5/(Math.PI*q.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,r,s,a,u="";for(i=0,o=t.length;i<o;i++){for(n=0,r=(s=t[i]).length;n<r;n++)u+=(n?"L":"M")+(a=s[n]).x+" "+a.y;u+=e?kt?"z":"x":""}return u||"M0 0"}var $=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=zt("webkit"),ot=zt("android"),rt=zt("android 2")||zt("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&zt("Google")&&st<537&&!("AudioNode"in window),ut=!!window.opera,ht=!it&&zt("chrome"),lt=zt("gecko")&&!nt&&!ut&&!tt,ct=!ht&&zt("safari"),pt=zt("phantom"),dt="OTransition"in $,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in $,_t="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,yt="MozPerspective"in $,vt=!window.L_DISABLE_3D&&(mt||_t||yt)&&!dt&&!pt,gt="undefined"!=typeof orientation||zt("mobile"),bt=gt&&nt,wt=gt&&_t,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),Pt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ct=gt&&ut,Mt=gt&&lt,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(i){}return t}(),At=!!document.createElement("canvas").getContext,kt=!(!document.createElementNS||!Q("svg").createSVGRect),Et=!kt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function zt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var St={ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:rt,androidStock:at,opera:ut,chrome:ht,gecko:lt,safari:ct,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:_t,gecko3d:yt,any3d:vt,mobile:gt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Lt,touch:Pt,mobileOpera:Ct,mobileGecko:Mt,retina:Tt,passiveEvents:Ot,canvas:At,svg:kt,vml:Et},It=xt?"MSPointerDown":"pointerdown",Bt=xt?"MSPointerMove":"pointermove",Zt=xt?"MSPointerUp":"pointerup",Rt=xt?"MSPointerCancel":"pointercancel",Nt={},Dt=!1;function jt(t,e,i,n){return"touchstart"===e?Ut(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&Jt(t,i,n),this}function Ft(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(It,n,!1):"touchmove"===e?t.removeEventListener(Bt,n,!1):"touchend"===e&&(t.removeEventListener(Zt,n,!1),t.removeEventListener(Rt,n,!1)),this}function Ut(t,e,i){var n=o((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&He(t),qt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(It,n,!1),Dt||(document.addEventListener(It,Wt,!0),document.addEventListener(Bt,Ht,!0),document.addEventListener(Zt,Vt,!0),document.addEventListener(Rt,Vt,!0),Dt=!0)}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function Vt(t){delete Nt[t.pointerId]}function qt(t,e){for(var i in t.touches=[],Nt)t.touches.push(Nt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||qt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(Bt,n,!1)}function Jt(t,e,i){var n=function(t){qt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(Zt,n,!1),t.addEventListener(Rt,n,!1)}var Kt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Qt="_leaflet_";function Xt(t,e,i){var n,o,r=!1,s=250;function a(t){if(Lt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(n||e);o=t.touches?t.touches[0]:t,r=i>0&&i<=s,n=e}function u(t){if(r&&!o.cancelBubble){if(Lt){if("mouse"===t.pointerType)return;var i,s,a={};for(s in o)a[s]=(i=o[s])&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=u,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!Ot&&{passive:!1}),t.addEventListener(Yt,u,!!Ot&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function $t(t,e){var i=t[Qt+Yt+e],n=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!Ot&&{passive:!1}),t.removeEventListener(Yt,i,!!Ot&&{passive:!1}),t.removeEventListener("dblclick",n,!1),this}var te,ee,ie,ne,oe,re=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function ue(t){return"string"==typeof t?document.getElementById(t):t}function he(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function le(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ce(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ge(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function _e(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!me(t,e)){var r=ge(t);ve(t,(r?r+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):ve(t,c((" "+ge(t)+" ").replace(" "+e+" "," ")))}function ve(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ge(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Le(t,e,i){var n=e||new S(0,0);t.style[re]=(mt?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Pe(t,e){t._leaflet_pos=e,vt?Le(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ce(t){return t._leaflet_pos||new S(0,0)}if("onselectstart"in document)te=function(){Ie(window,"selectstart",He)},ee=function(){Ze(window,"selectstart",He)};else{var Me=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Me){var t=document.documentElement.style;ie=t[Me],t[Me]="none"}},ee=function(){Me&&(document.documentElement.style[Me]=ie,ie=void 0)}}function Te(){Ie(window,"dragstart",He)}function Oe(){Ze(window,"dragstart",He)}function Ae(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ke(),ne=t,oe=t.style.outline,t.style.outline="none",Ie(window,"keydown",ke))}function ke(){ne&&(ne.style.outline=oe,ne=void 0,oe=void 0,Ze(window,"keydown",ke))}function Ee(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Se={TRANSFORM:re,TRANSITION:se,TRANSITION_END:ae,get:ue,getStyle:he,create:le,remove:ce,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:_e,removeClass:ye,setClass:ve,getClass:ge,setOpacity:be,testProp:xe,setTransform:Le,setPosition:Pe,getPosition:Ce,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:Te,enableImageDrag:Oe,preventOutline:Ae,restoreOutline:ke,getSizedParentNode:Ee,getScale:ze};function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)De(t,o,e[o],i);else for(var r=0,s=(e=p(e)).length;r<s;r++)De(t,e[r],i,n);return this}var Be="_leaflet_events";function Ze(t,e,i,n){if("object"==typeof e)for(var o in e)je(t,o,e[o],i);else if(e)for(var r=0,s=(e=p(e)).length;r<s;r++)je(t,e[r],i,n);else{for(var a in t[Be])je(t,a,t[Be][a]);delete t[Be]}return this}function Re(){if(Lt)return!(it||ct)}var Ne={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function De(t,e,i,n){var o=e+s(i)+(n?"_"+s(n):"");if(t[Be]&&t[Be][o])return this;var r=function(e){return i.call(n||t,e||window.event)},a=r;Lt&&0===e.indexOf("touch")?jt(t,e,r,o):Pt&&"dblclick"===e&&!Re()?Xt(t,r,o):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ne[e]||e,r,!!Ot&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Ne[e],r=function(e){e=e||window.event,Xe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,r),t[Be]=t[Be]||{},t[Be][o]=r}function je(t,e,i,n){var o=e+s(i)+(n?"_"+s(n):""),r=t[Be]&&t[Be][o];if(!r)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,o):Pt&&"dblclick"===e&&!Re()?$t(t,o):"removeEventListener"in t?t.removeEventListener(Ne[e]||e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[Be][o]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Ue(t){return De(t,"wheel",Fe),this}function We(t){return Ie(t,"mousedown touchstart dblclick",Fe),De(t,"click",Ye),this}function He(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return He(t),Fe(t),this}function qe(t,e){if(!e)return new S(t.clientX,t.clientY);var i=ze(e),n=i.boundingClientRect;return new S((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var Ge=ft&&ht?2*window.devicePixelRatio:lt?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t}var $e={on:Ie,off:Ze,stopPropagation:Fe,disableScrollPropagation:Ue,disableClickPropagation:We,preventDefault:He,stop:Ve,getMousePosition:qe,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:Xe,addListener:Ie,removeListener:Ze},ti=z.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ce(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=M(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Pe(this._el,i),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=z.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&&vt&&!Ct&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(vt?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(vt?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof S?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),s=this.containerPointToLatLng(o.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():D(t);var i=B(e.paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=D(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=B(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){_e(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!vt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),s=this._zoom;t=F(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),u=a*this.getZoomScale(s,e),h=o.distanceTo(n)||1,l=1.42,c=l*l;function p(t){var e=(u*u-a*a+(t?-1:1)*c*c*h*h)/(2*(t?u:a)*c*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var _=p(0);function y(t){return a*(f(_)/f(_+l*t))}function v(t){return a*(f(_)*m(_+l*t)-d(_))/c}function g(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-_)/l,x=i.duration?1e3*i.duration:1e3*w*.8;function L(){var i=(Date.now()-b)/x,r=g(i)*w;i<=1?(this._flyToFrame=M(L,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(v(r)/h)),s),this.getScaleZoom(a/y(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=D(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,D(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=B((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),r=this.project(o),s=this.project(t),a=this.getPixelBounds(),u=a.getSize().divideBy(2),h=R([a.min.add(i),a.max.subtract(n)]);if(!h.contains(s)){this._enforcingBounds=!0;var l=r.subtract(s),c=B(s.x+l.x,s.y+l.y);(s.x<h.min.x||s.x>h.max.x)&&(c.x=r.x-l.x,l.x>0?c.x+=u.x-i.x:c.x-=u.x-n.x),(s.y<h.min.y||s.y>h.max.y)&&(c.y=r.y-l.y,l.y>0?c.y+=u.y-i.y:c.y-=u.y-n.y),this.panTo(this.unproject(c),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),r=e.divideBy(2).round(),s=n.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new j(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ce(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ce(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=le("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=D(t),i=B(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),u=this.getSize().subtract(i),h=R(this.project(a,n),this.project(s,n)).getSize(),l=vt?this.options.zoomSnap:1,c=u.x/h.x,p=u.y/h.y,d=e?Math.max(c,p):Math.min(c,p);return n=this.getScaleZoom(d,n),l&&(n=Math.round(n/(l/100))*(l/100),n=e?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new S(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new Z(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,n=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return qe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ue(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&vt,_e(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(Tt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ct?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pe(this._mapPane,new S(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_e(t.markerPane,"leaflet-zoom-hide"),_e(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Pe(this._mapPane,new S(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Pe(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Ze:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),vt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=M((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(r,t))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!Xe(r,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Ae(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}if(!t._stopped&&(n=(n||[]).concat(this._findEventTargets(t,e))).length){var r=n[0];"contextmenu"===e&&r.listens(e,!0)&&He(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var u=0;u<n.length;u++)if(n[u].fire(e,s,!0),s.originalEvent._stopped||!1===n[u].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ce(this._mapPane)||new S(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),r=new Z(n.subtract(o),n.add(o)),s=this._getBoundsOffset(r,i,e);return s.round().equals([0,0])?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new Z(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),r=n.max.subtract(t.max);return new S(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=vt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Le(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ce(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Le(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(M((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,_e(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M((function(){this._moveEnd(!0)}),this))}});function ii(t,e){return new ei(t,e)}var ni=A.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return _e(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ce(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),oi=function(t){return new ni(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=le("div",e+"control-container",this._container);function n(n,o){t[n+o]=le("div",e+n+" "+e+o,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ce(this._controlCorners[t]);ce(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=ni.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ni.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){_e(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(_e(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=le("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),We(e),Ue(e);var n=this._section=le("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=le("a",t+"-toggle",e);o.href="#",o.title="Layers",Pt?(Ie(o,"click",Ve),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=le("div",t+"-base",n),this._separator=le("div",t+"-separator",n),this._overlaysList=le("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(o((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)this._addItem(n=this._layers[i]),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&o>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+s(this),n),this._layerControlInputs.push(e),e.layerId=s(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("div");return i.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)e=this._getLayer((t=i[r]).layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)e=this._getLayer((t=i[o]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),si=function(t,e,i){return new ri(t,e,i)},ai=ni.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=le("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var r=le("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),We(r),Ie(r,"click",Ve),Ie(r,"click",o,this),Ie(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&_e(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&_e(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))}));var ui=function(t){return new ai(t)},hi=ni.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=le("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=le("div",e,i)),t.imperial&&(this._iScale=le("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(i=this._getRoundNum(e=o/5280),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),li=function(t){return new hi(t)},ci=ni.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=le("div","leaflet-control-attribution"),We(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook((function(){this.options.attributionControl&&(new ci).addTo(this)}));var pi=function(t){return new ci(t)};ni.Layers=ri,ni.Zoom=ai,ni.Scale=hi,ni.Attribution=ci,oi.layers=si,oi.zoom=ui,oi.scale=li,oi.attribution=pi;var di=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:E},_i=Pt?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},vi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},gi=z.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){d(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,_i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(gi._dragging===this&&this.finishDrag(),Ze(this._dragStartTarget,_i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(gi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(gi._dragging=this,this._preventOutline&&Ae(this._element),Te(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Ee(this._element);this._startPoint=new S(e.clientX,e.clientY),this._parentScale=ze(i),Ie(document,vi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new S(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,He(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ce(this._element).subtract(i),_e(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,T(this._animRequest),this._lastEvent=t,this._animRequest=M(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Pe(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),vi)Ze(document,vi[t],this._onMove,this),Ze(document,yi[t],this._onUp,this);Oe(),ee(),this._moved&&this._moving&&(T(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,gi._dragging=!1}});function bi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Li(t=Ci(t,i),i)}function wi(t,e,i){return Math.sqrt(ki(t,e,i,!0))}function xi(t,e,i){return ki(t,e,i)}function Li(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Pi(t,n,e,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(t[o]);return r}function Pi(t,e,i,n,o){var r,s,a,u=0;for(s=n+1;s<=o-1;s++)(a=ki(t[s],t[n],t[o],!0))>u&&(r=s,u=a);u>i&&(e[r]=1,Pi(t,e,i,n,r),Pi(t,e,i,r,o))}function Ci(t,e){for(var i=[t[0]],n=1,o=0,r=t.length;n<r;n++)Ai(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<r-1&&i.push(t[r-1]),i}function Mi(t,e,i,n,o){var r,s,a,u=n?fi:Oi(t,i),h=Oi(e,i);for(fi=h;;){if(!(u|h))return[t,e];if(u&h)return!1;a=Oi(s=Ti(t,e,r=u||h,i,o),i),r===u?(t=s,u=a):(e=s,h=a)}}function Ti(t,e,i,n,o){var r,s,a=e.x-t.x,u=e.y-t.y,h=n.min,l=n.max;return 8&i?(r=t.x+a*(l.y-t.y)/u,s=l.y):4&i?(r=t.x+a*(h.y-t.y)/u,s=h.y):2&i?(r=l.x,s=t.y+u*(l.x-t.x)/a):1&i&&(r=h.x,s=t.y+u*(h.x-t.x)/a),new S(r,s,o)}function Oi(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Ai(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function ki(t,e,i,n){var o,r=e.x,s=e.y,a=i.x-r,u=i.y-s,h=a*a+u*u;return h>0&&((o=((t.x-r)*a+(t.y-s)*u)/h)>1?(r=i.x,s=i.y):o>0&&(r+=a*o,s+=u*o)),a=t.x-r,u=t.y-s,n?a*a+u*u:new S(r,s)}function Ei(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function zi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ei(t)}var Si={simplify:bi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Mi,_getEdgeIntersection:Ti,_getBitCode:Oi,_sqClosestPointOnSegment:ki,isFlat:Ei,_flat:zi};function Ii(t,e,i){var n,o,r,s,a,u,h,l,c,p=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Oi(t[o],e);for(s=0;s<4;s++){for(l=p[s],n=[],o=0,r=(h=t.length)-1;o<h;r=o++)u=t[r],(a=t[o])._code&l?u._code&l||((c=Ti(u,a,l,e,i))._code=Oi(c,e),n.push(c)):(u._code&l&&((c=Ti(u,a,l,e,i))._code=Oi(c,e),n.push(c)),n.push(a));t=n}return t}var Bi={clipPolygon:Ii},Zi={project:function(t){return new S(t.lng,t.lat)},unproject:function(t){return new j(t.y,t.x)},bounds:new Z([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new Z([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=r*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),r/2);return n=-i*Math.log(Math.max(a,1e-10)),new S(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(s),u=0,h=.1;u<15&&Math.abs(h)>1e-7;u++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=h=Math.PI/2-2*Math.atan(s*e)-a;return new j(a*i,t.x*i/n)}},Ni={LonLat:Zi,Mercator:Ri,SphericalMercator:q},Di=i({},H,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return J(t,.5,-t,.5)}()}),ji=i({},H,{code:"EPSG:4326",projection:Zi,transformation:J(1/180,1,-1/180,.5)}),Fi=i({},W,{projection:Zi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});W.Earth=H,W.EPSG3395=Di,W.EPSG3857=K,W.EPSG900913=Y,W.EPSG4326=ji,W.Simple=Fi;var Ui=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Wi=Ui.extend({initialize:function(t,e){var i,n;if(d(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Hi=function(t,e){return new Wi(t,e)},Vi=Wi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Wi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Wi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new N;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),qi=function(t,e){return new Vi(t,e)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=B(n),r=B("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Tt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=le("div","leaflet-default-icon-path",document.body),e=he(t,"background-image")||he(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new gi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_e(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Ce(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),u=R(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!u.contains(r)){var h=B((Math.max(u.max.x,r.x)-u.max.x)/(s.max.x-u.max.x)-(Math.min(u.min.x,r.x)-u.min.x)/(s.min.x-u.min.x),(Math.max(u.max.y,r.y)-u.max.y)/(s.max.y-u.max.y)-(Math.min(u.min.y,r.y)-u.min.y)/(s.min.y-u.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Pe(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=M(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=M(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Ce(e._icon),o=e._map.layerPointToLatLng(n);i&&Pe(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qi=Ui.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),_e(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(_e(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ce(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ce(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(_e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Qi(t,e)}var $i=Ui.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),tn=$i.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return $i.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new Z(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function en(t,e){return new tn(t,e)}var nn=tn.extend({initialize:function(t,e,n){if("number"==typeof e&&(e=i({},n,{radius:e})),d(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:$i.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===H.distance){var o=Math.PI/180,r=this._mRadius/H.R/o,s=i.project([e+r,t]),a=i.project([e-r,t]),u=s.add(a).divideBy(2),h=i.unproject(u).lat,l=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(l)||0===l)&&(l=r/Math.cos(Math.PI/180*e)),this._point=u.subtract(i.getPixelOrigin()),this._radius=isNaN(l)?0:u.x-i.project([h,t-l]).x,this._radiusY=u.y-s.y}else{var c=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(c).x}this._updateBounds()}});function on(t,e,i){return new nn(t,e,i)}var rn=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,r=ki,s=0,a=this._parts.length;s<a;s++)for(var u=this._parts[s],h=1,l=u.length;h<l;h++){var c=r(t,e=u[h-1],i=u[h],!0);c<n&&(n=c,o=r(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,s,a=this._rings[0],u=a.length;if(!u)return null;for(t=0,e=0;t<u-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<u-1;t++)if((n+=i=(o=a[t]).distanceTo(r=a[t+1]))>e)return this._map.layerPointToLatLng([r.x-(s=(n-e)/i)*(r.x-o.x),r.y-s*(r.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new N,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ei(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Ei(t),n=0,o=t.length;n<o;n++)i?(e[n]=F(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new Z;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new S(t,t);this._pxBounds=new Z([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,r=t.length;if(t[0]instanceof j){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,r,s,a,u=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=Mi(a[i],a[i+1],t,i,!0))&&(u[n]=u[n]||[],u[n].push(s[0]),s[1]===a[i+1]&&i!==r-2||(u[n].push(s[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=bi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,r,s,a,u=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(s=(a=this._parts[i]).length)-1;n<s;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=u)return!0;return!1}});function sn(t,e){return new rn(t,e)}rn._flat=zi;var an=rn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,s,a,u=this._rings[0],h=u.length;if(!h)return null;for(r=s=a=0,t=0,e=h-1;t<h;e=t++)s+=((i=u[t]).x+(n=u[e]).x)*(o=i.y*n.x-n.y*i.x),a+=(i.y+n.y)*o,r+=3*o;return this._map.layerPointToLatLng(0===r?u[0]:[s/r,a/r])},_convertLatLngs:function(t){var e=rn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof j&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){rn.prototype._setLatLngs.call(this,t),Ei(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ei(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new S(e,e);if(t=new Z(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,r,s,a,u,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(u=(e=this._parts[o]).length)-1;r<u;s=r++)(i=e[r]).y>t.y!=(n=e[s]).y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||rn.prototype._containsPoint.call(this,t,!0)}});function un(t,e){return new an(t,e)}var hn=Vi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=ln(t,r);return s?(s.feature=yn(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function ln(t,e){var i,n,o,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,u=[],h=e&&e.pointToLayer,l=e&&e.coordsToLatLng||pn;if(!a&&!s)return null;switch(s.type){case"Point":return cn(h,t,i=l(a),e);case"MultiPoint":for(o=0,r=a.length;o<r;o++)i=l(a[o]),u.push(cn(h,t,i,e));return new Vi(u);case"LineString":case"MultiLineString":return n=dn(a,"LineString"===s.type?0:1,l),new rn(n,e);case"Polygon":case"MultiPolygon":return n=dn(a,"Polygon"===s.type?1:2,l),new an(n,e);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var c=ln({geometry:s.geometries[o],type:"Feature",properties:t.properties},e);c&&u.push(c)}return new Vi(u);default:throw new Error("Invalid GeoJSON object.")}}function cn(t,e,i,n){return t?t(e,i):new Qi(i,n&&n.markersInheritOptions&&n)}function pn(t){return new j(t[1],t[0],t[2])}function dn(t,e,i){for(var n,o=[],r=0,s=t.length;r<s;r++)n=e?dn(t[r],e-1,i):(i||pn)(t[r]),o.push(n);return o}function fn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[l(t.lng,e),l(t.lat,e),l(t.alt,e)]:[l(t.lng,e),l(t.lat,e)]}function mn(t,e,i,n){for(var o=[],r=0,s=t.length;r<s;r++)o.push(e?mn(t[r],e-1,i,n):fn(t[r],n));return!e&&i&&o.push(o[0]),o}function _n(t,e){return t.feature?i({},t.feature,{geometry:e}):yn(e)}function yn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var vn={toGeoJSON:function(t){return _n(this,{type:"Point",coordinates:fn(this.getLatLng(),t)})}};function gn(t,e){return new hn(t,e)}Qi.include(vn),nn.include(vn),tn.include(vn),rn.include({toGeoJSON:function(t){var e=!Ei(this._latlngs);return _n(this,{type:(e?"Multi":"")+"LineString",coordinates:mn(this._latlngs,e?1:0,!1,t)})}}),an.include({toGeoJSON:function(t){var e=!Ei(this._latlngs),i=e&&!Ei(this._latlngs[0]),n=mn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),_n(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Wi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),_n(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var r=yn(o);"FeatureCollection"===r.type?n.push.apply(n,r.features):n.push(r)}}})),i?_n(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var bn=gn,wn=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=D(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ce(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=D(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:le("img");_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Le(this._image,i,e)},_reset:function(){var t=this._image,e=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Pe(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xn=function(t,e,i){return new wn(t,e,i)},Ln=wn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:le("video");if(_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var s=0;s<this._url.length;s++){var a=le("source");a.src=this._url[s],e.appendChild(a)}}}});function Pn(t,e,i){return new Ln(t,e,i)}var Cn=wn.extend({_initImage:function(){var t=this._image=this._url;_e(t,"leaflet-image-layer"),this._zoomAnimated&&_e(t,"leaflet-zoom-animated"),this.options.className&&_e(t,this.options.className),t.onselectstart=h,t.onmousemove=h}});function Mn(t,e,i){return new Cn(t,e,i)}var Tn=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(o(ce,void 0,this._container),200)):ce(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof Vi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Pe(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),On=Tn.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Tn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",Fe))},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",Fe))},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=le("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=le("div",t+"-content-wrapper",e);if(this._contentNode=le("div",t+"-content",i),We(e),Ue(this._contentNode),Ie(e,"contextmenu",Fe),this._tipContainer=le("div",t+"-tip-container",e),this._tip=le("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=le("a",t+"-close-button",e);n.href="#close",n.innerHTML="&#215;",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=this.options.maxHeight,o="leaflet-popup-scrolled";n&&t.offsetHeight>n?(e.height=n+"px",_e(t,o)):ye(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Pe(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(he(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new S(this._containerLeft,-i-this._containerBottom);o._add(Ce(this._container));var r=t.layerPointToContainerPoint(o),s=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||s),u=B(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),l=0,c=0;r.x+n+u.x>h.x&&(l=r.x+n-h.x+u.x),r.x-l-a.x<0&&(l=r.x-a.x),r.y+i+u.y>h.y&&(c=r.y+i-h.y+u.y),r.y-c-a.y<0&&(c=r.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new On(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof On||(t=new On(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof On?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new On(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof $i?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var kn=Tn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Tn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return Pt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=le("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,r=n.latLngToContainerPoint(n.getCenter()),s=n.layerPointToContainerPoint(t),a=this.options.direction,u=o.offsetWidth,h=o.offsetHeight,l=B(this.options.offset),c=this._getAnchor();"top"===a?(e=u/2,i=h):"bottom"===a?(e=u/2,i=0):"center"===a?(e=u/2,i=h/2):"right"===a?(e=0,i=h/2):"left"===a?(e=u,i=h/2):s.x<r.x?(a="right",e=0,i=h/2):(a="left",e=u+2*(l.x+c.x),i=h/2),t=t.subtract(B(e,i,!0)).add(l).add(c),ye(o,"leaflet-tooltip-right"),ye(o,"leaflet-tooltip-left"),ye(o,"leaflet-tooltip-top"),ye(o,"leaflet-tooltip-bottom"),_e(o,"leaflet-tooltip-"+a),Pe(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),En=function(t,e){return new kn(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof kn||(t=new kn(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof kn?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new kn(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Pt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(_e(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var zn=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=B(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function Sn(t){return new zn(t)}Gi.Default=Ki;var In=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:gt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ce(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof S?t:new S(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);be(o.el,r),r<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=le("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ce(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=le("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),h(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ce(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new S(+o,+r);a.z=+s;var u=this._tileCoordsToKey(a),h=this._tiles[u];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new S(o,r);s.z=i+1;var a=this._tileCoordsToKey(s),u=this._tiles[a];u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e);o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),n&&!(this.options.updateWhenZooming&&o!==this._tileZoom)||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();vt?Le(t.el,o,n):Pe(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*n);return new Z(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,u=new Z(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var l=this._tiles[h].coords;l.z===this._tileZoom&&u.contains(new S(l.x,l.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var c=o.min.y;c<=o.max.y;c++)for(var p=o.min.x;p<=o.max.x;p++){var d=new S(p,c);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:s.push(d)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<s.length;p++)this._addTile(s[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return D(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new N(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new S(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ce(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){_e(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,et&&this.options.opacity<1&&be(t,this.options.opacity),ot&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&M(o(this._tileReady,this,t,null,r)),Pe(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(be(i.el,0),T(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(_e(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new S(this._wrapX?u(t.x,this._wrapX):t.x,this._wrapY?u(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new Z(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Bn(t){return new In(t)}var Zn=In.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&Tt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",o(this._tileOnLoad,this,e,i)),Ie(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Tt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,e.complete||(e.src=g,ce(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",g),In.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==g))return In.prototype._tileReady.call(this,t,e,i)}});function Rn(t,e){return new Zn(t,e)}var Nn=Zn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var r=(e=d(this,e)).detectRetina&&Tt?2:1,s=this.getTileSize();n.width=s.x*r,n.height=s.y*r,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Zn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,r=n.max,s=(this._wmsVersion>=1.3&&this._crs===ji?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=Zn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Dn(t,e){return new Nn(t,e)}Zn.WMS=Nn,Rn.wms=Dn;var jn=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&_e(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=Ce(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),s=this._map.project(t,e).subtract(r),a=o.multiplyBy(-i).add(n).add(o).subtract(s);vt?Le(this._container,a,i):Pe(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new Z(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fn=jn.extend({getEvents:function(){var t=jn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){jn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",this._onMouseMove,this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,ce(this._container),Ze(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){jn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Tt?2:1;Pe(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Tt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){jn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||M(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Z,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,r,s=t._parts,a=s.length,u=this._ctx;if(a){for(u.beginPath(),i=0;i<a;i++){for(n=0,o=s[i].length;n<o;n++)u[n?"lineTo":"moveTo"]((r=s[i][n]).x,r.y);e&&u.closePath()}this._fillStroke(u,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(_e(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Un(t){return At?new Fn(t):null}var Wn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Hn={_initContainer:function(){this._container=le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(jn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Wn("shape");_e(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Wn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ce(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Wn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,e.dashStyle=n.dashArray?y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):"",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Wn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},Vn=Et?Wn:Q,qn=jn.extend({getEvents:function(){var t=jn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Vn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ce(this._container),Ze(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){jn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Pe(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Vn("path");t.options.className&&_e(e,t.options.className),t.options.interactive&&_e(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ce(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Gn(t){return kt||Et?new qn(t):null}Et&&qn.include(Hn),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Un(t)||Gn(t)}});var Jn=an.extend({initialize:function(t,e){an.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Kn(t,e){return new Jn(t,e)}qn.create=Vn,qn.pointsToPath=X,hn.geometryToLayer=ln,hn.coordsToLatLng=pn,hn.coordsToLatLngs=dn,hn.latLngToCoords=fn,hn.latLngsToCoords=mn,hn.getFeature=_n,hn.asFeature=yn,ei.mergeOptions({boxZoom:!0});var Yn=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ze(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ce(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),Te(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=le("div","leaflet-zoom-box",this._container),_e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new Z(this._point,this._startPoint),i=e.getSize();Pe(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ce(this._box),ye(this._container,"leaflet-crosshair")),ee(),Oe(),Ze(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yn),ei.mergeOptions({doubleClickZoom:!0});var Qn=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ei.addInitHook("addHandler","doubleClickZoom",Qn),ei.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new gi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}_e(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=D(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,r=(n+e+i)%t-e-i,s=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=i.easeLinearity,s=o.multiplyBy(r/((this._lastTime-this._times[0])/1e3)),a=s.distanceTo([0,0]),u=Math.min(i.inertiaMaxSpeed,a),h=s.multiplyBy(u/a),l=u/(i.inertiaDeceleration*r),c=h.multiplyBy(-l/2).round();c.x||c.y?(c=e._limitOffset(c,e.options.maxBounds),M((function(){e.panBy(c,{duration:l,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",Xn),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $n=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ze(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ze(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=B(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ve(t)}}});ei.addInitHook("addHandler","keyboard",$n),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=di.extend({addHooks:function(){Ie(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ze(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),n),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,o=i?Math.ceil(n/i)*i:n,r=t._limitZoom(e+(this._delta>0?o:-o))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ei.addInitHook("addHandler","scrollWheelZoom",to),ei.mergeOptions({tap:!0,tapTolerance:15});var eo=di.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ze(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(He(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new S(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&_e(i,"leaflet-active"),this._holdTimeout=setTimeout(o((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ze(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new S(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Pt||Lt&&!ct||ei.addInitHook("addHandler","tap",eo),ei.mergeOptions({touchZoom:Pt&&!rt,bounceAtZoomLimits:!0});var io=di.extend({addHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ze(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),He(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=M(a,this,!0),He(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),Ze(document,"touchmove",this._onTouchMove,this),Ze(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",io),ei.BoxZoom=Yn,ei.DoubleClickZoom=Qn,ei.Drag=Xn,ei.Keyboard=$n,ei.ScrollWheelZoom=to,ei.Tap=eo,ei.TouchZoom=io,t.version=e,t.Control=ni,t.control=oi,t.Browser=St,t.Evented=z,t.Mixin=mi,t.Util=O,t.Class=A,t.Handler=di,t.extend=i,t.bind=o,t.stamp=s,t.setOptions=d,t.DomEvent=$e,t.DomUtil=Se,t.PosAnimation=ti,t.Draggable=gi,t.LineUtil=Si,t.PolyUtil=Bi,t.Point=S,t.point=B,t.Bounds=Z,t.bounds=R,t.Transformation=G,t.transformation=J,t.Projection=Ni,t.LatLng=j,t.latLng=F,t.LatLngBounds=N,t.latLngBounds=D,t.CRS=W,t.GeoJSON=hn,t.geoJSON=gn,t.geoJson=bn,t.Layer=Ui,t.LayerGroup=Wi,t.layerGroup=Hi,t.FeatureGroup=Vi,t.featureGroup=qi,t.ImageOverlay=wn,t.imageOverlay=xn,t.VideoOverlay=Ln,t.videoOverlay=Pn,t.SVGOverlay=Cn,t.svgOverlay=Mn,t.DivOverlay=Tn,t.Popup=On,t.popup=An,t.Tooltip=kn,t.tooltip=En,t.Icon=Gi,t.icon=Ji,t.DivIcon=zn,t.divIcon=Sn,t.Marker=Qi,t.marker=Xi,t.TileLayer=Zn,t.tileLayer=Rn,t.GridLayer=In,t.gridLayer=Bn,t.SVG=qn,t.svg=Gn,t.Renderer=jn,t.Canvas=Fn,t.canvas=Un,t.Path=$i,t.CircleMarker=tn,t.circleMarker=en,t.Circle=nn,t.circle=on,t.Polyline=rn,t.polyline=sn,t.Polygon=an,t.polygon=un,t.Rectangle=Jn,t.rectangle=Kn,t.Map=ei,t.map=ii;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t})(l.exports);var c,p={exports:{}},d="object"==typeof Reflect?Reflect:null,f=d&&"function"==typeof d.apply?d.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};c=d&&"function"==typeof d.ownKeys?d.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var m=Number.isNaN||function(t){return t!=t};function _(){_.init.call(this)}p.exports=_,p.exports.once=function(t,e){return new Promise((function(i,n){function o(i){t.removeListener(e,r),n(i)}function r(){"function"==typeof t.removeListener&&t.removeListener("error",o),i([].slice.call(arguments))}T(t,e,r,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&T(t,"error",e,i)}(t,o,{once:!0})}))},_.EventEmitter=_,_.prototype._events=void 0,_.prototype._eventsCount=0,_.prototype._maxListeners=void 0;var y=10;function v(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function g(t){return void 0===t._maxListeners?_.defaultMaxListeners:t._maxListeners}function b(t,e,i,n){var o,r,s,a;if(v(i),void 0===(r=t._events)?(r=t._events=Object.create(null),t._eventsCount=0):(void 0!==r.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),r=t._events),s=r[e]),void 0===s)s=r[e]=i,++t._eventsCount;else if("function"==typeof s?s=r[e]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(o=g(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function w(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function x(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},o=w.bind(n);return o.listener=i,n.wrapFn=o,o}function P(t,e,i){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?i?[o.listener||o]:[o]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(o):M(o,o.length)}function C(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function M(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function T(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(r){n.once&&t.removeEventListener(e,o),i(r)}))}}Object.defineProperty(_,"defaultMaxListeners",{enumerable:!0,get:function(){return y},set:function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");y=t}}),_.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},_.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},_.prototype.getMaxListeners=function(){return g(this)},_.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var s=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw s.context=r,s}var a=o[t];if(void 0===a)return!1;if("function"==typeof a)f(a,this,e);else{var u=a.length,h=M(a,u);for(i=0;i<u;++i)f(h[i],this,e)}return!0},_.prototype.on=_.prototype.addListener=function(t,e){return b(this,t,e,!1)},_.prototype.prependListener=function(t,e){return b(this,t,e,!0)},_.prototype.once=function(t,e){return v(e),this.on(t,x(this,t,e)),this},_.prototype.prependOnceListener=function(t,e){return v(e),this.prependListener(t,x(this,t,e)),this},_.prototype.off=_.prototype.removeListener=function(t,e){var i,n,o,r,s;if(v(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(o=-1,r=i.length-1;r>=0;r--)if(i[r]===e||i[r].listener===e){s=i[r].listener,o=r;break}if(o<0)return this;0===o?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,o),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},_.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var o,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(o=r[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},_.prototype.listeners=function(t){return P(this,t,!0)},_.prototype.rawListeners=function(t){return P(this,t,!1)},_.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):C.call(t,e)},_.prototype.listenerCount=C,_.prototype.eventNames=function(){return this._eventsCount>0?c(this._events):[]};var O=function(t){function i(){var e=t.call(this)||this;return e.name="CancelError",Object.setPrototypeOf(e,i.prototype),e}return e(i,t),i}(Error),A=function(){function t(t){void 0===t&&(t={}),this.options=t,this._promises=new Map}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._promises.size>0},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())},t.prototype.get=function(t){return this._promises.get(t)},t.prototype.add=function(t,e){var i=this,n=e||t,o=this._promises.get(n);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),o||(this._promises.set(n,t),t.finally((function(){i.remove(n)})),t)},t.prototype.abort=function(){this.isLoaded&&(this._promises.forEach((function(t){t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())},t.prototype.waitFunc=function(t,e){void 0===e&&(e="");var i=this.get(e=e||t.name);return i||this.add(t(),e)},t.prototype.WaitForMe=function(t){void 0===t&&(t="");var e=this.get.bind(this),i=this.add.bind(this);return function(n,o,r){var s=r.value;return t=t||o,r.value=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=e(t);if(r)return r;var a=i(s.apply(this,n),t);return a},r}},t.prototype.GetOrCreateDecorator=function(t){return void 0===t&&(t=""),this.WaitForMe(t)},t.prototype._onStop=function(){this.options.onStop&&!this.isLoaded&&this.options.onStop()},t}(),k=function(t){function i(){var e=t.call(this)||this;return e.name="TimeoutError",Object.setPrototypeOf(e,i.prototype),e}return e(i,t),i}(Error),E=function(t,e,i,n){try{t(i(n))}catch(o){e(o)}},z=0,S=function(){function t(e,i){var n=this;this.id=z++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise((function(t,e){n._setCanceledCallback=function(e){return t(e||new O)}}));var o=[this._cancelPromise,new Promise((function(i,o){return e((function(e){e instanceof t?n.attach(e):n._isPending=!1,i(e)}),(function(t){n._isPending=!1,o(t)}),(function(t){if(!n._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");n._cancelHandlers.push(t)}))}))];i&&o.push(new Promise((function(t,e){setTimeout((function(){if(n._isPending)try{n.cancel()}finally{e(new k)}}),i)}))),this._promise=Promise.race(o)}return t.createControl=function(t){return new A(t)},t.resolve=function(e){return new t((function(t){return t(e)}))},t.reject=function(e){return new t((function(t,i){return i(e)}))},t.all=function(e){var i=this;return new t((function(t,i){Promise.all(e).then(t).catch(i)})).catch((function(t){if(t instanceof i.CancelError)for(var n=0,o=e;n<o.length;n++){var r=o[n];"cancel"in r&&r.cancel()}throw t}))},t.prototype.attach=function(t){this._isCanceled?t.cancel():this._children.push(t)},t.prototype.then=function(e,i){var n=this,o=new t((function(t,o){if(n._promise){var r=function(e){i?E(t,o,i,e):o(e)};n._promise.then((function(i){n._isCanceled?r(i):e?E(t,o,e,i):t(i)}),r)}}));return o._parentPromise=this,this._children.push(o),o},t.prototype.catch=function(t){return this._isCanceled&&t&&t(new O),this.then(void 0,t)},t.prototype.finally=function(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new O:t)},t.prototype.cancel=function(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;var t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((function(t){return t.cancel()})),this._isPending){if(this._cancelHandlers.length)try{for(var e=0,i=this._cancelHandlers;e<i.length;e++){(0,i[e])()}}catch(n){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this},t.prototype._getTopParent=function(){for(var t=this._parentPromise,e=!!t;e;)e=!(!t||!t._parentPromise)&&!!(t=t._parentPromise);return t},t.prototype._destroy=function(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0},t.CancelError=O,t.TimeoutError=k,t.PromiseControl=A,t}();function I(t,e,i){void 0===i&&(i={});var n=function(t,e){for(void 0===e&&(e=[]);null!==t;t=Object.getPrototypeOf(t))for(var i=Object.getOwnPropertyNames(t),n=0;n<i.length;n++)-1==e.indexOf(i[n])&&e.push(i[n]);return e}(t.prototype),o=void 0===i.replace||i.replace;e.forEach((function(e){Object.getOwnPropertyNames(e.prototype).forEach((function(i){var r=-1!==n.indexOf(i);if(!o&&!r||o){var s=Object.getOwnPropertyDescriptor(e.prototype,i);s&&Object.defineProperty(t.prototype,i,s)}}))}))}function B(t){return null!=t}function Z(t){return"string"==typeof t?!!t:B(t)}function R(t,e,i){void 0===i&&(i=!1);var n=t,o=e,r=Array.isArray(o),s=r&&[]||{};return r&&Array.isArray(o)?i?(s=s.concat(n=n||[]),o.forEach((function(t,e){void 0===s[e]?s[e]=t:"object"==typeof t?s[e]=R(n[e],t,i):-1===n.indexOf(t)&&s.push(t)}))):s=o:(n&&"object"==typeof n&&Object.keys(n).forEach((function(t){s[t]=n[t]})),Object.keys(o).forEach((function(t){s[t]="object"==typeof o[t]&&o[t]&&"object"==typeof n[t]&&"object"==typeof o[t]?R(n[t],o[t],i):o[t]}))),s}function N(t){!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat]);return t}function D(t,e){var i;function n(){for(var o=this,r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];n.clear(),i=setTimeout((function(){i=null,t.apply(o,r)}),e)}return void 0===e&&(e=10),n.clear=function(){i&&(clearTimeout(i),i=null)},n}Object.setPrototypeOf(S.prototype,Promise.prototype);function j(t){return{type:"Polygon",coordinates:[F(t)]}}function F(t){var e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}var U=Math.PI/180,W=180/Math.PI;function H(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;var i=20037508.34*t/180,n=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return[i,n=20037508.34*n/180]}function V(t,e,i,n){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===n:q(t,e));return t===e}function q(t,e){var i=Object.keys(t).sort(),n=Object.keys(e).sort();if(i.length!==n.length)return!1;if(i.join("")!==n.join(""))return!1;for(var o=0;o<i.length;o++){if(!V(t[i[o]],e[n[o]],t,e))return!1}return!0}function G(t){var e={};return Object.keys(t).forEach((function(i){t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=G(t[i])})),e}function J(t){return"[object Object]"===Object.prototype.toString.call(t)}function K(t){return t.replace(/([^:]\/)\/+/g,"$1")}function Y(t){return"[object Object]"===Object.prototype.toString.call(t)}function Q(t){return"function"==typeof t}var X={get:function(t,e){return t.properties&&t.properties[e[0]]},match:function(t,e){var i=e[0],n=e.slice(1),o=i;Array.isArray(i)&&(o=$(t,i));for(var r=n.splice(-1,n.length%2)[0],s=0;s<n.length-1;s+=2){if(n[s]===o)return n[s+1]}return r}};function $(t,e){var i=e[0],n=e.slice(1),o=X[i];if(o)return o(t,n)}function tt(t){return function(e){return $(e,t)}}var et=["iconSize","iconAnchor"];function it(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;var n,o="^".concat((n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(o,i?"i":"").exec(t)}var nt={gt:function(t,e){return t>e},lt:function(t,e){return t<e},ge:function(t,e){return t>=e},le:function(t,e){return t<=e},eq:function(t,e){return t===e},ne:function(t,e){return t!==e},in:function(t,e){return-1!==e.indexOf(t)},notin:function(t,e){return-1===e.indexOf(t)},like:function(t,e){return it(t,e)},ilike:function(t,e){return it(t,e,!0)}};function ot(t){return 3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function rt(t,e){var i="string"==typeof e[0]?e[0]:"all",n=function(e){if(ot(e)){var i=e[0],n=e[1],o=e[2],r=nt[n];if(r){if(("like"===n||"ilike"===n)&&"string"==typeof i){var s="",a=i.replace(/^%?(\w+)%?$/,(function(e,n){return s=t[n],i.replace(n,o)}));return r(s,a)}return r(t[i],o)}return!1}return rt(t,e)},o=e.filter((function(t){return Array.isArray(t)}));return"any"===i?o.some(n):o.every(n)}function st(t){for(var e={},n=[],o=0,r=t;o<r.length;o++){var s=r[o];s&&(Array.isArray(s)?n.push(s):e=s)}return function(t){var o=n.find((function(e){return function(t,e){var n=i({},t.properties);return!!n&&(n.$id=t.id,rt(n,e))}(t,e[0])}));return o?i(i({},e),o[1]):e}}function at(t,e,n){var o=function(t){var e=!1,n={};for(var o in t)if(-1===et.indexOf(o)){var r=o,s=t[r];Array.isArray(s)&&(e=!0,n[r]=tt(s))}if(e)return function(e){var o={};for(var r in n)o[r]=n[r](e);return i(i({},t),o)}}(t);if(o){var r=function(t){return ut(o(t),e,n)};return r.paint=t,r}var s=i({},e);return(s=i(i({},s),t)).fill=void 0===s.fill||s.fill,s.stroke=void 0!==s.stroke?s.stroke:!s.fill||!(!s.strokeColor&&!s.strokeOpacity),s}function ut(t,e,n){if(!t)throw new Error("paint is empty");var o=i({},e);if(Q(t)){var r=function(i){var o=ut(t(i),e,n);return o.type=t.type,o};return r.type=t.type,r}if(function(t){return!!Array.isArray(t)}(t))return function(i){return ut(st(t)(i),e,n)};if("get-paint"===t.type){var s=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){var i=e[t.from];if(i)return i(t.options)}}(t,n);s&&(o=ut(s,e,n))}else{if("icon"===t.type)return t;o=at(t,e,n)}return Q(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}function ht(t){for(var e,i={},n=0;n<t.length;n++)i[t[n]]=1+(i[t[n]]||0);for(var o in i){i[o]>((void 0!==e?i[e]:0)||0)&&(e=o)}return e}var lt={polygon:"path",line:"path",point:"circle"},ct={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function pt(t){if(t.data){var e=ct[function(t){var e;e="FeatureCollection"===t.type?ht(t.features.map((function(t){return t.geometry.type}))):"GeometryCollection"===t.type?ht(t.geometries.map((function(t){return t.type}))):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&Y(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":lt[e]),t.type=t.type||e}return t}var dt=function(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222},ft=function(){function t(){this.keyCodeAlias=new dt,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}return t.prototype.pressed=function(t){var e=this.keyCodeAlias[t];return!!e&&this.keys[e]},t.prototype.addKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))},t.prototype.removeKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))},t.prototype.keysPressed=function(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)},t.prototype.keysReleased=function(t){t.stopPropagation(),this.keys[t.keyCode]=!1},t.prototype.windowOnFocus=function(){this.keys={}},t}(),mt=function(){function t(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}return t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(t){this.value=t},t}(),_t=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="center",e.event="moveend",e}return e(i,t),i.prototype.getValue=function(){return this.webMap.getCenter()},i.prototype.setValue=function(t){this.webMap.setCenter(t)},i.prototype.toString=function(t){var e=t.map((function(t){return t.toFixed(5)}));return e[0]+"_"+e[1]},i.prototype.parse=function(t){return t.split("_").map(Number)},i}(mt),yt=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="zoom",e.event="zoomend",e}return e(i,t),i.prototype.getValue=function(){var t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0},i.prototype.setValue=function(t){this.webMap.setZoom(t)},i.prototype.toString=function(t){return String(t)},i.prototype.parse=function(t){return Number(t)},i}(mt);var vt=0,gt={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},bt=function(t){function n(e){var i=t.call(this,e)||this;i._layersIdCounter=1,i._layersOrderCounter=1,i._baselayers=[],i._layers={},i._selectedLayers=[];var n=i.options.tileJson;return n&&i.emitter.once("build-map",(function(){return i.addTileJsonLayer(n)})),i}return e(n,t),n.prototype.fitLayer=function(t,e){return o(this,void 0,void 0,(function(){var i,n,o;return r(this,(function(r){switch(r.label){case 0:return i=this.getLayer(t),(n=i&&(i.getBounds||i.getExtent))?[4,n.call(i)]:[3,2];case 1:(o=r.sent())&&this.fitBounds(o,e),r.label=2;case 2:return[2]}}))}))},n.prototype.isBaseLayer=function(t){var e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)},n.prototype.getBaseLayers=function(){var t=this,e=[];return this._baselayers.forEach((function(i){var n=t._layers[i];n&&e.push(n)})),e},n.prototype.getBaseLayersIds=function(){return this._baselayers},n.prototype.getLayer=function(t){return"string"==typeof t?this._layers[t]:t},n.prototype.getLayerId=function(t){var e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")},n.prototype.getLayers=function(){return Object.keys(this._layers)},n.prototype.allLayers=function(){return this._layers},n.prototype.orderedLayers=function(){return Object.values(this._layers).sort((function(t,e){return t.order&&e.order?t.order-e.order:0}))},n.prototype.findLayer=function(t){for(var e in this._layers){var i=this._layers[e];if(t(i))return i}},n.prototype.isLayerVisible=function(t){var e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility},n.prototype.addBaseLayer=function(t,e){return o(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return[4,this.addLayer(t,i(i({},e),{baselayer:!0}),void 0)];case 1:return[2,n.sent()]}}))}))},n.prototype.addLayer=function(t,e,n){var s,a;return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var o,u,h,l,c,p,d,f,m,_,y,v;return r(this,(function(r){switch(r.label){case 0:return o=this._layersIdCounter++,u=B(n)?n:void 0!==e.order?e.order:this.reserveOrder(),"string"!=typeof t?[3,1]:(h=this.getLayerAdapter(t),[3,4]);case 1:return"function"!=typeof t?[3,2]:(h=t,[3,4]);case 2:return"then"in t?[4,t]:[3,4];case 3:h=r.sent(),r.label=4;case 4:return this._updateGeoJsonOptions(l=e),e=i({id:String(o),order:u},e),c=null===(s=e.visibility)||void 0===s||s,e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer&&(p=this.options.onBeforeAddLayer({options:e,adapter:h}))&&(p.options&&(e=p.options),p.adapter&&(h=p.adapter)),void 0===h?[3,12]:((d=new h(this.mapAdapter.map,e)).options=i(i({},e),d.options),d.options.baselayer&&(e.baselayer=!0,e.order=0,d.options.order=0),f=void 0,d.options.id&&(f=String(d.options.id),this._layers[f]=d),this._emitLayerEvent("layer:preadd",f||"",d),[4,this.onMapLoad()]);case 5:return r.sent(),d.map=this.mapAdapter.map,[4,d.addLayer(d.options)];case 6:if(m=r.sent(),d.layer=m,d.id=d.options.id||String(o),d.options.id=d.id,e.baselayer&&(d.options.order=0),d.order=null!==(a=d.options.order)&&void 0!==a?a:u,f&&delete this._layers[f],f=String(d.id),this._layers[f])throw Error("layer with id '".concat(f,"' already exist"));return f?(this._layers[f]=d,l.filter&&this.filterLayer(d,l.filter),e.baselayer&&this._baselayers.push(f),c?[4,this.showLayer(f)]:[3,8]):[3,8];case 7:r.sent(),r.label=8;case 8:return void 0!==(_=e.opacity)&&_<=1&&this.setLayerOpacity(d,_),y=m&&(d.getBounds||d.getExtent),e.fit&&y?[4,y.call(d)]:[3,11];case 9:return(v=r.sent())?[4,this.fitBounds(v)]:[3,11];case 10:r.sent(),r.label=11;case 11:return e.onAdded&&e.onAdded(d),this._emitLayerEvent("layer:add",f,d),[2,d];case 12:return[2,Promise.reject("No adapter")]}}))}))},n.prototype.addLayerFromAsyncAdapter=function(t,e,i){return o(this,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:return n=i||void 0!==e.order?e.order:this.reserveOrder(),[4,t()];case 1:return(o=r.sent())?[2,this.addLayer(o,e,n)]:[2,Promise.reject("No adapter")]}}))}))},n.prototype.removeLayers=function(t){for(var e in this._layers){var i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}},n.prototype.reserveOrder=function(){return this._layersOrderCounter++},n.prototype.removeOverlays=function(){this.removeLayers((function(t,e){return!(e&&e.options&&e.options.baselayer)}))},n.prototype.removeLayer=function(t){var e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){var n=this._baselayers.indexOf(i);n&&this._baselayers.splice(n,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}},n.prototype.addGeoJsonLayer=function(t,e){return void 0===t&&(t={}),(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=pt(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)},n.prototype.addFeatureLayer=function(t){return void 0===t&&(t={}),this.addGeoJsonLayer(t)},n.prototype.addTileLayer=function(t,e){return void 0===e&&(e={}),this.addLayer("TILE",i(i({},e),{url:t}))},n.prototype.addImageLayer=function(t,e){var n;return"string"==typeof t?n=t:(n=t.url,e=t),this.addLayer("IMAGE",i(i({},e),{url:n}))},n.prototype.showLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!0,e)},n.prototype.hideLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!1,e)},n.prototype.toggleLayer=function(t,e,i){var n=this;void 0===i&&(i={});var s=this.getLayer(t),a=void 0!==e?e:!(s&&s.options.visibility),u=void 0!==i.silent&&i.silent;return s?this.onMapLoad().then((function(){return t=s,o(n,void 0,void 0,(function(){var e,i,n,o,s,h,l,c=this;return r(this,(function(r){switch(r.label){case 0:if(e=String(t.id),i=a?"layer:preshow":"layer:prehide",n=a?"layer:show":"layer:hide",u||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:pretoggle",e,t)),!a||!this.mapAdapter)return[3,9];if(o=t.options.baselayer?0:t.options.order,!t.options.baselayer||!this._baselayers.length)return[3,4];s=this._baselayers.filter((function(e){return e!==t.id&&c.isLayerVisible(e)})),h=0,l=s,r.label=1;case 1:return h<l.length?[4,this.hideLayer(l[h])]:[3,4];case 2:r.sent(),r.label=3;case 3:return h++,[3,1];case 4:return t.showLayer?[4,t.showLayer.call(t,t.layer)]:[3,6];case 5:return r.sent(),[3,8];case 6:return void 0===t.layer?[3,8]:[4,this.mapAdapter.showLayer(t.layer)];case 7:r.sent(),r.label=8;case 8:return void 0!==o&&this.mapAdapter.setLayerOrder(t.layer,o,this._layers),[3,13];case 9:return t.hideLayer?[4,t.hideLayer.call(t,t.layer)]:[3,11];case 10:return r.sent(),[3,13];case 11:return void 0===t.layer?[3,13]:[4,this.mapAdapter.hideLayer(t.layer)];case 12:r.sent(),r.label=13;case 13:return t.options.visibility=a,u||(this._emitLayerEvent(n,e,t),this._emitLayerEvent("layer:toggle",e,t)),[2]}}))}));var t})):Promise.resolve()},n.prototype.updateLayer=function(t){var e=this,i=this.getLayer(t);if(i){if(i.updateLayer)return Promise.resolve(i.updateLayer());if(this.isLayerVisible(i))return this.hideLayer(i,{silent:!0}).then((function(){return e.showLayer(i,{silent:!0})}))}return Promise.resolve()},n.prototype.setLayerOpacity=function(t,e){var i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))},n.prototype.showLayerLabel=function(t){this.toggleLayerLabel(t,!0)},n.prototype.hideLayerLabel=function(t){this.toggleLayerLabel(t,!1)},n.prototype.toggleLayerLabel=function(t,e){var i=this.getLayer(t);i&&(e?i.showLabel&&i.showLabel():i.hideLabel&&i.hideLabel())},n.prototype.selectLayer=function(t,e){var i=this.getLayer(t);if(i){i&&i.select&&i.select(e);var n=this.getLayerId(i);n&&this._selectedLayers.push(n)}},n.prototype.unSelectLayer=function(t,e){var i=this.getLayer(t);if(i){var n=i&&i;n.unselect&&n.unselect(e);var o=this.getLayerId(i);if(o){var r=this._selectedLayers.indexOf(o);-1!==r&&this._selectedLayers.splice(r,1)}}},n.prototype.unSelectLayers=function(){for(var t,e=0,i=Object.values(this.allLayers());e<i.length;e++)(t=i[e]).unselect&&t.unselect()},n.prototype.filterLayer=function(t,e){var i=this.getLayer(t);return i.filter?i.filter(e):[]},n.prototype.propertiesFilter=function(t,e,i){var n=this.getLayer(t);if(n){var o=n;if(o.propertiesFilter)return o.propertiesFilter(e,i);o.filter&&this.filterLayer(o,(function(t){return!t.feature||!t.feature.properties||rt(t.feature.properties,e)}))}return Promise.resolve()},n.prototype.removeLayerFilter=function(t){var e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((function(){return!0}))},n.prototype.setLayerData=function(t,e){var i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()},n.prototype.addLayerData=function(t,e){var i=this.getLayer(t);i.addData&&i.addData(e)},n.prototype.clearLayerData=function(t,e){var i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)},n.prototype.setLayerPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)},n.prototype.setLayerSelectedPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)},n.prototype.updateLayerPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)},n.prototype.updateLayerSelectedPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)},n.prototype.getAttributions=function(t){var e=[];for(var i in this._layers){var n=this._layers[i],o=!(void 0===t.onlyVisible||t.onlyVisible)||n.options.visibility;if(o&&t.onlyBaselayer&&(o=this._baselayers.includes(i)),o){var r=n.options&&n.options.attribution;r&&e.push(r)}}return e},n.prototype.getActiveBaseLayer=function(){var t=this,e=this.getBaseLayers().find((function(e){return t.isLayerVisible(e)}));if(e)return this.getLayer(e)},n.prototype.addTileJsonLayer=function(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})},n.prototype._emitLayerEvent=function(t,e,i){var n=String(t);if(B(e)&&n.startsWith("layer:")){var o=n.replace("layer:","layer-"+e+":");this.emitter.emit(o,i)}this.emitter.emit(t,i)},n.prototype._onLayerClick=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return this._emitLayerEvent("layer:click",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},n.prototype._onLayerSelect=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return this._emitLayerEvent("layer:select",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},n.prototype._updateGeoJsonOptions=function(t){var e=this,i=t.onSelect,n=t.onLayerSelect,o=t.onMouseOut,r=t.onMouseOver,s=t.onClick||t.onLayerClick;t.onClick=function(t){return s&&s(t),e._onLayerClick(t)},t.onMouseOut=function(t){var i=t.layer.id;o&&o(t),B(i)&&e._emitLayerEvent("layer:mouseout",i,t)},t.onMouseOver=function(t){var i=t.layer.id;r&&r(t),B(i)&&e._emitLayerEvent("layer:mouseover",i,t)};var a=i||n;t.onSelect=function(t){return a&&a(t),e._onLayerSelect(t)},t.nativePaint||(this.options.paint&&(t.paint=ut(t.paint||{},this.options.paint,this.getPaintFunctions)),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=ut(t.selectedPaint,this.options.selectedPaint,this.getPaintFunctions)))},n}(function(){function t(e){this.options=gt,this.emitter=new p.exports.EventEmitter,this.keys=t.keys,this.runtimeParams=[],this.getPaintFunctions=t.getPaintFunctions,this.mapState=[_t,yt],this.id=vt++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=R(gt||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}return t.prototype.getId=function(){return this.id},t.prototype.create=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return this.getEventStatus("create")?[3,3]:[4,this._setInitMapState(this.mapState)];case 1:return t.sent(),[4,this._setupMap()];case 2:t.sent(),this._emitStatusEvent("create",this),t.label=3;case 3:return[2,this]}}))}))},t.prototype.setRuntimeParams=function(t){this.runtimeParams.push(t)},t.prototype.destroy=function(){this._removeEventListeners(),function(t){for(var e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()},t.prototype.getState=function(){var t={};return this._mapState.forEach((function(e){t[e.name]=e.getValue()})),t},t.prototype.getRuntimeParams=function(){var t=this,e={};return this._mapState.forEach((function(i){for(var n=0,o=t.runtimeParams;n<o.length;n++){var r=o[n].get(i.name);if(void 0!==r){e[i.name]=i.parse(r);break}}})),e},t.prototype.getContainer=function(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){var t=document.getElementById(this.options.target);if(t)return t}}},t.prototype.setCursor=function(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)},t.prototype.getCursor=function(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();var t=this.getContainer();return t?t.style.cursor:void 0},t.prototype.setCenter=function(t){return this.mapAdapter.setCenter(t),this},t.prototype.getCenter=function(){return this.mapAdapter.getCenter()},t.prototype.getBounds=function(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()},t.prototype.getBoundsPolygon=function(){var t=this.getBounds();if(t)return{type:"Feature",properties:{},geometry:j(t)}},t.prototype.setZoom=function(t){return this.mapAdapter.setZoom(t),this},t.prototype.getZoom=function(){var t=this.mapAdapter.getZoom();if("number"==typeof t)return t},t.prototype.zoomIn=function(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t+1)}},t.prototype.zoomOut=function(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t-1)}},t.prototype.setView=function(t,e){if(Array.isArray(t)){var i=t;this.mapAdapter.setView&&i&&B(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),B(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}},t.prototype.fitBounds=function(t,e){return t.every((function(t){return B(t)}))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this},t.prototype.getEventStatus=function(t){var e=this._eventsStatus[t];return null!=e&&e},t.prototype.onLoad=function(t){var e=this;return void 0===t&&(t="create"),new Promise((function(i){e.getEventStatus(t)?i(e):e.emitter.once(t,(function(){i(e)}))}))},t.prototype.onMapLoad=function(t){var e=this;return new Promise((function(i){var n,o=function(){var n=e.mapAdapter;t&&t(n),n&&i(n)},r=null===(n=e.mapAdapter.isLoaded)||void 0===n||n;e.mapAdapter.map&&r?o():e.mapAdapter.emitter.once("create",(function(){o()}))}))},t.prototype.getLayerAdapters=function(){return this.mapAdapter.layerAdapters},t.prototype.getLayerAdapter=function(t){return this.mapAdapter.layerAdapters[t]},t.prototype.locate=function(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:function(){return{}}}},t.prototype.stopGetCoordFromMapClick=function(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()},t.prototype.getCoordFromMapClick=function(){var t=this;return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new S((function(e,i,n){var o=t.getCursor()||"grab";t._removeEventListeners({include:["click"]}),t.setCursor("crosshair");var r=function(){t.setCursor(o),t._addEventsListeners({include:["click"]}),t.mapAdapter.emitter.off("click",s),t._coordFromMapClickPromise=void 0},s=function(t){r(),N(t),e(t.lngLat)};t.mapAdapter.emitter.once("click",s),n(r)})),this._coordFromMapClickPromise)},t.prototype._emitStatusEvent=function(t,e){var i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)},t.prototype._addLayerProviders=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return[2]}))}))},t.prototype._onLoadSync=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return[2]}))}))},t.prototype._setupMap=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return[4,this.mapAdapter.create(this.options)];case 1:return t.sent(),this._zoomToInitialExtent(),[4,this._addLayerProviders()];case 2:return t.sent(),[4,this._onLoadSync()];case 3:return t.sent(),this._emitStatusEvent("build-map",this.mapAdapter),[2,this]}}))}))},t.prototype._setTileJsonOptions=function(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),B(t.maxzoom)&&(this.options.zoom=t.maxzoom),B(t.minzoom)&&(this.options.zoom=t.minzoom),B(t.maxzoom)&&B(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)},t.prototype._zoomToInitialExtent=function(){var t=this.options,e=t.center,i=t.zoom,n=t.bounds;this._extent?this.fitBounds(this._extent):e&&i?this.setView(e,i):n&&this.fitBounds(n)},t.prototype._setInitMapState=function(t){for(var e=0,i=t;e<i.length;e++){var n=new(0,i[e])(this);this._mapState.push(n);for(var o=0,r=this.runtimeParams;o<r.length;o++){var s=r[o].get(n.name);if(void 0!==s){var a=n.parse(s);this._initMapState[n.name]=a,Object.defineProperty(this.options,n.name,{value:a,configurable:!0,enumerable:!0});break}}}},t.prototype._addEventsListeners=function(t){var e=this,i=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(i=i.filter((function(e){return t.include.includes(e)}))),i.forEach((function(t){e._mapEvents[t]=function(i){if(e.runtimeParams.length){var n=e._mapState.find((function(e){return e.event===t}));if(n){var o=n.toString(n.getValue());e.runtimeParams.forEach((function(t){t.set(n.name,o)}))}}e._eventsStatus&&e.emitter.emit(t,i)};var i=e._mapEvents[t];i&&e.mapAdapter.emitter.on(t,i)}))},t.prototype._removeEventListeners=function(t){var e=this,i=Object.entries(this._mapEvents);t&&t.include&&(i=i.filter((function(e){return t.include.includes(e[0])}))),i.forEach((function(t){var i=t[1];i&&e.mapAdapter.emitter.removeListener(t[0],i)}))},t.keys=new ft,t}());function wt(t,e){var i=document.createElement("div"),n=!1;e.getStatus?n=e.getStatus():e.status&&(n=e.status);var o=e.title||"",r=e.html;function s(){o&&(i.title="string"==typeof o?o:n?o.on:o.off,i.setAttribute("aria-label",i.title))}function a(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function u(){r&&("string"==typeof r||r instanceof HTMLElement?a(r):a(n?r.on:r.off),i.setAttribute("aria-label",i.title))}function h(t,e){t.split(" ").forEach((function(t){e?i.classList.add(t):i.classList.remove(t)}))}function l(){e.addClassOn&&h(e.addClassOn,n),e.addClassOff&&h(e.addClassOff,!n)}s(),u(),e.addClass&&h(e.addClass,!0),l();var c=function(t){void 0!==t&&(n=t),u(),s(),l()},p=function(t){if(n=void 0!==t?t:!n,e.onClick){var i=e.onClick(n);Promise.resolve(i).then((function(){return c()})).catch((function(){return n=!n}))}else c()},d=t({html:i,onClick:p});return d.onClick=p,d.changeStatus=c,d}var xt=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},e._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1},e}return e(i,t),i.prototype.addControl=function(t,e,i){return o(this,void 0,void 0,(function(){var n,s=this;return r(this,(function(a){return e=null!=e?e:"top-left",(n="string"==typeof t?this.getControl(t,i):t)?[2,new Promise((function(t){s._setControlQueue(e,(function(){return o(s,void 0,void 0,(function(){var i,o;return r(this,(function(r){switch(r.label){case 0:return[4,n];case 1:return i=r.sent(),o=this.mapAdapter.addControl(i,e),t(o),[2]}}))}))}))}))]:[2]}))}))},i.prototype.createControl=function(t,e){return o(this,void 0,void 0,(function(){return r(this,(function(i){switch(i.label){case 0:return[4,this.onLoad("build-map")];case 1:return i.sent(),this.mapAdapter.createControl?[2,this.mapAdapter.createControl(t,e)]:[2]}}))}))},i.prototype.createButtonControl=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createButtonControl?[2,this.mapAdapter.createButtonControl(t)]:[2]}}))}))},i.prototype.createToggleControl=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createToggleControl?[2,this.mapAdapter.createToggleControl(t)]:this.mapAdapter.createButtonControl?[2,wt(this.mapAdapter.createButtonControl,t)]:[2]}}))}))},i.prototype.removeControl=function(t){var e=this;"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((function(t){e.mapAdapter.removeControl(t)}))},i.prototype.getControl=function(t,e){var n=this.mapAdapter.controlAdapters[t];if(n)return new n(e);var o=i.controls[t];return o?o(this,e):void 0},i.prototype.getControlContainer=function(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()},i.prototype._setControlQueue=function(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)},i.prototype._applyControls=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._loadControlQueue[t].length?(this._isControlLoading[t]=!0,[4,(0,this._loadControlQueue[t][0])()]):[3,2];case 1:return e.sent(),this._loadControlQueue[t].splice(0,1),this._applyControls(t),[3,3];case 2:this._isControlLoading[t]=!1,e.label=3;case 3:return[2]}}))}))},i.controls={CONTROL:function(t,e){return t.createControl(e.control,e.options)},BUTTON:function(t,e){return t.createButtonControl(e)},TOGGLE:function(t,e){return t.createToggleControl(e)}},i}(bt),Lt={};var Pt=function(t){function i(e){var i=t.call(this,e)||this;return i._addControls(),Lt[i.id]=i,i}return e(i,t),i.get=function(t){return function(t){return Lt[t]}(t)},i.prototype._addLayerProviders=function(){var t,e,i,n;return o(this,void 0,void 0,(function(){var o,s,a,h,l,c,p,d,f,m;return r(this,(function(r){switch(r.label){case 0:r.trys.push([0,18,19,24]),o=u(this._starterKits),r.label=1;case 1:return[4,o.next()];case 2:return(s=r.sent()).done?[3,17]:(a=s.value).getLayerAdapters?[4,a.getLayerAdapters.call(a)]:[3,16];case 3:if(!(h=r.sent()))return[3,16];r.label=4;case 4:r.trys.push([4,10,11,16]),i=void 0,l=u(h),r.label=5;case 5:return[4,l.next()];case 6:return(c=r.sent()).done?[3,9]:[4,(p=c.value).createAdapter(this)];case 7:(d=r.sent())&&(this.mapAdapter.layerAdapters[p.name]=d),r.label=8;case 8:return[3,5];case 9:return[3,16];case 10:return f=r.sent(),i={error:f},[3,16];case 11:return r.trys.push([11,,14,15]),c&&!c.done&&(n=l.return)?[4,n.call(l)]:[3,13];case 12:r.sent(),r.label=13;case 13:return[3,15];case 14:if(i)throw i.error;return[7];case 15:return[7];case 16:return[3,1];case 17:return[3,24];case 18:return m=r.sent(),t={error:m},[3,24];case 19:return r.trys.push([19,,22,23]),s&&!s.done&&(e=o.return)?[4,e.call(o)]:[3,21];case 20:r.sent(),r.label=21;case 21:return[3,23];case 22:if(t)throw t.error;return[7];case 23:return[7];case 24:return[2]}}))}))},i.prototype._onLoadSync=function(){var t,e;return o(this,void 0,void 0,(function(){var i,n,o,s,a;return r(this,(function(r){switch(r.label){case 0:r.trys.push([0,8,9,14]),i=u(this._starterKits),r.label=1;case 1:return[4,i.next()];case 2:if((n=r.sent()).done)return[3,7];if(!(o=n.value).onLoadSync)return[3,6];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,o.onLoadSync.call(o,this)];case 4:return r.sent(),[3,6];case 5:return s=r.sent(),console.error(s),[3,6];case 6:return[3,1];case 7:return[3,14];case 8:return a=r.sent(),t={error:a},[3,14];case 9:return r.trys.push([9,,12,13]),n&&!n.done&&(e=i.return)?[4,e.call(i)]:[3,11];case 10:r.sent(),r.label=11;case 11:return[3,13];case 12:if(t)throw t.error;return[7];case 13:return[7];case 14:return[2]}}))}))},i.prototype._addControls=function(){var t=this;this.options.controls&&this.options.controls.forEach((function(e){var i=e,o={};"string"==typeof e&&t.options.controlsOptions&&t.options.controlsOptions[e]&&void 0!==(o=t.options.controlsOptions[e]).control&&(i=o.control);var r=o.position,s=n(o,["position"]);t.addControl(i,r||"top-left",s)})),this._emitStatusEvent("controls:create")},i}(xt);var Ct,Mt=function(){function t(e){var i;void 0===e&&(e={}),this.cache=[];var n=null!==(i=e.namespace)&&void 0!==i?i:"default";return t.instance[n]?t.instance[n]:(t.instance[n]=this,this)}return t.prototype.clean=function(){this.cache.length=0},t.prototype.all=function(){return this.cache},t.prototype.addFull=function(t,e,i){return this.add(t,e,i,!0)},t.prototype.add=function(t,e,i,n){var o=this,r=this._find(t,i);if(r)return r.value;var s=void 0;s=e instanceof Function?e():e;var a=i&&JSON.parse(JSON.stringify(G(i))),u={key:t,value:s,props:a,options:a};return n&&!Z(s)?s:(this.cache.push(u),s instanceof Promise?(s.catch((function(e){throw o.delete(t,i),e})),n&&s.then((function(e){return Z(e)||o.delete(t,i),e})),s):s)},t.prototype.match=function(t,e){var i=this._find(t,e);if(i)return i.value},t.prototype.matchAll=function(t,e){var i=this;return t?this.cache.filter((function(n){return i._filter(n,t,e)})).map((function(t){return t.value})):this.cache.map((function(t){return t.value}))},t.prototype.delete=function(t,e){var i=this,n=[];"string"==typeof t?n=this.cache.filter((function(n){return i._filter(n,t,e)})):n.push(t);for(var o=0,r=n;o<r.length;o++){var s=this.cache.indexOf(r[o]);this.cache.splice(s,1)}},t.prototype._find=function(t,e){var i=this;return this.cache.find((function(n){return i._filter(n,t,e)}))},t.prototype._filter=function(t,e,i){return t.key===e&&(!i||q(t.props||t.options||{},G(i)))},t.instance={},t}(),Tt=function(t){function i(e){var n=t.call(this)||this;return n.name="NetworkError",Object.setPrototypeOf(n,i.prototype),n.message="Unable to request ".concat(e,".\n Possibly invalid NGW URL entered or CORS not configured to get request from ").concat(location.origin),n}return e(i,t),i}(Error),Ot=function(t){function i(e){var n=t.call(this)||this;return n.name="NgwError",Object.assign(n,e),Object.setPrototypeOf(n,i.prototype),n}return e(i,t),i}(Error);function At(t){return"[object Object]"===Object.prototype.toString.call(t)}Ct=function(t,e,i,n,o){void 0===i&&(i={}),i.method=i.method||"GET";var r=new XMLHttpRequest;r.open(i.method||"GET",t,!0),"blob"===i.responseType&&(r.responseType=i.responseType);var s=function(){try{return JSON.parse(r.responseText)}catch(t){return r.responseText}};r.onload=function(){-1!==[401,403,404,422,500].indexOf(r.status)&&n(new Ot(s())),function(t){void 0===t&&(t=!1);var o=t?n:e;"blob"===i.responseType?o(r.response):r.responseText?o(s()):n({message:""})}()},r.onerror=function(e){n(0===r.status?new Tt(t):e)},r.upload.onprogress=function(t){t.lengthComputable&&(i.onProgress&&i.onProgress(t.loaded/t.total*100,t))};var a,u=i.headers;if(u)for(var h in u){var l=u[h];"string"==typeof l&&r.setRequestHeader(h,l)}if(void 0!==i.withCredentials&&(r.withCredentials=i.withCredentials),i.file){if((a=new FormData).append("file",i.file),i.data)for(var c in i.data)a.append(c,a[c])}else a=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;o&&o((function(){r.abort()})),r.send(a)};var kt=/\{ *([\w_-]+) *\}/g;function Et(t,e){return t.replace(kt,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for letiable "+t);return"function"==typeof n&&(n=n(e)),n}))}var zt=function(t){function i(e){var n=t.call(this,e)||this;return n.name="ResourceNotFoundError",n.exception="nextgisweb.resource.exception.ResourceNotFound",Object.setPrototypeOf(n,i.prototype),n}return e(i,t),i}(Ot),St=function(t){function i(e){var n=t.call(this,e)||this;return n.name="InsufficientPermissionsError",n.exception="nextgisweb.core.exception.InsufficientPermissions",Object.setPrototypeOf(n,i.prototype),n}return e(i,t),i}(Ot),It=[];function Bt(t){It.push(t)}var Zt=["description"];function Rt(t,e){void 0===e&&(e=""),e=e?e+"__":"";for(var i={},n=0,o=Object.entries(t);n<o.length;n++){var r=o[n],s=r[0],a=r[1];if(-1===Zt.indexOf(s))if(At(a))if("owner_user"===s){var u=Rt(a,s);Object.assign(i,u)}else"parent"===s&&"id"in a&&(i.parent_id=a.id);else B(a)&&(i[e+s]=a)}return i}var Nt=function(){function t(t){this.connector=t,this.cache=new Mt}return t.prototype.getOne=function(t,e){var n=this,o=new Mt,r={},s=i(i({},e),{cache:!1});"string"==typeof t?r.keyname=t:"number"==typeof t?r.id=t:At(t)&&(void 0!==t.id?r.id=t.id:t.keyname&&(r.keyname=t.keyname));return o.addFull("resource",(function(){return"string"==typeof t?n._fetchResourceBy({keyname:t},s):"number"==typeof t?n._fetchResourceById(t,s):At(t)?n._fetchResourceBy(t,s):S.resolve(void 0)}),r)},t.prototype.getOneOrFail=function(t,e){return this.getOne(t,e).then((function(t){if(t)return t;throw new zt}))},t.prototype.getId=function(t,e){return"number"==typeof t?S.resolve(t):"string"==typeof t||At(t)?this.getOne(t,e).then((function(t){if(t)return t.resource.id})):S.resolve(void 0)},t.prototype.getIdOrFail=function(t,e){return this.getId(t,e).then((function(t){if(void 0===t)throw new Error;return t}))},t.prototype.getMany=function(t,e){var n=this;return this._resourceCacheFilter(t).then((function(o){if(!o.length){var r={};return t.keyname?r.keyname=t.keyname:Object.assign(r,Rt(t)),n.connector.get("resource.search",e,i({serialization:"full"},r)).then((function(t){if(t)for(var e=0,i=t;e<i.length;e++){var o=i[e];n.cache.add("resource.item",S.resolve(o),{id:o.resource.id})}return t}))}return o}))},t.prototype.getParent=function(t,e){var i=this;return this.getOne(t,e).then((function(t){return t?i.getOne(t.resource.parent.id,e):S.resolve(void 0)}))},t.prototype.getChildrenOf=function(t,e){var i=this;return this.getIdOrFail(t).then((function(t){return i._getChildrenOf(t,e)}))},t.prototype.update=function(t,e){var i=this;return this.getId(t).then((function(t){if(void 0!==t)return i.connector.put("resource.item",{data:e},{id:t})}))},t.prototype.delete=function(t){var e=this;return this.getId(t).then((function(t){if(void 0!==t)return e.connector.delete("resource.item",null,{id:t}).then((function(){e._cleanResourceItemCache(t)}))}))},t.prototype._getChildrenOf=function(t,e,n){var o=this;return void 0===n&&(n=[]),this.connector.get("resource.collection",i({cache:!0},e),{parent:t}).then((function(t){for(var i=[],r=0,s=t;r<s.length;r++){var a=s[r];o.cache.add("resource.item",S.resolve(a),{id:a.resource.id}),n.push(a),(null==e?void 0:e.recursive)&&a.resource.children&&i.push(o._getChildrenOf(a.resource.id,e,n))}return i.length?S.all(i).then((function(){return n})):n}))},t.prototype._cleanResourceItemCache=function(t){return o(this,void 0,void 0,(function(){var e,i,n,o,s,a,u,h;return r(this,(function(r){switch(r.label){case 0:e=this.cache.all(),i=[],n=0,o=e,r.label=1;case 1:return n<o.length?(a=(s=o[n]).options&&s.options.id,["resource.item","resource"].includes(s.key)&&void 0!==a?"number"!=typeof a?[3,2]:(a===t&&i.push(s),[3,4]):[3,4]):[3,5];case 2:return[4,this.getId(a)];case 3:r.sent()===t&&i.push(s),r.label=4;case 4:return n++,[3,1];case 5:for(u=0,h=i;u<h.length;u++)this.cache.delete(h[u]);return[2]}}))}))},t.prototype._fetchResourceById=function(t,e){var i=this;return this.cache.add("resource.item",(function(){return i.connector.get("resource.item",e,{id:t})}),{id:t}).catch((function(t){if(!(t instanceof zt))throw t}))},t.prototype._fetchResourceBy=function(t,e){return this.getMany(t,e).then((function(t){return t[0]}))},t.prototype._resourceCacheFilter=function(t){return S.all(this.cache.matchAll("resource.item")).then((function(e){return e.filter((function(e){if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:B(t.id)&&B(e.resource.id)?t.id===e.resource.id:q(t,e.resource)})),[]}))},t}(),Dt=0,jt=function(){function t(t){this.options=t,this.id=Dt++,this.emitter=new p.exports.EventEmitter,this.routeStr="/api/component/pyramid/route",this.activeRequests=[];var e=function(t){return It.find((function(e){if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return q(e.options.auth,t.auth)}}))}(t);if(e)return e;this.options.route&&(this.routeStr=this.options.route),this.options.requestTransform&&(this.requestTransform=this.options.requestTransform),this.resources=new Nt(this),Bt(this)}return t.create=function(t){return new this(t)},t.prototype.setRequestTransform=function(t){this.requestTransform=t},t.prototype.setNgw=function(t){this.logout(),this.options.baseUrl=t,Bt(this)},t.prototype.connect=function(){var t=this,e=new Mt,i=this.options.auth;return e.add("route",(function(){return new S((function(e,n){var o=function(){return t.makeQuery(t.routeStr,{},{}).then((function(t){e(t)})).catch((function(t){n(t)}))};if(i){var r=i.login,s=i.password;if(r&&s)return t._login({login:r,password:s}).then((function(){return o()})).catch((function(t){return n(t)}))}return o()}))}),{id:this.id,auth:i,baseUrl:this.options.baseUrl})},t.prototype.login=function(t,e){return this.logout(),Bt(this),this._login(t,e)},t.prototype.logout=function(){var t;this.abort(),-1!==(t=It.indexOf(this))&&It.splice(t,1),this.options.auth=void 0,this.user=void 0,this.emitter.emit("logout"),this.resources.cache.clean()},t.prototype.getUserInfo=function(t,e){if(this.user&&this.user.id)return S.resolve(this.user);t&&(this.options.auth=t);var n=i({headers:this.getAuthorizationHeaders(t)},e);return this.makeQuery("/api/component/auth/current_user",{},n)},t.prototype.getAuthorizationHeaders=function(t){var e=this.makeClientId(t);if(e)return{Authorization:"Basic "+e}},t.prototype.makeClientId=function(t){if(t=t||this.options.auth){var e=t.password,i=unescape(encodeURIComponent("".concat(t.login,":").concat(e)));return window.btoa(i)}},t.prototype.abort=function(){for(var t=0,e=this.activeRequests;t<e.length;t++){e[t].cancel()}this.activeRequests=[]},t.prototype.getActiveApiRequests=function(){return a([],this.activeRequests,!0)},t.prototype.apiRequest=function(t,e,n){var o,r=this;void 0===e&&(e={}),void 0===n&&(n={});var s=n.method,u=n.headers,h=n.withCredentials,l=n.responseType,c=G(e),p=function(){return function(t){var e=t.params;return new S((function(i,n){t.connector.connect().then((function(o){var r=o&&o[t.name];if(r){var s=(r=a([],r,!0)).shift();if(r.length){for(var u={},h=0;h<r.length;h++){var l=r[h];if(u[h]="{"+l+"}",void 0===e[l])throw new Error("`"+l+"` url api argument is not specified")}s&&(s=Et(s,u))}if(e){var c=[],p=e.paramList;for(var d in Array.isArray(p)&&(delete e.paramList,p.forEach((function(t){c.push("".concat(t[0],"=").concat(t[1]))}))),e)-1===r.indexOf(d)&&c.push("".concat(d,"=").concat(e[d]));c.length&&(s=s+"?"+c.join("&"))}s?i(t.connector.makeQuery(s,e,t.requestOptions)):n(new Error("request url is not set"))}else i(void 0)})).catch((function(t){n(t)}))}))}({name:t,params:c,requestOptions:n,connector:r})};return n.cache&&"GET"===s?(new Mt).add(t,p,i({params:c},G({headers:u,withCredentials:h,responseType:l,baseUrl:this.options.baseUrl,userId:null===(o=this.user)||void 0===o?void 0:o.id}))):p()},t.prototype.post=function(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)},t.prototype.get=function(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)},t.prototype.patch=function(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)},t.prototype.put=function(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)},t.prototype.delete=function(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)},t.prototype.makeQuery=function(t,e,i){if(void 0===i&&(i={}),t=(this.options.baseUrl?this.options.baseUrl:"")+t)return e&&(t=Et(t,e)),t=encodeURI(K(t)),this._loadData(t,i);throw new Error("Empty `url` not allowed")},t.prototype.getResource=function(t,e){return this.resources.getOne(t,e)},t.prototype.getResourceOrFail=function(t,e){return this.resources.getOneOrFail(t,e)},t.prototype.getResourceBy=function(t){return this.resources.getOne(t)},t.prototype.getResourceByKeyname=function(t){return this.resources.getOne(t)},t.prototype.getResourceById=function(t){return this.resources.getOne(t)},t.prototype.getResourceId=function(t,e){return this.resources.getId(t,e)},t.prototype.getResourceIdOrFail=function(t,e){return this.resources.getIdOrFail(t,e)},t.prototype.getResourcesBy=function(t,e){return this.resources.getMany(t,e)},t.prototype.getResourceParent=function(t,e){return this.resources.getParent(t,e)},t.prototype.getResourceChildren=function(t,e){return this.resources.getChildrenOf(t,e)},t.prototype.updateResource=function(t,e){return this.resources.update(t,e)},t.prototype.deleteResource=function(t){return this.resources.delete(t)},t.prototype._loadData=function(t,e){var n=this;e.responseType=e.responseType||"json";var o=new S((function(o,r,s){if(n.user&&((e=e||{}).headers=i(i({},n.getAuthorizationHeaders()),e.headers)),n.requestTransform){var a=n.requestTransform(t,e);t=a[0],e=a[1]}Ct(t,o,e,r,s)})).then((function(t){return n._cleanActiveRequests(o),t})).catch((function(t){if(n._cleanActiveRequests(o),t instanceof S.CancelError);else{var e=n._handleHttpError(t);if(e)throw e}}));return e.signal&&"function"==typeof e.signal.addEventListener&&e.signal.addEventListener("abort",(function(){o.cancel(),n._cleanActiveRequests(o)})),this.activeRequests.push(o),o},t.prototype._login=function(t,e){var i=this;return this.getUserInfo(t,e).then((function(t){return i.user=t,i.emitter.emit("login",t),t})).catch((function(t){throw i.emitter.emit("login:error",t),t}))},t.prototype._cleanActiveRequests=function(t){var e=this.activeRequests.indexOf(t);-1!==e&&this.activeRequests.splice(e,1)},t.prototype._handleHttpError=function(t){if(t&&t instanceof Ot){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new zt(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new St(t)}return t},t.errors={NgwError:Ot,ResourceNotFoundError:zt},t}();function Ft(t){var e=t.extent_bottom,i=t.extent_left,n=t.extent_top,o=t.extent_right;if(e&&i&&n&&o){var r=[i,e,o,n];return r[3]>82&&(r[3]=82),r[1]<-82&&(r[1]=-82),r}}function Ut(t){var e=t.cache;return t.connector.get("layer.extent",{cache:void 0===e||e},{id:t.resourceId}).then((function(t){if(t){var e=t.extent;return[e.minLon,e.minLat,e.maxLon,e.maxLat]}}))}function Wt(t){return t.connector.getResource(t.resourceId).then((function(e){if(e)return Ht(e,t.connector,t)}))}function Ht(t,e,n){if(t.webmap)return S.resolve(Ft(t.webmap));var o=t.resource;return o.cls&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id).then((function(t){if(t)return Ut(i(i({},n),{resourceId:t.resource.id,connector:e}))})):Ut(i(i({},n),{resourceId:o.id,connector:e}))}var Vt=function(){function t(){}return t.prototype.getExtent=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.getBounds()]}))}))},t.prototype.getBounds=function(t){return o(this,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return this._extent?[2,this._extent]:this.item?(e=this,[4,Ht(this.item,this.connector,t)]):[3,2];case 1:return e._extent=i.sent(),[2,this._extent];case 2:return[2]}}))}))},t}();var qt=["fields","intersects","limit","orderBy","strategy"];function Gt(t){var e={};return qt.forEach((function(i){var n=t[i];void 0!==n&&(e[i]=n)})),e}function Jt(t,e){return o(this,void 0,void 0,(function(){var i,n,o,s,a;return r(this,(function(r){switch(r.label){case 0:return n=i=t.resource,o=t.keyname,s=t.resourceId,i?"string"!=typeof i?[3,1]:(o=i,[3,5]):[3,5];case 1:return"number"!=typeof i?[3,2]:(s=i,[3,5]);case 2:return n.resource&&void 0!==n.resource&&"resource"in n?(s=i.resource.id,[3,5]):[3,3];case 3:return[4,Jt(i,e)];case 4:s=r.sent(),r.label=5;case 5:return s||!o?[3,7]:[4,e.getResource(o)];case 6:(a=r.sent())&&(s=a.resource.id),r.label=7;case 7:return[2,s]}}))}))}var Kt={srs:4326,geom_format:"geojson"};function Yt(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function Qt(t,e){var i=e.extensions,n=e.geom,o=e.fields,r=e.srs;t.extensions=i?i.join(","):"",void 0!==o&&(t.fields=Array.isArray(o)?o.join(","):""),void 0!==n&&(t.geom=n?"yes":"no",n||(delete t.srs,delete t.geom_format)),B(r)&&(t.srs=r)}function Xt(t){var e=te(t);return S.all(e).then((function(e){for(var i=[],n=[],o=0,r=e;o<r.length;o++)for(var s=0,a=r[o];s<a.length;s++){var u=a[s];i.includes(u.id)||(n.push(u),i.push(u.id))}return t.offset||t.limit?n.splice(void 0!==t.offset?t.offset:0,void 0!==t.limit?t.limit:n.length):n}))}function $t(t){var e=t[0],i=t[1],n=t[2],o="id"!==e?"fld_":"",r="",s="",a=String(e).trim().replace(/^(%?)(.+?)(%?)$/,(function(t,e,i,n){return r=e,s=n,i})),u=r+n+s;return["".concat(o).concat(a,"__").concat(i),u]}function te(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=[]);var o=t.filters,r="string"==typeof o[0]?o[0]:"all",s=o.filter((function(t){return Array.isArray(t)}));if("any"===r)for(var u=0,h=s;u<h.length;u++){ot(f=h[u])?e.push(ie(i(i({},t),{paramList:a(a([],n,!0),[$t(f)],!1)}))):te(i(i({},t),{filters:f}),e,a([],n,!0))}else if("all"===r){for(var l=[],c=[],p=0,d=s;p<d.length;p++){var f;ot(f=d[p])?l.push($t(f)):c.push(f)}if(c.length)for(var m=0,_=c;m<_.length;m++){var y=_[m];te(i(i({},t),{filters:y}),e,a(a([],n,!0),l,!0))}else e.push(ie(i(i({},t),{paramList:a(a([],n,!0),l,!0)})))}return e}function ee(t){var e=t.map((function(t){var e=H(t[0],t[1]).map((function(t){return e=t,n=i?Number("1e+"+i):1,Math.round((e+Number.EPSILON)*n)/n;var e,i,n}));return e[0]+" "+e[1]}));return"POLYGON((".concat(e.join(", "),"))")}function ie(t){var e,n=i({},Kt),o=t.limit,r=t.cache,s=t.signal,a=t.offset,u=t.orderBy,h=t.paramList,l=t.connector,c=t.geomFormat,p=t.intersects,d=t.resourceId;if(o?o!==Number.POSITIVE_INFINITY&&(n.limit=o):n.limit=7e3,a&&(n.offset=a),c&&(n.geom_format=c),Qt(n,t),u&&(n.order_by=u.join(",")),Array.isArray(p)){var f=(e=p,Array.isArray(e)&&4===e.length&&e.every((function(t){return"number"==typeof t}))?F(p):p);n.intersects=ee(f)}else"string"==typeof p&&(n.intersects=p);h&&(n.paramList=h);var m=i({id:d},n);return l.get("feature_layer.feature.collection",{cache:r,signal:s},m)}function ne(t){var e,i=function(){var i=t[e];if(J(i)){var n=i;if(B(n.year)&&B(n.month)&&B(n.day)){var o=[n.year,n.month-1,n.day];"hour"in n&&[n.hour,n.minute,n.second].forEach((function(t){o.push(t)})),t[e]=(new(Date.bind.apply(Date,a([void 0],o,!1)))).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))};for(e in t)i();return t}function oe(t){var e=t.filters;return e?Xt(i(i({},t),{filters:e})).then((function(n){var o;return(null!==(o=t.clientFilterValidate)&&void 0!==o?o:re(e))&&(n=n.filter((function(t){return rt(ne(i(i({},t.fields),{id:t.id})),e)}))),n})):ie(t)}function re(t){if("any"===t[0])return!0;for(var e=1;e<t.length;e++){var i=t[e];if("[object Array]"===Object.prototype.toString.call(i))if(re(i))return!0}return!1}function se(t){return function(t){return oe(t).then((function(t){var e=[];return t.forEach((function(t){e.push(Yt(t))})),e}))}(t).then((function(t){return{type:"FeatureCollection",features:t}}))}function ae(t){var n,s;return o(this,void 0,void 0,(function(){var a,u,h,l,c,d,f,m,_,y,v,g,b,w,x,L,P=this;return r(this,(function(C){switch(C.label){case 0:return a=t.item,u=t.webMap,c=null==(l=t.addLayerOptionsPriority)||l,f=t.Adapter||u.mapAdapter.layerAdapters.GEOJSON,m=[],_=!1,[4,Jt(d=t.layerOptions,h=t.connector)];case 1:return g=C.sent(),(null===(s=null===(n=d.adapterOptions)||void 0===n?void 0:n.popupOptions)||void 0===s?void 0:s.fromProperties)&&(d.adapterOptions.popupOptions.createPopupContent=function(t){var e=t.feature;return e&&function(t,e){var i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach((function(e){if(e.grid_visibility){var n=t.properties&&t.properties[e.keyname];if(n){var o=document.createElement("div");i.appendChild(o),o.innerHTML="<span>".concat(e.display_name,"</span>: ").concat(n,"<span></span>")}}}));else if(t.properties)for(var n in t.properties){var o=document.createElement("div");i.appendChild(o),o.innerHTML="<span>".concat(n,"</span>: ").concat(t.properties[n],"<span></span>")}return i}(e,a)}),b=function(t,e){return o(P,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return x(),y={filters:t,options:e},[4,v=se(i({resourceId:g,filters:t,connector:h,cache:!0},e))];case 1:return[2,n.sent()]}}))}))},w=!1,x=function(){v&&(v.cancel(),v=void 0)},L=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.emitter=new p.exports.EventEmitter,e}return e(n,t),n.prototype.addLayer=function(e){return o(this,void 0,void 0,(function(){var n,o,s,u,h;return r(this,(function(r){switch(r.label){case 0:return n=!e.data,o=void 0===e.waitFullLoad||e.waitFullLoad,void 0!==d.id&&(e.id=d.id),a&&a.vector_layer&&(e.type=De[a.vector_layer.geometry_type]),d.adapterOptions&&(e=c?i(i({},d.adapterOptions),e):i(i({},e),d.adapterOptions)),e.data&&0===Object.keys(e.data).length&&(e.data=void 0,n=!1),this.options.strategy=s=e.strategy||void 0,u=t.prototype.addLayer.call(this,e),y={filters:e.propertiesFilter,options:Gt(e)},n&&(h=this.updateLayer()),o&&h?[4,h]:[3,2];case 1:r.sent(),r.label=2;case 2:return s&&s.startsWith("BBOX")&&!_&&this._addBboxEventListener(),[2,u]}}))}))},n.prototype.getExtent=function(){return this.getBounds()},n.prototype.getBounds=function(){return o(this,void 0,void 0,(function(){var e,i;return r(this,(function(n){return e=this.getLayers&&this.getLayers().length,(null==(i=this.options.strategy)?void 0:i.startsWith("BBOX"))||e?[2,Wt({connector:h,resourceId:a.resource.id})]:t.prototype.getBounds?[2,t.prototype.getBounds.call(this)]:[2]}))}))},n.prototype.beforeRemove=function(){w=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,x()},n.prototype.getCount=function(){return function(t){var e=t.cache;return t.connector.get("feature_layer.feature.count",{cache:void 0===e||e},{id:t.resourceId}).then((function(t){return t.total_count}))}({connector:h,resourceId:g,cache:!0})},n.prototype.updateLayer=function(e){var n;return o(this,void 0,void 0,(function(){var o,s,a,h,l,c,p,f,v,g,x;return r(this,(function(r){switch(r.label){case 0:return e=e||y||{},(null===(n=this.options.strategy)||void 0===n?void 0:n.startsWith("BBOX"))?[4,u.onLoad("create")]:[3,2];case 1:if(r.sent(),e.options=e.options||{},e.options.intersects=u.getBounds(),s=(o=this.options).minZoom,a=o.maxZoom,void 0!==(h=u.getZoom())){if(void 0!==s&&h<s)return[2];if(void 0!==a&&h>a)return[2];if(_)return[2]}r.label=2;case 2:if(w)return[2];r.label=3;case 3:return r.trys.push([3,10,,11]),this.emitter.emit("preupdate",e),u._emitLayerEvent("layer:preupdate",d.id||"",e),[4,b(e.filters,i(i({},e.options),{srs:this.options.srs}))];case 4:return l=r.sent(),c=l,[4,this.getCount()];case 5:if(p=r.sent(),"BBOX+"!==this.options.strategy)return[3,7];for(c={type:"FeatureCollection",features:[]},f=0,v=l.features;f<v.length;f++)g=v[f],-1===m.indexOf(String(g.id))&&(m.push(String(g.id)),c.features.push(g));return _=void 0!==p&&m.length>=p,[4,u.addLayerData(this,c)];case 6:return r.sent(),[3,9];case 7:return _=void 0!==p&&l.features.length>=p,[4,u.setLayerData(this,l)];case 8:r.sent(),r.label=9;case 9:return this.emitter.emit("updated",l),u._emitLayerEvent("layer:updated",d.id||"",{data:l,newData:c,isFull:_}),[3,11];case 10:if((x=r.sent())instanceof Error&&"CancelError"!==x.name)throw x;return[3,11];case 11:return t.prototype.updateLayer&&t.prototype.updateLayer.call(this),[2]}}))}))},n.prototype.propertiesFilter=function(t,e){return o(this,void 0,void 0,(function(){var n;return r(this,(function(o){switch(o.label){case 0:return x(),this.filter&&_?(this.filter((function(e){var n=e.feature&&e.feature.properties&&ne(i({},e.feature.properties));return!n||rt(n,t)})),[3,3]):[3,1];case 1:return this.setData?(this.clearLayer&&this.clearLayer(),[4,b(t,i(i({},e),{srs:this.options.srs}))]):[3,3];case 2:n=o.sent(),this.setData(n),o.label=3;case 3:return[2]}}))}))},n.prototype.removeFilter=function(){y=void 0,this.propertiesFilter([]),this.filter&&this.filter((function(){return!0}))},n.prototype._addBboxEventListener=function(){var t=this;this.__enableMapMoveListener=function(e){e===t&&(t._removeMoveEventListener(),t.updateLayer(),t._addMoveEventListener())},this.__disableMapMoveListener=function(e){e===t&&t._removeMoveEventListener()},u.emitter.on("layer:show",this.__enableMapMoveListener),u.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)},n.prototype._removeBboxEventListener=function(){this.__enableMapMoveListener&&u.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&u.emitter.on("layer:hide",this.__disableMapMoveListener)},n.prototype._addMoveEventListener=function(){var t=this;this.__onMapMove=D((function(){return t.updateLayer()})),this.__onMapMoveStart=x,u.emitter.on("movestart",this.__onMapMoveStart),u.emitter.on("moveend",this.__onMapMove)},n.prototype._removeMoveEventListener=function(){this.__onMapMove&&u.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&u.emitter.removeListener("movestart",this.__onMapMoveStart)},n}(f),[2,L]}}))}))}function ue(t){var e,i,n=t.options,o=t.webMap,r=t.baseUrl,s=n.adapter||"IMAGE",a=o&&o.getLayerAdapters(),u=n.resource,h=n.tileNoData?n.tileNoData:200;if("number"==typeof u){if("IMAGE"===s){if(!a||a.IMAGE)return function(t){var e=t.resourceId,i=t.nd,n=t.headers,o=t.baseUrl+"/api/component/render/image",r={resource:e};return i&&(r.nd=i),{url:o,resourceId:e,headers:n,params:r,updateWmsParams:function(t){return i&&(t.nd=i),Re(t,e)}}}({resourceId:u,headers:n.headers,nd:h,baseUrl:r});s="TILE"}if("WMS"===s){i="".concat(r,"/api/resource/").concat(u,"/wms");var l=n.adapterOptions;return{url:i,format:"image/png",version:"1.1.1",layers:l&&l.layers,headers:n.headers}}if("MVT"===s)return{url:i=r+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+u+"&simplification="+(null!==(e=n.simplification)&&void 0!==e?e:6),sourceLayer:"ngw:"+u,featureIdName:"$id"};if("TERRAIN"===s)return{url:i=r+"/api/resource/".concat(u,"/terrain_provider"),adapter:s};if("MODEL_3D"===s)return{url:i=r+"/api/component/model_3d/".concat(u,"/data.glb")};if("TILE"===s)return{url:i=r+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+u+"&nd="+h,adapter:s}}else{if(void 0!==u)throw new Error("Option `resource` must be number, not "+typeof u);console.log("Option `resource` not set")}}function he(t){var n=t.layerOptions,s=t.webMap,a=t.connector,u=t.item;return o(this,void 0,void 0,(function(){var t,h,l,c,p,d;return r(this,(function(f){switch(f.label){case 0:return t=u.resource.cls,h={wmsserver_service:"WMS",tmsclient_layer:"IMAGE"},void 0!==(l=n.adapter||t&&h[t]||"IMAGE")&&(n.adapter=l),"IMAGE"===l&&(c=s.getLayerAdapters(),!c||c.IMAGE||(l="TILE")),(p=s.mapAdapter.layerAdapters[l])?[4,Jt(n,a)]:[3,2];case 1:return d=f.sent(),[2,function(t){function h(e,o){var r=t.call(this,e,o)||this;r.map=e,r.item=u,r.resourceId=d;var h=ue({options:n,webMap:s,baseUrl:a.options.baseUrl||""});if(h){var l=i(i(i({},h),n.adapterOptions),{params:{resource:d},layers:h.layers||String(d),resourceId:d});n.adapterOptions&&B(n.adapterOptions.setViewDelay)&&(l.setViewDelay=n.adapterOptions.setViewDelay),r.options=i(i({},r.options),l)}return r}return e(h,t),h.prototype.addLayer=function(e){return t.prototype.addLayer.call(this,i(i({},this.options),e))},h.prototype.getIdentificationIds=function(){return o(this,void 0,void 0,(function(){var t;return r(this,(function(e){if(this.item){if("MVT"===l)return[2,[this.item.resource.id]];if(B(t=this.item.resource.parent.id))return[2,[t]]}return[2,[]]}))}))},h}(p)];case 2:throw new Error(l+" not supported yet. Only TILE")}}))}))}function le(t,e,i,n){return!!de(t,e,i,fe,n)}function ce(t,e,i,n){return de(t,e,i,me,n)}function pe(t,e){void 0===e&&(e="children");var i=[],n=("function"==typeof e?e:function(t){return t[e]})(t);return n&&(Array.isArray(n)?i=n:i.push(n)),n?i:void 0}function de(t,e,i,n,o){void 0===e&&(e=function(t){return!!t}),void 0===i&&(i="children");var r="function"==typeof e?e:function(t){return rt(t,e)};return n(t,o?function(t){return r(o(t))}:r,i)}function fe(t,e,i,n){void 0===e&&(e=function(t){return!!t});var o=[];if(Array.isArray(t))o=t;else{if(e(t))return t;var r=pe(t,i);r&&(o=r)}for(var s=0;s<o.length;s++)if(o[s]){var a=fe(o[s],e,i);if(a)return a}}function me(t,e,i,n){void 0===e&&(e=function(t){return!!t}),void 0===n&&(n=[]);var o=[];if(Array.isArray(t))o=t;else{e(t)&&n.push(t);var r=pe(t,i);r&&(o=r)}for(var s=0;s<o.length;s++)o[s]&&me(o[s],e,i,n);return n}function _e(t,e,i,n){void 0===e&&(e=function(t){return!!t});var o=[];if(Array.isArray(t))o=t;else{if(!e(t))return!1;var r=pe(t,i);r&&(o=r)}for(var s=0;s<o.length;s++){if(o[s])if(!_e(o[s],e,i))return!1}return!0}var ye=function(){function t(t){this._children=[],this.item=t}return t.prototype.setParent=function(t){this._parent=t},t.prototype.addChild=function(t){this._children.push(t)},t.prototype.getParent=function(){return this._parent},t.prototype.getParents=function(t){var e=this.getParent();return e?ce(e,t,(function(t){return t.tree.getParent()})):[]},t.prototype.getRoot=function(){for(var t=this.getParent(),e=t;t;)(t=t.tree.getParent())&&(e=t);return e},t.prototype.find=function(t){return de(this._children,t,(function(t){return t.tree.getChildren()}),fe,e);var e},t.prototype.every=function(t){return!!de(this._children,t,(function(t){return t.tree.getChildren()}),_e,e);var e},t.prototype.some=function(t){return le(this._children,t,(function(t){return t.tree.getChildren()}))},t.prototype.all=function(t){return this.getDescendants(t)},t.prototype.getDescendants=function(t){return ce(this._children,t,(function(t){return t.tree.getChildren()}))},t.prototype.getChildren=function(){return a([],this._children,!0)},t}(),ve=function(){function t(t,e,i){this.emitter=new p.exports.EventEmitter,this._blocked=!1,this.item=e,this.options=Object.assign({},i),this.name=t,this._value=this.getProperty()}return t.prototype.getProperty=function(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value},t.prototype.getParents=function(){return this.item.tree.getParents()||[]},t.prototype.getParent=function(){return this.item.tree.getParent()},t.prototype.getChildren=function(){return this.item.tree.getChildren()},t.prototype.isGroup=function(){return this.item.tree.getDescendants().length},t.prototype.isBlocked=function(){var t=this;if(void 0===this._blocked){var e=this.item.tree.getParents();if(e){var i=e.find((function(e){var i=e.properties&&e.properties.property(t.name);return!!i&&!i.get()}));this._blocked=!!i}else this._blocked=!1}return this._blocked},t.prototype.set=function(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)},t.prototype.get=function(){return this.getValue()},t.prototype.update=function(t,e){this._callOnSet(t,e)},t.prototype.getContainer=function(){return this._container},t.prototype.destroy=function(){if(this._container){var t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()},t.prototype.getValue=function(){return void 0!==this._value?this._value:this.getProperty()},t.prototype._prepareValue=function(t){return t},t.prototype._callOnSet=function(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)},t.prototype._fireChangeEvent=function(t,e){var i=this;this.emitter&&(t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e}),this.item.tree.getParents().forEach((function(n){var o=n.properties&&n.properties.property(i.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:i.item})})))},t}(),ge=function(t){function n(e,o,r){var s=t.call(this,e,o,i(i({},n.options),r))||this;return s.set(s.get()),s}return e(n,t),n.prototype.update=function(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);var i=this.getParent(),n=i&&i.properties&&i.properties.property(this.name);n&&n.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)},n.prototype.getHierarchyValue=function(){var t=this;return this.get()&&this.getParents().every((function(e){var i=e.properties&&e.properties.get(t.name);return i&&i.get()}))},n.prototype.block=function(t){this._blocked=!0,this._block(t)},n.prototype.unBlock=function(t){this._blocked=!1,this.getValue()&&this._unBlock(t)},n.prototype.blockChild=function(t){var e=this;this.item.tree.getDescendants().forEach((function(i){return e._blockChild(i,t)}))},n.prototype.unblockChild=function(t){var e=this;this.item.tree.getChildren().forEach((function(i){return e._unBlockChild(i,t)}))},n.prototype._prepareValue=function(t){return t},n.prototype._turnOff=function(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)},n.prototype._turnOn=function(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)},n.prototype._block=function(t){this._turnOff(t)},n.prototype._unBlock=function(t){this._turnOn(t)},n.prototype._blockChild=function(t,e){var i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(e)},n.prototype._unBlockChild=function(t,e){var i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(e)},n.prototype._propagation=function(t,e){if(this.isGroup())for(var n=this.item.tree.getChildren(),o=0;o<n.length;o++){var r=n[o],s=r.properties&&r.properties.property(this.name);s&&s.set(t,i(i({},e),{propagation:!0,bubble:!1}))}},n.options={hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"},n}(ve),be=function(){function t(t,e){this.item=t,this.options={},this._properties={},this._propertiesList=[],e&&e.forEach(this._setPropertyHandler.bind(this))}return t.prototype.add=function(t){this._setPropertyHandler(t)},t.prototype._setPropertyHandler=function(e){var n=t.handlers,o=e.handler;if(!o&&e.type)if("boolean"===e.type)o=n.CheckProperty;else o=n.BaseProperty;if(o&&e.name){var r=i({},e||{});this._properties[e.name]=new o(e.name,this.item,r),this._propertiesList.push(e.name)}},t.prototype.update=function(){this.list().forEach((function(t){t.update()}))},t.prototype.get=function(t){var e=this.property(t);if(e)return e.get()},t.prototype.set=function(t,e,i){var n=this.property(t);if(n)return n.set(e,i)},t.prototype.property=function(t){return this._properties[t]},t.prototype.list=function(){var t=this;return this._propertiesList.map((function(e){return t._properties[e]}))},t.prototype.destroy=function(){for(var t in this._properties){var e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]},t.handlers={CheckProperty:ge},t}(),we=0,xe=function(){function t(t){this.options={},this.id=we,we+=1,this.options=i({},t),this.tree=new ye(this)}return t.prototype.initProperties=function(){this.properties=new be(this,this.options.properties)},t}(),Le=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.getProperty=function(){var t=this.item.layer;return t&&t&&t.options&&void 0!==t.options.opacity?t.options.opacity:1},i.prototype.update=function(t,e){var i=this;if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);for(var n=0,o=this.getChildren();n<o.length;n++){var r=o[n].properties.property(this.name);r&&(e.propagation?r.set(t,e):r.update(r.get(),e))}}var s=this.item.layer;if(s){var a=this.getParents().reduce((function(t,e){var n=e.properties.property(i.name);return t*(n?n.getValue():1)}),1);this.item.webMap.setLayerOpacity(s,this._prepareValue(t*a))}},i.prototype._prepareValue=function(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)},i}(ve),Pe=function(t){function n(e,o,r,s,a,u){var h=t.call(this,i(i({},n.options),r))||this;if(h.webMap=e,h.emitter=new p.exports.EventEmitter,h._rootDescendantsCount=0,s&&(h.connector=s),a&&h.tree.setParent(a),h.item=o,"root"===h.item.item_type)h._rootDescendantsCount=h._sumUp(h.item.children);else{var l=h.tree.getRoot();l&&(h._rootDescendantsCount=l._rootDescendantsCount)}return h.initProperties(),u||h._init(o),h}return e(n,t),n.create=function(t,e,i,s,a){return o(this,void 0,void 0,(function(){var o;return r(this,(function(r){switch(r.label){case 0:return[4,(o=new n(t,e,i,s,a,!0))._init(e)];case 1:return r.sent(),[2,o]}}))}))},n.prototype.initItem=function(t){var e=this,i=t,o=this.getItemOptions(t),r=function(t){i._layer=t,e.layer=t,e.properties.get("visibility")&&e.properties.set("visibility",!0),void 0!==o.opacity&&e.webMap.setLayerOpacity(t,o.opacity)};if("group"===t.item_type||"root"===t.item_type){if(t.children&&t.children.length)for(var s=0,a=this.getChildren(t);s<a.length;s++){var u=new this.constructor(this.webMap,a[s],this.options,this.connector,this);this.tree.addChild(u)}return Promise.resolve()}var h=void 0;if("layer"===t.item_type)h=t.adapter||t.layer_adapter.toUpperCase();else if(n.GetAdapterFromLayerType[t.item_type]){h=(0,n.GetAdapterFromLayerType[t.item_type])(t,o,this.webMap,this.connector)}return h?this.webMap.addLayer(h,o).then((function(t){r(t)})):t._layer?Promise.resolve(r(t._layer)):Promise.reject("No layer added")},n.prototype.bringToFront=function(){},n.prototype.fit=function(){},n.prototype.getLayer=function(){return this.layer},n.prototype.getItemOptions=function(t){var e="layer"===t.item_type&&t.layer_transparency,i="number"==typeof e?(100-e)/100:void 0,n={visibility:!1,headers:this.options.headers,crossOrigin:this.options.crossOrigin,setViewDelay:this.options.setViewDelay,params:{resource:this.item.resourceId,item:this.item}};if(this.options.order){var o=String(this.options.drawOrderEnabled&&"draw_order_position"in t?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");n.order=Number((0|this.options.order)+"."+o)}if(this.options.popupOptions&&(n.popupOptions=this.options.popupOptions),"layer"===t.item_type){var r=this._getZoomRange(t);!function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0,o=e;n<o.length;n++)for(var r=o[n],s=0,a=Object.getOwnPropertyNames(r);s<a.length;s++){var u=a[s];t[u]=r[u]}}(n,{updateWmsParams:t.updateWmsParams,url:t.url,headers:this.options.headers,ratio:this.options.ratio,maxZoom:r.maxZoom,minZoom:r.minZoom,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom})}return void 0!==i&&(n.opacity=i),n},n.prototype.getChildren=function(t){return a([],t.children,!0).reverse()},n.prototype._mapScaleToZoomLevel=function(t){return function(t,e){void 0===e&&(e=0);var i=e;return function(t){return Math.log(t/256)/Math.LN2}(function(){if(void 0===Ne){var t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);var e=t.offsetWidth;document.body.removeChild(t),Ne=e}return Ne}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t)}(t)},n.prototype._getZoomRange=function(t){var e=this.options.minZoom,i=this.options.maxZoom,n=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,o=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,r=[e,n].filter(Boolean),s=[i,o].filter(Boolean);return{minZoom:r.length?Math.max.apply(Math,r):void 0,maxZoom:s.length?Math.min.apply(Math,s):void 0}},n.prototype._init=function(t){var e=this;this.initItem(t).then((function(){e.emitter.emit("init")}))},n.prototype._sumUp=function(t,e){void 0===e&&(e=0);for(var i=0,n=t;i<n.length;i++){var o=n[i];"layer"===o.item_type?(e+=1,o.draw_order_position=o.draw_order_position||e):"group"===o.item_type&&(e=this._sumUp(o.children,e))}return e},n.GetAdapterFromLayerType={},n.options={properties:[{type:"boolean",name:"visibility",getProperty:function(t){if(t){if("group"===t.item.item_type||"root"===t.item.item_type)return le(t.item,(function(t){return"layer_enabled"in t&&t.layer_enabled}),(function(t){return t.children}));if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet:function(t,e,i){i&&"layer"===i.item.item_type&&(i.layer&&(t?i.webMap.showLayer(i.layer):i.webMap.hideLayer(i.layer)),i.item.layer_enabled=t)}},{name:"opacity",handler:Le}]},n}(xe);function Ce(t){var e=t.webMap,n=t.connector,s=t.item,a=t.adapterOptions,u=void 0===a?{}:a,h=t.idPrefix,l=void 0===h?"first-show-adapter":h;return o(this,void 0,void 0,(function(){var t;return r(this,(function(a){return t=function(t){var e=t.webMap,n=t.adapterOptions,s=void 0===n?{}:n,a=t.onLayerAdded,u=t.createAdapter;return o(this,void 0,void 0,(function(){var t;return r(this,(function(n){return t=function(){function t(){this.options={},this.layer=[],this._removed=!1,this._creatingInProgress=!1}return t.prototype.addLayer=function(){return this.layer},t.prototype.removeLayer=function(){this._removed=!0;for(var t=0,i=this.layer;t<i.length;t++)e.removeLayer(i[t])},t.prototype.destroyed=function(){return this._removed},t.prototype.showLayer=function(){return o(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:if(this.options.visibility=!0,!this.layer.length)return[3,5];t=0,i=this.layer,n.label=1;case 1:return t<i.length?[4,e.showLayer(i[t])]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[3,7];case 5:return[4,this.loadLayer()];case 6:n.sent(),n.label=7;case 7:return[2]}}))}))},t.prototype.hideLayer=function(){return o(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:if(this.options.visibility=!1,!this.layer)return[3,4];t=0,i=this.layer,n.label=1;case 1:return t<i.length?[4,e.hideLayer(i[t])]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},t.prototype.loadLayer=function(){return o(this,void 0,void 0,(function(){var t,n,o;return r(this,(function(r){switch(r.label){case 0:return this.layer.length||this._creatingInProgress?[3,5]:(this._creatingInProgress=!0,[4,u(this)]);case 1:return(t=r.sent())?[4,(n=new t(e.mapAdapter.map,i({},s))).addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer})]:[3,5];case 2:return o=r.sent(),a&&a(n),Object.assign(n.options,s),n.layer=o,this._removed&&e.removeLayer(n),this.layer.push(n),this.options.visibility?[4,e.showLayer(n)]:[3,4];case 3:r.sent(),r.label=4;case 4:this._creatingInProgress=!1,r.label=5;case 5:return[2,this.layer]}}))}))},t}(),[2,t]}))}))}({webMap:e,adapterOptions:u,onLayerAdded:function(t){t.options.baselayer=!1,t.id=l+"-"+s.resource_id},createAdapter:function(){return Ze({resource:s.resource_id,adapterOptions:{name:s.display_name,opacity:s.opacity}},e,n)}}),[2,t]}))}))}var Me=function(){function t(t){this.options=t,this.resourceId=t.resourceId;var e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}return t.prototype.extent=function(){var t=this;return this._extent?S.resolve(this._extent):this.options.connector.get("feature_layer.feature.item_extent",null,{id:this.resourceId,fid:this.item.id}).then((function(e){var i=e.extent,n=[i.minLon,i.minLat,i.maxLon,i.maxLat];return t._extent=n,n}))},t.prototype.geoJson=function(){var t=this;return this.item.geom?S.resolve(Yt(this.item)):We({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null}).then((function(e){return t.item.geom=e.geom,Yt(t.item)}))},t}(),Te=function(){function t(t,e){this.map=t,this.options=e,this.NgwWebmapItem=Pe,this.pixelRadius=10,this.webmapClassName="webmap",this.emitter=new p.exports.EventEmitter,this._webmapBaselayersIds=[];var i=e.resourceId;if(Array.isArray(i)?(this.resourceId=i[0],this.options.id=i[1]):this.resourceId=i,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}return t.prototype.addLayer=function(t){var e,n;return o(this,void 0,void 0,(function(){var o,s;return r(this,(function(r){switch(r.label){case 0:return this.options=i(i({},this.options),t),o=this,[4,this._getWebMapLayerItem()];case 1:return o.layer=r.sent(),s=null===(n=null===(e=this.response)||void 0===e?void 0:e.webmap)||void 0===n?void 0:n.extent_constrained,this.options.useExtentConstrained&&this._extent&&s&&this.options.webMap.setView({maxBounds:this._extent}),[2,this.layer]}}))}))},t.prototype.removeLayer=function(){var t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach((function(e){"layer"in e&&t.removeLayer(e.layer.layer)})),this._webmapBaselayersIds.length){for(var e=0,i=this._webmapBaselayersIds;e<i.length;e++){this.options.webMap.removeLayer(i[e])}this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.response,delete this._webmapLayersIds},t.prototype.showLayer=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return this.layer&&this.layer.properties?[2,this.layer.properties.property("visibility").set(!0)]:[2]}))}))},t.prototype.hideLayer=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return this.layer&&this.layer.properties?[2,this.layer.properties.property("visibility").set(!1)]:[2]}))}))},t.prototype.setOpacity=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return this.layer&&this.layer.properties?[2,this.layer.properties.property("opacity").set(t)]:[2]}))}))},t.prototype.getExtent=function(){return this.getBounds()},t.prototype.getBounds=function(){var t=this.response&&this.response.webmap;if(t)return Ft(t)},t.prototype.getDependLayers=function(){return this.layer&&this.layer.tree.getDescendants()||[]},t.prototype.getBookmarksResourceId=function(){var t=this.response&&this.response.webmap;if(t)return t.bookmark_resource.id},t.prototype.fetchBookmarks=function(){var t=this.getBookmarksResourceId(),e=this.options.connector;if(t)return e.getResourceOrFail(t).then((function(i){var n,o=null===(n=i.feature_layer)||void 0===n?void 0:n.fields.find((function(t){return t.label_field})),r=o&&o.keyname;return oe({connector:e,resourceId:t,geom:!1,fields:r?[r]:void 0}).then((function(i){for(var n=[],o=0,s=i;o<s.length;o++){var a=new Me({item:s[o],resourceId:t,labelField:r,connector:e});n.push(a)}return n}))}));throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")},t.prototype.getIdentificationIds=function(){return o(this,void 0,void 0,(function(){var t,e,i;return r(this,(function(n){switch(n.label){case 0:return t=[],(e=this._webmapLayersIds)?[3,2]:[4,this._getWebMapIds()];case 1:e=n.sent(),this._webmapLayersIds=e,n.label=2;case 2:return e&&e.length&&(i=(i=this.getDependLayers()).sort((function(t,e){return e.id-t.id})),i.forEach((function(e){var i=e.item,n=i.parentId;if(void 0!==n&&"layer"===i.item_type){var o=e.properties.property("visibility");o.get()&&!o.isBlocked()&&t.push(n)}}))),[2,t]}}))}))},t.prototype._getWebMapLayerItem=function(){return o(this,void 0,void 0,(function(){var t,e=this;return r(this,(function(i){switch(i.label){case 0:return this.resourceId?[4,this.getWebMapConfig(this.resourceId)]:[3,2];case 1:if((t=i.sent())&&t.root_item)return[2,new Promise((function(i){var n={};if(e.options.connector&&e.options.connector.options.auth){var o=e.options.connector.getAuthorizationHeaders();o&&(n.headers=o)}n.setViewDelay=e.options.setViewDelay,n.order=e.options.order,n.ratio=e.options.ratio,n.crossOrigin=e.options.crossOrigin,n.minZoom=e.options.minZoom,n.maxZoom=e.options.maxZoom,n.drawOrderEnabled=t.draw_order_enabled,n.popupOptions=e.options.popupOptions;var r=new e.NgwWebmapItem(e.options.webMap,t.root_item,n,e.options.connector);r.emitter.on("init",(function(){return i(r)}))}))];i.label=2;case 2:return[2]}}))}))},t.prototype.getWebMapConfig=function(t){return o(this,void 0,void 0,(function(){var e,i;return r(this,(function(n){switch(n.label){case 0:return[4,this.options.connector.getResource(t)];case 1:return(e=n.sent())&&(this.response=e,i=e[this.webmapClassName],this._setupBaselayers(e),i)?(this._extent=[i.extent_left,i.extent_bottom,i.extent_right,i.extent_top],this._updateItemsParams(i.root_item,this.options.webMap,e),[2,i]):[2]}}))}))},t.prototype._setupBaselayers=function(t){var e,i=this.options.webMap;if(null===(e=this.options.useBasemap)||void 0===e||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){var n=i.getActiveBaseLayer();this._lastActiveBaselayer=n?n.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})},t.prototype._setBasemaps=function(t){for(var e=this,i=this.options.webMap,n=!1,o=function(t){Ce({webMap:i,connector:r.options.connector,item:t,adapterOptions:{crossOrigin:r.options.crossOrigin}}).then((function(o){var r=!n&&t.enabled;return t.enabled&&(n=!0),i.addBaseLayer(o,{id:Ue+t.resource_id,name:t.display_name,opacity:t.opacity,visibility:r}).then((function(t){t.id&&e._webmapBaselayersIds.push(t.id)}))}))},r=this,s=0,a=t.basemaps;s<a.length;s++){o(a[s])}},t.prototype._updateItemsParams=function(t,e,n){var o=this;if(t)if("group"===t.item_type||"root"===t.item_type)t.children&&(t.children=t.children.map((function(t){return o._updateItemsParams(t,e,n)}))),"root"===t.item_type&&(t.display_name=n.resource.display_name);else if("layer"===t.item_type){var r=K(this.options.connector.options.baseUrl+"/api/component/render/image"),s=t.layer_style_id;t.url=r,t.resourceId=s,t.updateWmsParams=function(t){return Re(t,s)};var a=ue({options:{adapter:t.layer_adapter.toUpperCase(),resource:s},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t=i(i({},t),a)}return t},t.prototype._getWebMapIds=function(){return o(this,void 0,void 0,(function(){var t,e,i,n,o,s,a;return r(this,(function(r){switch(r.label){case 0:if(!(t=this.layer)||"root"!==t.item.item_type)return[3,2];for(e=t.tree.getDescendants(),i=[],n=function(t){var e=t.item;if("layer"===e.item_type){var n=o.options.connector.getResource(e.layer_style_id).then((function(t){if(t){var i=Number(t.resource.parent.id);return e.parentId=i,i}}));i.push(n)}},o=this,s=0,a=e;s<a.length;s++)n(a[s]);return[4,Promise.all(i)];case 1:return[2,r.sent().filter((function(t){return void 0!==t}))];case 2:return[2]}}))}))},t}();var Oe={tms:"TILE"};function Ae(t){return new Promise((function(e,i){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState&&200===n.status&&n.responseText)try{e(JSON.parse(n.responseText))}catch(t){i(t)}},n.open("GET",K(t),!0),n.send()}))}var ke="https://qms.nextgis.com";function Ee(t,e,s){var a;if(void 0===e&&(e=ke),void 0===s&&(s={}),"webMap"in t){var u=t.webMap,h=t.url,l=n(t,["webMap","url"]);a=u,h&&(e=h),l&&(s=l)}else a=t;return e||(e=ke),function(){function t(t,e){this.map=t;var n=i(i({},s),e);this.options=n,this.options.baselayer=!0,n.qms&&(this.qms=n.qms)}return t.prototype.addLayer=function(n){return o(this,void 0,void 0,(function(){var o,s,u,h,l,c,p,d;return r(this,(function(r){switch(r.label){case 0:if(this.qms||!n.qmsId)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),o=this,[4,Ae(e+"/api/v1/geoservices/"+n.qmsId)];case 2:return o.qms=r.sent(),[3,4];case 3:return s=r.sent(),console.error(s),[3,4];case 4:return(u=this.qms)&&(l=a.mapAdapter.layerAdapters[h=Oe[u.type||"tms"]])&&(m=t,_=l,["showLayer","hideLayer"].forEach((function(t){var e=Object.getOwnPropertyDescriptor(_.prototype,t);e&&Object.defineProperty(m.prototype,t,e)})),"TILE"===h)?(n=i(i({order:0,maxZoom:a.options.maxZoom,minZoom:a.options.minZoom},this.options),function(t){var e=("https:"===location.protocol?"https":"http")+"://",i=t.url.replace(/^(https?|ftp):\/\//,e);return t.y_origin_top||(i=i.replace("{y}","{-y}")),{url:i,name:t.name,attribution:t.copyright_text,maxZoom:t.z_max,minZoom:t.z_min}}(u)),u.origin_url&&(f=[],c=[u.origin_url.replace(/{switch:(.*?)}/,(function(t,e){return"string"==typeof e&&e.split(",").forEach((function(t){return f.push(t)})),"{s}"})),f],p=c[0],(d=c[1]).length&&(n.subdomains=d,n.url=p)),this.options=n,[2,new l(this.map,n).addLayer(n)]):[2]}var f,m,_}))}))},t}()}var ze=function(){function t(t){this.options={url:"https://qms.nextgis.com"},this.options=i(i({},this.options),t),this.url=this.options.url}return t.prototype.getLayerAdapters=function(){var t=this;return Promise.resolve([{name:"QMS",createAdapter:function(e){return Promise.resolve(t._createAdapter(e))}}])},t.prototype._createAdapter=function(t){return Ee({webMap:t,url:this.url})},t.utils={createQmsAdapter:Ee},t}();var Se={},Ie=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];function Be(t){var e=t.layerOptions,n=t.webMap,s=t.connector,a=t.item;return o(this,void 0,void 0,(function(){var t,o;return r(this,(function(r){switch(r.label){case 0:return[4,s.getResourceChildren(a.resource.id)];case 1:return t=r.sent(),(o=t&&t[0])?[2,Ze(i(i({},e),{resource:o.resource.id}),n,s)]:[2]}}))}))}function Ze(t,n,s){return o(this,void 0,void 0,(function(){var a,u,h,l,c,p,d,f,m,_,y,v,g,b;return r(this,(function(w){switch(w.label){case 0:return h=t.adapter,[4,Jt(t,s)];case 1:return(l=w.sent())?(c=t.resource)&&c.resource&&void 0!==c.resource.id?(u=c,[3,4]):[3,2]:[3,15];case 2:return[4,s.getResource(l)];case 3:u=w.sent(),w.label=4;case 4:return u?(p=u.resource.cls,d=i(i({},t),{resource:l}),f={layerOptions:d,webMap:n,connector:s,item:u},-1===Ie.indexOf(p)?[3,12]:"webmap"!==p?[3,5]:(a=function(t){var i=t.layerOptions,n=t.webMap,s=t.connector;return o(this,void 0,void 0,(function(){var t;return r(this,(function(o){switch(o.label){case 0:return[4,Jt(i,s)];case 1:return t=o.sent(),[2,function(i){function o(e){return i.call(this,e,{url:"",webMap:n,resourceId:t,connector:s})||this}return e(o,i),o}(Te)]}}))}))}(f),[3,11])):[3,14];case 5:if("vector_layer"!==p&&"postgis_layer"!==p)return[3,6];if(m=u.vector_layer&&De[u.vector_layer.geometry_type],(_=f.layerOptions.adapterOptions||{}).type=_.type||m,f.layerOptions.adapterOptions=_,t.adapterOptions=f,void 0!==h&&"GEOJSON"!==h){if("MVT"!==h)return[2,Be(f)];a=he(f)}else a=ae(f);return[3,11];case 6:return"raster_layer"!==p?[3,7]:[2,Be(f)];case 7:return"basemap_layer"!==p?[3,8]:(a=function(t){var n=t.webMap,s=t.item;return o(this,void 0,void 0,(function(){var t,a,u,h,l;return r(this,(function(c){if(s.basemap_layer){if(a=s.basemap_layer.url,t=s.basemap_layer.qms)return u=JSON.parse(t),[2,Promise.resolve(ze.utils.createQmsAdapter(n,void 0,{qms:u,baselayer:!0}))];if(a&&(h=n.mapAdapter.layerAdapters.TILE))return l=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.addLayer=function(e){return o(this,void 0,void 0,(function(){return r(this,(function(n){return[2,t.prototype.addLayer.call(this,i(i({},e),{url:a}))]}))}))},n}(h),[2,l]}return[2]}))}))}(f),[3,11]);case 8:return"GEOJSON"!==h?[3,10]:[4,s.getResource(u.resource.parent.id)];case 9:return(y=w.sent())&&(v=i(i({},t),{resource:u.resource.parent.id}),a=ae(i(i({},f),{item:y,layerOptions:v}))),[3,11];case 10:a=he(f),w.label=11;case 11:return[3,13];case 12:if(!Se[p])throw"Resource class '".concat(p,"' not yet supported.");g=Se[p],b=void 0,(b=h&&"function"!=typeof b?g[h]:g)&&(a=b(f)),w.label=13;case 13:return[3,15];case 14:throw"Resource item is not found";case 15:return a?[2,a.then((function(t){if(t){var e=t;return u&&(e.prototype.item=u,e.prototype.resourceId=u.resource.id,e.prototype.connector=s),I(e,[Vt],{replace:!1}),e}}))]:[2]}}))}))}function Re(t,e){var i=t.bbox,n=t.width,o=t.height,r=t.nd;return{resource:Array.isArray(e)?e.join(","):e,extent:i,size:n+","+o,timestamp:Date.now(),nd:null!=r?r:200}}var Ne,De={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};var je=function(){function t(t){if(this.options=t,this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new jt({baseUrl:this.url,auth:this.options.auth})}}return t.addClassAdapters=function(t,e){Se[t]=e},t.prototype.onLoadSync=function(t){return o(this,void 0,void 0,(function(){var e,n,o;return r(this,(function(r){switch(r.label){case 0:if(!this.options.resourceId||!this.url)return[3,4];if(!(e=[this.options.resourceId]).length)return[3,4];n=0,o=e,r.label=1;case 1:return n<o.length?[4,t.addLayer(Te,i({visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius},{resourceId:o[n],connector:this.connector,webMap:t}))]:[3,4];case 2:return[2,r.sent()];case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.getLayerAdapters=function(){return Promise.resolve([this._getLayerAdapter()])},t.prototype._getLayerAdapter=function(){var t=this;return{name:"WEBMAP",createAdapter:function(e){return Promise.resolve(t._createAdapter(e))}}},t.prototype._createAdapter=function(t){var n;return n={webMap:t,connector:this.connector,baseUrl:this.url},function(t){function o(e,o){return o=i(i({},n),o),t.call(this,e,o)||this}return e(o,t),o}(Te)},t}(),Fe=function(){function t(t){var e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}return t.prototype.identify=function(t){var e=this;return void 0===t&&(t={}),this._item?S.resolve(this._item):We(i({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"]},t)).then((function(t){return e._item=t,e.geom=t.geom,e.extensions=t.extensions,t}))},t.prototype.resource=function(){var t=this;return this._resource?S.resolve(this._resource.feature_layer):this.connector.getResource(this.layerId).then((function(e){return t._resource=e,t._resource.feature_layer}))},t.prototype.getBounds=function(){return this._extent?S.resolve(this._extent):(t={connector:this.connector,featureId:this.id,resourceId:this.layerId}).connector.get("feature_layer.feature.item_extent",{cache:void 0===(e=t.cache)||e},{id:t.resourceId,fid:t.featureId}).then((function(t){if(t){var e=t.extent;return[e.minLon,e.minLat,e.maxLon,e.maxLat]}}));var t,e},t.prototype.geojson=function(){var t=this;return this._geojson?S.resolve(this._geojson):this.identify().then((function(e){return e.toGeojson().then((function(e){return t._geojson=e,e}))}))},t}(),Ue="webmap-baselayer";function We(t){var e=i({},Kt);Qt(e,t);var n=i({id:t.resourceId,fid:t.featureId},e);return t.connector.get("feature_layer.feature.item",{cache:t.cache||!0},n).then((function(e){return i(i({},e),{toGeojson:function(){return e.geom?S.resolve(Yt(e)):We(i(i({},t),{geom:!0,fields:null,extensions:null})).then((function(t){var n=t.geom;return Yt(i(i({},e),{geom:n}))}))}})}))}function He(t){return We(t).then((function(t){return Yt(t)}))}function Ve(t,e){void 0===e&&(e=!1);var i=[],n=[];for(var o in t){var r=Number(o);isNaN(r)||i.push(r)}var s=t.resources;s&&i.sort((function(t,e){return s.indexOf(t)-s.indexOf(e)}));for(var a=0;a<i.length;a++){var u=t[o=i[a]];if("features"in u){var h=qe(u.features,Number(o),e);if(h.length&&(n.push.apply(n,h),!e))break}}return n}function qe(t,e,i){for(var n=[],o=0,r=t;o<r.length;o++){var s=r[o];if(n.push({featureId:s.id,resourceId:e,feature:s}),!i)break}return n}function Ge(t,e){N(t);var n=t.lngLat,o=e.geom,r=e.signal,s=e.cache,a=null!=o?o:function(t,e,i,n){void 0===i&&(i=10),void 0===n&&(n=6);for(var o=i/6371*W,r=o/Math.cos(e*U),s=[],a=0;a<n+1;a++){var u=Math.PI*(a/(n/2)),h=t+r*Math.cos(u),l=e+o*Math.sin(u);s.push([h,l])}return s}(n[0],n[1],e.radius);return function(t){var e=t.geom,i=t.signal,n=t.cache,o=[];if(Array.isArray(e))o=e;else{var r="Feature"===e.type?e.geometry:"Polygon"===e.type&&e;r&&(o=r.coordinates[0])}if(o){for(var s=[],a=0,u=o;a<u.length;a++){var h=u[a],l=H(h[0],h[1]);s.push(l[0]+" "+l[1])}var c="POLYGON((".concat(s.join(", "),"))");return t.connector.post("feature_layer.identify",{data:{geom:c,srs:3857,layers:t.layers},signal:i,cache:n})}throw new Error("Not valid geometry format to make intersection")}(i(i({},e),{geom:a,signal:r,cache:s}))}function Je(t,e){var i;return o(this,void 0,void 0,(function(){var n,o,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return[4,t.get("pyramid.settings",null,{component:"pyramid"})];case 1:if(!((n=r.sent())&&n.company_logo&&n.company_logo.enabled))return[3,6];(o=document.createElement("a")).style.position="absolute",o.style.bottom="0",o.style.right="0",o.style.padding=null!==(i=null==e?void 0:e.padding)&&void 0!==i?i:"10px",o.className="ngw-map-logo",e&&e.cssClass&&(o.className+=" "+e.cssClass),(s=new Image).style.maxHeight="100px",s.style.maxWidth="100px",s.src="",r.label=2;case 2:return r.trys.push([2,4,,5]),[4,t.get("pyramid.company_logo",{responseType:"blob"})];case 3:return a=r.sent(),u=window.URL||window.webkitURL,h=u.createObjectURL(a),s.src=h,[3,5];case 4:return l=r.sent(),console.warn(l),[3,5];case 5:return null!==n.company_logo.link&&""!==n.company_logo.link.trim()&&(o.href=n.company_logo.link,o.target="_blank",-1!==n.company_logo.link.search(/:\/\/nextgis/)&&(s.alt="Get your own Web GIS at nextgis.com")),o.appendChild(s),[2,o];case 6:return[2]}}))}))}var Ke={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'};function Ye(t){var e,i,n,o;void 0===t&&(t={});var r=null!==(e=t.shape)&&void 0!==e?e:"circle",s=null!==(i=t.color)&&void 0!==i?i:"blue",a=null!==(n=t.strokeColor)&&void 0!==n?n:"white",u=null!==(o=t.size)&&void 0!==o?o:12,h=u/2,l="number"==typeof t.stroke?t.stroke:.8,c=u/12,p=t.p||Ke[r]||"circle",d="string"==typeof p?p:p(t),f=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function(t,e,i,n){void 0===i&&(i=0);var o=i/2;return'<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="'.concat(t,'"\n height="').concat(e,'"\n viewBox="-').concat(o," -").concat(o," ").concat(t+i," ").concat(e+i,'"\n >').concat(n,"</svg>")}(u,u,l*c,d)),m=f.firstChild,_="scale(".concat(c,")");return m.setAttribute("fill",s),l&&(m.setAttribute("stroke",a),m.setAttribute("stroke-width",String(l))),m.setAttribute("transform",_),{type:"icon",iconSize:[u,u],iconAnchor:[h,h],html:(new XMLSerializer).serializeToString(f),svg:f}}function Qe(t,e,n,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push(i(i({},n),{resource:e}));else if(Array.isArray(e)){var r=e[0],s=e[1];t.push(i(i(i({},n),{resource:r,id:s}),o))}else"object"==typeof e&&t.push(i(i(i({},n),e),o))}var Xe={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};var $e=function(t){function n(e){var n=t.call(this,function(t){var e=[new ze];return t.starterKits&&t.starterKits.forEach((function(t){e.push(t)})),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new jt({baseUrl:t.baseUrl||"",auth:t.auth}),(t=R(Xe,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new je({connector:t.connector,auth:t.auth})),i(i({},t),{starterKits:e,create:!1})}(e))||this;return n.emitter=new p.exports.EventEmitter,n._ngwLayers={},n._promises={select:[],identify:[]},e.connector&&(n.connector=e.connector),n._createWebMap().then((function(){var t=n.getContainer();t&&t.classList.add("ngw-map-container"),n.options.whitlabel&&n._whiteLabel()})),n}return e(n,t),n.prototype.addControl=function(e,i,n){return o(this,void 0,void 0,(function(){return r(this,(function(o){switch(o.label){case 0:return[4,this.onLoad("controls:create")];case 1:return o.sent(),[2,t.prototype.addControl.call(this,e,i,n)]}}))}))},n.prototype.addNgwLayer=function(t){return o(this,void 0,void 0,(function(){var e,n,o,s,a,u,h,l,c;return r(this,(function(r){switch(r.label){case 0:return[4,this.onMapLoad()];case 1:if(r.sent(),n=t.resourceId,((e=t.keyname)||void 0!==n)&&console.warn("DEPRECATED WARN: ".concat("set `resource` options instead of `keyname` or `resourceId`")),o=t.resource,!e&&!n&&!o)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(!B(this.options.baseUrl))return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),B(this.options.setViewDelay)&&(t.adapterOptions=t.adapterOptions||{},B(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay)),s=function(t,e,i){var n=i.getAuthorizationHeaders();return n&&(t.headers=n),Ze(t,e,i)}(t,this,this.connector),a=i(i({visibility:!0},t),t.adapterOptions),[4,this.addLayer(s,a)];case 3:return u=r.sent(),h=u&&this.getLayerId(u),u&&h&&(this._ngwLayers[h]={layer:u,resourceId:u.resourceId},u.options.name=u.options.name||u.item&&u.item.resource.display_name,u.options.baselayer&&this.getActiveBaseLayer()),[2,u];case 4:return l=r.sent(),c=J(o)&&"id"in o?o.id:e||n||o,console.error("Can't add NGW layer ".concat(c,"."),l),[3,5];case 5:return[2]}}))}))},n.prototype.fit=function(){var t=this.options,e=t.center,i=t.zoom,n=t.bounds;e?(this.setCenter(e),i&&this.setZoom(i)):n&&this.fitBounds(n)},n.prototype.fetchNgwLayerItem=function(t){return We(i({connector:this.connector},t))},n.prototype.fetchNgwLayerItems=function(t){return oe(i({connector:this.connector},t))},n.prototype.fetchNgwLayerFeature=function(t){return He(i({connector:this.connector},t))},n.prototype.fetchNgwLayerFeatures=function(t){return se(i({connector:this.connector},t))},n.prototype.fetchIdentifyItem=function(t,e){var n,o,r,s=(o=(n={identify:t,connector:this.connector,requestOptions:e}).connector,(r=Ve(n.identify))&&r.length?We(i(i({connector:o},n.requestOptions),r[0])):S.resolve(void 0));return this._addPromise("identify",s),s},n.prototype.fetchIdentifyGeoJson=function(t,e){void 0===e&&(e=!1);var n=function(t){var e=t.connector,n=t.identify,o=t.requestOptions;for(var r in n){var s=Number(r);if(!isNaN(s)){var a=n[r];if("features"in a){var u=a.features.find((function(t){return t.geom}));if(u&&u.geom){var h=u.geom;return S.resolve(Yt(i(i({},u),{geom:h})))}}}}var l=Ve(n);return l&&l.length?He(i(i(i({},o),{connector:e}),l[0])):S.resolve(void 0)}({identify:t,connector:this.connector,multiple:e});return n&&"then"in n?(this._addPromise("identify",n),n):S.resolve(n)},n.prototype.getIdentifyGeoJson=function(t,e){return void 0===e&&(e=!1),this.fetchIdentifyGeoJson(t,e)},n.prototype.getNgwLayers=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.onLoad()];case 1:return t.sent(),[2,this._ngwLayers]}}))}))},n.prototype.getNgwLayerByResourceId=function(t){return o(this,void 0,void 0,(function(){var e,i,n,o,s,a,u;return r(this,(function(r){switch(r.label){case 0:for(i in e=[],this._ngwLayers)e.push(i);n=0,r.label=1;case 1:return n<e.length?(o=this._ngwLayers[e[n]]).resourceId!==t?[3,2]:[2,o&&o.layer]:[3,6];case 2:return o.layer.getIdentificationIds?[4,o.layer.getIdentificationIds()]:[3,4];case 3:if((s=r.sent())&&s.some((function(e){return e===t})))return[2,o.layer];r.label=4;case 4:if(o.layer.getDependLayers&&(a=o.layer.getDependLayers(),u=a.find((function(e){return e.item&&e.item.parentId===t}))))return[2,u.layer];r.label=5;case 5:return n++,[3,1];case 6:return[2]}}))}))},n.prototype.fitLayer=function(e,i){return o(this,void 0,void 0,(function(){var n,o,s,a,u=this;return r(this,(function(r){switch(r.label){case 0:return n="string"==typeof e||"number"==typeof e?String(n):e.id,(o=n&&this._ngwLayers[n])?o.layer.getBounds?[4,o.layer.getBounds()]:[3,2]:[3,7];case 1:return(s=r.sent())&&this.fitBounds(s,i),[3,6];case 2:return a=void 0,o.layer.item?(a=o.layer.item,[3,5]):[3,3];case 3:return[4,this.connector.getResource(o.resourceId)];case 4:a=r.sent(),r.label=5;case 5:a&&Wt({resourceId:a.resource.id,connector:this.connector}).then((function(t){t&&u.fitBounds(t,i)})),r.label=6;case 6:return[3,8];case 7:t.prototype.fitLayer.call(this,"number"==typeof e?String(e):e,i),r.label=8;case 8:return[2]}}))}))},n.prototype.zoomToLayer=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return[2,this.fitLayer(t)]}))}))},n.prototype.onLoad=function(e){return void 0===e&&(e="ngw-map:create"),t.prototype.onLoad.call(this,e)},n.prototype.removeLayer=function(e){var i=this.getLayer(e);if(i){var n=this.getLayerId(i);n&&delete this._ngwLayers[n],t.prototype.removeLayer.call(this,i)}},n.prototype.enableSelection=function(){var t=this;this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=function(e){t._getSelectListenersCount()&&t.selectFromNgwRaster(e)},this.$$selectFromNgwVector=function(e){t._getSelectListenersCount()&&t._selectFromNgwVector(e)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))},n.prototype.disableSelection=function(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)},n.prototype.getNgwLayerItem=function(t){return this.fetchNgwLayerItem(t)},n.prototype.getNgwLayerItems=function(t){return this.fetchNgwLayerItems(t)},n.prototype.getNgwLayerFeature=function(t){return this.fetchNgwLayerFeature(t)},n.prototype.getNgwLayerFeatures=function(t){return this.fetchNgwLayerFeatures(t)},n.prototype.cancelPromise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.cancelPromises.apply(this,t)},n.prototype.cancelPromises=function(){for(var t=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];e.length||(e=Object.keys(this._promises)),e.forEach((function(e){var i=t._promises[e];i&&(i.forEach((function(t){return t.cancel()})),t._promises[e]=[])}))},n.prototype.selectFromNgwRaster=function(t){return o(this,void 0,void 0,(function(){var e,n,o,s,a,u,h,l,c,p,d,f,m,_,y,v,g=this;return r(this,(function(r){switch(r.label){case 0:for(this._emitStatusEvent("ngw:preselect"),e=[],(n=Object.values(this._ngwLayers)).sort((function(t,e){return t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1})),o=0,s=n;o<s.length;o++)(u="function"==typeof(a=s[o].layer).getIdentificationIds&&a.getIdentificationIds)&&a.options.selectable&&this.isLayerVisible(a)&&e.push(u.call(a));return[4,Promise.all(e)];case 1:for(h=r.sent(),l=[],c=0,p=h;c<p.length;c++)(d=p[c])&&l.push.apply(l,d);return l.length?(f=this.options.pixelRadius||10,m=this.getCenter(),_=void 0!==(_=this.getZoom())?_:20,m&&_?(y=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(m,_,f),v=Ge(t,{layers:l,connector:this.connector,radius:y}).then((function(e){var n=i(i({},e),{resources:l,sourceType:"raster",event:t}),o=g._prepareToIdentify(n);return g._emitStatusEvent("ngw:select",o),o})),this._addPromise("select",v),[2,v]):(this._emitStatusEvent("ngw:select",null),[2])):(this._emitStatusEvent("ngw:select",null),[2])}}))}))},n.prototype._addPromise=function(t,e){var i=this._promises[t];if(i&&-1===i.indexOf(e)){var n=function(){var t=i.indexOf(e);-1!==t&&i.splice(t,1)};e.then(n),e.catch(n),i.push(e)}},n.prototype._isFitFromResource=function(){var t=this._initMapState;return!t.zoom||!t.center},n.prototype._createWebMap=function(){return o(this,void 0,void 0,(function(){var t,e,i,n,o,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return[4,this.create()];case 1:if(r.sent(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer(),t=[],e=this._isFitFromResource(),this.options.webmapId&&Qe(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(i=0,n=this.options.resources;i<n.length;i++)o=n[i],s={},e||(s.fit=!1),Qe(t,o,{},s);a=0,u=t,r.label=2;case 2:if(!(a<u.length))return[3,7];h=u[a],r.label=3;case 3:return r.trys.push([3,5,,6]),[4,this.addNgwLayer(h)];case 4:return r.sent(),[3,6];case 5:return l=r.sent(),console.warn(l),[3,6];case 6:return a++,[3,2];case 7:return this._emitStatusEvent("ngw-map:create",this),this.enableSelection(),[2]}}))}))},n.prototype._addOsmBaseLayer=function(){this.addBaseLayer("OSM")},n.prototype._addQmsBaseLayer=function(){var t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);var i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)},n.prototype._selectFromNgwVector=function(t){var e,n=t.layer;if(n.options.selectable&&this.isLayerVisible(n)){var o=n.item&&n.item.resource.id,r=t.feature;if(void 0!==o&&r){var s=r.id;if(s){var a={id:Number(s),fields:r.properties||{},label:"#".concat(o),layerId:Number(o),parent:"",geom:r.geometry},u=((e={featureCount:1})[o]={featureCount:1,features:[a]},e);return this._emitStatusEvent("ngw:select",this._prepareToIdentify(i(i({},u),{resources:[o],sourceType:"vector"}))),u}}}},n.prototype._prepareToIdentify=function(t){var e=this;return i(i({},t),{getIdentifyItems:function(){return Ve(t,!0).map((function(t){return new Fe({feature:t.feature,connector:e.connector})}))}})},n.prototype._getSelectListenersCount=function(){return this.emitter.listenerCount("ngw:select")},n.prototype._whiteLabel=function(){return o(this,void 0,void 0,(function(){var t,e;return r(this,(function(i){switch(i.label){case 0:return(t=this.getContainer())?[4,Je(this.connector,this.options.companyLogoOptions)]:[3,2];case 1:(e=i.sent())&&t.appendChild(e),i.label=2;case 2:return[2]}}))}))},n.getIcon=Ye,n}(Pt);function ti(t){var e=t.containerPoint,i=t.latlng;return{latLng:i,lngLat:[i.lng,i.lat],pixel:{left:e.x,top:e.y},source:t}}function ei(t,e,i){return void 0===e&&(e={}),new(l.exports.Control.extend({onAdd:function(){var n=document.createElement("div"),o=t.onAdd(i);return n.classList.add("leaflet-control"),e.bar&&n.classList.add("leaflet-bar"),e.addClass&&n.classList.add(e.addClass),e.margin||e.bar||(n.style.marginBottom="0px",n.style.marginTop="0px",n.style.marginLeft="0px",n.style.marginRight="0px"),o&&n.appendChild(o),l.exports.DomEvent.disableClickPropagation(n),n},onRemove:function(){t.onRemove()}}))}var ii=function(t){function i(e){var i=t.call(this,e)||this,n=e&&e.customAttribution;if(n){var o=[];Array.isArray(n)?o=n:n&&(o=[n]),o.forEach((function(t){return i.addAttribution(t)}))}return i}return e(i,t),i}(l.exports.Control.Attribution);function ni(t){var e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}var oi={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},ri={stroke:!1,opacity:1},si={};for(var ai in oi){var ui=oi[ai],hi=si[ui]||[];hi.push(ai),si[ui]=hi}function li(t,e){return-1!==(si[e]||[]).indexOf(t)}function ci(t){var e=new l.exports.GeoJSON;return(Array.isArray(t)?t:[t]).forEach((function(t){return e.addData(t)})),e.getBounds()}function pi(t){return{getBounds:function(){return function(t){return ni(ci(t))}(t)},getCenter:function(){return function(t){var e=ci(t).getCenter();return[e.lng,e.lat]}(t)}}}function di(t){for(var e={},i=0;i<t.length;i++)e[t[i]]=1+(e[t[i]]||0);var n="";for(var o in e){e[o]>(n?e[n]:0)&&(n=o)}return n}var fi=function(){function t(t,e){if(this.map=t,this.options=e,this.pane="order-0",void 0!==e.order){var i="order-"+e.order,n=t.getPane(i);n||(n=t.createPane(i)),n.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}return t.prototype.addLayer=function(t){Object.assign(this.options,t)},t}(),mi=function(t){function s(e,i){var n=t.call(this,e,i)||this;return n.selected=!1,n._layers=[],n._selectedLayers=[],n._filteredLayers=[],n._openedPopup=[],n.$updateTooltip=D((function(){n.updateTooltip()}),300),n.$unselect=function(){n.unselect()},n}return e(s,t),s.prototype.addLayer=function(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new l.exports.FeatureGroup([],i(i({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer},s.prototype.beforeRemove=function(){this._removeMapListener()},s.prototype.select=function(t){if(this.unselect(),t)for(var e=0,i=this._layers.filter(t);e<i.length;e++){this._selectLayer(i[e],"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._setPaintEachLayer(this.selectedPaint))},s.prototype.unselect=function(t){var e=this;if(t)this._layers.filter(t).forEach((function(t){e._unSelectLayer(t)}));else if(this.selected){for(var i=0,n=this._openedPopup;i<n.length;i++){this._removePopup(n[i][0])}this.paint&&this._setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}},s.prototype.getSelected=function(){var t=this;return this._selectedLayers.map((function(e){return i({target:t,feature:e.feature,layer:e},pi(e.feature))}))},s.prototype.getFiltered=function(){return this._filteredLayers},s.prototype.filter=function(t){var e=this;this._filterFun=t;var n=this.layer,o=n&&n._map;if(n&&o){n.remove();var r=[];this._layers.forEach((function(o){var s=o.feature,a=o.layer;a&&(!t||t(i({target:e,feature:s,layer:a},pi(s)))?(n.addLayer(a),r.push(i({target:e,feature:s,layer:a},pi(s)))):n.removeLayer(a))})),this._filteredLayers=r,n.addTo(o)}return this._filteredLayers},s.prototype.cleanFilter=function(){this.filter()},s.prototype.getLayers=function(){var t=this;return this._layers.map((function(e){var n=e.layer,o=e.feature;return i({feature:o,layer:n,visible:n&&!!n._map,target:t},pi(o))}))},s.prototype.clearLayer=function(t){this.unselect();var e=this.layer;if(e)if(t)for(var i=this._layers.length;i--;){var n=this._layers[i];if(n){var o=n.feature,r=n.layer;if(o&&r)t(o)&&(e.removeLayer(r),this._layers.splice(i,1))}}else e.clearLayers(),this._layers=[]},s.prototype.setData=function(t){this.clearLayer(),this.addData(t)},s.prototype.addData=function(t){var e,i=this.options;if(i){if(t){var n=void 0;if(i.type)n=i.type;else{var o=function(t){var e;e="FeatureCollection"===t.type?di(t.features.map((function(t){return t.geometry.type}))):"GeometryCollection"===t.type?di(t.geometries.map((function(t){return t.type}))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);n=oi[o]}if(this.type&&this.type!==n)return void console.warn("no other data type than layer can be added");this.type=n,t=function(t,e){if("FeatureCollection"===t.type)(i=t).features=i.features.filter((function(t){return li(t.geometry.type,e)}));else if("Feature"===t.type){if(!li(t.geometry.type,e))return!1}else if("GeometryCollection"===t.type){var i;(i=t).geometries=i.geometries.filter((function(t){return li(t.type,e)}))}return t}(t,n),t&&(e=this._getGeoJsonOptions(i,n))}new l.exports.GeoJSON(t||void 0,e)}},s.prototype.openPopup=function(t,e){var i=this;t&&this._layers.filter(t).forEach((function(t){i._openPopup(t,e,"api")}))},s.prototype.closePopup=function(t){var e=this;(t?this._openedPopup.filter((function(e){return t(e[2])})):this._openedPopup).forEach((function(t){e._removePopup(t[0])}))},s.prototype.updateTooltip=function(t){var e=this;t?this._updateTooltip(t):this.getLayers().forEach((function(t){return e._updateTooltip({feature:t.feature,layer:t.layer})}))},s.prototype.getExtent=function(){return this.getBounds()},s.prototype.getBounds=function(){if(this.layer){var t=this.layer.getBounds();if(t.isValid())return ni(t)}},s.prototype.setOpacity=function(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)},s.prototype.setPaint=function(t){if(t){this.paint=t;for(var e=0,i=this._layers;e<i.length;e++){this._setPaint(i[e],t)}}},s.prototype.setSelectedPaint=function(t){if(t){this.selectedPaint=t;for(var e=0,i=this._selectedLayers;e<i.length;e++){this._setPaint(i[e],t)}}},s.prototype.updatePaint=function(t){this.paint=i(i({},this.paint),t);for(var e=0,n=this._layers;e<n.length;e++){this._setPaint(n[e],this.paint)}},s.prototype.updateSelectedPaint=function(t){this.selectedPaint=i(i({},this.selectedPaint),t);for(var e=0,n=this._selectedLayers;e<n.length;e++){this._setPaint(n[e],this.selectedPaint)}},s.prototype._updateTooltip=function(t){var e=t.feature,i=t.layer;if(e&&i&&e.properties&&this.options.labelField){i.unbindTooltip();var n=e.properties[this.options.labelField];if(void 0!==n){var o=!this.options.labelOnHover;i.bindTooltip(String(n),{permanent:o,sticky:!1})}}},s.prototype._openPopup=function(t,e,n,s){var a,u;return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var o,h,l,c,p,d,f,m,_,y,v,g,b,w,x,L=this;return r(this,(function(r){switch(r.label){case 0:return o=t.feature,h=t.layer,l=i({minWidth:300},e),c=l.minWidth,p=l.autoPan,d=l.maxWidth,m=null!=(f=l.closeButton)?f:!this.options.selectOnHover,y=[],v=function(t){y.push(t)},g=function(){_&&L._removePopup(_)},e.createPopupContent?[4,e.createPopupContent(i({layer:h,feature:o,target:this,type:n,close:g,onClose:v},pi(o)))]:[3,2];case 1:return b=r.sent(),[3,3];case 2:b=e.popupContent,r.label=3;case 3:return b&&h&&(w={minWidth:c,autoPan:p,closeButton:m,closeOnClick:!1,autoClose:!1},B(d)&&(w.maxWidth=d),_=h.bindPopup(b,w),(null===(u=null===(a=this.options.popupOptions)||void 0===a?void 0:a.unselectOnClose)||void 0===u||u)&&(x=h.getPopup())&&x.once("remove",(function(){g()}),this),this._openedPopup.push([_,y,t]),_.openPopup(s)),[2]}}))}))},s.prototype._removePopup=function(t){var e,i;if(this.map){t.closePopup().unbindPopup();var n=this._openedPopup.findIndex((function(e){return e[0]===t}));if(-1!==n){for(var o=null===(i=null===(e=this.options.popupOptions)||void 0===e?void 0:e.unselectOnClose)||void 0===i||i,r=this._openedPopup[n],s=r[1],a=r[2],u=0,h=s;u<h.length;u++){(0,h[u])(a)}s.length=0,o&&this._unSelectLayer(a),this._openedPopup.splice(n,1)}}},s.prototype._setPaintEachLayer=function(t){var e=this;this._layers.forEach((function(i){e._setPaint(i,t)}))},s.prototype._setPaint=function(t,e){var i=void 0,n=t.layer,o=t.feature;if(n&&o&&(Q(e)?i=e(o):Y(e)&&(i=e),i))if("point"===this.type&&"icon"===i.type){var r=n,s=this._createDivIcon(i);r.setIcon(s)}else"setStyle"in n&&n.setStyle(this._preparePaint(i))},s.prototype._preparePaint=function(t){if("get-paint"!==t.type){var e="line"===this.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(var n=0,o=e;n<o.length;n++){var r=o[n],s=r[0],a=r[1],u=t[a];B(this.options.opacity)&&-1!==a.toLowerCase().indexOf("opacity")&&(u=Number(u)*this.options.opacity),void 0!==u&&Object.defineProperty(i,s,{enumerable:!0,value:u})}return i}return ri},s.prototype._getGeoJsonOptions=function(t,e){var n=this,o=t.paint,r={};return"function"==typeof o?"point"===e?r.pointToLayer=function(t,e){var i=o(t);return n._createPaintToLayer(i)(t,e)}:r={style:function(t){return n._preparePaint(i(i({},ri),t?o(t):{type:"path"}))}}:r=this._createPaintOptions(o,e),r.onEachFeature=function(t,e){n._onEachFeature(t,e)},r},s.prototype._onEachFeature=function(t,e){var n=this,o=this.layer;if(o){var r=i({target:this,feature:t,layer:e},pi(t));e.options.pane=this.pane,this._layers.push(r);var s=!0;if(this._filterFun&&(s=this._filterFun(r)),s){var a=this.options,u=a.popup,h=a.popupOptions,l=a.selectable,c=a.interactive,p=a.selectOnHover;e.options.interactive=!B(c)||c,o.addLayer(e),l&&(p?(e.on("mouseover",(function(){n._selectLayer(r,"hover")})),e.on("mouseout",(function(){n._unSelectLayer(r)}))):e.on("click",(function(t){return n._selectOnLayerClick(t)}),this)),this._handleMouseEvents(e),setTimeout((function(){u&&n._openPopup(i({target:n,layer:e,feature:t},pi(t)),h,"api"),n._updateTooltip({layer:e,feature:t})}))}}},s.prototype._handleMouseEvents=function(t){var e=this,n=this.options,o=n.onMouseOut,r=n.onMouseOver,s=n.onClick||n.onLayerClick;s&&t.on("click",(function(n){var o=!!e._getSelected(t);s(i({selected:o},e._createMouseEvent(n)))}),this),o&&t.on("mouseout",(function(t){o(e._createMouseEvent(t))}),this),r&&t.on("mouseover",(function(t){r(e._createMouseEvent(t))}),this)},s.prototype._createMouseEvent=function(t){return function(t){var e=t.source,n=e.target.feature;return i({layer:t.layer,feature:n,event:ti(e),source:e},pi(n))}({layer:this,source:t})},s.prototype._getSelected=function(t){return this._selectedLayers.find((function(e){return e.layer===t}))},s.prototype._selectOnLayerClick=function(t){l.exports.DomEvent.stopPropagation(t);var e=t.target,n=e.feature,o=i({target:this,layer:e,feature:n},pi(n)),r=this._getSelected(e);r?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(r):this._selectLayer(o,"click",t.latlng)},s.prototype._selectLayer=function(t,e,n){var o=this;this.options.multiselect||(this.map._addUnselectCb((function(){o._unSelectLayer(t)})),this._selectedLayers.forEach((function(t){return o._unSelectLayer(t)}))),this._selectedLayers.push(t),this.selected=!0;var r=this.options,s=r.selectedPaint,a=r.popupOnSelect,u=r.popupOptions;if(s&&t.layer&&this._setPaint(t,s),a&&this._openPopup(t,u,e,n),this.options.onSelect){var h=t.feature?[t.feature]:[];this.options.onSelect(i({type:e,layer:this,features:h},pi(h)))}},s.prototype._unSelectLayer=function(t){var e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0},s.prototype._createDivIcon=function(t){var e=n(t,[]);return new l.exports.DivIcon(i({className:""},e))},s.prototype._createPaintToLayer=function(t){var e=this;if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return function(i,n){var o=e._createDivIcon(t);return new l.exports.Marker(n,{icon:o})}}else if("pin"===t.type)return function(t,e){return new l.exports.Marker(e)};return function(n,o){return new l.exports.CircleMarker(o,e._preparePaint(i(i({},ri),t)))}},s.prototype._createPaintOptions=function(t,e){var i={},n=t&&this._preparePaint(t)||{};return t&&(i.style=function(){return n}),"point"===e?i.pointToLayer=this._createPaintToLayer(t):"line"===e&&(n.stroke=!0),i},s.prototype._addMapClickListener=function(){var t=this.map;if(t){var e=this.options.unselectOnClick;(null==e||e)&&t.on("click",this.$unselect)}},s.prototype._removeMapClickListener=function(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)},s.prototype._addMapListener=function(){var t=this.map;if(t){var e=this.options,i=e.labelField,n=e.labelOnHover;this._addMapClickListener(),i&&!n&&(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}},s.prototype._removeMapListener=function(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)},s}(fi);function _i(t,e,i){var n=new XMLHttpRequest;for(var o in n.open("GET",t),n.responseType="arraybuffer",i)n.setRequestHeader(o,i[o]);return n.onload=function(){var t=new Uint8Array(this.response),i=new Blob([t],{type:"image/png"}),n=(window.URL||window.webkitURL).createObjectURL(i);e(n)},n.send(),function(){n.abort()}}var yi=function(t){function i(e,i,n){var o=t.call(this,e,i,n)||this;return o._abort=[],o}return e(i,t),i.prototype.cancelLoad=function(){this._abort&&(this._abort.forEach((function(t){return t()})),this._abort=[])},i.prototype._initImage=function(){t.prototype._initImage.call(this);var e=this.options.headers;if(e){var i=this._image,n=i.src;i.src="",this._abort.push(_i(n,(function(t){i.src=t}),e))}},i}(l.exports.ImageOverlay),vi=function(t){function i(e,i){var n=t.call(this,i)||this;n.defaultWmsParams={service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},n.options={crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100},n._url=e;var o,r={},s={};for(o in i)o in n.options?s[o]=i[o]:r[o]=i[o];return l.exports.Util.setOptions(n,s),n.wmsParams=l.exports.Util.extend({},n.defaultWmsParams,r),n}return e(i,t),i.prototype.setParams=function(t){l.exports.Util.extend(this.wmsParams,t),this.update()},i.prototype.getAttribution=function(){return this.options.attribution||""},i.prototype.onAdd=function(){return this.update(),this},i.prototype.onRemove=function(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this},i.prototype.getEvents=function(){return{moveend:D(this.update,this.options.setViewDelay)}},i.prototype.update=function(){var t=this;if(this._map){this.updateWmsParams();var e=this.getImageUrl();if(this._currentUrl!==e){this._currentUrl=e;var i=this.options.viewPortBuffer||0,n=this._map.getBounds().pad(i),o=new yi(e,n,{opacity:0,pane:this.options.pane,headers:this.options.headers});o.addTo(this._map),this._currentOverlay&&this._currentOverlay.cancelLoad(),o.once("load",(function(){t._map&&(o._url===t._currentUrl?(t._currentOverlay&&t._map.removeLayer(t._currentOverlay),t._currentOverlay=o,o.setOpacity(void 0!==t.options.opacity?t.options.opacity:1),!0===t.options.isBack&&o.bringToBack(),!1===t.options.isBack&&o.bringToFront(),void 0!==t.options.zIndex&&o.setZIndex(t.options.zIndex)):t._map.removeLayer(o))}),this);var r=this.options,s=r.minZoom,a=r.maxZoom;(s&&this._map.getZoom()<s||a&&this._map.getZoom()>a)&&this._map.removeLayer(o)}}},i.prototype.setOpacity=function(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)},i.prototype.bringToBack=function(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()},i.prototype.bringToFront=function(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()},i.prototype.setZIndex=function(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)},i.prototype.updateWmsParams=function(t){t||(t=this._map);var e=this.options.viewPortBuffer||0,i=t.getBounds().pad(e),n=t.getSize();if(0!==this.options.viewPortBuffer){var o=e+1;n.x=Math.ceil(n.x*o),n.y=Math.ceil(n.y*o)}var r=parseFloat(this.wmsParams.version),s=this.options.crs||t.options.crs,a=r>=1.3?"crs":"srs";if(s){var u=s.project(i.getNorthWest()),h=s.project(i.getSouthEast()),c={width:n.x,height:n.y};c[a]=s.code,c.bbox=(r>=1.3&&s===l.exports.CRS.EPSG4326?[h.y,u.x,u.y,h.x]:[u.x,h.y,h.x,u.y]).join(","),l.exports.Util.extend(this.wmsParams,c)}},i.prototype.getImageUrl=function(){var t=l.exports.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t},i}(l.exports.Layer),gi=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.addLayer=function(t){var e=t&&t.url;if(e){var n=(t=i({transparent:!0},t)).updateWmsParams;if(this.layer=new vi(e,i(i(i({pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay},t),t.params),t.nativeOptions)),n){var o=this.layer.updateWmsParams;this.layer.updateWmsParams=function(t){o.call(this,t),this.wmsParams=n(this.wmsParams)}}return this.layer}},n}(fi);
1
+ var NgwLeaflet=function(){"use strict";var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};function e(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}var i=function(){return i=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},i.apply(this,arguments)};function n(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i}function o(t,e,i,n){return new(i||(i=Promise))((function(o,r){function s(t){try{u(n.next(t))}catch(e){r(e)}}function a(t){try{u(n.throw(t))}catch(e){r(e)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function r(t,e){var i,n,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(a){return function(u){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,a[0]&&(s=0)),s;)try{if(i=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{i=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e,i){if(i||2===arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}function u(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t=s(t),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=t[i]&&function(e){return new Promise((function(n,o){(function(t,e,i,n){Promise.resolve(n).then((function(e){t({value:e,done:i})}),e)})(n,o,(e=t[i](e)).done,e.value)}))}}}function h(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}"function"==typeof SuppressedError&&SuppressedError;h('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;height:0;width:0;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);height:36px;width:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{height:44px;width:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}');h(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}");"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var l={exports:{}};(function(t){var e="1.7.1";function i(t){var e,i,n,o;for(i=1,n=arguments.length;i<n;i++)for(e in o=arguments[i])t[e]=o[e];return t}var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function o(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var n=i.call(arguments,2);return function(){return t.apply(e,n.length?n.concat(i.call(arguments)):arguments)}}var r=0;function s(t){return t._leaflet_id=t._leaflet_id||++r,t._leaflet_id}function a(t,e,i){var n,o,r,s;return s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)},r}function u(t,e,i){var n=e[1],o=e[0],r=n-o;return t===n&&i?t:((t-o)%r+r)%r+o}function h(){return!1}function l(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function c(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return c(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?n(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}var m=/\{ *([\w_-]+) *\}/g;function _(t,e){return t.replace(m,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for variable "+t);return"function"==typeof n&&(n=n(e)),n}))}var y=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function v(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var g="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,C=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function M(t,e,i){if(!i||P!==x)return P.call(window,o(t,e));t.call(e)}function T(t){t&&C.call(window,t)}var O={extend:i,create:n,bind:o,lastId:r,stamp:s,throttle:a,wrapNum:u,falseFn:h,formatNum:l,trim:c,splitWords:p,setOptions:d,getParamString:f,template:_,isArray:y,indexOf:v,emptyImageUrl:g,requestFn:P,cancelFn:C,requestAnimFrame:M,cancelAnimFrame:T};function A(){}function k(t){if("undefined"!=typeof L&&L&&L.Mixin){t=y(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}A.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},o=e.__super__=this.prototype,r=n(o);for(var s in r.constructor=e,e.prototype=r,this)Object.prototype.hasOwnProperty.call(this,s)&&"prototype"!==s&&"__super__"!==s&&(e[s]=this[s]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(k(t.includes),i.apply(null,[r].concat(t.includes)),delete t.includes),r.options&&(t.options=i(n(r.options),t.options)),i(r,t),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){o.callInitHooks&&o.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=r._initHooks.length;t<e;t++)r._initHooks[t].call(this)}},e},A.include=function(t){return i(this.prototype,t),this},A.mergeOptions=function(t){return i(this.prototype.options,t),this},A.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var E={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,r=(t=p(t)).length;o<r;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else for(var o=0,r=(t=p(t)).length;o<r;o++)this._off(t[o],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var n=this._events[t];n||(this._events[t]=n=[]),i===this&&(i=void 0);for(var o={fn:e,ctx:i},r=n,s=0,a=r.length;s<a;s++)if(r[s].fn===e&&r[s].ctx===i)return;r.push(o)},_off:function(t,e,i){var n,o,r;if(this._events&&(n=this._events[t]))if(e){if(i===this&&(i=void 0),n)for(o=0,r=n.length;o<r;o++){var s=n[o];if(s.ctx===i&&s.fn===e)return s.fn=h,this._firingCount&&(this._events[t]=n=n.slice()),void n.splice(o,1)}}else{for(o=0,r=n.length;o<r;o++)n[o].fn=h;delete this._events[t]}},fire:function(t,e,n){if(!this.listens(t,n))return this;var o=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var r=this._events[t];if(r){this._firingCount=this._firingCount+1||1;for(var s=0,a=r.length;s<a;s++){var u=r[s];u.fn.call(u.ctx||this,o)}this._firingCount--}}return n&&this._propagateEvent(o),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var n in this._eventParents)if(this._eventParents[n].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var n in t)this.once(n,t[n],e);return this}var r=o((function(){this.off(t,e,i).off(t,r,i)}),this);return this.on(t,e,i).on(t,r,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[s(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[s(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};E.addEventListener=E.on,E.removeEventListener=E.clearAllEventListeners=E.off,E.addOneTimeEventListener=E.once,E.fireEvent=E.fire,E.hasEventListeners=E.listens;var S=A.extend(E);function z(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var I=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function B(t,e,i){return t instanceof z?t:y(t)?new z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new z(t.x,t.y):new z(t,e,i)}function Z(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function R(t,e){return!t||t instanceof Z?t:new Z(t,e)}function N(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function D(t,e){return t instanceof N?t:new N(t,e)}function j(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof j?t:y(t)&&"object"!=typeof t[0]?3===t.length?new j(t[0],t[1],t[2]):2===t.length?new j(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new j(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new j(t,e,i)}z.prototype={clone:function(){return new z(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new z(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new z(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(t){var e=(t=B(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=B(t)).x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+l(this.x)+", "+l(this.y)+")"}},Z.prototype={extend:function(t){return t=B(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new z(this.min.x,this.max.y)},getTopRight:function(){return new z(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t="number"==typeof t[0]||t instanceof z?B(t):R(t))instanceof Z?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max;return o.x>=e.x&&n.x<=i.x&&o.y>=e.y&&n.y<=i.y},overlaps:function(t){t=R(t);var e=this.min,i=this.max,n=t.min,o=t.max;return o.x>e.x&&n.x<i.x&&o.y>e.y&&n.y<i.y},isValid:function(){return!(!this.min||!this.max)}},N.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof j)e=t,i=t;else{if(!(t instanceof N))return t?this.extend(F(t)||D(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new j(e.lat,e.lng),this._northEast=new j(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,o=Math.abs(e.lng-i.lng)*t;return new N(new j(e.lat-n,e.lng-o),new j(i.lat+n,i.lng+o))},getCenter:function(){return new j((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"==typeof t[0]||t instanceof j||"lat"in t?F(t):D(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof N?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=D(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast();return o.lat>=e.lat&&n.lat<=i.lat&&o.lng>=e.lng&&n.lng<=i.lng},overlaps:function(t){t=D(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),o=t.getNorthEast();return o.lat>e.lat&&n.lat<i.lat&&o.lng>e.lng&&n.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=D(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},j.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+l(this.lat,t)+", "+l(this.lng,t)+")"},distanceTo:function(t){return H.distance(this,F(t))},wrap:function(){return H.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return D([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new j(this.lat,this.lng,this.alt)}};var U,W={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new Z(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?u(t.lng,this.wrapLng,!0):t.lng;return new j(this.wrapLat?u(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,o=e.lng-i.lng;if(0===n&&0===o)return t;var r=t.getSouthWest(),s=t.getNorthEast();return new N(new j(r.lat-n,r.lng-o),new j(s.lat-n,s.lng-o))}},H=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,r=Math.sin((e.lat-t.lat)*i/2),s=Math.sin((e.lng-t.lng)*i/2),a=r*r+Math.cos(n)*Math.cos(o)*s*s,u=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*u}}),V=6378137,q={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),o=Math.sin(n*e);return new z(this.R*t.lng*e,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(t){var e=180/Math.PI;return new j((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(U=V*Math.PI,new Z([-U,-U],[U,U]))};function G(t,e,i,n){if(y(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=n}function J(t,e,i,n){return new G(t,e,i,n)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new z((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},H,{code:"EPSG:3857",projection:q,transformation:function(){var t=.5/(Math.PI*q.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,n,o,r,s,a,u="";for(i=0,o=t.length;i<o;i++){for(n=0,r=(s=t[i]).length;n<r;n++)u+=(n?"L":"M")+(a=s[n]).x+" "+a.y;u+=e?kt?"z":"x":""}return u||"M0 0"}var $=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),nt=St("webkit"),ot=St("android"),rt=St("android 2")||St("android 3"),st=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=ot&&St("Google")&&st<537&&!("AudioNode"in window),ut=!!window.opera,ht=!it&&St("chrome"),lt=St("gecko")&&!nt&&!ut&&!tt,ct=!ht&&St("safari"),pt=St("phantom"),dt="OTransition"in $,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in $,_t="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!rt,yt="MozPerspective"in $,vt=!window.L_DISABLE_3D&&(mt||_t||yt)&&!dt&&!pt,gt="undefined"!=typeof orientation||St("mobile"),bt=gt&&nt,wt=gt&&_t,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),Pt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Ct=gt&&ut,Mt=gt&&lt,Tt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Ot=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",h,e),window.removeEventListener("testPassiveEventSupport",h,e)}catch(i){}return t}(),At=!!document.createElement("canvas").getContext,kt=!(!document.createElementNS||!Q("svg").createSVGRect),Et=!kt&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function St(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var zt={ie:tt,ielt9:et,edge:it,webkit:nt,android:ot,android23:rt,androidStock:at,opera:ut,chrome:ht,gecko:lt,safari:ct,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:_t,gecko3d:yt,any3d:vt,mobile:gt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Lt,touch:Pt,mobileOpera:Ct,mobileGecko:Mt,retina:Tt,passiveEvents:Ot,canvas:At,svg:kt,vml:Et},It=xt?"MSPointerDown":"pointerdown",Bt=xt?"MSPointerMove":"pointermove",Zt=xt?"MSPointerUp":"pointerup",Rt=xt?"MSPointerCancel":"pointercancel",Nt={},Dt=!1;function jt(t,e,i,n){return"touchstart"===e?Ut(t,i,n):"touchmove"===e?Gt(t,i,n):"touchend"===e&&Jt(t,i,n),this}function Ft(t,e,i){var n=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(It,n,!1):"touchmove"===e?t.removeEventListener(Bt,n,!1):"touchend"===e&&(t.removeEventListener(Zt,n,!1),t.removeEventListener(Rt,n,!1)),this}function Ut(t,e,i){var n=o((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&He(t),qt(t,e)}));t["_leaflet_touchstart"+i]=n,t.addEventListener(It,n,!1),Dt||(document.addEventListener(It,Wt,!0),document.addEventListener(Bt,Ht,!0),document.addEventListener(Zt,Vt,!0),document.addEventListener(Rt,Vt,!0),Dt=!0)}function Wt(t){Nt[t.pointerId]=t}function Ht(t){Nt[t.pointerId]&&(Nt[t.pointerId]=t)}function Vt(t){delete Nt[t.pointerId]}function qt(t,e){for(var i in t.touches=[],Nt)t.touches.push(Nt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var n=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||qt(t,e)};t["_leaflet_touchmove"+i]=n,t.addEventListener(Bt,n,!1)}function Jt(t,e,i){var n=function(t){qt(t,e)};t["_leaflet_touchend"+i]=n,t.addEventListener(Zt,n,!1),t.addEventListener(Rt,n,!1)}var Kt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Qt="_leaflet_";function Xt(t,e,i){var n,o,r=!1,s=250;function a(t){if(Lt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(n||e);o=t.touches?t.touches[0]:t,r=i>0&&i<=s,n=e}function u(t){if(r&&!o.cancelBubble){if(Lt){if("mouse"===t.pointerType)return;var i,s,a={};for(s in o)a[s]=(i=o[s])&&i.bind?i.bind(o):i;o=a}o.type="dblclick",o.button=0,e(o),n=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=u,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!Ot&&{passive:!1}),t.addEventListener(Yt,u,!!Ot&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function $t(t,e){var i=t[Qt+Yt+e],n=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!Ot&&{passive:!1}),t.removeEventListener(Yt,i,!!Ot&&{passive:!1}),t.removeEventListener("dblclick",n,!1),this}var te,ee,ie,ne,oe,re=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),se=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===se||"OTransition"===se?se+"End":"transitionend";function ue(t){return"string"==typeof t?document.getElementById(t):t}function he(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var n=document.defaultView.getComputedStyle(t,null);i=n?n[e]:null}return"auto"===i?null:i}function le(t,e,i){var n=document.createElement(t);return n.className=e||"",i&&i.appendChild(n),n}function ce(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ge(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function _e(t,e){if(void 0!==t.classList)for(var i=p(e),n=0,o=i.length;n<o;n++)t.classList.add(i[n]);else if(!me(t,e)){var r=ge(t);ve(t,(r?r+" ":"")+e)}}function ye(t,e){void 0!==t.classList?t.classList.remove(e):ve(t,c((" "+ge(t)+" ").replace(" "+e+" "," ")))}function ve(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ge(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Le(t,e,i){var n=e||new z(0,0);t.style[re]=(mt?"translate("+n.x+"px,"+n.y+"px)":"translate3d("+n.x+"px,"+n.y+"px,0)")+(i?" scale("+i+")":"")}function Pe(t,e){t._leaflet_pos=e,vt?Le(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Ce(t){return t._leaflet_pos||new z(0,0)}if("onselectstart"in document)te=function(){Ie(window,"selectstart",He)},ee=function(){Ze(window,"selectstart",He)};else{var Me=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Me){var t=document.documentElement.style;ie=t[Me],t[Me]="none"}},ee=function(){Me&&(document.documentElement.style[Me]=ie,ie=void 0)}}function Te(){Ie(window,"dragstart",He)}function Oe(){Ze(window,"dragstart",He)}function Ae(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ke(),ne=t,oe=t.style.outline,t.style.outline="none",Ie(window,"keydown",ke))}function ke(){ne&&(ne.style.outline=oe,ne=void 0,oe=void 0,Ze(window,"keydown",ke))}function Ee(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Se(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var ze={TRANSFORM:re,TRANSITION:se,TRANSITION_END:ae,get:ue,getStyle:he,create:le,remove:ce,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:_e,removeClass:ye,setClass:ve,getClass:ge,setOpacity:be,testProp:xe,setTransform:Le,setPosition:Pe,getPosition:Ce,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:Te,enableImageDrag:Oe,preventOutline:Ae,restoreOutline:ke,getSizedParentNode:Ee,getScale:Se};function Ie(t,e,i,n){if("object"==typeof e)for(var o in e)De(t,o,e[o],i);else for(var r=0,s=(e=p(e)).length;r<s;r++)De(t,e[r],i,n);return this}var Be="_leaflet_events";function Ze(t,e,i,n){if("object"==typeof e)for(var o in e)je(t,o,e[o],i);else if(e)for(var r=0,s=(e=p(e)).length;r<s;r++)je(t,e[r],i,n);else{for(var a in t[Be])je(t,a,t[Be][a]);delete t[Be]}return this}function Re(){if(Lt)return!(it||ct)}var Ne={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function De(t,e,i,n){var o=e+s(i)+(n?"_"+s(n):"");if(t[Be]&&t[Be][o])return this;var r=function(e){return i.call(n||t,e||window.event)},a=r;Lt&&0===e.indexOf("touch")?jt(t,e,r,o):Pt&&"dblclick"===e&&!Re()?Xt(t,r,o):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Ne[e]||e,r,!!Ot&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Ne[e],r=function(e){e=e||window.event,Xe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,r),t[Be]=t[Be]||{},t[Be][o]=r}function je(t,e,i,n){var o=e+s(i)+(n?"_"+s(n):""),r=t[Be]&&t[Be][o];if(!r)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,o):Pt&&"dblclick"===e&&!Re()?$t(t,o):"removeEventListener"in t?t.removeEventListener(Ne[e]||e,r,!1):"detachEvent"in t&&t.detachEvent("on"+e,r),t[Be][o]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Ue(t){return De(t,"wheel",Fe),this}function We(t){return Ie(t,"mousedown touchstart dblclick",Fe),De(t,"click",Ye),this}function He(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return He(t),Fe(t),this}function qe(t,e){if(!e)return new z(t.clientX,t.clientY);var i=Se(e),n=i.boundingClientRect;return new z((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)}var Ge=ft&&ht?2*window.devicePixelRatio:lt?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t}var $e={on:Ie,off:Ze,stopPropagation:Fe,disableScrollPropagation:Ue,disableClickPropagation:We,preventDefault:He,stop:Ve,getMousePosition:qe,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:Xe,addListener:Ie,removeListener:Ze},ti=S.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Ce(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=M(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Pe(this._el,i),this.fire("step")},_complete:function(){T(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=S.extend({options:{crs:K,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=o(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=se&&vt&&!Ct&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ie(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,n){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),n=n||{},this._stop(),this._loaded&&!n.reset&&!0!==n&&(void 0!==n.animate&&(n.zoom=i({animate:n.animate},n.zoom),n.pan=i({animate:n.animate,duration:n.duration},n.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(vt?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(vt?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),r=(t instanceof z?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),s=this.containerPointToLatLng(o.add(r));return this.setView(s,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():D(t);var i=B(e.paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};var r=n.subtract(i).divideBy(2),s=this.project(t.getSouthWest(),o),a=this.project(t.getNorthEast(),o);return{center:this.unproject(s.add(a).divideBy(2).add(r),o),zoom:o}},fitBounds:function(t,e){if(!(t=D(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=B(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){_e(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!vt)return this.setView(t,e,i);this._stop();var n=this.project(this.getCenter()),o=this.project(t),r=this.getSize(),s=this._zoom;t=F(t),e=void 0===e?s:e;var a=Math.max(r.x,r.y),u=a*this.getZoomScale(s,e),h=o.distanceTo(n)||1,l=1.42,c=l*l;function p(t){var e=(u*u-a*a+(t?-1:1)*c*c*h*h)/(2*(t?u:a)*c*h),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var _=p(0);function y(t){return a*(f(_)/f(_+l*t))}function v(t){return a*(f(_)*m(_+l*t)-d(_))/c}function g(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-_)/l,x=i.duration?1e3*i.duration:1e3*w*.8;function L(){var i=(Date.now()-b)/x,r=g(i)*w;i<=1?(this._flyToFrame=M(L,this),this._move(this.unproject(n.add(o.subtract(n).multiplyBy(v(r)/h)),s),this.getScaleZoom(a/y(r),s),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=D(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),n=this._limitCenter(i,this._zoom,D(t));return i.equals(n)||this.panTo(n,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=B((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=B(e.paddingBottomRight||e.padding||[0,0]),o=this.getCenter(),r=this.project(o),s=this.project(t),a=this.getPixelBounds(),u=a.getSize().divideBy(2),h=R([a.min.add(i),a.max.subtract(n)]);if(!h.contains(s)){this._enforcingBounds=!0;var l=r.subtract(s),c=B(s.x+l.x,s.y+l.y);(s.x<h.min.x||s.x>h.max.x)&&(c.x=r.x-l.x,l.x>0?c.x+=u.x-i.x:c.x-=u.x-n.x),(s.y<h.min.y||s.y>h.max.y)&&(c.y=r.y-l.y,l.y>0?c.y+=u.y-i.y:c.y-=u.y-n.y),this.panTo(this.unproject(c),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var n=this.getSize(),r=e.divideBy(2).round(),s=n.divideBy(2).round(),a=r.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:n})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o(this._handleGeolocationResponse,this),n=o(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,n,t):navigator.geolocation.getCurrentPosition(e,n,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new j(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),n=this._locateOptions;if(n.setView){var o=this.getBoundsZoom(i);this.setView(e,n.maxZoom?Math.min(o,n.maxZoom):o)}var r={latlng:e,bounds:i,timestamp:t.timestamp};for(var s in t.coords)"number"==typeof t.coords[s]&&(r[s]=t.coords[s]);this.fire("locationfound",r)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ce(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(T(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ce(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=le("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new N(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=D(t),i=B(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),r=this.getMaxZoom(),s=t.getNorthWest(),a=t.getSouthEast(),u=this.getSize().subtract(i),h=R(this.project(a,n),this.project(s,n)).getSize(),l=vt?this.options.zoomSnap:1,c=u.x/h.x,p=u.y/h.y,d=e?Math.max(c,p):Math.min(c,p);return n=this.getScaleZoom(d,n),l&&(n=Math.round(n/(l/100))*(l/100),n=e?Math.ceil(n/l)*l:Math.floor(n/l)*l),Math.max(o,Math.min(r,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new Z(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,n=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(n)?1/0:n},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return qe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ue(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Ie(e,"scroll",this._onScroll,this),this._containerId=s(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&vt,_e(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(Tt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ct?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=he(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pe(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_e(t.markerPane,"leaflet-zoom-hide"),_e(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Pe(this._mapPane,new z(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var n=this._zoom!==e;this._moveStart(n,!1)._move(t,e)._moveEnd(n),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var n=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(n||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return T(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Pe(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[s(this._container)]=this;var e=t?Ze:Ie;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),vt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){T(this._resizeRequest),this._resizeRequest=M((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,r=t.target||t.srcElement,a=!1;r;){if((i=this._targets[s(r)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(o&&!Xe(r,t))break;if(n.push(i),o)break}if(r===this._container)break;r=r.parentNode}return n.length||a||o||!Xe(r,t)||(n=[this]),n},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Ae(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,n){if("click"===t.type){var o=i({},t);o.type="preclick",this._fireDOMEvent(o,o.type,n)}if(!t._stopped&&(n=(n||[]).concat(this._findEventTargets(t,e))).length){var r=n[0];"contextmenu"===e&&r.listens(e,!0)&&He(t);var s={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=r.getLatLng&&(!r._radius||r._radius<=10);s.containerPoint=a?this.latLngToContainerPoint(r.getLatLng()):this.mouseEventToContainerPoint(t),s.layerPoint=this.containerPointToLayerPoint(s.containerPoint),s.latlng=a?r.getLatLng():this.layerPointToLatLng(s.layerPoint)}for(var u=0;u<n.length;u++)if(n[u].fire(e,s,!0),s.originalEvent._stopped||!1===n[u].options.bubblingMouseEvents&&-1!==v(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Ce(this._mapPane)||new z(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(n)},_latLngBoundsToNewLayerBounds:function(t,e,i){var n=this._getNewPixelOrigin(i,e);return R([this.project(t.getSouthWest(),e)._subtract(n),this.project(t.getNorthWest(),e)._subtract(n),this.project(t.getSouthEast(),e)._subtract(n),this.project(t.getNorthEast(),e)._subtract(n)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),o=this.getSize().divideBy(2),r=new Z(n.subtract(o),n.add(o)),s=this._getBoundsOffset(r,i,e);return s.round().equals([0,0])?t:this.unproject(n.add(s),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new Z(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=R(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),o=n.min.subtract(t.min),r=n.max.subtract(t.max);return new z(this._rebound(o.x,-r.x),this._rebound(o.y,-r.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=vt?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ye(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=re,i=this._proxy.style[e];Le(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ce(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Le(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),o=this._getCenterOffset(t)._divideBy(1-1/n);return!(!0!==i.animate&&!this.getSize().contains(o)||(M((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,_e(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),setTimeout(o(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ye(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),M((function(){this._moveEnd(!0)}),this))}});function ii(t,e){return new ei(t,e)}var ni=A.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return _e(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ce(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),oi=function(t){return new ni(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=le("div",e+"control-container",this._container);function n(n,o){t[n+o]=le("div",e+n+" "+e+o,i)}n("top","left"),n("top","right"),n("bottom","left"),n("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ce(this._controlCorners[t]);ce(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var ri=ni.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return ni.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(s(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){_e(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(_e(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ye(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ye(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=le("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),We(e),Ue(e);var n=this._section=le("section",t+"-list");i&&(this._map.on("click",this.collapse,this),ot||Ie(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var o=this._layersLink=le("a",t+"-toggle",e);o.href="#",o.title="Layers",Pt?(Ie(o,"click",Ve),Ie(o,"click",this.expand,this)):Ie(o,"focus",this.expand,this),i||this.expand(),this._baseLayersList=le("div",t+"-base",n),this._separator=le("div",t+"-separator",n),this._overlaysList=le("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&s(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(o((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,n,o=0;for(i=0;i<this._layers.length;i++)this._addItem(n=this._layers[i]),e=e||n.overlay,t=t||!n.overlay,o+=n.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&o>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(s(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",n=document.createElement("div");return n.innerHTML=i,n.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+s(this),n),this._layerControlInputs.push(e),e.layerId=s(t.layer),Ie(e,"click",this._onInputClick,this);var o=document.createElement("span");o.innerHTML=" "+t.name;var r=document.createElement("div");return i.appendChild(r),r.appendChild(e),r.appendChild(o),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var r=i.length-1;r>=0;r--)e=this._getLayer((t=i[r]).layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(r=0;r<o.length;r++)this._map.hasLayer(o[r])&&this._map.removeLayer(o[r]);for(r=0;r<n.length;r++)this._map.hasLayer(n[r])||this._map.addLayer(n[r]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;o>=0;o--)e=this._getLayer((t=i[o]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),si=function(t,e,i){return new ri(t,e,i)},ai=ni.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=le("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){var r=le("a",i,n);return r.innerHTML=t,r.href="#",r.title=e,r.setAttribute("role","button"),r.setAttribute("aria-label",e),We(r),Ie(r,"click",Ve),Ie(r,"click",o,this),Ie(r,"click",this._refocusOnMap,this),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ye(this._zoomInButton,e),ye(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&_e(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&_e(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))}));var ui=function(t){return new ai(t)},hi=ni.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=le("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=le("div",e,i)),t.imperial&&(this._iScale=le("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,n,o=3.2808399*t;o>5280?(i=this._getRoundNum(e=o/5280),this._updateScale(this._iScale,i+" mi",i/e)):(n=this._getRoundNum(o),this._updateScale(this._iScale,n+" ft",n/o))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),li=function(t){return new hi(t)},ci=ni.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=le("div","leaflet-control-attribution"),We(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook((function(){this.options.attributionControl&&(new ci).addTo(this)}));var pi=function(t){return new ci(t)};ni.Layers=ri,ni.Zoom=ai,ni.Scale=hi,ni.Attribution=ci,oi.layers=si,oi.zoom=ui,oi.scale=li,oi.attribution=pi;var di=A.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:E},_i=Pt?"touchstart mousedown":"mousedown",yi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},vi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},gi=S.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){d(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Ie(this._dragStartTarget,_i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(gi._dragging===this&&this.finishDrag(),Ze(this._dragStartTarget,_i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(gi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(gi._dragging=this,this._preventOutline&&Ae(this._element),Te(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Ee(this._element);this._startPoint=new z(e.clientX,e.clientY),this._parentScale=Se(i),Ie(document,vi[t.type],this._onMove,this),Ie(document,yi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,He(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Ce(this._element).subtract(i),_e(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,T(this._animRequest),this._lastEvent=t,this._animRequest=M(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Pe(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ye(document.body,"leaflet-dragging"),this._lastTarget&&(ye(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),vi)Ze(document,vi[t],this._onMove,this),Ze(document,yi[t],this._onUp,this);Oe(),ee(),this._moved&&this._moving&&(T(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,gi._dragging=!1}});function bi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Li(t=Ci(t,i),i)}function wi(t,e,i){return Math.sqrt(ki(t,e,i,!0))}function xi(t,e,i){return ki(t,e,i)}function Li(t,e){var i=t.length,n=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);n[0]=n[i-1]=1,Pi(t,n,e,0,i-1);var o,r=[];for(o=0;o<i;o++)n[o]&&r.push(t[o]);return r}function Pi(t,e,i,n,o){var r,s,a,u=0;for(s=n+1;s<=o-1;s++)(a=ki(t[s],t[n],t[o],!0))>u&&(r=s,u=a);u>i&&(e[r]=1,Pi(t,e,i,n,r),Pi(t,e,i,r,o))}function Ci(t,e){for(var i=[t[0]],n=1,o=0,r=t.length;n<r;n++)Ai(t[n],t[o])>e&&(i.push(t[n]),o=n);return o<r-1&&i.push(t[r-1]),i}function Mi(t,e,i,n,o){var r,s,a,u=n?fi:Oi(t,i),h=Oi(e,i);for(fi=h;;){if(!(u|h))return[t,e];if(u&h)return!1;a=Oi(s=Ti(t,e,r=u||h,i,o),i),r===u?(t=s,u=a):(e=s,h=a)}}function Ti(t,e,i,n,o){var r,s,a=e.x-t.x,u=e.y-t.y,h=n.min,l=n.max;return 8&i?(r=t.x+a*(l.y-t.y)/u,s=l.y):4&i?(r=t.x+a*(h.y-t.y)/u,s=h.y):2&i?(r=l.x,s=t.y+u*(l.x-t.x)/a):1&i&&(r=h.x,s=t.y+u*(h.x-t.x)/a),new z(r,s,o)}function Oi(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Ai(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}function ki(t,e,i,n){var o,r=e.x,s=e.y,a=i.x-r,u=i.y-s,h=a*a+u*u;return h>0&&((o=((t.x-r)*a+(t.y-s)*u)/h)>1?(r=i.x,s=i.y):o>0&&(r+=a*o,s+=u*o)),a=t.x-r,u=t.y-s,n?a*a+u*u:new z(r,s)}function Ei(t){return!y(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Si(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ei(t)}var zi={simplify:bi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Mi,_getEdgeIntersection:Ti,_getBitCode:Oi,_sqClosestPointOnSegment:ki,isFlat:Ei,_flat:Si};function Ii(t,e,i){var n,o,r,s,a,u,h,l,c,p=[1,4,2,8];for(o=0,h=t.length;o<h;o++)t[o]._code=Oi(t[o],e);for(s=0;s<4;s++){for(l=p[s],n=[],o=0,r=(h=t.length)-1;o<h;r=o++)u=t[r],(a=t[o])._code&l?u._code&l||((c=Ti(u,a,l,e,i))._code=Oi(c,e),n.push(c)):(u._code&l&&((c=Ti(u,a,l,e,i))._code=Oi(c,e),n.push(c)),n.push(a));t=n}return t}var Bi={clipPolygon:Ii},Zi={project:function(t){return new z(t.lng,t.lat)},unproject:function(t){return new j(t.y,t.x)},bounds:new Z([-180,-90],[180,90])},Ri={R:6378137,R_MINOR:6356752.314245179,bounds:new Z([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,r=Math.sqrt(1-o*o),s=r*Math.sin(n),a=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),r/2);return n=-i*Math.log(Math.max(a,1e-10)),new z(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,r=Math.sqrt(1-o*o),s=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(s),u=0,h=.1;u<15&&Math.abs(h)>1e-7;u++)e=r*Math.sin(a),e=Math.pow((1-e)/(1+e),r/2),a+=h=Math.PI/2-2*Math.atan(s*e)-a;return new j(a*i,t.x*i/n)}},Ni={LonLat:Zi,Mercator:Ri,SphericalMercator:q},Di=i({},H,{code:"EPSG:3395",projection:Ri,transformation:function(){var t=.5/(Math.PI*Ri.R);return J(t,.5,-t,.5)}()}),ji=i({},H,{code:"EPSG:4326",projection:Zi,transformation:J(1/180,1,-1/180,.5)}),Fi=i({},W,{projection:Zi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,n=e.lat-t.lat;return Math.sqrt(i*i+n*n)},infinite:!0});W.Earth=H,W.EPSG3395=Di,W.EPSG3857=K,W.EPSG900913=Y,W.EPSG4326=ji,W.Simple=Fi;var Ui=S.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[s(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[s(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=s(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=s(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&s(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?y(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[s(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=s(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var n in this._zoomBoundLayers){var o=this._zoomBoundLayers[n].options;t=void 0===o.minZoom?t:Math.min(t,o.minZoom),e=void 0===o.maxZoom?e:Math.max(e,o.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Wi=Ui.extend({initialize:function(t,e){var i,n;if(d(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return s(t)}}),Hi=function(t,e){return new Wi(t,e)},Vi=Wi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Wi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Wi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new N;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),qi=function(t,e){return new Vi(t,e)},Gi=A.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"];"number"==typeof n&&(n=[n,n]);var o=B(n),r=B("shadow"===e&&i.shadowAnchor||i.iconAnchor||o&&o.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),r&&(t.style.marginLeft=-r.x+"px",t.style.marginTop=-r.y+"px"),o&&(t.style.width=o.x+"px",t.style.height=o.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Tt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=le("div","leaflet-default-icon-path",document.body),e=he(t,"background-image")||he(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new gi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_e(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&ye(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,r=Ce(e._icon),s=i.getPixelBounds(),a=i.getPixelOrigin(),u=R(s.min._subtract(a).add(o),s.max._subtract(a).subtract(o));if(!u.contains(r)){var h=B((Math.max(u.max.x,r.x)-u.max.x)/(s.max.x-u.max.x)-(Math.min(u.min.x,r.x)-u.min.x)/(s.min.x-u.min.x),(Math.max(u.max.y,r.y)-u.max.y)/(s.max.y-u.max.y)-(Math.min(u.min.y,r.y)-u.min.y)/(s.min.y-u.min.y)).multiplyBy(n);i.panBy(h,{animate:!1}),this._draggable._newPos._add(h),this._draggable._startPos._add(h),Pe(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=M(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(T(this._panRequest),this._panRequest=M(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Ce(e._icon),o=e._map.layerPointToLatLng(n);i&&Pe(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){T(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qi=Ui.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1;i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),_e(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var o=t.icon.createShadow(this._shadow),r=!1;o!==this._shadow&&(this._removeShadow(),r=!0),o&&(_e(o,e),o.alt=""),this._shadow=o,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),o&&r&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ce(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ce(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(_e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Qi(t,e)}var $i=Ui.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),tn=$i.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return $i.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),n=[t+i,e+i];this._pxBounds=new Z(this._point.subtract(n),this._point.add(n))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function en(t,e){return new tn(t,e)}var nn=tn.extend({initialize:function(t,e,n){if("number"==typeof e&&(e=i({},n,{radius:e})),d(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new N(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:$i.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,n=i.options.crs;if(n.distance===H.distance){var o=Math.PI/180,r=this._mRadius/H.R/o,s=i.project([e+r,t]),a=i.project([e-r,t]),u=s.add(a).divideBy(2),h=i.unproject(u).lat,l=Math.acos((Math.cos(r*o)-Math.sin(e*o)*Math.sin(h*o))/(Math.cos(e*o)*Math.cos(h*o)))/o;(isNaN(l)||0===l)&&(l=r/Math.cos(Math.PI/180*e)),this._point=u.subtract(i.getPixelOrigin()),this._radius=isNaN(l)?0:u.x-i.project([h,t-l]).x,this._radiusY=u.y-s.y}else{var c=n.unproject(n.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(c).x}this._updateBounds()}});function on(t,e,i){return new nn(t,e,i)}var rn=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,n=1/0,o=null,r=ki,s=0,a=this._parts.length;s<a;s++)for(var u=this._parts[s],h=1,l=u.length;h<l;h++){var c=r(t,e=u[h-1],i=u[h],!0);c<n&&(n=c,o=r(t,e,i))}return o&&(o.distance=Math.sqrt(n)),o},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,s,a=this._rings[0],u=a.length;if(!u)return null;for(t=0,e=0;t<u-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,n=0;t<u-1;t++)if((n+=i=(o=a[t]).distanceTo(r=a[t+1]))>e)return this._map.layerPointToLatLng([r.x-(s=(n-e)/i)*(r.x-o.x),r.y-s*(r.y-o.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new N,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ei(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Ei(t),n=0,o=t.length;n<o;n++)i?(e[n]=F(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new Z;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new z(t,t);this._pxBounds=new Z([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var n,o,r=t.length;if(t[0]instanceof j){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,n,o,r,s,a,u=this._parts;for(e=0,n=0,o=this._rings.length;e<o;e++)for(i=0,r=(a=this._rings[e]).length;i<r-1;i++)(s=Mi(a[i],a[i+1],t,i,!0))&&(u[n]=u[n]||[],u[n].push(s[0]),s[1]===a[i+1]&&i!==r-2||(u[n].push(s[1]),n++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=bi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,r,s,a,u=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,r=this._parts.length;i<r;i++)for(n=0,o=(s=(a=this._parts[i]).length)-1;n<s;o=n++)if((e||0!==n)&&wi(t,a[o],a[n])<=u)return!0;return!1}});function sn(t,e){return new rn(t,e)}rn._flat=Si;var an=rn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,n,o,r,s,a,u=this._rings[0],h=u.length;if(!h)return null;for(r=s=a=0,t=0,e=h-1;t<h;e=t++)s+=((i=u[t]).x+(n=u[e]).x)*(o=i.y*n.x-n.y*i.x),a+=(i.y+n.y)*o,r+=3*o;return this._map.layerPointToLatLng(0===r?u[0]:[s/r,a/r])},_convertLatLngs:function(t){var e=rn.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof j&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){rn.prototype._setLatLngs.call(this,t),Ei(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ei(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new z(e,e);if(t=new Z(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var n,o=0,r=this._rings.length;o<r;o++)(n=Ii(this._rings[o],t,!0)).length&&this._parts.push(n)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,r,s,a,u,h=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(r=0,s=(u=(e=this._parts[o]).length)-1;r<u;s=r++)(i=e[r]).y>t.y!=(n=e[s]).y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(h=!h);return h||rn.prototype._containsPoint.call(this,t,!0)}});function un(t,e){return new an(t,e)}var hn=Vi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=y(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var r=this.options;if(r.filter&&!r.filter(t))return this;var s=ln(t,r);return s?(s.feature=yn(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function ln(t,e){var i,n,o,r,s="Feature"===t.type?t.geometry:t,a=s?s.coordinates:null,u=[],h=e&&e.pointToLayer,l=e&&e.coordsToLatLng||pn;if(!a&&!s)return null;switch(s.type){case"Point":return cn(h,t,i=l(a),e);case"MultiPoint":for(o=0,r=a.length;o<r;o++)i=l(a[o]),u.push(cn(h,t,i,e));return new Vi(u);case"LineString":case"MultiLineString":return n=dn(a,"LineString"===s.type?0:1,l),new rn(n,e);case"Polygon":case"MultiPolygon":return n=dn(a,"Polygon"===s.type?1:2,l),new an(n,e);case"GeometryCollection":for(o=0,r=s.geometries.length;o<r;o++){var c=ln({geometry:s.geometries[o],type:"Feature",properties:t.properties},e);c&&u.push(c)}return new Vi(u);default:throw new Error("Invalid GeoJSON object.")}}function cn(t,e,i,n){return t?t(e,i):new Qi(i,n&&n.markersInheritOptions&&n)}function pn(t){return new j(t[1],t[0],t[2])}function dn(t,e,i){for(var n,o=[],r=0,s=t.length;r<s;r++)n=e?dn(t[r],e-1,i):(i||pn)(t[r]),o.push(n);return o}function fn(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[l(t.lng,e),l(t.lat,e),l(t.alt,e)]:[l(t.lng,e),l(t.lat,e)]}function mn(t,e,i,n){for(var o=[],r=0,s=t.length;r<s;r++)o.push(e?mn(t[r],e-1,i,n):fn(t[r],n));return!e&&i&&o.push(o[0]),o}function _n(t,e){return t.feature?i({},t.feature,{geometry:e}):yn(e)}function yn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var vn={toGeoJSON:function(t){return _n(this,{type:"Point",coordinates:fn(this.getLatLng(),t)})}};function gn(t,e){return new hn(t,e)}Qi.include(vn),nn.include(vn),tn.include(vn),rn.include({toGeoJSON:function(t){var e=!Ei(this._latlngs);return _n(this,{type:(e?"Multi":"")+"LineString",coordinates:mn(this._latlngs,e?1:0,!1,t)})}}),an.include({toGeoJSON:function(t){var e=!Ei(this._latlngs),i=e&&!Ei(this._latlngs[0]),n=mn(this._latlngs,i?2:e?1:0,!0,t);return e||(n=[n]),_n(this,{type:(i?"Multi":"")+"Polygon",coordinates:n})}}),Wi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),_n(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,n=[];return this.eachLayer((function(e){if(e.toGeoJSON){var o=e.toGeoJSON(t);if(i)n.push(o.geometry);else{var r=yn(o);"FeatureCollection"===r.type?n.push.apply(n,r.features):n.push(r)}}})),i?_n(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}});var bn=gn,wn=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=D(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ce(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=D(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:le("img");_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onload=o(this.fire,this,"load"),e.onerror=o(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Le(this._image,i,e)},_reset:function(){var t=this._image,e=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Pe(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xn=function(t,e,i){return new wn(t,e,i)},Ln=wn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:le("video");if(_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=h,e.onmousemove=h,e.onloadeddata=o(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],r=0;r<i.length;r++)n.push(i[r].src);this._url=i.length>0?n:[e.src]}else{y(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var s=0;s<this._url.length;s++){var a=le("source");a.src=this._url[s],e.appendChild(a)}}}});function Pn(t,e,i){return new Ln(t,e,i)}var Cn=wn.extend({_initImage:function(){var t=this._image=this._url;_e(t,"leaflet-image-layer"),this._zoomAnimated&&_e(t,"leaflet-zoom-animated"),this.options.className&&_e(t,this.options.className),t.onselectstart=h,t.onmousemove=h}});function Mn(t,e,i){return new Cn(t,e,i)}var Tn=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(o(ce,void 0,this._container),200)):ce(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof Vi)for(var n in t._layers){e=t._layers[n];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Pe(this._container,t.add(i)):e=e.add(t).add(i);var n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=n+"px",this._container.style.left=o+"px"}},_getAnchor:function(){return[0,0]}}),On=Tn.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){Tn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",Fe))},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",Fe))},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=le("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=le("div",t+"-content-wrapper",e);if(this._contentNode=le("div",t+"-content",i),We(e),Ue(this._contentNode),Ie(e,"contextmenu",Fe),this._tipContainer=le("div",t+"-tip-container",e),this._tip=le("div",t+"-tip",this._tipContainer),this.options.closeButton){var n=this._closeButton=le("a",t+"-close-button",e);n.href="#close",n.innerHTML="&#215;",Ie(n,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var n=this.options.maxHeight,o="leaflet-popup-scrolled";n&&t.offsetHeight>n?(e.height=n+"px",_e(t,o)):ye(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Pe(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(he(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new z(this._containerLeft,-i-this._containerBottom);o._add(Ce(this._container));var r=t.layerPointToContainerPoint(o),s=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||s),u=B(this.options.autoPanPaddingBottomRight||s),h=t.getSize(),l=0,c=0;r.x+n+u.x>h.x&&(l=r.x+n-h.x+u.x),r.x-l-a.x<0&&(l=r.x-a.x),r.y+i+u.y>h.y&&(c=r.y+i-h.y+u.y),r.y-c-a.y<0&&(c=r.y-a.y),(l||c)&&t.fire("autopanstart").panBy([l,c])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),An=function(t,e){return new On(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof On||(t=new On(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof On?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new On(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof $i?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var kn=Tn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){Tn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){Tn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=Tn.prototype.getEvents.call(this);return Pt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=le("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,n=this._map,o=this._container,r=n.latLngToContainerPoint(n.getCenter()),s=n.layerPointToContainerPoint(t),a=this.options.direction,u=o.offsetWidth,h=o.offsetHeight,l=B(this.options.offset),c=this._getAnchor();"top"===a?(e=u/2,i=h):"bottom"===a?(e=u/2,i=0):"center"===a?(e=u/2,i=h/2):"right"===a?(e=0,i=h/2):"left"===a?(e=u,i=h/2):s.x<r.x?(a="right",e=0,i=h/2):(a="left",e=u+2*(l.x+c.x),i=h/2),t=t.subtract(B(e,i,!0)).add(l).add(c),ye(o,"leaflet-tooltip-right"),ye(o,"leaflet-tooltip-left"),ye(o,"leaflet-tooltip-top"),ye(o,"leaflet-tooltip-bottom"),_e(o,"leaflet-tooltip-"+a),Pe(o,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),En=function(t,e){return new kn(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof kn||(t=new kn(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof kn?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new kn(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Pt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(_e(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ye(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,n=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),n=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(n)}});var Sn=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var n=B(i.bgPos);e.style.backgroundPosition=-n.x+"px "+-n.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zn(t){return new Sn(t)}Gi.Default=Ki;var In=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:gt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ce(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof z?t:new z(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,r=i.length;o<r;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var n in this._tiles){var o=this._tiles[n];if(o.current&&o.loaded){var r=Math.min(1,(t-o.loaded)/200);be(o.el,r),r<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(T(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=le("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ce(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=le("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),h(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n,n}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var n=e.coords;this._retainParent(n.x,n.y,n.z,n.z-5)||this._retainChildren(n.x,n.y,n.z,n.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ce(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var o=Math.floor(t/2),r=Math.floor(e/2),s=i-1,a=new z(+o,+r);a.z=+s;var u=this._tileCoordsToKey(a),h=this._tiles[u];return h&&h.active?(h.retain=!0,!0):(h&&h.loaded&&(h.retain=!0),s>n&&this._retainParent(o,r,s,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var r=2*e;r<2*e+2;r++){var s=new z(o,r);s.z=i+1;var a=this._tileCoordsToKey(s),u=this._tiles[a];u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),i+1<n&&this._retainChildren(o,r,i+1,n))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e);o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),n&&!(this.options.updateWhenZooming&&o!==this._tileZoom)||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),o=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();vt?Le(t.el,o,n):Pe(t.el,o)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),n=e.getZoomScale(i,this._tileZoom),o=e.project(t,this._tileZoom).floor(),r=e.getSize().divideBy(2*n);return new Z(o.subtract(r),o.add(r))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(n),r=o.getCenter(),s=[],a=this.options.keepBuffer,u=new Z(o.getBottomLeft().subtract([a,-a]),o.getTopRight().add([a,-a]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var h in this._tiles){var l=this._tiles[h].coords;l.z===this._tileZoom&&u.contains(new z(l.x,l.y))||(this._tiles[h].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var c=o.min.y;c<=o.max.y;c++)for(var p=o.min.x;p<=o.max.x;p++){var d=new z(p,c);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:s.push(d)}}if(s.sort((function(t,e){return t.distanceTo(r)-e.distanceTo(r)})),0!==s.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<s.length;p++)this._addTile(s[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var n=this._tileCoordsToBounds(t);return D(this.options.bounds).overlaps(n)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),o=n.add(i);return[e.unproject(n,t.z),e.unproject(o,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new N(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ce(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){_e(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=h,t.onmousemove=h,et&&this.options.opacity<1&&be(t,this.options.opacity),ot&&!rt&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),r=this.createTile(this._wrapCoords(t),o(this._tileReady,this,t));this._initTile(r),this.createTile.length<2&&M(o(this._tileReady,this,t,null,r)),Pe(r,i),this._tiles[n]={el:r,coords:t,current:!0},e.appendChild(r),this.fire("tileloadstart",{tile:r,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(be(i.el,0),T(this._fadeFrame),this._fadeFrame=M(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(_e(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?M(this._pruneTiles,this):setTimeout(o(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new z(this._wrapX?u(t.x,this._wrapX):t.x,this._wrapY?u(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new Z(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Bn(t){return new In(t)}var Zn=In.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&Tt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),ot||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Ie(i,"load",o(this._tileOnLoad,this,e,i)),Ie(i,"error",o(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:Tt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var n=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=n),e["-y"]=n}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(o(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=h,e.onerror=h,e.complete||(e.src=g,ce(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",g),In.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==g))return In.prototype._tileReady.call(this,t,e,i)}});function Rn(t,e){return new Zn(t,e)}var Nn=Zn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var n=i({},this.defaultWmsParams);for(var o in e)o in this.options||(n[o]=e[o]);var r=(e=d(this,e)).detectRetina&&Tt?2:1,s=this.getTileSize();n.width=s.x*r,n.height=s.y*r,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Zn.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,n=R(i.project(e[0]),i.project(e[1])),o=n.min,r=n.max,s=(this._wmsVersion>=1.3&&this._crs===ji?[o.y,o.x,r.y,r.x]:[o.x,o.y,r.x,r.y]).join(","),a=Zn.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+s},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Dn(t,e){return new Nn(t,e)}Zn.WMS=Nn,Rn.wms=Dn;var jn=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),s(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&_e(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=Ce(this._container),o=this._map.getSize().multiplyBy(.5+this.options.padding),r=this._map.project(this._center,e),s=this._map.project(t,e).subtract(r),a=o.multiplyBy(-i).add(n).add(o).subtract(s);vt?Le(this._container,a,i):Pe(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new Z(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fn=jn.extend({getEvents:function(){var t=jn.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){jn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Ie(t,"mousemove",this._onMouseMove,this),Ie(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){T(this._redrawRequest),delete this._ctx,ce(this._container),Ze(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){jn.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),n=Tt?2:1;Pe(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",Tt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){jn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[s(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,n=e.prev;i?i.prev=n:this._drawLast=n,n?n.next=i:this._drawFirst=i,delete t._order,delete this._layers[s(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,n=t.options.dashArray.split(/[, ]+/),o=[];for(i=0;i<n.length;i++){if(e=Number(n[i]),isNaN(e))return;o.push(e)}t.options._dashArray=o}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||M(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Z,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,r,s=t._parts,a=s.length,u=this._ctx;if(a){for(u.beginPath(),i=0;i<a;i++){for(n=0,o=s[i].length;n<o;n++)u[n?"lineTo":"moveTo"]((r=s[i][n]).x,r.y);e&&u.closePath()}this._fillStroke(u,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),o=(Math.max(Math.round(t._radiusY),1)||n)/n;1!==o&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!==o&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ye(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,r=this._drawFirst;r;r=r.next)(i=r.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(_e(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(o((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;i&&(i.prev=n,n?n.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,n=e.prev;n&&(n.next=i,i?i.prev=n:n&&(this._drawLast=n),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Un(t){return At?new Fn(t):null}var Wn=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Hn={_initContainer:function(){this._container=le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(jn.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Wn("shape");_e(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Wn("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ce(e),t.removeInteractiveTarget(e),delete this._layers[s(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e||(e=t._stroke=Wn("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,e.dashStyle=n.dashArray?y(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):"",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i||(i=t._fill=Wn("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},Vn=Et?Wn:Q,qn=jn.extend({getEvents:function(){var t=jn.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Vn("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vn("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ce(this._container),Ze(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){jn.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Pe(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Vn("path");t.options.className&&_e(e,t.options.className),t.options.interactive&&_e(e,"leaflet-interactive"),this._updateStyle(t),this._layers[s(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ce(t._path),t.removeInteractiveTarget(t._path),delete this._layers[s(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",o=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,o)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Gn(t){return kt||Et?new qn(t):null}Et&&qn.include(Hn),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Un(t)||Gn(t)}});var Jn=an.extend({initialize:function(t,e){an.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Kn(t,e){return new Jn(t,e)}qn.create=Vn,qn.pointsToPath=X,hn.geometryToLayer=ln,hn.coordsToLatLng=pn,hn.coordsToLatLngs=dn,hn.latLngToCoords=fn,hn.latLngsToCoords=mn,hn.getFeature=_n,hn.asFeature=yn,ei.mergeOptions({boxZoom:!0});var Yn=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ze(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ce(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),Te(),this._startPoint=this._map.mouseEventToContainerPoint(t),Ie(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=le("div","leaflet-zoom-box",this._container),_e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new Z(this._point,this._startPoint),i=e.getSize();Pe(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ce(this._box),ye(this._container,"leaflet-crosshair")),ee(),Oe(),Ze(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(o(this._resetState,this),0);var e=new N(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yn),ei.mergeOptions({doubleClickZoom:!0});var Qn=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,o=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(o):e.setZoomAround(t.containerPoint,o)}});ei.addInitHook("addHandler","doubleClickZoom",Qn),ei.mergeOptions({dragging:!0,inertia:!rt,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xn=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new gi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}_e(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ye(this._map._container,"leaflet-grab"),ye(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=D(this._map.options.maxBounds);this._offsetLimit=R(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,r=(n+e+i)%t-e-i,s=Math.abs(o+i)<Math.abs(r+i)?o:r;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=s},_onDragEnd:function(t){var e=this._map,i=e.options,n=!i.inertia||this._times.length<2;if(e.fire("dragend",t),n)e.fire("moveend");else{this._prunePositions(+new Date);var o=this._lastPos.subtract(this._positions[0]),r=i.easeLinearity,s=o.multiplyBy(r/((this._lastTime-this._times[0])/1e3)),a=s.distanceTo([0,0]),u=Math.min(i.inertiaMaxSpeed,a),h=s.multiplyBy(u/a),l=u/(i.inertiaDeceleration*r),c=h.multiplyBy(-l/2).round();c.x||c.y?(c=e._limitOffset(c,e.options.maxBounds),M((function(){e.panBy(c,{duration:l,easeLinearity:r,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",Xn),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $n=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Ie(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ze(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,n=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(n,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;e<i;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;e<i;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;e<i;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;e<i;e++)n[o.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;e<i;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;e<i;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){Ie(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ze(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,n=this._map;if(i in this._panKeys)n._panAnim&&n._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=B(e).multiplyBy(3)),n.panBy(e),n.options.maxBounds&&n.panInsideBounds(n.options.maxBounds));else if(i in this._zoomKeys)n.setZoom(n.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!n._popup||!n._popup.options.closeOnEscapeKey)return;n.closePopup()}Ve(t)}}});ei.addInitHook("addHandler","keyboard",$n),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var to=di.extend({addHooks:function(){Ie(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ze(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var n=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o(this._performZoom,this),n),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var n=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,o=i?Math.ceil(n/i)*i:n,r=t._limitZoom(e+(this._delta>0?o:-o))-e;this._delta=0,this._startTime=null,r&&("center"===t.options.scrollWheelZoom?t.setZoom(e+r):t.setZoomAround(this._lastMousePos,e+r))}});ei.addInitHook("addHandler","scrollWheelZoom",to),ei.mergeOptions({tap:!0,tapTolerance:15});var eo=di.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ze(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(He(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new z(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&_e(i,"leaflet-active"),this._holdTimeout=setTimeout(o((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Ie(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ze(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ye(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new z(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Pt||Lt&&!ct||ei.addInitHook("addHandler","tap",eo),ei.mergeOptions({touchZoom:Pt&&!rt,bounceAtZoomLimits:!0});var io=di.extend({addHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ye(this._map._container,"leaflet-touch-zoom"),Ze(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(n)._divideBy(2))),this._startDist=i.distanceTo(n),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend",this._onTouchEnd,this),He(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),r=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(r,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&r<1||this._zoom>e.getMaxZoom()&&r>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===r)return}else{var s=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1===r&&0===s.x&&0===s.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(s),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),T(this._animRequest);var a=o(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=M(a,this,!0),He(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,T(this._animRequest),Ze(document,"touchmove",this._onTouchMove,this),Ze(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",io),ei.BoxZoom=Yn,ei.DoubleClickZoom=Qn,ei.Drag=Xn,ei.Keyboard=$n,ei.ScrollWheelZoom=to,ei.Tap=eo,ei.TouchZoom=io,t.version=e,t.Control=ni,t.control=oi,t.Browser=zt,t.Evented=S,t.Mixin=mi,t.Util=O,t.Class=A,t.Handler=di,t.extend=i,t.bind=o,t.stamp=s,t.setOptions=d,t.DomEvent=$e,t.DomUtil=ze,t.PosAnimation=ti,t.Draggable=gi,t.LineUtil=zi,t.PolyUtil=Bi,t.Point=z,t.point=B,t.Bounds=Z,t.bounds=R,t.Transformation=G,t.transformation=J,t.Projection=Ni,t.LatLng=j,t.latLng=F,t.LatLngBounds=N,t.latLngBounds=D,t.CRS=W,t.GeoJSON=hn,t.geoJSON=gn,t.geoJson=bn,t.Layer=Ui,t.LayerGroup=Wi,t.layerGroup=Hi,t.FeatureGroup=Vi,t.featureGroup=qi,t.ImageOverlay=wn,t.imageOverlay=xn,t.VideoOverlay=Ln,t.videoOverlay=Pn,t.SVGOverlay=Cn,t.svgOverlay=Mn,t.DivOverlay=Tn,t.Popup=On,t.popup=An,t.Tooltip=kn,t.tooltip=En,t.Icon=Gi,t.icon=Ji,t.DivIcon=Sn,t.divIcon=zn,t.Marker=Qi,t.marker=Xi,t.TileLayer=Zn,t.tileLayer=Rn,t.GridLayer=In,t.gridLayer=Bn,t.SVG=qn,t.svg=Gn,t.Renderer=jn,t.Canvas=Fn,t.canvas=Un,t.Path=$i,t.CircleMarker=tn,t.circleMarker=en,t.Circle=nn,t.circle=on,t.Polyline=rn,t.polyline=sn,t.Polygon=an,t.polygon=un,t.Rectangle=Jn,t.rectangle=Kn,t.Map=ei,t.map=ii;var no=window.L;t.noConflict=function(){return window.L=no,this},window.L=t})(l.exports);var c,p={exports:{}},d="object"==typeof Reflect?Reflect:null,f=d&&"function"==typeof d.apply?d.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};c=d&&"function"==typeof d.ownKeys?d.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var m=Number.isNaN||function(t){return t!=t};function _(){_.init.call(this)}p.exports=_,p.exports.once=function(t,e){return new Promise((function(i,n){function o(i){t.removeListener(e,r),n(i)}function r(){"function"==typeof t.removeListener&&t.removeListener("error",o),i([].slice.call(arguments))}T(t,e,r,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&T(t,"error",e,i)}(t,o,{once:!0})}))},_.EventEmitter=_,_.prototype._events=void 0,_.prototype._eventsCount=0,_.prototype._maxListeners=void 0;var y=10;function v(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function g(t){return void 0===t._maxListeners?_.defaultMaxListeners:t._maxListeners}function b(t,e,i,n){var o,r,s,a;if(v(i),void 0===(r=t._events)?(r=t._events=Object.create(null),t._eventsCount=0):(void 0!==r.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),r=t._events),s=r[e]),void 0===s)s=r[e]=i,++t._eventsCount;else if("function"==typeof s?s=r[e]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(o=g(t))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function w(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function x(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},o=w.bind(n);return o.listener=i,n.wrapFn=o,o}function P(t,e,i){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?i?[o.listener||o]:[o]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(o):M(o,o.length)}function C(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function M(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function T(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function o(r){n.once&&t.removeEventListener(e,o),i(r)}))}}Object.defineProperty(_,"defaultMaxListeners",{enumerable:!0,get:function(){return y},set:function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");y=t}}),_.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},_.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||m(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},_.prototype.getMaxListeners=function(){return g(this)},_.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var s=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw s.context=r,s}var a=o[t];if(void 0===a)return!1;if("function"==typeof a)f(a,this,e);else{var u=a.length,h=M(a,u);for(i=0;i<u;++i)f(h[i],this,e)}return!0},_.prototype.on=_.prototype.addListener=function(t,e){return b(this,t,e,!1)},_.prototype.prependListener=function(t,e){return b(this,t,e,!0)},_.prototype.once=function(t,e){return v(e),this.on(t,x(this,t,e)),this},_.prototype.prependOnceListener=function(t,e){return v(e),this.prependListener(t,x(this,t,e)),this},_.prototype.removeListener=function(t,e){var i,n,o,r,s;if(v(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(o=-1,r=i.length-1;r>=0;r--)if(i[r]===e||i[r].listener===e){s=i[r].listener,o=r;break}if(o<0)return this;0===o?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,o),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},_.prototype.off=_.prototype.removeListener,_.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var o,r=Object.keys(i);for(n=0;n<r.length;++n)"removeListener"!==(o=r[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},_.prototype.listeners=function(t){return P(this,t,!0)},_.prototype.rawListeners=function(t){return P(this,t,!1)},_.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):C.call(t,e)},_.prototype.listenerCount=C,_.prototype.eventNames=function(){return this._eventsCount>0?c(this._events):[]};var O=function(t){function i(){var e=t.call(this)||this;return e.name="CancelError",Object.setPrototypeOf(e,i.prototype),e}return e(i,t),i}(Error),A=function(){function t(t){void 0===t&&(t={}),this.options=t,this._promises=new Map}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._promises.size>0},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())},t.prototype.get=function(t){return this._promises.get(t)},t.prototype.add=function(t,e){var i=this,n=e||t,o=this._promises.get(n);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),o||(this._promises.set(n,t),t.finally((function(){i.remove(n)})),t)},t.prototype.abort=function(){this.isLoaded&&(this._promises.forEach((function(t){t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())},t.prototype.waitFunc=function(t,e){void 0===e&&(e="");var i=this.get(e=e||t.name);return i||this.add(t(),e)},t.prototype.WaitForMe=function(t){void 0===t&&(t="");var e=this.get.bind(this),i=this.add.bind(this);return function(n,o,r){var s=r.value;return t=t||o,r.value=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var r=e(t);return r||i(s.apply(this,n),t)},r}},t.prototype.GetOrCreateDecorator=function(t){return void 0===t&&(t=""),this.WaitForMe(t)},t.prototype._onStop=function(){this.options.onStop&&!this.isLoaded&&this.options.onStop()},t}(),k=function(t){function i(){var e=t.call(this)||this;return e.name="TimeoutError",Object.setPrototypeOf(e,i.prototype),e}return e(i,t),i}(Error),E=function(t,e,i,n){try{t(i(n))}catch(o){e(o)}},S=0,z=function(){function t(e,i){var n=this;this.id=S++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise((function(t,e){n._setCanceledCallback=function(e){return t(e||new O)}}));var o=[this._cancelPromise,new Promise((function(i,o){return e((function(e){e instanceof t?n.attach(e):n._isPending=!1,i(e)}),(function(t){n._isPending=!1,o(t)}),(function(t){if(!n._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");n._cancelHandlers.push(t)}))}))];i&&o.push(new Promise((function(t,e){setTimeout((function(){if(n._isPending)try{n.cancel()}finally{e(new k)}}),i)}))),this._promise=Promise.race(o)}return t.createControl=function(t){return new A(t)},t.resolve=function(e){return new t((function(t){return t(e)}))},t.reject=function(e){return new t((function(t,i){return i(e)}))},t.all=function(e){var i=this;return new t((function(t,i){Promise.all(e).then(t).catch(i)})).catch((function(t){if(t instanceof i.CancelError)for(var n=0,o=e;n<o.length;n++){var r=o[n];"cancel"in r&&r.cancel()}throw t}))},t.prototype.attach=function(t){this._isCanceled?t.cancel():this._children.push(t)},t.prototype.then=function(e,i){var n=this,o=new t((function(t,o){if(n._promise){var r=function(e){i?E(t,o,i,e):o(e)};n._promise.then((function(i){n._isCanceled?r(i):e?E(t,o,e,i):t(i)}),r)}}));return o._parentPromise=this,this._children.push(o),o},t.prototype.catch=function(t){return this._isCanceled&&t&&t(new O),this.then(void 0,t)},t.prototype.finally=function(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new O:t)},t.prototype.cancel=function(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;var t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((function(t){return t.cancel()})),this._isPending){if(this._cancelHandlers.length)try{for(var e=0,i=this._cancelHandlers;e<i.length;e++){(0,i[e])()}}catch(n){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this},t.prototype._getTopParent=function(){for(var t=this._parentPromise,e=!!t;e;)e=!(!t||!t._parentPromise)&&!!(t=t._parentPromise);return t},t.prototype._destroy=function(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0},t.CancelError=O,t.TimeoutError=k,t.PromiseControl=A,t}();function I(t,e,i){void 0===i&&(i={});var n=function(t,e){for(void 0===e&&(e=[]);null!==t;t=Object.getPrototypeOf(t))for(var i=Object.getOwnPropertyNames(t),n=0;n<i.length;n++)-1==e.indexOf(i[n])&&e.push(i[n]);return e}(t.prototype),o=void 0===i.replace||i.replace;e.forEach((function(e){Object.getOwnPropertyNames(e.prototype).forEach((function(i){var r=-1!==n.indexOf(i);if(!o&&!r||o){var s=Object.getOwnPropertyDescriptor(e.prototype,i);s&&Object.defineProperty(t.prototype,i,s)}}))}))}function B(t){return null!=t}function Z(t){return"string"==typeof t?!!t:B(t)}function R(t,e,i){void 0===i&&(i=!1);var n=t,o=e,r=Array.isArray(o),s=r&&[]||{};return r&&Array.isArray(o)?i?(s=s.concat(n=n||[]),o.forEach((function(t,e){void 0===s[e]?s[e]=t:"object"==typeof t?s[e]=R(n[e],t,i):-1===n.indexOf(t)&&s.push(t)}))):s=o:(n&&"object"==typeof n&&Object.keys(n).forEach((function(t){s[t]=n[t]})),Object.keys(o).forEach((function(t){s[t]="object"==typeof o[t]&&o[t]&&"object"==typeof n[t]&&"object"==typeof o[t]?R(n[t],o[t],i):o[t]}))),s}function N(t){!t.lngLat&&t.latLng&&(t.lngLat=[t.latLng.lng,t.latLng.lat]);return t}function D(t,e){var i;function n(){for(var o=this,r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];n.clear(),i=setTimeout((function(){i=null,t.apply(o,r)}),e)}return void 0===e&&(e=10),n.clear=function(){i&&(clearTimeout(i),i=null)},n}Object.setPrototypeOf(z.prototype,Promise.prototype);var j=6371;function F(t){return{type:"Polygon",coordinates:[U(t)]}}function U(t){var e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}var W=Math.PI/180,H=180/Math.PI;function V(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;var i=20037508.34*t/180,n=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return[i,n=20037508.34*n/180]}function q(t,e,i,n){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===n:G(t,e));return t===e}function G(t,e){var i=Object.keys(t).sort(),n=Object.keys(e).sort();if(i.length!==n.length)return!1;if(i.join("")!==n.join(""))return!1;for(var o=0;o<i.length;o++){if(!q(t[i[o]],e[n[o]],t,e))return!1}return!0}function J(t){var e={};return Object.keys(t).forEach((function(i){t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=J(t[i])})),e}function K(t){return"[object Object]"===Object.prototype.toString.call(t)}function Y(t){return t.replace(/([^:]\/)\/+/g,"$1")}function Q(t){return"[object Object]"===Object.prototype.toString.call(t)}function X(t){return"function"==typeof t}var $={get:function(t,e){return t.properties&&t.properties[e[0]]},match:function(t,e){var i=e[0],n=e.slice(1),o=i;Array.isArray(i)&&(o=tt(t,i));for(var r=n.splice(-1,n.length%2)[0],s=0;s<n.length-1;s+=2){if(n[s]===o)return n[s+1]}return r}};function tt(t,e){var i=e[0],n=e.slice(1),o=$[i];if(o)return o(t,n)}function et(t){return function(e){return tt(e,t)}}var it=["iconSize","iconAnchor"];function nt(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;var n,o="^".concat((n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")),"$").replace(/%/g,".*").replace("_",".");return null!==new RegExp(o,i?"i":"").exec(t)}var ot={gt:function(t,e){return t>e},lt:function(t,e){return t<e},ge:function(t,e){return t>=e},le:function(t,e){return t<=e},eq:function(t,e){return t===e},ne:function(t,e){return t!==e},in:function(t,e){return-1!==e.indexOf(t)},notin:function(t,e){return-1===e.indexOf(t)},like:function(t,e){return nt(t,e)},ilike:function(t,e){return nt(t,e,!0)}};function rt(t){return 3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function st(t,e){var i="string"==typeof e[0]?e[0]:"all",n=function(e){if(rt(e)){var i=e[0],n=e[1],o=e[2],r=ot[n];if(r){if(("like"===n||"ilike"===n)&&"string"==typeof i){var s="",a=i.replace(/^%?(\w+)%?$/,(function(e,n){return s=t[n],i.replace(n,o)}));return r(s,a)}return r(t[i],o)}return!1}return st(t,e)},o=e.filter((function(t){return Array.isArray(t)}));return"any"===i?o.some(n):o.every(n)}function at(t){for(var e={},n=[],o=0,r=t;o<r.length;o++){var s=r[o];s&&(Array.isArray(s)?n.push(s):e=s)}return function(t){var o=n.find((function(e){return function(t,e){var n=i({},t.properties);return!!n&&(n.$id=t.id,st(n,e))}(t,e[0])}));return o?i(i({},e),o[1]):e}}function ut(t,e,n){var o=function(t){var e=!1,n={};for(var o in t)if(-1===it.indexOf(o)){var r=o,s=t[r];Array.isArray(s)&&(e=!0,n[r]=et(s))}if(e)return function(e){var o={};for(var r in n)o[r]=n[r](e);return i(i({},t),o)}}(t);if(o){var r=function(t){return ht(o(t),e,n)};return r.paint=t,r}var s=i({},e);return(s=i(i({},s),t)).fill=void 0===s.fill||s.fill,s.stroke=void 0!==s.stroke?s.stroke:!s.fill||!(!s.strokeColor&&!s.strokeOpacity),s}function ht(t,e,n){if(!t)throw new Error("paint is empty");var o=i({},e);if(X(t)){var r=function(i){var o=ht(t(i),e,n);return o.type=t.type,o};return r.type=t.type,r}if(function(t){return!!Array.isArray(t)}(t))return function(i){return ht(at(t)(i),e,n)};if("get-paint"===t.type){var s=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){var i=e[t.from];if(i)return i(t.options)}}(t,n);s&&(o=ht(s,e,n))}else{if("icon"===t.type)return t;o=ut(t,e,n)}return X(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}function lt(t){for(var e,i={},n=0;n<t.length;n++)i[t[n]]=1+(i[t[n]]||0);for(var o in i){i[o]>((void 0!==e?i[e]:0)||0)&&(e=o)}return e}var ct={polygon:"path",line:"path",point:"circle"},pt={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function dt(t){if(t.data){var e=pt[function(t){var e;e="FeatureCollection"===t.type?lt(t.features.map((function(t){return t.geometry.type}))):"GeometryCollection"===t.type?lt(t.geometries.map((function(t){return t.type}))):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&Q(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":ct[e]),t.type=t.type||e}return t}var ft=function(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222},mt=function(){function t(){this.keyCodeAlias=new ft,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}return t.prototype.pressed=function(t){var e=this.keyCodeAlias[t];return!!e&&this.keys[e]},t.prototype.addKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))},t.prototype.removeKeyboardEventsListener=function(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))},t.prototype.keysPressed=function(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)},t.prototype.keysReleased=function(t){t.stopPropagation(),this.keys[t.keyCode]=!1},t.prototype.windowOnFocus=function(){this.keys={}},t}(),_t=function(){function t(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}return t.prototype.getValue=function(){return this.value},t.prototype.setValue=function(t){this.value=t},t}(),yt=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="center",e.event="moveend",e}return e(i,t),i.prototype.getValue=function(){return this.webMap.getCenter()},i.prototype.setValue=function(t){this.webMap.setCenter(t)},i.prototype.toString=function(t){var e=t.map((function(t){return t.toFixed(5)}));return e[0]+"_"+e[1]},i.prototype.parse=function(t){return t.split("_").map(Number)},i}(_t),vt=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="zoom",e.event="zoomend",e}return e(i,t),i.prototype.getValue=function(){var t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0},i.prototype.setValue=function(t){this.webMap.setZoom(t)},i.prototype.toString=function(t){return String(t)},i.prototype.parse=function(t){return Number(t)},i}(_t);var gt=0,bt={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0},wt=function(t){function n(e){var i=t.call(this,e)||this;i._layersIdCounter=1,i._layersOrderCounter=1,i._baselayers=[],i._layers={},i._selectedLayers=[];var n=i.options.tileJson;return n&&i.emitter.once("build-map",(function(){return i.addTileJsonLayer(n)})),i}return e(n,t),n.prototype.fitLayer=function(t,e){return o(this,void 0,void 0,(function(){var i,n,o;return r(this,(function(r){switch(r.label){case 0:return i=this.getLayer(t),(n=i&&(i.getBounds||i.getExtent))?[4,n.call(i)]:[3,2];case 1:(o=r.sent())&&this.fitBounds(o,e),r.label=2;case 2:return[2]}}))}))},n.prototype.isBaseLayer=function(t){var e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)},n.prototype.getBaseLayers=function(){var t=this,e=[];return this._baselayers.forEach((function(i){var n=t._layers[i];n&&e.push(n)})),e},n.prototype.getBaseLayersIds=function(){return this._baselayers},n.prototype.getLayer=function(t){return"string"==typeof t?this._layers[t]:t},n.prototype.getLayerId=function(t){var e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")},n.prototype.getLayers=function(){return Object.keys(this._layers)},n.prototype.allLayers=function(){return this._layers},n.prototype.orderedLayers=function(){return Object.values(this._layers).sort((function(t,e){return t.order&&e.order?t.order-e.order:0}))},n.prototype.findLayer=function(t){for(var e in this._layers){var i=this._layers[e];if(t(i))return i}},n.prototype.isLayerVisible=function(t){var e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility},n.prototype.addBaseLayer=function(t,e){return o(this,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return[4,this.addLayer(t,i(i({},e),{baselayer:!0}),void 0)];case 1:return[2,n.sent()]}}))}))},n.prototype.addLayer=function(t,e,n){var s,a;return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var o,u,h,l,c,p,d,f,m,_,y,v;return r(this,(function(r){switch(r.label){case 0:return o=this._layersIdCounter++,u=B(n)?n:void 0!==e.order?e.order:this.reserveOrder(),"string"!=typeof t?[3,1]:(h=this.getLayerAdapter(t),[3,4]);case 1:return"function"!=typeof t?[3,2]:(h=t,[3,4]);case 2:return"then"in t?[4,t]:[3,4];case 3:h=r.sent(),r.label=4;case 4:return this._updateGeoJsonOptions(l=e),e=i({id:String(o),order:u},e),c=null===(s=e.visibility)||void 0===s||s,e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer&&(p=this.options.onBeforeAddLayer({options:e,adapter:h}))&&(p.options&&(e=p.options),p.adapter&&(h=p.adapter)),void 0===h?[3,12]:((d=new h(this.mapAdapter.map,e)).options=i(i({},e),d.options),d.options.baselayer&&(e.baselayer=!0,e.order=0,d.options.order=0),f=void 0,d.options.id&&(f=String(d.options.id),this._layers[f]=d),this._emitLayerEvent("layer:preadd",f||"",d),[4,this.onMapLoad()]);case 5:return r.sent(),d.map=this.mapAdapter.map,[4,d.addLayer(d.options)];case 6:if(m=r.sent(),d.layer=m,d.id=d.options.id||String(o),d.options.id=d.id,e.baselayer&&(d.options.order=0),d.order=null!==(a=d.options.order)&&void 0!==a?a:u,f&&delete this._layers[f],f=String(d.id),this._layers[f])throw Error("layer with id '".concat(f,"' already exist"));return f?(this._layers[f]=d,l.filter&&this.filterLayer(d,l.filter),e.baselayer&&this._baselayers.push(f),c?[4,this.showLayer(f)]:[3,8]):[3,8];case 7:r.sent(),r.label=8;case 8:return void 0!==(_=e.opacity)&&_<=1&&this.setLayerOpacity(d,_),y=m&&(d.getBounds||d.getExtent),e.fit&&y?[4,y.call(d)]:[3,11];case 9:return(v=r.sent())?[4,this.fitBounds(v)]:[3,11];case 10:r.sent(),r.label=11;case 11:return e.onAdded&&e.onAdded(d),this._emitLayerEvent("layer:add",f,d),[2,d];case 12:return[2,Promise.reject("No adapter")]}}))}))},n.prototype.addLayerFromAsyncAdapter=function(t,e,i){return o(this,void 0,void 0,(function(){var n,o;return r(this,(function(r){switch(r.label){case 0:return n=i||void 0!==e.order?e.order:this.reserveOrder(),[4,t()];case 1:return(o=r.sent())?[2,this.addLayer(o,e,n)]:[2,Promise.reject("No adapter")]}}))}))},n.prototype.removeLayers=function(t){for(var e in this._layers){var i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}},n.prototype.reserveOrder=function(){return this._layersOrderCounter++},n.prototype.removeOverlays=function(){this.removeLayers((function(t,e){return!(e&&e.options&&e.options.baselayer)}))},n.prototype.removeLayer=function(t){var e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){var n=this._baselayers.indexOf(i);n&&this._baselayers.splice(n,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}},n.prototype.addGeoJsonLayer=function(t,e){return void 0===t&&(t={}),(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=dt(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)},n.prototype.addFeatureLayer=function(t){return void 0===t&&(t={}),this.addGeoJsonLayer(t)},n.prototype.addTileLayer=function(t,e){return void 0===e&&(e={}),this.addLayer("TILE",i(i({},e),{url:t}))},n.prototype.addImageLayer=function(t,e){var n;return"string"==typeof t?n=t:(n=t.url,e=t),this.addLayer("IMAGE",i(i({},e),{url:n}))},n.prototype.showLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!0,e)},n.prototype.hideLayer=function(t,e){return void 0===e&&(e={}),this.toggleLayer(t,!1,e)},n.prototype.toggleLayer=function(t,e,i){var n=this;void 0===i&&(i={});var s=this.getLayer(t),a=void 0!==e?e:!(s&&s.options.visibility),u=void 0!==i.silent&&i.silent;return s?this.onMapLoad().then((function(){return t=s,o(n,void 0,void 0,(function(){var e,i,n,o,s,h,l,c=this;return r(this,(function(r){switch(r.label){case 0:if(e=String(t.id),i=a?"layer:preshow":"layer:prehide",n=a?"layer:show":"layer:hide",u||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:pretoggle",e,t)),!a||!this.mapAdapter)return[3,9];if(o=t.options.baselayer?0:t.options.order,!t.options.baselayer||!this._baselayers.length)return[3,4];s=this._baselayers.filter((function(e){return e!==t.id&&c.isLayerVisible(e)})),h=0,l=s,r.label=1;case 1:return h<l.length?[4,this.hideLayer(l[h])]:[3,4];case 2:r.sent(),r.label=3;case 3:return h++,[3,1];case 4:return t.showLayer?[4,t.showLayer.call(t,t.layer)]:[3,6];case 5:return r.sent(),[3,8];case 6:return void 0===t.layer?[3,8]:[4,this.mapAdapter.showLayer(t.layer)];case 7:r.sent(),r.label=8;case 8:return void 0!==o&&this.mapAdapter.setLayerOrder(t.layer,o,this._layers),[3,13];case 9:return t.hideLayer?[4,t.hideLayer.call(t,t.layer)]:[3,11];case 10:return r.sent(),[3,13];case 11:return void 0===t.layer?[3,13]:[4,this.mapAdapter.hideLayer(t.layer)];case 12:r.sent(),r.label=13;case 13:return t.options.visibility=a,u||(this._emitLayerEvent(n,e,t),this._emitLayerEvent("layer:toggle",e,t)),[2]}}))}));var t})):Promise.resolve()},n.prototype.updateLayer=function(t){var e=this,i=this.getLayer(t);if(i){if(i.updateLayer)return Promise.resolve(i.updateLayer());if(this.isLayerVisible(i))return this.hideLayer(i,{silent:!0}).then((function(){return e.showLayer(i,{silent:!0})}))}return Promise.resolve()},n.prototype.setLayerOpacity=function(t,e){var i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))},n.prototype.isLayerLabelVisible=function(t){var e,i=this.getLayer(t);return i.isLabelVisible?i.isLabelVisible():null===(e=i.options.labelVisibility)||void 0===e||e},n.prototype.showLayerLabel=function(t){this.toggleLayerLabel(t,!0)},n.prototype.hideLayerLabel=function(t){this.toggleLayerLabel(t,!1)},n.prototype.toggleLayerLabel=function(t,e){var i=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),i&&(e?i.showLabel&&(i.options.labelVisibility=!0,i.showLabel()):i.hideLabel&&(i.options.labelVisibility=!1,i.hideLabel()),i.id&&this._emitLayerEvent("layer:label:toggle",i.id,i)),e},n.prototype.selectLayer=function(t,e){var i=this.getLayer(t);if(i){i&&i.select&&i.select(e);var n=this.getLayerId(i);n&&this._selectedLayers.push(n)}},n.prototype.unSelectLayer=function(t,e){var i=this.getLayer(t);if(i){var n=i&&i;n.unselect&&n.unselect(e);var o=this.getLayerId(i);if(o){var r=this._selectedLayers.indexOf(o);-1!==r&&this._selectedLayers.splice(r,1)}}},n.prototype.unSelectLayers=function(){for(var t,e=0,i=Object.values(this.allLayers());e<i.length;e++)(t=i[e]).unselect&&t.unselect()},n.prototype.filterLayer=function(t,e){var i=this.getLayer(t);return i.filter?i.filter(e):[]},n.prototype.propertiesFilter=function(t,e,i){var n=this.getLayer(t);if(n){var o=n;if(o.propertiesFilter)return o.propertiesFilter(e,i);o.filter&&this.filterLayer(o,(function(t){return!t.feature||!t.feature.properties||st(t.feature.properties,e)}))}return Promise.resolve()},n.prototype.removeLayerFilter=function(t){var e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((function(){return!0}))},n.prototype.setLayerData=function(t,e){var i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()},n.prototype.addLayerData=function(t,e){var i=this.getLayer(t);i.addData&&i.addData(e)},n.prototype.clearLayerData=function(t,e){var i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)},n.prototype.setLayerPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)},n.prototype.setLayerSelectedPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)},n.prototype.updateLayerPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)},n.prototype.updateLayerSelectedPaint=function(t,e){var i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)},n.prototype.getAttributions=function(t){var e=[];for(var i in this._layers){var n=this._layers[i],o=!(void 0===t.onlyVisible||t.onlyVisible)||n.options.visibility;if(o&&t.onlyBaselayer&&(o=this._baselayers.includes(i)),o){var r=n.options&&n.options.attribution;r&&e.push(r)}}return e},n.prototype.getActiveBaseLayer=function(){var t=this,e=this.getBaseLayers().find((function(e){return t.isLayerVisible(e)}));if(e)return this.getLayer(e)},n.prototype.addTileJsonLayer=function(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})},n.prototype._emitLayerEvent=function(t,e,i){var n=String(t);if(B(e)&&n.startsWith("layer:")){var o=n.replace("layer:","layer-"+e+":");this.emitter.emit(o,i)}this.emitter.emit(t,i)},n.prototype._onLayerClick=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return this._emitLayerEvent("layer:click",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},n.prototype._onLayerSelect=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return this._emitLayerEvent("layer:select",t.layer.id||"",t),[2,Promise.resolve(t)]}))}))},n.prototype._updateGeoJsonOptions=function(t){var e=this,i=t.onSelect,n=t.onLayerSelect,o=t.onMouseOut,r=t.onMouseOver,s=t.onClick||t.onLayerClick;t.onClick=function(t){return s&&s(t),e._onLayerClick(t)},t.onMouseOut=function(t){var i=t.layer.id;o&&o(t),B(i)&&e._emitLayerEvent("layer:mouseout",i,t)},t.onMouseOver=function(t){var i=t.layer.id;r&&r(t),B(i)&&e._emitLayerEvent("layer:mouseover",i,t)};var a=i||n;t.onSelect=function(t){return a&&a(t),e._onLayerSelect(t)},t.nativePaint||(this.options.paint&&(t.paint=ht(t.paint||{},this.options.paint,this.getPaintFunctions)),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=ht(t.selectedPaint,this.options.selectedPaint,this.getPaintFunctions)))},n}(function(){function t(e){this.options=bt,this.emitter=new p.exports.EventEmitter,this.keys=t.keys,this.runtimeParams=[],this.getPaintFunctions=t.getPaintFunctions,this.mapState=[yt,vt],this.id=gt++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=e.mapAdapter,this._starterKits=e.starterKits||[],e&&(this.options=R(bt||{},e)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}return t.prototype.getId=function(){return this.id},t.prototype.create=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return this.getEventStatus("create")?[3,3]:[4,this._setInitMapState(this.mapState)];case 1:return t.sent(),[4,this._setupMap()];case 2:t.sent(),this._emitStatusEvent("create",this),t.label=3;case 3:return[2,this]}}))}))},t.prototype.setRuntimeParams=function(t){this.runtimeParams.push(t)},t.prototype.destroy=function(){this._removeEventListeners(),function(t){for(var e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()},t.prototype.getState=function(){var t={};return this._mapState.forEach((function(e){t[e.name]=e.getValue()})),t},t.prototype.getRuntimeParams=function(){var t=this,e={};return this._mapState.forEach((function(i){for(var n=0,o=t.runtimeParams;n<o.length;n++){var r=o[n].get(i.name);if(void 0!==r){e[i.name]=i.parse(r);break}}})),e},t.prototype.getContainer=function(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){var t=document.getElementById(this.options.target);if(t)return t}}},t.prototype.setCursor=function(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)},t.prototype.getCursor=function(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();var t=this.getContainer();return t?t.style.cursor:void 0},t.prototype.setCenter=function(t){return this.mapAdapter.setCenter(t),this},t.prototype.getCenter=function(){return this.mapAdapter.getCenter()},t.prototype.getBounds=function(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()},t.prototype.getBoundsPolygon=function(){var t=this.getBounds();if(t)return{type:"Feature",properties:{},geometry:F(t)}},t.prototype.setZoom=function(t){return this.mapAdapter.setZoom(t),this},t.prototype.getZoom=function(){var t=this.mapAdapter.getZoom();if("number"==typeof t)return t},t.prototype.zoomIn=function(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t+1)}},t.prototype.zoomOut=function(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{var t=this.getZoom();if(void 0!==t)this.setZoom(t-1)}},t.prototype.setView=function(t,e){if(Array.isArray(t)){var i=t;this.mapAdapter.setView&&i&&B(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),B(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}},t.prototype.fitBounds=function(t,e){return t.every((function(t){return B(t)}))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this},t.prototype.getEventStatus=function(t){var e=this._eventsStatus[t];return null!=e&&e},t.prototype.onLoad=function(t){var e=this;return void 0===t&&(t="create"),new Promise((function(i){e.getEventStatus(t)?i(e):e.emitter.once(t,(function(){i(e)}))}))},t.prototype.onMapLoad=function(t){var e=this;return new Promise((function(i){var n,o=function(){var n=e.mapAdapter;t&&t(n),n&&i(n)},r=null===(n=e.mapAdapter.isLoaded)||void 0===n||n;e.mapAdapter.map&&r?o():e.mapAdapter.emitter.once("create",(function(){o()}))}))},t.prototype.getLayerAdapters=function(){return this.mapAdapter.layerAdapters},t.prototype.getLayerAdapter=function(t){return this.mapAdapter.layerAdapters[t]},t.prototype.locate=function(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:function(){return{}}}},t.prototype.stopGetCoordFromMapClick=function(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()},t.prototype.getCoordFromMapClick=function(){var t=this;return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new z((function(e,i,n){var o=t.getCursor()||"grab";t._removeEventListeners({include:["click"]}),t.setCursor("crosshair");var r=function(){t.setCursor(o),t._addEventsListeners({include:["click"]}),t.mapAdapter.emitter.off("click",s),t._coordFromMapClickPromise=void 0},s=function(t){r(),N(t),e(t.lngLat)};t.mapAdapter.emitter.once("click",s),n(r)})),this._coordFromMapClickPromise)},t.prototype._emitStatusEvent=function(t,e){var i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)},t.prototype._addLayerProviders=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return[2]}))}))},t.prototype._onLoadSync=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return[2]}))}))},t.prototype._setupMap=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return[4,this.mapAdapter.create(this.options)];case 1:return t.sent(),this._zoomToInitialExtent(),[4,this._addLayerProviders()];case 2:return t.sent(),[4,this._onLoadSync()];case 3:return t.sent(),this._emitStatusEvent("build-map",this.mapAdapter),[2,this]}}))}))},t.prototype._setTileJsonOptions=function(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),B(t.maxzoom)&&(this.options.zoom=t.maxzoom),B(t.minzoom)&&(this.options.zoom=t.minzoom),B(t.maxzoom)&&B(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)},t.prototype._zoomToInitialExtent=function(){var t,e=(t=this.options).center,i=t.zoom,n=t.bounds;this._extent?this.fitBounds(this._extent):e&&i?this.setView(e,i):n&&this.fitBounds(n)},t.prototype._setInitMapState=function(t){for(var e=0,i=t;e<i.length;e++){var n=new(0,i[e])(this);this._mapState.push(n);for(var o=0,r=this.runtimeParams;o<r.length;o++){var s=r[o].get(n.name);if(void 0!==s){var a=n.parse(s);this._initMapState[n.name]=a,Object.defineProperty(this.options,n.name,{value:a,configurable:!0,enumerable:!0});break}}}},t.prototype._addEventsListeners=function(t){var e=this,i=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(i=i.filter((function(e){return t.include.includes(e)}))),i.forEach((function(t){e._mapEvents[t]=function(i){if(e.runtimeParams.length){var n=e._mapState.find((function(e){return e.event===t}));if(n){var o=n.toString(n.getValue());e.runtimeParams.forEach((function(t){t.set(n.name,o)}))}}e._eventsStatus&&e.emitter.emit(t,i)};var i=e._mapEvents[t];i&&e.mapAdapter.emitter.on(t,i)}))},t.prototype._removeEventListeners=function(t){var e=this,i=Object.entries(this._mapEvents);t&&t.include&&(i=i.filter((function(e){return t.include.includes(e[0])}))),i.forEach((function(t){var i=t[1];i&&e.mapAdapter.emitter.removeListener(t[0],i)}))},t.keys=new mt,t}());function xt(t,e){var i=document.createElement("div"),n=!1;e.getStatus?n=e.getStatus():e.status&&(n=e.status);var o=e.title||"",r=e.html;function s(){o&&(i.title="string"==typeof o?o:n?o.on:o.off,i.setAttribute("aria-label",i.title))}function a(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function u(){r&&("string"==typeof r||r instanceof HTMLElement?a(r):a(n?r.on:r.off),i.setAttribute("aria-label",i.title))}function h(t,e){t.split(" ").forEach((function(t){e?i.classList.add(t):i.classList.remove(t)}))}function l(){e.addClassOn&&h(e.addClassOn,n),e.addClassOff&&h(e.addClassOff,!n)}s(),u(),e.addClass&&h(e.addClass,!0),l();var c=function(t){void 0!==t&&(n=t),u(),s(),l()},p=function(t){if(n=void 0!==t?t:!n,e.onClick){var i=e.onClick(n);Promise.resolve(i).then((function(){return c()})).catch((function(){return n=!n}))}else c()},d=t({html:i,onClick:p});return d.onClick=p,d.changeStatus=c,d}var Lt=function(t){function i(){var e=null!==t&&t.apply(this,arguments)||this;return e._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},e._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1},e}return e(i,t),i.prototype.addControl=function(t,e,i){return o(this,void 0,void 0,(function(){var n,s=this;return r(this,(function(a){return e=null!=e?e:"top-left",(n="string"==typeof t?this.getControl(t,i):t)?[2,new Promise((function(t){s._setControlQueue(e,(function(){return o(s,void 0,void 0,(function(){var i,o;return r(this,(function(r){switch(r.label){case 0:return[4,n];case 1:return i=r.sent(),o=this.mapAdapter.addControl(i,e),t(o),[2]}}))}))}))}))]:[2]}))}))},i.prototype.createControl=function(t,e){return o(this,void 0,void 0,(function(){return r(this,(function(i){switch(i.label){case 0:return[4,this.onLoad("build-map")];case 1:return i.sent(),this.mapAdapter.createControl?[2,this.mapAdapter.createControl(t,e)]:[2]}}))}))},i.prototype.createButtonControl=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createButtonControl?[2,this.mapAdapter.createButtonControl(t)]:[2]}}))}))},i.prototype.createToggleControl=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,this.onLoad("build-map")];case 1:return e.sent(),this.mapAdapter.createToggleControl?[2,this.mapAdapter.createToggleControl(t)]:this.mapAdapter.createButtonControl?[2,xt(this.mapAdapter.createButtonControl,t)]:[2]}}))}))},i.prototype.removeControl=function(t){var e=this;"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((function(t){e.mapAdapter.removeControl(t)}))},i.prototype.getControl=function(t,e){var n=this.mapAdapter.controlAdapters[t];if(n)return new n(e);var o=i.controls[t];return o?o(this,e):void 0},i.prototype.getControlContainer=function(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()},i.prototype._setControlQueue=function(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)},i.prototype._applyControls=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return this._loadControlQueue[t].length?(this._isControlLoading[t]=!0,[4,(0,this._loadControlQueue[t][0])()]):[3,2];case 1:return e.sent(),this._loadControlQueue[t].splice(0,1),this._applyControls(t),[3,3];case 2:this._isControlLoading[t]=!1,e.label=3;case 3:return[2]}}))}))},i.controls={CONTROL:function(t,e){return t.createControl(e.control,e.options)},BUTTON:function(t,e){return t.createButtonControl(e)},TOGGLE:function(t,e){return t.createToggleControl(e)}},i}(wt),Pt={};var Ct=function(t){function i(e){var i=t.call(this,e)||this;return i._addControls(),Pt[i.id]=i,i}return e(i,t),i.get=function(t){return function(t){return Pt[t]}(t)},i.prototype._addLayerProviders=function(){var t,e,i,n,s,a;return o(this,void 0,void 0,(function(){var o,h,l,c,p,d,f,m,_,y,v,g;return r(this,(function(r){switch(r.label){case 0:r.trys.push([0,18,19,24]),o=!0,h=u(this._starterKits),r.label=1;case 1:return[4,h.next()];case 2:return l=r.sent(),(t=l.done)?[3,17]:(o=!1,(c=l.value).getLayerAdapters?[4,c.getLayerAdapters.call(c)]:[3,16]);case 3:if(!(p=r.sent()))return[3,16];r.label=4;case 4:r.trys.push([4,10,11,16]),d=!0,s=void 0,f=u(p),r.label=5;case 5:return[4,f.next()];case 6:return m=r.sent(),(n=m.done)?[3,9]:(d=!1,[4,(_=m.value).createAdapter(this)]);case 7:(y=r.sent())&&(this.mapAdapter.layerAdapters[_.name]=y),r.label=8;case 8:return d=!0,[3,5];case 9:return[3,16];case 10:return v=r.sent(),s={error:v},[3,16];case 11:return r.trys.push([11,,14,15]),d||n||!(a=f.return)?[3,13]:[4,a.call(f)];case 12:r.sent(),r.label=13;case 13:return[3,15];case 14:if(s)throw s.error;return[7];case 15:return[7];case 16:return o=!0,[3,1];case 17:return[3,24];case 18:return g=r.sent(),e={error:g},[3,24];case 19:return r.trys.push([19,,22,23]),o||t||!(i=h.return)?[3,21]:[4,i.call(h)];case 20:r.sent(),r.label=21;case 21:return[3,23];case 22:if(e)throw e.error;return[7];case 23:return[7];case 24:return[2]}}))}))},i.prototype._onLoadSync=function(){var t,e,i;return o(this,void 0,void 0,(function(){var n,o,s,a,h,l;return r(this,(function(r){switch(r.label){case 0:r.trys.push([0,8,9,14]),n=!0,o=u(this._starterKits),r.label=1;case 1:return[4,o.next()];case 2:if(s=r.sent(),t=s.done)return[3,7];if(n=!1,!(a=s.value).onLoadSync)return[3,6];r.label=3;case 3:return r.trys.push([3,5,,6]),[4,a.onLoadSync.call(a,this)];case 4:return r.sent(),[3,6];case 5:return h=r.sent(),console.error(h),[3,6];case 6:return n=!0,[3,1];case 7:return[3,14];case 8:return l=r.sent(),e={error:l},[3,14];case 9:return r.trys.push([9,,12,13]),n||t||!(i=o.return)?[3,11]:[4,i.call(o)];case 10:r.sent(),r.label=11;case 11:return[3,13];case 12:if(e)throw e.error;return[7];case 13:return[7];case 14:return[2]}}))}))},i.prototype._addControls=function(){var t=this;this.options.controls&&this.options.controls.forEach((function(e){var i=e,o={};"string"==typeof e&&t.options.controlsOptions&&t.options.controlsOptions[e]&&void 0!==(o=t.options.controlsOptions[e]).control&&(i=o.control);var r=o.position,s=n(o,["position"]);t.addControl(i,r||"top-left",s)})),this._emitStatusEvent("controls:create")},i}(Lt);var Mt,Tt=function(){function t(e){var i;void 0===e&&(e={}),this.cache=[];var n=null!==(i=e.namespace)&&void 0!==i?i:"default";return t.instance[n]?t.instance[n]:(t.instance[n]=this,this)}return t.prototype.clean=function(){this.cache.length=0},t.prototype.all=function(){return this.cache},t.prototype.addFull=function(t,e,i){return this.add(t,e,i,!0)},t.prototype.add=function(t,e,i,n){var o=this,r=this._find(t,i);if(r)return r.value;var s=void 0;s=e instanceof Function?e():e;var a=i&&JSON.parse(JSON.stringify(J(i))),u={key:t,value:s,props:a,options:a};return n&&!Z(s)?s:(this.cache.push(u),s instanceof Promise?(s.catch((function(e){throw o.delete(t,i),e})),n&&s.then((function(e){return Z(e)||o.delete(t,i),e})),s):s)},t.prototype.match=function(t,e){var i=this._find(t,e);if(i)return i.value},t.prototype.matchAll=function(t,e){var i=this;return t?this.cache.filter((function(n){return i._filter(n,t,e)})).map((function(t){return t.value})):this.cache.map((function(t){return t.value}))},t.prototype.delete=function(t,e){var i=this,n=[];"string"==typeof t?n=this.cache.filter((function(n){return i._filter(n,t,e)})):n.push(t);for(var o=0,r=n;o<r.length;o++){var s=this.cache.indexOf(r[o]);this.cache.splice(s,1)}},t.prototype._find=function(t,e){var i=this;return this.cache.find((function(n){return i._filter(n,t,e)}))},t.prototype._filter=function(t,e,i){return t.key===e&&(!i||G(t.props||t.options||{},J(i)))},t.instance={},t}(),Ot=function(t){function i(e){var n=t.call(this)||this;return n.name="NetworkError",Object.setPrototypeOf(n,i.prototype),n.message="Unable to request ".concat(e,".\n Possibly invalid NGW URL entered or CORS not configured to get request from ").concat(location.origin),n}return e(i,t),i}(Error),At=function(t){function i(e){var n=t.call(this)||this;return n.name="NgwError",Object.assign(n,e),Object.setPrototypeOf(n,i.prototype),n}return e(i,t),i}(Error);function kt(t){return"[object Object]"===Object.prototype.toString.call(t)}Mt=function(t,e,i,n,o){void 0===i&&(i={}),i.method=i.method||"GET";var r=new XMLHttpRequest;r.open(i.method||"GET",t,!0),"blob"===i.responseType&&(r.responseType=i.responseType);var s=function(){try{return JSON.parse(r.responseText)}catch(t){return r.responseText}};r.onload=function(){-1!==[401,403,404,422,500].indexOf(r.status)&&n(new At(s())),function(t){void 0===t&&(t=!1);var o=t?n:e;"blob"===i.responseType?o(r.response):r.responseText?o(s()):n({message:""})}()},r.onerror=function(e){n(0===r.status?new Ot(t):e)},r.upload.onprogress=function(t){t.lengthComputable&&(i.onProgress&&i.onProgress(t.loaded/t.total*100,t))};var a,u=i.headers;if(u)for(var h in u){var l=u[h];"string"==typeof l&&r.setRequestHeader(h,l)}if(void 0!==i.withCredentials&&(r.withCredentials=i.withCredentials),i.file){if((a=new FormData).append("file",i.file),i.data)for(var c in i.data)a.append(c,a[c])}else a=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;o&&o((function(){r.abort()})),r.send(a)};var Et=/\{ *([\w_-]+) *\}/g;function St(t,e){return t.replace(Et,(function(t,i){var n=e[i];if(void 0===n)throw new Error("No value provided for letiable "+t);return"function"==typeof n&&(n=n(e)),n}))}var zt=function(t){function i(e){var n=t.call(this,e)||this;return n.name="ResourceNotFoundError",n.exception="nextgisweb.resource.exception.ResourceNotFound",Object.setPrototypeOf(n,i.prototype),n}return e(i,t),i}(At),It=function(t){function i(e){var n=t.call(this,e)||this;return n.name="InsufficientPermissionsError",n.exception="nextgisweb.core.exception.InsufficientPermissions",Object.setPrototypeOf(n,i.prototype),n}return e(i,t),i}(At),Bt=[];function Zt(t){Bt.push(t)}var Rt=["description"];function Nt(t,e){void 0===e&&(e=""),e=e?e+"__":"";for(var i={},n=0,o=Object.entries(t);n<o.length;n++){var r=o[n],s=r[0],a=r[1];if(-1===Rt.indexOf(s))if(kt(a))if("owner_user"===s){var u=Nt(a,s);Object.assign(i,u)}else"parent"===s&&"id"in a&&(i.parent_id=a.id);else B(a)&&(i[e+s]=a)}return i}var Dt=function(){function t(t){this.connector=t,this.cache=new Tt}return t.prototype.getOne=function(t,e){var n=this,o=new Tt,r={},s=i(i({},e),{cache:!1});"string"==typeof t?r.keyname=t:"number"==typeof t?r.id=t:kt(t)&&(void 0!==t.id?r.id=t.id:t.keyname&&(r.keyname=t.keyname));return o.addFull("resource",(function(){return"string"==typeof t?n._fetchResourceBy({keyname:t},s):"number"==typeof t?n._fetchResourceById(t,s):kt(t)?n._fetchResourceBy(t,s):z.resolve(void 0)}),r)},t.prototype.getOneOrFail=function(t,e){return this.getOne(t,e).then((function(t){if(t)return t;throw new zt}))},t.prototype.getId=function(t,e){return"number"==typeof t?z.resolve(t):"string"==typeof t||kt(t)?this.getOne(t,e).then((function(t){if(t)return t.resource.id})):z.resolve(void 0)},t.prototype.getIdOrFail=function(t,e){return this.getId(t,e).then((function(t){if(void 0===t)throw new Error;return t}))},t.prototype.getMany=function(t,e){var n=this;return this._resourceCacheFilter(t).then((function(o){if(!o.length){var r={};return t.keyname?r.keyname=t.keyname:Object.assign(r,Nt(t)),n.connector.get("resource.search",e,i({serialization:"full"},r)).then((function(t){if(t)for(var e=0,i=t;e<i.length;e++){var o=i[e];n.cache.add("resource.item",z.resolve(o),{id:o.resource.id})}return t}))}return o}))},t.prototype.getParent=function(t,e){var i=this;return this.getOne(t,e).then((function(t){return t?i.getOne(t.resource.parent.id,e):z.resolve(void 0)}))},t.prototype.getChildrenOf=function(t,e){var i=this;return this.getIdOrFail(t).then((function(t){return i._getChildrenOf(t,e)}))},t.prototype.update=function(t,e){var i=this;return this.getId(t).then((function(t){if(void 0!==t)return i.connector.put("resource.item",{data:e},{id:t})}))},t.prototype.delete=function(t){var e=this;return this.getId(t).then((function(t){if(void 0!==t)return e.connector.delete("resource.item",null,{id:t}).then((function(){e._cleanResourceItemCache(t)}))}))},t.prototype._getChildrenOf=function(t,e,n){var o=this;return void 0===n&&(n=[]),this.connector.get("resource.collection",i({cache:!0},e),{parent:t}).then((function(t){for(var i=[],r=0,s=t;r<s.length;r++){var a=s[r];o.cache.add("resource.item",z.resolve(a),{id:a.resource.id}),n.push(a),(null==e?void 0:e.recursive)&&a.resource.children&&i.push(o._getChildrenOf(a.resource.id,e,n))}return i.length?z.all(i).then((function(){return n})):n}))},t.prototype._cleanResourceItemCache=function(t){return o(this,void 0,void 0,(function(){var e,i,n,o,s,a,u,h;return r(this,(function(r){switch(r.label){case 0:e=this.cache.all(),i=[],n=0,o=e,r.label=1;case 1:return n<o.length?(a=(s=o[n]).options&&s.options.id,["resource.item","resource"].includes(s.key)&&void 0!==a?"number"!=typeof a?[3,2]:(a===t&&i.push(s),[3,4]):[3,4]):[3,5];case 2:return[4,this.getId(a)];case 3:r.sent()===t&&i.push(s),r.label=4;case 4:return n++,[3,1];case 5:for(u=0,h=i;u<h.length;u++)this.cache.delete(h[u]);return[2]}}))}))},t.prototype._fetchResourceById=function(t,e){var i=this;return this.cache.add("resource.item",(function(){return i.connector.get("resource.item",e,{id:t})}),{id:t}).catch((function(t){if(!(t instanceof zt))throw t}))},t.prototype._fetchResourceBy=function(t,e){return this.getMany(t,e).then((function(t){return t[0]}))},t.prototype._resourceCacheFilter=function(t){return z.all(this.cache.matchAll("resource.item")).then((function(e){return e.filter((function(e){if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:B(t.id)&&B(e.resource.id)?t.id===e.resource.id:G(t,e.resource)})),[]}))},t}(),jt=0,Ft=function(){function t(t){this.options=t,this.id=jt++,this.emitter=new p.exports.EventEmitter,this.routeStr="/api/component/pyramid/route",this.activeRequests=[];var e=function(t){return Bt.find((function(e){if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return G(e.options.auth,t.auth)}}))}(t);if(e)return e;this.options.route&&(this.routeStr=this.options.route),this.options.requestTransform&&(this.requestTransform=this.options.requestTransform),this.resources=new Dt(this),Zt(this)}return t.create=function(t){return new this(t)},t.prototype.setRequestTransform=function(t){this.requestTransform=t},t.prototype.setNgw=function(t){this.logout(),this.options.baseUrl=t,Zt(this)},t.prototype.connect=function(){var t=this,e=new Tt,i=this.options.auth;return e.add("route",(function(){return new z((function(e,n){var o=function(){return t.makeQuery(t.routeStr,{},{}).then((function(t){e(t)})).catch((function(t){n(t)}))};if(i){var r=i.login,s=i.password;if(r&&s)return t._login({login:r,password:s}).then((function(){return o()})).catch((function(t){return n(t)}))}return o()}))}),{id:this.id,auth:i,baseUrl:this.options.baseUrl})},t.prototype.login=function(t,e){return this.logout(),Zt(this),this._login(t,e)},t.prototype.logout=function(){var t;this.abort(),-1!==(t=Bt.indexOf(this))&&Bt.splice(t,1),this.options.auth=void 0,this.user=void 0,this.emitter.emit("logout"),this.resources.cache.clean()},t.prototype.getUserInfo=function(t,e){if(this.user&&this.user.id)return z.resolve(this.user);t&&(this.options.auth=t);var n=i({headers:this.getAuthorizationHeaders(t)},e);return this.makeQuery("/api/component/auth/current_user",{},n)},t.prototype.getAuthorizationHeaders=function(t){var e=this.makeClientId(t);if(e)return{Authorization:"Basic "+e}},t.prototype.makeClientId=function(t){if(t=t||this.options.auth){var e=t.password,i=unescape(encodeURIComponent("".concat(t.login,":").concat(e)));return window.btoa(i)}},t.prototype.abort=function(){for(var t=0,e=this.activeRequests;t<e.length;t++){e[t].cancel()}this.activeRequests=[]},t.prototype.getActiveApiRequests=function(){return a([],this.activeRequests,!0)},t.prototype.apiRequest=function(t,e,n){var o,r=this;void 0===e&&(e={}),void 0===n&&(n={});var s=n.method,u=n.headers,h=n.withCredentials,l=n.responseType,c=J(e),p=function(){return function(t){var e=t.params;return new z((function(i,n){t.connector.connect().then((function(o){var r=o&&o[t.name];if(r){var s=(r=a([],r,!0)).shift();if(r.length){for(var u={},h=0;h<r.length;h++){var l=r[h];if(u[h]="{"+l+"}",void 0===e[l])throw new Error("`"+l+"` url api argument is not specified")}s&&(s=St(s,u))}if(e){var c=[],p=e.paramList;for(var d in Array.isArray(p)&&(delete e.paramList,p.forEach((function(t){c.push("".concat(t[0],"=").concat(t[1]))}))),e)-1===r.indexOf(d)&&c.push("".concat(d,"=").concat(e[d]));c.length&&(s=s+"?"+c.join("&"))}s?i(t.connector.makeQuery(s,e,t.requestOptions)):n(new Error("request url is not set"))}else i(void 0)})).catch((function(t){n(t)}))}))}({name:t,params:c,requestOptions:n,connector:r})};return n.cache&&"GET"===s?(new Tt).add(t,p,i({params:c},J({headers:u,withCredentials:h,responseType:l,baseUrl:this.options.baseUrl,userId:null===(o=this.user)||void 0===o?void 0:o.id}))):p()},t.prototype.post=function(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)},t.prototype.get=function(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)},t.prototype.patch=function(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)},t.prototype.put=function(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)},t.prototype.delete=function(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)},t.prototype.makeQuery=function(t,e,i){if(void 0===i&&(i={}),t=(this.options.baseUrl?this.options.baseUrl:"")+t)return e&&(t=St(t,e)),t=encodeURI(Y(t)),this._loadData(t,i);throw new Error("Empty `url` not allowed")},t.prototype.getResource=function(t,e){return this.resources.getOne(t,e)},t.prototype.getResourceOrFail=function(t,e){return this.resources.getOneOrFail(t,e)},t.prototype.getResourceBy=function(t){return this.resources.getOne(t)},t.prototype.getResourceByKeyname=function(t){return this.resources.getOne(t)},t.prototype.getResourceById=function(t){return this.resources.getOne(t)},t.prototype.getResourceId=function(t,e){return this.resources.getId(t,e)},t.prototype.getResourceIdOrFail=function(t,e){return this.resources.getIdOrFail(t,e)},t.prototype.getResourcesBy=function(t,e){return this.resources.getMany(t,e)},t.prototype.getResourceParent=function(t,e){return this.resources.getParent(t,e)},t.prototype.getResourceChildren=function(t,e){return this.resources.getChildrenOf(t,e)},t.prototype.updateResource=function(t,e){return this.resources.update(t,e)},t.prototype.deleteResource=function(t){return this.resources.delete(t)},t.prototype._loadData=function(t,e){var n=this;e.responseType=e.responseType||"json";var o=new z((function(o,r,s){if(n.user&&((e=e||{}).headers=i(i({},n.getAuthorizationHeaders()),e.headers)),n.requestTransform){var a=n.requestTransform(t,e);t=a[0],e=a[1]}Mt(t,o,e,r,s)})).then((function(t){return n._cleanActiveRequests(o),t})).catch((function(t){if(n._cleanActiveRequests(o),t instanceof z.CancelError);else{var e=n._handleHttpError(t);if(e)throw e}}));return e.signal&&"function"==typeof e.signal.addEventListener&&e.signal.addEventListener("abort",(function(){o.cancel(),n._cleanActiveRequests(o)})),this.activeRequests.push(o),o},t.prototype._login=function(t,e){var i=this;return this.getUserInfo(t,e).then((function(t){return i.user=t,i.emitter.emit("login",t),t})).catch((function(t){throw i.emitter.emit("login:error",t),t}))},t.prototype._cleanActiveRequests=function(t){var e=this.activeRequests.indexOf(t);-1!==e&&this.activeRequests.splice(e,1)},t.prototype._handleHttpError=function(t){if(t&&t instanceof At){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new zt(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new It(t)}return t},t.errors={NgwError:At,ResourceNotFoundError:zt},t}();function Ut(t){var e=t.extent_bottom,i=t.extent_left,n=t.extent_top,o=t.extent_right;if(e&&i&&n&&o){var r=[i,e,o,n];return r[3]>82&&(r[3]=82),r[1]<-82&&(r[1]=-82),r}}function Wt(t){var e=t.cache;return t.connector.get("layer.extent",{cache:void 0===e||e},{id:t.resourceId}).then((function(t){if(t){var e=t.extent;return[e.minLon,e.minLat,e.maxLon,e.maxLat]}}))}function Ht(t){return t.connector.getResource(t.resourceId).then((function(e){if(e)return Vt(e,t.connector,t)}))}function Vt(t,e,n){if(t.webmap)return z.resolve(Ut(t.webmap));var o=t.resource;return o.cls&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id).then((function(t){if(t)return Wt(i(i({},n),{resourceId:t.resource.id,connector:e}))})):Wt(i(i({},n),{resourceId:o.id,connector:e}))}var qt=function(){function t(){}return t.prototype.getExtent=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return[2,this.getBounds()]}))}))},t.prototype.getBounds=function(t){return o(this,void 0,void 0,(function(){var e;return r(this,(function(i){switch(i.label){case 0:return this._extent?[2,this._extent]:this.item?(e=this,[4,Vt(this.item,this.connector,t)]):[3,2];case 1:return e._extent=i.sent(),[2,this._extent];case 2:return[2]}}))}))},t}();var Gt=["fields","intersects","limit","orderBy","strategy"];function Jt(t){var e={};return Gt.forEach((function(i){var n=t[i];void 0!==n&&(e[i]=n)})),e}function Kt(t,e){return o(this,void 0,void 0,(function(){var i,n,o,s,a;return r(this,(function(r){switch(r.label){case 0:return n=i=t.resource,o=t.keyname,s=t.resourceId,i?"string"!=typeof i?[3,1]:(o=i,[3,5]):[3,5];case 1:return"number"!=typeof i?[3,2]:(s=i,[3,5]);case 2:return n.resource&&void 0!==n.resource&&"resource"in n?(s=i.resource.id,[3,5]):[3,3];case 3:return[4,Kt(i,e)];case 4:s=r.sent(),r.label=5;case 5:return s||!o?[3,7]:[4,e.getResource(o)];case 6:(a=r.sent())&&(s=a.resource.id),r.label=7;case 7:return[2,s]}}))}))}var Yt={srs:4326,geom_format:"geojson"};function Qt(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function Xt(t,e){var i=e.extensions,n=e.geom,o=e.fields,r=e.srs;t.extensions=i?i.join(","):"",void 0!==o&&(t.fields=Array.isArray(o)?o.join(","):""),void 0!==n&&(t.geom=n?"yes":"no",n||(delete t.srs,delete t.geom_format)),B(r)&&(t.srs=r)}function $t(t){var e=ee(t);return z.all(e).then((function(e){for(var i=[],n=[],o=0,r=e;o<r.length;o++)for(var s=0,a=r[o];s<a.length;s++){var u=a[s];i.includes(u.id)||(n.push(u),i.push(u.id))}return t.offset||t.limit?n.splice(void 0!==t.offset?t.offset:0,void 0!==t.limit?t.limit:n.length):n}))}function te(t){var e=t[0],i=t[1],n=t[2],o="id"!==e?"fld_":"",r="",s="",a=String(e).trim().replace(/^(%?)(.+?)(%?)$/,(function(t,e,i,n){return r=e,s=n,i})),u=r+n+s;return["".concat(o).concat(a,"__").concat(i),u]}function ee(t,e,n){void 0===e&&(e=[]),void 0===n&&(n=[]);var o=t.filters,r="string"==typeof o[0]?o[0]:"all",s=o.filter((function(t){return Array.isArray(t)}));if("any"===r)for(var u=0,h=s;u<h.length;u++){rt(f=h[u])?e.push(ne(i(i({},t),{paramList:a(a([],n,!0),[te(f)],!1)}))):ee(i(i({},t),{filters:f}),e,a([],n,!0))}else if("all"===r){for(var l=[],c=[],p=0,d=s;p<d.length;p++){var f;rt(f=d[p])?l.push(te(f)):c.push(f)}if(c.length)for(var m=0,_=c;m<_.length;m++){var y=_[m];ee(i(i({},t),{filters:y}),e,a(a([],n,!0),l,!0))}else e.push(ne(i(i({},t),{paramList:a(a([],n,!0),l,!0)})))}return e}function ie(t){var e=t.map((function(t){var e=V(t[0],t[1]).map((function(t){return e=t,n=i?Number("1e+"+i):1,Math.round((e+Number.EPSILON)*n)/n;var e,i,n}));return e[0]+" "+e[1]}));return"POLYGON((".concat(e.join(", "),"))")}function ne(t){var e,n=i({},Yt),o=t.limit,r=t.cache,s=t.signal,a=t.offset,u=t.orderBy,h=t.paramList,l=t.connector,c=t.geomFormat,p=t.intersects,d=t.resourceId;if(o?o!==Number.POSITIVE_INFINITY&&(n.limit=o):n.limit=7e3,a&&(n.offset=a),c&&(n.geom_format=c),Xt(n,t),u&&(n.order_by=u.join(",")),Array.isArray(p)){var f=(e=p,Array.isArray(e)&&4===e.length&&e.every((function(t){return"number"==typeof t}))?U(p):p);n.intersects=ie(f)}else"string"==typeof p&&(n.intersects=p);h&&(n.paramList=h);var m=i({id:d},n);return l.get("feature_layer.feature.collection",{cache:r,signal:s},m)}function oe(t){var e,i=function(){var i=t[e];if(K(i)){var n=i;if(B(n.year)&&B(n.month)&&B(n.day)){var o=[n.year,n.month-1,n.day];"hour"in n&&[n.hour,n.minute,n.second].forEach((function(t){o.push(t)})),t[e]=(new(Date.bind.apply(Date,a([void 0],o,!1)))).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))};for(e in t)i();return t}function re(t){var e=t.filters;return e?$t(i(i({},t),{filters:e})).then((function(n){var o;return(null!==(o=t.clientFilterValidate)&&void 0!==o?o:se(e))&&(n=n.filter((function(t){return st(oe(i(i({},t.fields),{id:t.id})),e)}))),n})):ne(t)}function se(t){if("any"===t[0])return!0;for(var e=1;e<t.length;e++){var i=t[e];if("[object Array]"===Object.prototype.toString.call(i))if(se(i))return!0}return!1}function ae(t){return function(t){return re(t).then((function(t){var e=[];return t.forEach((function(t){e.push(Qt(t))})),e}))}(t).then((function(t){return{type:"FeatureCollection",features:t}}))}function ue(t){var n,s;return o(this,void 0,void 0,(function(){var a,u,h,l,c,d,f,m,_,y,v,g,b,w,x,L,P=this;return r(this,(function(C){switch(C.label){case 0:return a=t.item,u=t.webMap,c=null==(l=t.addLayerOptionsPriority)||l,f=t.Adapter||u.mapAdapter.layerAdapters.GEOJSON,m=[],_=!1,[4,Kt(d=t.layerOptions,h=t.connector)];case 1:return g=C.sent(),(null===(s=null===(n=d.adapterOptions)||void 0===n?void 0:n.popupOptions)||void 0===s?void 0:s.fromProperties)&&(d.adapterOptions.popupOptions.createPopupContent=function(t){var e=t.feature;return e&&function(t,e){var i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach((function(e){if(e.grid_visibility){var n=t.properties&&t.properties[e.keyname];if(n){var o=document.createElement("div");i.appendChild(o),o.innerHTML="<span>".concat(e.display_name,"</span>: ").concat(n,"<span></span>")}}}));else if(t.properties)for(var n in t.properties){var o=document.createElement("div");i.appendChild(o),o.innerHTML="<span>".concat(n,"</span>: ").concat(t.properties[n],"<span></span>")}return i}(e,a)}),b=function(t,e){return o(P,void 0,void 0,(function(){return r(this,(function(n){switch(n.label){case 0:return x(),y={filters:t,options:e},[4,v=ae(i({resourceId:g,filters:t,connector:h,cache:!0},e))];case 1:return[2,n.sent()]}}))}))},w=!1,x=function(){v&&(v.cancel(),v=void 0)},L=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.emitter=new p.exports.EventEmitter,e}return e(n,t),n.prototype.addLayer=function(e){return o(this,void 0,void 0,(function(){var n,o,s,u,h;return r(this,(function(r){switch(r.label){case 0:return n=!e.data,o=void 0===e.waitFullLoad||e.waitFullLoad,void 0!==d.id&&(e.id=d.id),a&&a.vector_layer&&(e.type=je[a.vector_layer.geometry_type]),d.adapterOptions&&(e=c?i(i({},d.adapterOptions),e):i(i({},e),d.adapterOptions)),e.data&&0===Object.keys(e.data).length&&(e.data=void 0,n=!1),this.options.strategy=s=e.strategy||void 0,u=t.prototype.addLayer.call(this,e),y={filters:e.propertiesFilter,options:Jt(e)},n&&(h=this.updateLayer()),o&&h?[4,h]:[3,2];case 1:r.sent(),r.label=2;case 2:return s&&s.startsWith("BBOX")&&!_&&this._addBboxEventListener(),[2,u]}}))}))},n.prototype.getExtent=function(){return this.getBounds()},n.prototype.getBounds=function(){return o(this,void 0,void 0,(function(){var e,i;return r(this,(function(n){return e=this.getLayers&&this.getLayers().length,(null==(i=this.options.strategy)?void 0:i.startsWith("BBOX"))||e?[2,Ht({connector:h,resourceId:a.resource.id})]:t.prototype.getBounds?[2,t.prototype.getBounds.call(this)]:[2]}))}))},n.prototype.beforeRemove=function(){w=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,x()},n.prototype.getCount=function(){return function(t){var e=t.cache;return t.connector.get("feature_layer.feature.count",{cache:void 0===e||e},{id:t.resourceId}).then((function(t){return t.total_count}))}({connector:h,resourceId:g,cache:!0})},n.prototype.updateLayer=function(e){var n;return o(this,void 0,void 0,(function(){var o,s,a,h,l,c,p,f,v,g,x;return r(this,(function(r){switch(r.label){case 0:return e=e||y||{},(null===(n=this.options.strategy)||void 0===n?void 0:n.startsWith("BBOX"))?[4,u.onLoad("create")]:[3,2];case 1:if(r.sent(),e.options=e.options||{},e.options.intersects=u.getBounds(),s=(o=this.options).minZoom,a=o.maxZoom,void 0!==(h=u.getZoom())){if(void 0!==s&&h<s)return[2];if(void 0!==a&&h>a)return[2];if(_)return[2]}r.label=2;case 2:if(w)return[2];r.label=3;case 3:return r.trys.push([3,10,,11]),this.emitter.emit("preupdate",e),u._emitLayerEvent("layer:preupdate",d.id||"",e),[4,b(e.filters,i(i({},e.options),{srs:this.options.srs}))];case 4:return l=r.sent(),c=l,[4,this.getCount()];case 5:if(p=r.sent(),"BBOX+"!==this.options.strategy)return[3,7];for(c={type:"FeatureCollection",features:[]},f=0,v=l.features;f<v.length;f++)g=v[f],-1===m.indexOf(String(g.id))&&(m.push(String(g.id)),c.features.push(g));return _=void 0!==p&&m.length>=p,[4,u.addLayerData(this,c)];case 6:return r.sent(),[3,9];case 7:return _=void 0!==p&&l.features.length>=p,[4,u.setLayerData(this,l)];case 8:r.sent(),r.label=9;case 9:return this.emitter.emit("updated",l),u._emitLayerEvent("layer:updated",d.id||"",{data:l,newData:c,isFull:_}),[3,11];case 10:if((x=r.sent())instanceof Error&&"CancelError"!==x.name)throw x;return[3,11];case 11:return t.prototype.updateLayer&&t.prototype.updateLayer.call(this),[2]}}))}))},n.prototype.propertiesFilter=function(t,e){return o(this,void 0,void 0,(function(){var n;return r(this,(function(o){switch(o.label){case 0:return x(),this.filter&&_?(this.filter((function(e){var n=e.feature&&e.feature.properties&&oe(i({},e.feature.properties));return!n||st(n,t)})),[3,3]):[3,1];case 1:return this.setData?(this.clearLayer&&this.clearLayer(),[4,b(t,i(i({},e),{srs:this.options.srs}))]):[3,3];case 2:n=o.sent(),this.setData(n),o.label=3;case 3:return[2]}}))}))},n.prototype.removeFilter=function(){y=void 0,this.propertiesFilter([]),this.filter&&this.filter((function(){return!0}))},n.prototype._addBboxEventListener=function(){var t=this;this.__enableMapMoveListener=function(e){e===t&&(t._removeMoveEventListener(),t.updateLayer(),t._addMoveEventListener())},this.__disableMapMoveListener=function(e){e===t&&t._removeMoveEventListener()},u.emitter.on("layer:show",this.__enableMapMoveListener),u.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)},n.prototype._removeBboxEventListener=function(){this.__enableMapMoveListener&&u.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&u.emitter.on("layer:hide",this.__disableMapMoveListener)},n.prototype._addMoveEventListener=function(){var t=this;this.__onMapMove=D((function(){return t.updateLayer()})),this.__onMapMoveStart=x,u.emitter.on("movestart",this.__onMapMoveStart),u.emitter.on("moveend",this.__onMapMove)},n.prototype._removeMoveEventListener=function(){this.__onMapMove&&u.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&u.emitter.removeListener("movestart",this.__onMapMoveStart)},n}(f),[2,L]}}))}))}function he(t){var e,i,n=t.options,o=t.webMap,r=t.baseUrl,s=n.adapter||"IMAGE",a=o&&o.getLayerAdapters(),u=n.resource,h=n.tileNoData?n.tileNoData:200;if("number"==typeof u){if("IMAGE"===s){if(!a||a.IMAGE)return function(t){var e=t.resourceId,i=t.nd,n=t.headers,o=t.baseUrl+"/api/component/render/image",r={resource:e};return i&&(r.nd=i),{url:o,resourceId:e,headers:n,params:r,updateWmsParams:function(t){return i&&(t.nd=i),Ne(t,e)}}}({resourceId:u,headers:n.headers,nd:h,baseUrl:r});s="TILE"}if("WMS"===s){i="".concat(r,"/api/resource/").concat(u,"/wms");var l=n.adapterOptions;return{url:i,format:"image/png",version:"1.1.1",layers:l&&l.layers,headers:n.headers}}if("MVT"===s)return{url:i=r+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+u+"&simplification="+(null!==(e=n.simplification)&&void 0!==e?e:6),sourceLayer:"ngw:"+u,featureIdName:"$id"};if("TERRAIN"===s)return{url:i=r+"/api/resource/".concat(u,"/terrain_provider"),adapter:s};if("MODEL_3D"===s)return{url:i=r+"/api/component/model_3d/".concat(u,"/data.glb")};if("TILE"===s)return{url:i=r+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+u+"&nd="+h,adapter:s}}else{if(void 0!==u)throw new Error("Option `resource` must be number, not "+typeof u);console.log("Option `resource` not set")}}function le(t){var n=t.layerOptions,s=t.webMap,a=t.connector,u=t.item;return o(this,void 0,void 0,(function(){var t,h,l,c,p,d;return r(this,(function(f){switch(f.label){case 0:return t=u.resource.cls,h={wmsserver_service:"WMS",tmsclient_layer:"IMAGE"},void 0!==(l=n.adapter||t&&h[t]||"IMAGE")&&(n.adapter=l),"IMAGE"===l&&(c=s.getLayerAdapters(),!c||c.IMAGE||(l="TILE")),(p=s.mapAdapter.layerAdapters[l])?[4,Kt(n,a)]:[3,2];case 1:return d=f.sent(),[2,function(t){function h(e,o){var r=t.call(this,e,o)||this;r.map=e,r.item=u,r.resourceId=d;var h=he({options:n,webMap:s,baseUrl:a.options.baseUrl||""});if(h){var l=i(i(i({},h),n.adapterOptions),{params:{resource:d},layers:h.layers||String(d),resourceId:d});n.adapterOptions&&B(n.adapterOptions.setViewDelay)&&(l.setViewDelay=n.adapterOptions.setViewDelay),r.options=i(i({},r.options),l)}return r}return e(h,t),h.prototype.addLayer=function(e){return t.prototype.addLayer.call(this,i(i({},this.options),e))},h.prototype.getIdentificationIds=function(){return o(this,void 0,void 0,(function(){var t;return r(this,(function(e){if(this.item){if("MVT"===l)return[2,[this.item.resource.id]];if(B(t=this.item.resource.parent.id))return[2,[t]]}return[2,[]]}))}))},h}(p)];case 2:throw new Error(l+" not supported yet. Only TILE")}}))}))}function ce(t,e,i,n){return!!fe(t,e,i,me,n)}function pe(t,e,i,n){return fe(t,e,i,_e,n)}function de(t,e){void 0===e&&(e="children");var i=[],n=("function"==typeof e?e:function(t){return t[e]})(t);return n&&(Array.isArray(n)?i=n:i.push(n)),n?i:void 0}function fe(t,e,i,n,o){void 0===e&&(e=function(t){return!!t}),void 0===i&&(i="children");var r="function"==typeof e?e:function(t){return st(t,e)};return n(t,o?function(t){return r(o(t))}:r,i)}function me(t,e,i,n){void 0===e&&(e=function(t){return!!t});var o=[];if(Array.isArray(t))o=t;else{if(e(t))return t;var r=de(t,i);r&&(o=r)}for(var s=0;s<o.length;s++)if(o[s]){var a=me(o[s],e,i);if(a)return a}}function _e(t,e,i,n){void 0===e&&(e=function(t){return!!t}),void 0===n&&(n=[]);var o=[];if(Array.isArray(t))o=t;else{e(t)&&n.push(t);var r=de(t,i);r&&(o=r)}for(var s=0;s<o.length;s++)o[s]&&_e(o[s],e,i,n);return n}function ye(t,e,i,n){void 0===e&&(e=function(t){return!!t});var o=[];if(Array.isArray(t))o=t;else{if(!e(t))return!1;var r=de(t,i);r&&(o=r)}for(var s=0;s<o.length;s++){if(o[s])if(!ye(o[s],e,i))return!1}return!0}var ve=function(){function t(t){this._children=[],this.item=t}return t.prototype.setParent=function(t){this._parent=t},t.prototype.addChild=function(t){this._children.push(t)},t.prototype.getParent=function(){return this._parent},t.prototype.getParents=function(t){var e=this.getParent();return e?pe(e,t,(function(t){return t.tree.getParent()})):[]},t.prototype.getRoot=function(){for(var t=this.getParent(),e=t;t;)(t=t.tree.getParent())&&(e=t);return e},t.prototype.find=function(t){return fe(this._children,t,(function(t){return t.tree.getChildren()}),me,e);var e},t.prototype.every=function(t){return!!fe(this._children,t,(function(t){return t.tree.getChildren()}),ye,e);var e},t.prototype.some=function(t){return ce(this._children,t,(function(t){return t.tree.getChildren()}))},t.prototype.all=function(t){return this.getDescendants(t)},t.prototype.getDescendants=function(t){return pe(this._children,t,(function(t){return t.tree.getChildren()}))},t.prototype.getChildren=function(){return a([],this._children,!0)},t}(),ge=function(){function t(t,e,i){this.emitter=new p.exports.EventEmitter,this._blocked=!1,this.item=e,this.options=Object.assign({},i),this.name=t,this._value=this.getProperty()}return t.prototype.getProperty=function(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value},t.prototype.getParents=function(){return this.item.tree.getParents()||[]},t.prototype.getParent=function(){return this.item.tree.getParent()},t.prototype.getChildren=function(){return this.item.tree.getChildren()},t.prototype.isGroup=function(){return this.item.tree.getDescendants().length},t.prototype.isBlocked=function(){if(void 0!==this._blocked)return this._blocked;var t=this.item.tree.getParents();return this._blocked=this._calculateBlockedStatus(t),this._blocked},t.prototype.set=function(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)},t.prototype.get=function(){return this.getValue()},t.prototype.update=function(t,e){this._callOnSet(t,e)},t.prototype.getContainer=function(){return this._container},t.prototype.destroy=function(){if(this._container){var t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()},t.prototype.getValue=function(){return void 0!==this._value?this._value:this.getProperty()},t.prototype._prepareValue=function(t){return t},t.prototype._callOnSet=function(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)},t.prototype._fireChangeEvent=function(t,e){var i=this;this.emitter&&(t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e}),this.item.tree.getParents().forEach((function(n){var o=n.properties&&n.properties.property(i.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:i.item})})))},t.prototype._calculateBlockedStatus=function(t){var e=this;return t.some((function(t){var i,n=null===(i=t.properties)||void 0===i?void 0:i.property(e.name);return!!n&&!n.get()}))},t}(),be=function(t){function n(e,o,r){var s=t.call(this,e,o,i(i({},n.options),r))||this;return s.set(s.get()),s}return e(n,t),n.prototype.update=function(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);var i=this.getParent(),n=i&&i.properties&&i.properties.property(this.name);n&&n.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)},n.prototype.getHierarchyValue=function(){var t=this;return this.get()&&this.getParents().every((function(e){var i=e.properties&&e.properties.get(t.name);return i&&i.get()}))},n.prototype.block=function(t){this._blocked=!0,this._block(t)},n.prototype.unBlock=function(t){this._blocked=!1,this.getValue()&&this._unBlock(t)},n.prototype.blockChild=function(t){var e=this;this.item.tree.getDescendants().forEach((function(i){return e._blockChild(i,t)}))},n.prototype.unblockChild=function(t){var e=this;this.item.tree.getChildren().forEach((function(i){return e._unBlockChild(i,t)}))},n.prototype._prepareValue=function(t){return t},n.prototype._turnOff=function(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)},n.prototype._turnOn=function(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)},n.prototype._block=function(t){this._turnOff(t)},n.prototype._unBlock=function(t){this._turnOn(t)},n.prototype._blockChild=function(t,e){var i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(e)},n.prototype._unBlockChild=function(t,e){var i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(e)},n.prototype._propagation=function(t,e){if(this.isGroup())for(var n=this.item.tree.getChildren(),o=0;o<n.length;o++){var r=n[o],s=r.properties&&r.properties.property(this.name);s&&s.set(t,i(i({},e),{propagation:!0,bubble:!1}))}},n.options={hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"},n}(ge),we=function(){function t(t,e){this.item=t,this.options={},this._properties={},this._propertiesList=[],e&&e.forEach(this._setPropertyHandler.bind(this))}return t.prototype.add=function(t){this._setPropertyHandler(t)},t.prototype.update=function(){this.list().forEach((function(t){return t.update()}))},t.prototype.get=function(t){var e=this.property(t);return e?e.get():void 0},t.prototype.set=function(t,e,i){var n=this.property(t);n&&n.getValue()!==e&&n.set(e,i)},t.prototype.property=function(t){return this._properties[t]},t.prototype.list=function(){var t=this;return this._propertiesList.map((function(e){return t._properties[e]}))},t.prototype.destroy=function(){for(var t in this._properties){var e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]},t.prototype._setPropertyHandler=function(t){var e=this._getHandler(t);if(e&&t.name){var n=i({},t);this._properties[t.name]=new e(t.name,this.item,n),this._propertiesList.push(t.name)}},t.prototype._getHandler=function(e){var i=e.handler;return!i&&e.type?"boolean"===e.type?t.handlers.CheckProperty:t.handlers.BaseProperty:i},t.handlers={CheckProperty:be},t}(),xe=0,Le=function(){function t(t){this.options={},this.id=xe,xe+=1,this.options=i({},t),this.tree=new ve(this)}return t.prototype.initProperties=function(){this.properties=new we(this,this.options.properties)},t}(),Pe=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return e(i,t),i.prototype.getProperty=function(){var t=this.item.layer;return t&&t&&t.options&&void 0!==t.options.opacity?t.options.opacity:1},i.prototype.update=function(t,e){var i=this;if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);for(var n=0,o=this.getChildren();n<o.length;n++){var r=o[n].properties.property(this.name);r&&(e.propagation?r.set(t,e):r.update(r.get(),e))}}var s=this.item.layer;if(s){var a=this.getParents().reduce((function(t,e){var n=e.properties.property(i.name);return t*(n?n.getValue():1)}),1);this.item.webMap.setLayerOpacity(s,this._prepareValue(t*a))}},i.prototype._prepareValue=function(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)},i}(ge),Ce=function(t){function n(e,o,r,s,a,u){var h=t.call(this,i(i({},n.options),r))||this;if(h.webMap=e,h.emitter=new p.exports.EventEmitter,h._rootDescendantsCount=0,s&&(h.connector=s),a&&h.tree.setParent(a),h.item=o,"root"===h.item.item_type)h._rootDescendantsCount=h._sumUp(h.item.children);else{var l=h.tree.getRoot();l&&(h._rootDescendantsCount=l._rootDescendantsCount)}return h.initProperties(),u||h._init(o),h}return e(n,t),n.create=function(t,e,i,s,a){return o(this,void 0,void 0,(function(){var o;return r(this,(function(r){switch(r.label){case 0:return[4,(o=new n(t,e,i,s,a,!0))._init(e)];case 1:return r.sent(),[2,o]}}))}))},n.prototype.initItem=function(t){var e=this,i=t,o=this.getItemOptions(t),r=function(t){i._layer=t,e.layer=t,e.properties.get("visibility")&&e.properties.set("visibility",!0),void 0!==o.opacity&&e.webMap.setLayerOpacity(t,o.opacity)};if("group"===t.item_type||"root"===t.item_type){if(t.children&&t.children.length)for(var s=0,a=this.getChildren(t);s<a.length;s++){var u=new this.constructor(this.webMap,a[s],this.options,this.connector,this);this.tree.addChild(u)}return Promise.resolve()}var h=void 0;if("layer"===t.item_type)h=t.adapter||t.layer_adapter.toUpperCase();else if(n.GetAdapterFromLayerType[t.item_type]){h=(0,n.GetAdapterFromLayerType[t.item_type])(t,o,this.webMap,this.connector)}return h?this.webMap.addLayer(h,o).then((function(t){r(t)})):t._layer?Promise.resolve(r(t._layer)):Promise.reject("No layer added")},n.prototype.bringToFront=function(){},n.prototype.fit=function(){},n.prototype.getLayer=function(){return this.layer},n.prototype.getItemOptions=function(t){var e,i="layer"===t.item_type&&t.layer_transparency,n="number"==typeof i?(100-i)/100:void 0,o={visibility:!1,headers:this.options.headers,crossOrigin:this.options.crossOrigin,setViewDelay:this.options.setViewDelay,params:{resource:this.item.resourceId,item:this.item}};if(this.options.order){var r=String(this.options.drawOrderEnabled&&"draw_order_position"in t?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");o.order=Number((0|this.options.order)+"."+r)}if(this.options.popupOptions&&(o.popupOptions=this.options.popupOptions),"layer"===t.item_type){var s=(e=this._getZoomRange(t)).maxZoom;!function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];for(var n=0,o=e;n<o.length;n++)for(var r=o[n],s=0,a=Object.getOwnPropertyNames(r);s<a.length;s++){var u=a[s];t[u]=r[u]}}(o,{updateWmsParams:t.updateWmsParams,url:t.url,headers:this.options.headers,ratio:this.options.ratio,maxZoom:s,minZoom:e.minZoom,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom})}return void 0!==n&&(o.opacity=n),o},n.prototype.getChildren=function(t){return a([],t.children,!0).reverse()},n.prototype._mapScaleToZoomLevel=function(t){return function(t,e){void 0===e&&(e=0);var i=e,n=function(){if(void 0===De){var t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);var e=t.offsetWidth;document.body.removeChild(t),De=e}return De}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t;return function(t){return Math.log(t/256)/Math.LN2}(n)}(t)},n.prototype._getZoomRange=function(t){var e=this.options.minZoom,i=this.options.maxZoom,n=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,o=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,r=[e,n].filter(Boolean),s=[i,o].filter(Boolean);return{minZoom:r.length?Math.max.apply(Math,r):void 0,maxZoom:s.length?Math.min.apply(Math,s):void 0}},n.prototype._init=function(t){var e=this;this.initItem(t).then((function(){e.emitter.emit("init")}))},n.prototype._sumUp=function(t,e){void 0===e&&(e=0);for(var i=0,n=t;i<n.length;i++){var o=n[i];"layer"===o.item_type?(e+=1,o.draw_order_position=o.draw_order_position||e):"group"===o.item_type&&(e=this._sumUp(o.children,e))}return e},n.GetAdapterFromLayerType={},n.options={properties:[{type:"boolean",name:"visibility",getProperty:function(t){if(t){if("group"===t.item.item_type||"root"===t.item.item_type)return ce(t.item,(function(t){return"layer_enabled"in t&&t.layer_enabled}),(function(t){return t.children}));if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet:function(t,e,i){i&&"layer"===i.item.item_type&&(i.layer&&(t?i.webMap.showLayer(i.layer):i.webMap.hideLayer(i.layer)),i.item.layer_enabled=t)}},{name:"opacity",handler:Pe}]},n}(Le);function Me(t){var e=t.webMap,n=t.connector,s=t.item,a=t.adapterOptions,u=void 0===a?{}:a,h=t.idPrefix,l=void 0===h?"first-show-adapter":h;return o(this,void 0,void 0,(function(){var t;return r(this,(function(a){return t=function(t){var e=t.webMap,n=t.adapterOptions,s=void 0===n?{}:n,a=t.onLayerAdded,u=t.createAdapter;return o(this,void 0,void 0,(function(){var t;return r(this,(function(n){return t=function(){function t(){this.options={},this.layer=[],this._removed=!1,this._creatingInProgress=!1}return t.prototype.addLayer=function(){return this.layer},t.prototype.removeLayer=function(){this._removed=!0;for(var t=0,i=this.layer;t<i.length;t++)e.removeLayer(i[t])},t.prototype.destroyed=function(){return this._removed},t.prototype.showLayer=function(){return o(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:if(this.options.visibility=!0,!this.layer.length)return[3,5];t=0,i=this.layer,n.label=1;case 1:return t<i.length?[4,e.showLayer(i[t])]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[3,7];case 5:return[4,this.loadLayer()];case 6:n.sent(),n.label=7;case 7:return[2]}}))}))},t.prototype.hideLayer=function(){return o(this,void 0,void 0,(function(){var t,i;return r(this,(function(n){switch(n.label){case 0:if(this.options.visibility=!1,!this.layer)return[3,4];t=0,i=this.layer,n.label=1;case 1:return t<i.length?[4,e.hideLayer(i[t])]:[3,4];case 2:n.sent(),n.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},t.prototype.loadLayer=function(){return o(this,void 0,void 0,(function(){var t,n,o;return r(this,(function(r){switch(r.label){case 0:return this.layer.length||this._creatingInProgress?[3,5]:(this._creatingInProgress=!0,[4,u(this)]);case 1:return(t=r.sent())?[4,(n=new t(e.mapAdapter.map,i({},s))).addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer})]:[3,5];case 2:return o=r.sent(),a&&a(n),Object.assign(n.options,s),n.layer=o,this._removed&&e.removeLayer(n),this.layer.push(n),this.options.visibility?[4,e.showLayer(n)]:[3,4];case 3:r.sent(),r.label=4;case 4:this._creatingInProgress=!1,r.label=5;case 5:return[2,this.layer]}}))}))},t}(),[2,t]}))}))}({webMap:e,adapterOptions:u,onLayerAdded:function(t){t.options.baselayer=!1,t.id=l+"-"+s.resource_id},createAdapter:function(){return Re({resource:s.resource_id,adapterOptions:{name:s.display_name,opacity:s.opacity}},e,n)}}),[2,t]}))}))}var Te=function(){function t(t){this.options=t,this.resourceId=t.resourceId;var e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}return t.prototype.extent=function(){var t=this;return this._extent?z.resolve(this._extent):this.options.connector.get("feature_layer.feature.item_extent",null,{id:this.resourceId,fid:this.item.id}).then((function(e){var i=e.extent,n=[i.minLon,i.minLat,i.maxLon,i.maxLat];return t._extent=n,n}))},t.prototype.geoJson=function(){var t=this;return this.item.geom?z.resolve(Qt(this.item)):He({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null}).then((function(e){return t.item.geom=e.geom,Qt(t.item)}))},t}(),Oe=function(){function t(t,e){this.map=t,this.options=e,this.NgwWebmapItem=Ce,this.pixelRadius=10,this.webmapClassName="webmap",this.emitter=new p.exports.EventEmitter,this._webmapBaselayersIds=[];var i=e.resourceId;if(Array.isArray(i)?(this.resourceId=i[0],this.options.id=i[1]):this.resourceId=i,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}return t.prototype.addLayer=function(t){var e,n;return o(this,void 0,void 0,(function(){var o,s;return r(this,(function(r){switch(r.label){case 0:return this.options=i(i({},this.options),t),o=this,[4,this._getWebMapLayerItem()];case 1:return o.layer=r.sent(),s=null===(n=null===(e=this.response)||void 0===e?void 0:e.webmap)||void 0===n?void 0:n.extent_constrained,this.options.useExtentConstrained&&this._extent&&s&&this.options.webMap.setView({maxBounds:this._extent}),[2,this.layer]}}))}))},t.prototype.removeLayer=function(){var t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach((function(e){"layer"in e&&t.removeLayer(e.layer.layer)})),this._webmapBaselayersIds.length){for(var e=0,i=this._webmapBaselayersIds;e<i.length;e++){this.options.webMap.removeLayer(i[e])}this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.response,delete this._webmapLayersIds},t.prototype.showLayer=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return this.layer&&this.layer.properties?[2,this.layer.properties.property("visibility").set(!0)]:[2]}))}))},t.prototype.hideLayer=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){return this.layer&&this.layer.properties?[2,this.layer.properties.property("visibility").set(!1)]:[2]}))}))},t.prototype.setOpacity=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return this.layer&&this.layer.properties?[2,this.layer.properties.property("opacity").set(t)]:[2]}))}))},t.prototype.getExtent=function(){return this.getBounds()},t.prototype.getBounds=function(){var t=this.response&&this.response.webmap;if(t)return Ut(t)},t.prototype.getDependLayers=function(){return this.layer&&this.layer.tree.getDescendants()||[]},t.prototype.getBookmarksResourceId=function(){var t=this.response&&this.response.webmap;if(t)return t.bookmark_resource.id},t.prototype.fetchBookmarks=function(){var t=this.getBookmarksResourceId(),e=this.options.connector;if(t)return e.getResourceOrFail(t).then((function(i){var n,o=null===(n=i.feature_layer)||void 0===n?void 0:n.fields.find((function(t){return t.label_field})),r=o&&o.keyname;return re({connector:e,resourceId:t,geom:!1,fields:r?[r]:void 0}).then((function(i){for(var n=[],o=0,s=i;o<s.length;o++){var a=new Te({item:s[o],resourceId:t,labelField:r,connector:e});n.push(a)}return n}))}));throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")},t.prototype.getIdentificationIds=function(){return o(this,void 0,void 0,(function(){var t,e,i;return r(this,(function(n){switch(n.label){case 0:return t=[],(e=this._webmapLayersIds)?[3,2]:[4,this._getWebMapIds()];case 1:e=n.sent(),this._webmapLayersIds=e,n.label=2;case 2:return e&&e.length&&(i=(i=this.getDependLayers()).sort((function(t,e){return e.id-t.id})),i.forEach((function(e){var i=e.item,n=i.parentId;if(void 0!==n&&"layer"===i.item_type){var o=e.properties.property("visibility");o.get()&&!o.isBlocked()&&t.push(n)}}))),[2,t]}}))}))},t.prototype._getWebMapLayerItem=function(){return o(this,void 0,void 0,(function(){var t,e=this;return r(this,(function(i){switch(i.label){case 0:return this.resourceId?[4,this.getWebMapConfig(this.resourceId)]:[3,2];case 1:if((t=i.sent())&&t.root_item)return[2,new Promise((function(i){var n={};if(e.options.connector&&e.options.connector.options.auth){var o=e.options.connector.getAuthorizationHeaders();o&&(n.headers=o)}n.setViewDelay=e.options.setViewDelay,n.order=e.options.order,n.ratio=e.options.ratio,n.crossOrigin=e.options.crossOrigin,n.minZoom=e.options.minZoom,n.maxZoom=e.options.maxZoom,n.drawOrderEnabled=t.draw_order_enabled,n.popupOptions=e.options.popupOptions;var r=new e.NgwWebmapItem(e.options.webMap,t.root_item,n,e.options.connector);r.emitter.on("init",(function(){return i(r)}))}))];i.label=2;case 2:return[2]}}))}))},t.prototype.getWebMapConfig=function(t){return o(this,void 0,void 0,(function(){var e,i;return r(this,(function(n){switch(n.label){case 0:return[4,this.options.connector.getResource(t)];case 1:return(e=n.sent())&&(this.response=e,i=e[this.webmapClassName],this._setupBaselayers(e),i)?(this._extent=[i.extent_left,i.extent_bottom,i.extent_right,i.extent_top],this._updateItemsParams(i.root_item,this.options.webMap,e),[2,i]):[2]}}))}))},t.prototype._setupBaselayers=function(t){var e,i=this.options.webMap;if(null===(e=this.options.useBasemap)||void 0===e||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){var n=i.getActiveBaseLayer();this._lastActiveBaselayer=n?n.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})},t.prototype._setBasemaps=function(t){for(var e=this,i=this.options.webMap,n=!1,o=function(t){Me({webMap:i,connector:r.options.connector,item:t,adapterOptions:{crossOrigin:r.options.crossOrigin}}).then((function(o){var r=!n&&t.enabled;return t.enabled&&(n=!0),i.addBaseLayer(o,{id:We+t.resource_id,name:t.display_name,opacity:t.opacity,visibility:r}).then((function(t){t.id&&e._webmapBaselayersIds.push(t.id)}))}))},r=this,s=0,a=t.basemaps;s<a.length;s++){o(a[s])}},t.prototype._updateItemsParams=function(t,e,n){var o=this;if(t)if("group"===t.item_type||"root"===t.item_type)t.children&&(t.children=t.children.map((function(t){return o._updateItemsParams(t,e,n)}))),"root"===t.item_type&&(t.display_name=n.resource.display_name);else if("layer"===t.item_type){var r=Y(this.options.connector.options.baseUrl+"/api/component/render/image"),s=t.layer_style_id;t.url=r,t.resourceId=s,t.updateWmsParams=function(t){return Ne(t,s)};var a=he({options:{adapter:t.layer_adapter.toUpperCase(),resource:s},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t=i(i({},t),a)}return t},t.prototype._getWebMapIds=function(){return o(this,void 0,void 0,(function(){var t,e,i,n,o,s,a;return r(this,(function(r){switch(r.label){case 0:if(!(t=this.layer)||"root"!==t.item.item_type)return[3,2];for(e=t.tree.getDescendants(),i=[],n=function(t){var e=t.item;if("layer"===e.item_type){var n=o.options.connector.getResource(e.layer_style_id).then((function(t){if(t){var i=Number(t.resource.parent.id);return e.parentId=i,i}}));i.push(n)}},o=this,s=0,a=e;s<a.length;s++)n(a[s]);return[4,Promise.all(i)];case 1:return[2,r.sent().filter((function(t){return void 0!==t}))];case 2:return[2]}}))}))},t}();var Ae={tms:"TILE"};function ke(t){return new Promise((function(e,i){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState&&200===n.status&&n.responseText)try{e(JSON.parse(n.responseText))}catch(t){i(t)}},n.open("GET",Y(t),!0),n.send()}))}var Ee="https://qms.nextgis.com";function Se(t,e,s){var a;if(void 0===e&&(e=Ee),void 0===s&&(s={}),"webMap"in t){var u=t.webMap,h=t.url,l=n(t,["webMap","url"]);a=u,h&&(e=h),l&&(s=l)}else a=t;return e||(e=Ee),function(){function t(t,e){this.map=t;var n=i(i({},s),e);this.options=n,this.options.baselayer=!0,n.qms&&(this.qms=n.qms)}return t.prototype.addLayer=function(n){return o(this,void 0,void 0,(function(){var o,s,u,h,l,c,p,d;return r(this,(function(r){switch(r.label){case 0:if(this.qms||!n.qmsId)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),o=this,[4,ke(e+"/api/v1/geoservices/"+n.qmsId)];case 2:return o.qms=r.sent(),[3,4];case 3:return s=r.sent(),console.error(s),[3,4];case 4:return(u=this.qms)&&(l=a.mapAdapter.layerAdapters[h=Ae[u.type||"tms"]])&&(m=t,_=l,["showLayer","hideLayer"].forEach((function(t){var e=Object.getOwnPropertyDescriptor(_.prototype,t);e&&Object.defineProperty(m.prototype,t,e)})),"TILE"===h)?(n=i(i({order:0,maxZoom:a.options.maxZoom,minZoom:a.options.minZoom},this.options),function(t){var e=("https:"===location.protocol?"https":"http")+"://",i=t.url.replace(/^(https?|ftp):\/\//,e);return t.y_origin_top||(i=i.replace("{y}","{-y}")),{url:i,name:t.name,attribution:t.copyright_text,maxZoom:t.z_max,minZoom:t.z_min}}(u)),u.origin_url&&(f=[],c=[u.origin_url.replace(/{switch:(.*?)}/,(function(t,e){return"string"==typeof e&&e.split(",").forEach((function(t){return f.push(t)})),"{s}"})),f],p=c[0],(d=c[1]).length&&(n.subdomains=d,n.url=p)),this.options=n,[2,new l(this.map,n).addLayer(n)]):[2]}var f,m,_}))}))},t}()}var ze=function(){function t(t){this.options={url:"https://qms.nextgis.com"},this.options=i(i({},this.options),t),this.url=this.options.url}return t.prototype.getLayerAdapters=function(){var t=this;return Promise.resolve([{name:"QMS",createAdapter:function(e){return Promise.resolve(t._createAdapter(e))}}])},t.prototype._createAdapter=function(t){return Se({webMap:t,url:this.url})},t.utils={createQmsAdapter:Se},t}();var Ie={},Be=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];function Ze(t){var e=t.layerOptions,n=t.webMap,s=t.connector,a=t.item;return o(this,void 0,void 0,(function(){var t,o;return r(this,(function(r){switch(r.label){case 0:return[4,s.getResourceChildren(a.resource.id)];case 1:return t=r.sent(),(o=t&&t[0])?[2,Re(i(i({},e),{resource:o.resource.id}),n,s)]:[2]}}))}))}function Re(t,n,s){return o(this,void 0,void 0,(function(){var a,u,h,l,c,p,d,f,m,_,y,v,g,b;return r(this,(function(w){switch(w.label){case 0:return h=t.adapter,[4,Kt(t,s)];case 1:return(l=w.sent())?(c=t.resource)&&c.resource&&void 0!==c.resource.id?(u=c,[3,4]):[3,2]:[3,15];case 2:return[4,s.getResource(l)];case 3:u=w.sent(),w.label=4;case 4:return u?(p=u.resource.cls,d=i(i({},t),{resource:l}),f={layerOptions:d,webMap:n,connector:s,item:u},-1===Be.indexOf(p)?[3,12]:"webmap"!==p?[3,5]:(a=function(t){var i=t.layerOptions,n=t.webMap,s=t.connector;return o(this,void 0,void 0,(function(){var t;return r(this,(function(o){switch(o.label){case 0:return[4,Kt(i,s)];case 1:return t=o.sent(),[2,function(i){function o(e){return i.call(this,e,{url:"",webMap:n,resourceId:t,connector:s})||this}return e(o,i),o}(Oe)]}}))}))}(f),[3,11])):[3,14];case 5:if("vector_layer"!==p&&"postgis_layer"!==p)return[3,6];if(m=u.vector_layer&&je[u.vector_layer.geometry_type],(_=f.layerOptions.adapterOptions||{}).type=_.type||m,f.layerOptions.adapterOptions=_,t.adapterOptions=f,void 0!==h&&"GEOJSON"!==h){if("MVT"!==h)return[2,Ze(f)];a=le(f)}else a=ue(f);return[3,11];case 6:return"raster_layer"!==p?[3,7]:[2,Ze(f)];case 7:return"basemap_layer"!==p?[3,8]:(a=function(t){var n=t.webMap,s=t.item;return o(this,void 0,void 0,(function(){var t,a,u,h,l;return r(this,(function(c){if(s.basemap_layer){if(a=s.basemap_layer.url,t=s.basemap_layer.qms)return u=JSON.parse(t),[2,Promise.resolve(ze.utils.createQmsAdapter(n,void 0,{qms:u,baselayer:!0}))];if(a&&(h=n.mapAdapter.layerAdapters.TILE))return l=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.addLayer=function(e){return o(this,void 0,void 0,(function(){return r(this,(function(n){return[2,t.prototype.addLayer.call(this,i(i({},e),{url:a}))]}))}))},n}(h),[2,l]}return[2]}))}))}(f),[3,11]);case 8:return"GEOJSON"!==h?[3,10]:[4,s.getResource(u.resource.parent.id)];case 9:return(y=w.sent())&&(v=i(i({},t),{resource:u.resource.parent.id}),a=ue(i(i({},f),{item:y,layerOptions:v}))),[3,11];case 10:a=le(f),w.label=11;case 11:return[3,13];case 12:if(!Ie[p])throw"Resource class '".concat(p,"' not yet supported.");g=Ie[p],b=void 0,(b=h&&"function"!=typeof b?g[h]:g)&&(a=b(f)),w.label=13;case 13:return[3,15];case 14:throw"Resource item is not found";case 15:return a?[2,a.then((function(t){if(t){var e=t;return u&&(e.prototype.item=u,e.prototype.resourceId=u.resource.id,e.prototype.connector=s),I(e,[qt],{replace:!1}),e}}))]:[2]}}))}))}function Ne(t,e){var i=t.bbox,n=t.width,o=t.height,r=t.nd;return{resource:Array.isArray(e)?e.join(","):e,extent:i,size:n+","+o,timestamp:Date.now(),nd:null!=r?r:200}}var De,je={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};var Fe=function(){function t(t){if(this.options=t,this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new Ft({baseUrl:this.url,auth:this.options.auth})}}return t.addClassAdapters=function(t,e){Ie[t]=e},t.prototype.onLoadSync=function(t){return o(this,void 0,void 0,(function(){var e,n,o;return r(this,(function(r){switch(r.label){case 0:if(!this.options.resourceId||!this.url)return[3,4];if(!(e=[this.options.resourceId]).length)return[3,4];n=0,o=e,r.label=1;case 1:return n<o.length?[4,t.addLayer(Oe,i({visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius},{resourceId:o[n],connector:this.connector,webMap:t}))]:[3,4];case 2:return[2,r.sent()];case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.getLayerAdapters=function(){return Promise.resolve([this._getLayerAdapter()])},t.prototype._getLayerAdapter=function(){var t=this;return{name:"WEBMAP",createAdapter:function(e){return Promise.resolve(t._createAdapter(e))}}},t.prototype._createAdapter=function(t){var n;return n={webMap:t,connector:this.connector,baseUrl:this.url},function(t){function o(e,o){return o=i(i({},n),o),t.call(this,e,o)||this}return e(o,t),o}(Oe)},t}(),Ue=function(){function t(t){var e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}return t.prototype.identify=function(t){var e=this;return void 0===t&&(t={}),this._item?z.resolve(this._item):He(i({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"]},t)).then((function(t){return e._item=t,e.geom=t.geom,e.extensions=t.extensions,t}))},t.prototype.resource=function(){var t=this;return this._resource?z.resolve(this._resource.feature_layer):this.connector.getResource(this.layerId).then((function(e){return t._resource=e,t._resource.feature_layer}))},t.prototype.getBounds=function(){return this._extent?z.resolve(this._extent):(t={connector:this.connector,featureId:this.id,resourceId:this.layerId}).connector.get("feature_layer.feature.item_extent",{cache:void 0===(e=t.cache)||e},{id:t.resourceId,fid:t.featureId}).then((function(t){if(t){var e=t.extent;return[e.minLon,e.minLat,e.maxLon,e.maxLat]}}));var t,e},t.prototype.geojson=function(){var t=this;return this._geojson?z.resolve(this._geojson):this.identify().then((function(e){return e.toGeojson().then((function(e){return t._geojson=e,e}))}))},t}(),We="webmap-baselayer";function He(t){var e=i({},Yt);Xt(e,t);var n=i({id:t.resourceId,fid:t.featureId},e);return t.connector.get("feature_layer.feature.item",{cache:t.cache||!0},n).then((function(e){return i(i({},e),{toGeojson:function(){return e.geom?z.resolve(Qt(e)):He(i(i({},t),{geom:!0,fields:null,extensions:null})).then((function(t){var n=t.geom;return Qt(i(i({},e),{geom:n}))}))}})}))}function Ve(t){return He(t).then((function(t){return Qt(t)}))}function qe(t,e){void 0===e&&(e=!1);var i=[],n=[];for(var o in t){var r=Number(o);isNaN(r)||i.push(r)}var s=t.resources;s&&i.sort((function(t,e){return s.indexOf(t)-s.indexOf(e)}));for(var a=0;a<i.length;a++){var u=t[o=i[a]];if("features"in u){var h=Ge(u.features,Number(o),e);if(h.length&&(n.push.apply(n,h),!e))break}}return n}function Ge(t,e,i){for(var n=[],o=0,r=t;o<r.length;o++){var s=r[o];if(n.push({featureId:s.id,resourceId:e,feature:s}),!i)break}return n}function Je(t,e){N(t);var n=t.lngLat,o=e.geom,r=e.signal,s=e.cache,a=null!=o?o:function(t,e,i,n){void 0===i&&(i=10),void 0===n&&(n=6);for(var o=i/j*H,r=o/Math.cos(e*W),s=[],a=0;a<n+1;a++){var u=Math.PI*(a/(n/2)),h=t+r*Math.cos(u),l=e+o*Math.sin(u);s.push([h,l])}return s}(n[0],n[1],e.radius);return function(t){var e=t.geom,i=t.signal,n=t.cache,o=[];if(Array.isArray(e))o=e;else{var r="Feature"===e.type?e.geometry:"Polygon"===e.type&&e;r&&(o=r.coordinates[0])}if(o){for(var s=[],a=0,u=o;a<u.length;a++){var h=u[a],l=V(h[0],h[1]);s.push(l[0]+" "+l[1])}var c="POLYGON((".concat(s.join(", "),"))");return t.connector.post("feature_layer.identify",{data:{geom:c,srs:3857,layers:t.layers},signal:i,cache:n})}throw new Error("Not valid geometry format to make intersection")}(i(i({},e),{geom:a,signal:r,cache:s}))}function Ke(t,e){var i;return o(this,void 0,void 0,(function(){var n,o,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return[4,t.get("pyramid.settings",null,{component:"pyramid"})];case 1:if(!((n=r.sent())&&n.company_logo&&n.company_logo.enabled))return[3,6];(o=document.createElement("a")).style.position="absolute",o.style.bottom="0",o.style.right="0",o.style.padding=null!==(i=null==e?void 0:e.padding)&&void 0!==i?i:"10px",o.className="ngw-map-logo",e&&e.cssClass&&(o.className+=" "+e.cssClass),(s=new Image).style.maxHeight="100px",s.style.maxWidth="100px",s.src="",r.label=2;case 2:return r.trys.push([2,4,,5]),[4,t.get("pyramid.company_logo",{responseType:"blob"})];case 3:return a=r.sent(),u=window.URL||window.webkitURL,h=u.createObjectURL(a),s.src=h,[3,5];case 4:return l=r.sent(),console.warn(l),[3,5];case 5:return null!==n.company_logo.link&&""!==n.company_logo.link.trim()&&(o.href=n.company_logo.link,o.target="_blank",-1!==n.company_logo.link.search(/:\/\/nextgis/)&&(s.alt="Get your own Web GIS at nextgis.com")),o.appendChild(s),[2,o];case 6:return[2]}}))}))}var Ye={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'};function Qe(t){var e,i,n,o;void 0===t&&(t={});var r=null!==(e=t.shape)&&void 0!==e?e:"circle",s=null!==(i=t.color)&&void 0!==i?i:"blue",a=null!==(n=t.strokeColor)&&void 0!==n?n:"white",u=null!==(o=t.size)&&void 0!==o?o:12,h=u/2,l="number"==typeof t.stroke?t.stroke:.8,c=u/12,p=t.p||Ye[r]||"circle",d="string"==typeof p?p:p(t),f=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function(t,e,i,n){void 0===i&&(i=0);var o=i/2;return'<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="'.concat(t,'"\n height="').concat(e,'"\n viewBox="-').concat(o," -").concat(o," ").concat(t+i," ").concat(e+i,'"\n >').concat(n,"</svg>")}(u,u,l*c,d)),m=f.firstChild,_="scale(".concat(c,")");return m.setAttribute("fill",s),l&&(m.setAttribute("stroke",a),m.setAttribute("stroke-width",String(l))),m.setAttribute("transform",_),{type:"icon",iconSize:[u,u],iconAnchor:[h,h],html:(new XMLSerializer).serializeToString(f),svg:f}}function Xe(t,e,n,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push(i(i({},n),{resource:e}));else if(Array.isArray(e)){var r=e[0],s=e[1];t.push(i(i(i({},n),{resource:r,id:s}),o))}else"object"==typeof e&&t.push(i(i(i({},n),e),o))}var $e={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};var ti=function(t){function n(e){var n=t.call(this,function(t){var e=[new ze];return t.starterKits&&t.starterKits.forEach((function(t){e.push(t)})),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new Ft({baseUrl:t.baseUrl||"",auth:t.auth}),(t=R($e,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new Fe({connector:t.connector,auth:t.auth})),i(i({},t),{starterKits:e,create:!1})}(e))||this;return n.emitter=new p.exports.EventEmitter,n._ngwLayers={},n._promises={select:[],identify:[]},e.connector&&(n.connector=e.connector),n._createWebMap().then((function(){var t=n.getContainer();t&&t.classList.add("ngw-map-container"),n.options.whitlabel&&n._whiteLabel()})),n}return e(n,t),n.prototype.addControl=function(e,i,n){return o(this,void 0,void 0,(function(){return r(this,(function(o){switch(o.label){case 0:return[4,this.onLoad("controls:create")];case 1:return o.sent(),[2,t.prototype.addControl.call(this,e,i,n)]}}))}))},n.prototype.addNgwLayer=function(t){return o(this,void 0,void 0,(function(){var e,n,o,s,a,u,h,l,c;return r(this,(function(r){switch(r.label){case 0:return[4,this.onMapLoad()];case 1:if(r.sent(),n=t.resourceId,((e=t.keyname)||void 0!==n)&&console.warn("DEPRECATED WARN: ".concat("set `resource` options instead of `keyname` or `resourceId`")),o=t.resource,!e&&!n&&!o)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(!B(this.options.baseUrl))return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),B(this.options.setViewDelay)&&(t.adapterOptions=t.adapterOptions||{},B(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay)),s=function(t,e,i){var n=i.getAuthorizationHeaders();return n&&(t.headers=n),Re(t,e,i)}(t,this,this.connector),a=i(i({visibility:!0},t),t.adapterOptions),[4,this.addLayer(s,a)];case 3:return u=r.sent(),h=u&&this.getLayerId(u),u&&h&&(this._ngwLayers[h]={layer:u,resourceId:u.resourceId},u.options.name=u.options.name||u.item&&u.item.resource.display_name,u.options.baselayer&&this.getActiveBaseLayer()),[2,u];case 4:return l=r.sent(),c=K(o)&&"id"in o?o.id:e||n||o,console.error("Can't add NGW layer ".concat(c,"."),l),[3,5];case 5:return[2]}}))}))},n.prototype.fit=function(){var t,e=(t=this.options).center,i=t.zoom,n=t.bounds;e?(this.setCenter(e),i&&this.setZoom(i)):n&&this.fitBounds(n)},n.prototype.fetchNgwLayerItem=function(t){return He(i({connector:this.connector},t))},n.prototype.fetchNgwLayerItems=function(t){return re(i({connector:this.connector},t))},n.prototype.fetchNgwLayerFeature=function(t){return Ve(i({connector:this.connector},t))},n.prototype.fetchNgwLayerFeatures=function(t){return ae(i({connector:this.connector},t))},n.prototype.fetchIdentifyItem=function(t,e){var n,o,r,s=(o=(n={identify:t,connector:this.connector,requestOptions:e}).connector,(r=qe(n.identify))&&r.length?He(i(i({connector:o},n.requestOptions),r[0])):z.resolve(void 0));return this._addPromise("identify",s),s},n.prototype.fetchIdentifyGeoJson=function(t,e){void 0===e&&(e=!1);var n=function(t){var e=t.connector,n=t.identify,o=t.requestOptions;for(var r in n){var s=Number(r);if(!isNaN(s)){var a=n[r];if("features"in a){var u=a.features.find((function(t){return t.geom}));if(u&&u.geom){var h=u.geom;return z.resolve(Qt(i(i({},u),{geom:h})))}}}}var l=qe(n);return l&&l.length?Ve(i(i(i({},o),{connector:e}),l[0])):z.resolve(void 0)}({identify:t,connector:this.connector,multiple:e});return n&&"then"in n?(this._addPromise("identify",n),n):z.resolve(n)},n.prototype.getIdentifyGeoJson=function(t,e){return void 0===e&&(e=!1),this.fetchIdentifyGeoJson(t,e)},n.prototype.getNgwLayers=function(){return o(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return[4,this.onLoad()];case 1:return t.sent(),[2,this._ngwLayers]}}))}))},n.prototype.getNgwLayerByResourceId=function(t){return o(this,void 0,void 0,(function(){var e,i,n,o,s,a,u,h;return r(this,(function(r){switch(r.label){case 0:for(n in i=[],e=this._ngwLayers)i.push(n);o=0,r.label=1;case 1:return o<i.length?(n=i[o])in e?(s=this._ngwLayers[n]).resourceId!==t?[3,2]:[2,s&&s.layer]:[3,5]:[3,6];case 2:return s.layer.getIdentificationIds?[4,s.layer.getIdentificationIds()]:[3,4];case 3:if((a=r.sent())&&a.some((function(e){return e===t})))return[2,s.layer];r.label=4;case 4:if(s.layer.getDependLayers&&(u=s.layer.getDependLayers(),h=u.find((function(e){return e.item&&e.item.parentId===t}))))return[2,h.layer];r.label=5;case 5:return o++,[3,1];case 6:return[2]}}))}))},n.prototype.fitLayer=function(e,i){return o(this,void 0,void 0,(function(){var n,o,s,a,u=this;return r(this,(function(r){switch(r.label){case 0:return n="string"==typeof e||"number"==typeof e?String(n):e.id,(o=n&&this._ngwLayers[n])?o.layer.getBounds?[4,o.layer.getBounds()]:[3,2]:[3,7];case 1:return(s=r.sent())&&this.fitBounds(s,i),[3,6];case 2:return a=void 0,o.layer.item?(a=o.layer.item,[3,5]):[3,3];case 3:return[4,this.connector.getResource(o.resourceId)];case 4:a=r.sent(),r.label=5;case 5:a&&Ht({resourceId:a.resource.id,connector:this.connector}).then((function(t){t&&u.fitBounds(t,i)})),r.label=6;case 6:return[3,8];case 7:t.prototype.fitLayer.call(this,"number"==typeof e?String(e):e,i),r.label=8;case 8:return[2]}}))}))},n.prototype.zoomToLayer=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return[2,this.fitLayer(t)]}))}))},n.prototype.onLoad=function(e){return void 0===e&&(e="ngw-map:create"),t.prototype.onLoad.call(this,e)},n.prototype.removeLayer=function(e){var i=this.getLayer(e);if(i){var n=this.getLayerId(i);n&&delete this._ngwLayers[n],t.prototype.removeLayer.call(this,i)}},n.prototype.enableSelection=function(){var t=this;this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=function(e){t._getSelectListenersCount()&&t.selectFromNgwRaster(e)},this.$$selectFromNgwVector=function(e){t._getSelectListenersCount()&&t._selectFromNgwVector(e)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))},n.prototype.disableSelection=function(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)},n.prototype.getNgwLayerItem=function(t){return this.fetchNgwLayerItem(t)},n.prototype.getNgwLayerItems=function(t){return this.fetchNgwLayerItems(t)},n.prototype.getNgwLayerFeature=function(t){return this.fetchNgwLayerFeature(t)},n.prototype.getNgwLayerFeatures=function(t){return this.fetchNgwLayerFeatures(t)},n.prototype.cancelPromise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.cancelPromises.apply(this,t)},n.prototype.cancelPromises=function(){for(var t=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];e.length||(e=Object.keys(this._promises)),e.forEach((function(e){var i=t._promises[e];i&&(i.forEach((function(t){return t.cancel()})),t._promises[e]=[])}))},n.prototype.selectFromNgwRaster=function(t){return o(this,void 0,void 0,(function(){var e,n,o,s,a,u,h,l,c,p,d,f,m,_,y,v,g=this;return r(this,(function(r){switch(r.label){case 0:for(this._emitStatusEvent("ngw:preselect"),e=[],(n=Object.values(this._ngwLayers)).sort((function(t,e){return t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1})),o=0,s=n;o<s.length;o++)(u="function"==typeof(a=s[o].layer).getIdentificationIds&&a.getIdentificationIds)&&a.options.selectable&&this.isLayerVisible(a)&&e.push(u.call(a));return[4,Promise.all(e)];case 1:for(h=r.sent(),l=[],c=0,p=h;c<p.length;c++)(d=p[c])&&l.push.apply(l,d);return l.length?(f=this.options.pixelRadius||10,m=this.getCenter(),_=void 0!==(_=this.getZoom())?_:20,m&&_?(y=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(m,_,f),v=Je(t,{layers:l,connector:this.connector,radius:y}).then((function(e){var n=i(i({},e),{resources:l,sourceType:"raster",event:t}),o=g._prepareToIdentify(n);return g._emitStatusEvent("ngw:select",o),o})),this._addPromise("select",v),[2,v]):(this._emitStatusEvent("ngw:select",null),[2])):(this._emitStatusEvent("ngw:select",null),[2])}}))}))},n.prototype._addPromise=function(t,e){var i=this._promises[t];if(i&&-1===i.indexOf(e)){var n=function(){var t=i.indexOf(e);-1!==t&&i.splice(t,1)};e.then(n),e.catch(n),i.push(e)}},n.prototype._isFitFromResource=function(){var t=this._initMapState;return!t.zoom||!t.center},n.prototype._createWebMap=function(){return o(this,void 0,void 0,(function(){var t,e,i,n,o,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return[4,this.create()];case 1:if(r.sent(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer(),t=[],e=this._isFitFromResource(),this.options.webmapId&&Xe(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(i=0,n=this.options.resources;i<n.length;i++)o=n[i],s={},e||(s.fit=!1),Xe(t,o,{},s);a=0,u=t,r.label=2;case 2:if(!(a<u.length))return[3,7];h=u[a],r.label=3;case 3:return r.trys.push([3,5,,6]),[4,this.addNgwLayer(h)];case 4:return r.sent(),[3,6];case 5:return l=r.sent(),console.warn(l),[3,6];case 6:return a++,[3,2];case 7:return this._emitStatusEvent("ngw-map:create",this),this.enableSelection(),[2]}}))}))},n.prototype._addOsmBaseLayer=function(){this.addBaseLayer("OSM")},n.prototype._addQmsBaseLayer=function(){var t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);var i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)},n.prototype._selectFromNgwVector=function(t){var e,n=t.layer;if(n.options.selectable&&this.isLayerVisible(n)){var o=n.item&&n.item.resource.id,r=t.feature;if(void 0!==o&&r){var s=r.id;if(s){var a={id:Number(s),fields:r.properties||{},label:"#".concat(o),layerId:Number(o),parent:"",geom:r.geometry},u=((e={featureCount:1})[o]={featureCount:1,features:[a]},e);return this._emitStatusEvent("ngw:select",this._prepareToIdentify(i(i({},u),{resources:[o],sourceType:"vector"}))),u}}}},n.prototype._prepareToIdentify=function(t){var e=this;return i(i({},t),{getIdentifyItems:function(){return qe(t,!0).map((function(t){return new Ue({feature:t.feature,connector:e.connector})}))}})},n.prototype._getSelectListenersCount=function(){return this.emitter.listenerCount("ngw:select")},n.prototype._whiteLabel=function(){return o(this,void 0,void 0,(function(){var t,e;return r(this,(function(i){switch(i.label){case 0:return(t=this.getContainer())?[4,Ke(this.connector,this.options.companyLogoOptions)]:[3,2];case 1:(e=i.sent())&&t.appendChild(e),i.label=2;case 2:return[2]}}))}))},n.getIcon=Qe,n}(Ct);function ei(t){var e=t.containerPoint,i=t.latlng;return{latLng:i,lngLat:[i.lng,i.lat],pixel:{left:e.x,top:e.y},source:t}}function ii(t,e,i){return void 0===e&&(e={}),new(l.exports.Control.extend({onAdd:function(){var n=document.createElement("div"),o=t.onAdd(i);return n.classList.add("leaflet-control"),e.bar&&n.classList.add("leaflet-bar"),e.addClass&&n.classList.add(e.addClass),e.margin||e.bar||(n.style.marginBottom="0px",n.style.marginTop="0px",n.style.marginLeft="0px",n.style.marginRight="0px"),o&&n.appendChild(o),l.exports.DomEvent.disableClickPropagation(n),n},onRemove:function(){t.onRemove()}}))}var ni=function(t){function i(e){var i=t.call(this,e)||this,n=e&&e.customAttribution;if(n){var o=[];Array.isArray(n)?o=n:n&&(o=[n]),o.forEach((function(t){return i.addAttribution(t)}))}return i}return e(i,t),i}(l.exports.Control.Attribution);function oi(t){var e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}var ri={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},si={stroke:!1,opacity:1},ai={};for(var ui in ri){var hi=ri[ui],li=ai[hi]||[];li.push(ui),ai[hi]=li}function ci(t,e){return-1!==(ai[e]||[]).indexOf(t)}function pi(t){var e=new l.exports.GeoJSON;return(Array.isArray(t)?t:[t]).forEach((function(t){return e.addData(t)})),e.getBounds()}function di(t){return{getBounds:function(){return function(t){return oi(pi(t))}(t)},getCenter:function(){return function(t){var e=pi(t).getCenter();return[e.lng,e.lat]}(t)}}}function fi(t){for(var e={},i=0;i<t.length;i++)e[t[i]]=1+(e[t[i]]||0);var n="";for(var o in e){e[o]>(n?e[n]:0)&&(n=o)}return n}var mi=function(){function t(t,e){if(this.map=t,this.options=e,this.pane="order-0",void 0!==e.order){var i="order-"+e.order,n=t.getPane(i);n||(n=t.createPane(i)),n.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}return t.prototype.addLayer=function(t){Object.assign(this.options,t)},t}(),_i=function(t){function s(e,i){var n=t.call(this,e,i)||this;return n.selected=!1,n._layers=[],n._selectedLayers=[],n._filteredLayers=[],n._openedPopup=[],n.$updateTooltip=D((function(){n.updateTooltip()}),300),n.$unselect=function(){n.unselect()},n}return e(s,t),s.prototype.addLayer=function(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new l.exports.FeatureGroup([],i(i({},t.nativeOptions),{pane:this.pane})),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer},s.prototype.beforeRemove=function(){this._removeMapListener()},s.prototype.select=function(t){if(this.unselect(),t)for(var e=0,i=this._layers.filter(t);e<i.length;e++){this._selectLayer(i[e],"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._setPaintEachLayer(this.selectedPaint))},s.prototype.unselect=function(t){var e=this;if(t)this._layers.filter(t).forEach((function(t){e._unSelectLayer(t)}));else if(this.selected){for(var i=0,n=this._openedPopup;i<n.length;i++){this._removePopup(n[i][0])}this.paint&&this._setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}},s.prototype.getSelected=function(){var t=this;return this._selectedLayers.map((function(e){return i({target:t,feature:e.feature,layer:e},di(e.feature))}))},s.prototype.getFiltered=function(){return this._filteredLayers},s.prototype.filter=function(t){var e=this;this._filterFun=t;var n=this.layer,o=n&&n._map;if(n&&o){n.remove();var r=[];this._layers.forEach((function(o){var s=o.feature,a=o.layer;a&&(!t||t(i({target:e,feature:s,layer:a},di(s)))?(n.addLayer(a),r.push(i({target:e,feature:s,layer:a},di(s)))):n.removeLayer(a))})),this._filteredLayers=r,n.addTo(o)}return this._filteredLayers},s.prototype.cleanFilter=function(){this.filter()},s.prototype.getLayers=function(){var t=this;return this._layers.map((function(e){var n=e.layer,o=e.feature;return i({feature:o,layer:n,visible:n&&!!n._map,target:t},di(o))}))},s.prototype.clearLayer=function(t){this.unselect();var e=this.layer;if(e)if(t)for(var i=this._layers.length;i--;){var n=this._layers[i];if(n){var o=n.feature,r=n.layer;if(o&&r)t(o)&&(e.removeLayer(r),this._layers.splice(i,1))}}else e.clearLayers(),this._layers=[]},s.prototype.setData=function(t){this.clearLayer(),this.addData(t)},s.prototype.addData=function(t){var e,i=this.options;if(i){if(t){var n=void 0;if(i.type)n=i.type;else{var o=function(t){var e;e="FeatureCollection"===t.type?fi(t.features.map((function(t){return t.geometry.type}))):"GeometryCollection"===t.type?fi(t.geometries.map((function(t){return t.type}))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);n=ri[o]}if(this.type&&this.type!==n)return void console.warn("no other data type than layer can be added");this.type=n,t=function(t,e){if("FeatureCollection"===t.type)(i=t).features=i.features.filter((function(t){return ci(t.geometry.type,e)}));else if("Feature"===t.type){if(!ci(t.geometry.type,e))return!1}else if("GeometryCollection"===t.type){var i;(i=t).geometries=i.geometries.filter((function(t){return ci(t.type,e)}))}return t}(t,n),t&&(e=this._getGeoJsonOptions(i,n))}new l.exports.GeoJSON(t||void 0,e)}},s.prototype.openPopup=function(t,e){var i=this;t&&this._layers.filter(t).forEach((function(t){i._openPopup(t,e,"api")}))},s.prototype.closePopup=function(t){var e=this;(t?this._openedPopup.filter((function(e){return t(e[2])})):this._openedPopup).forEach((function(t){e._removePopup(t[0])}))},s.prototype.updateTooltip=function(t){var e=this;t?this._updateTooltip(t):this.getLayers().forEach((function(t){return e._updateTooltip({feature:t.feature,layer:t.layer})}))},s.prototype.getExtent=function(){return this.getBounds()},s.prototype.getBounds=function(){if(this.layer){var t=this.layer.getBounds();if(t.isValid())return oi(t)}},s.prototype.setOpacity=function(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)},s.prototype.setPaint=function(t){if(t){this.paint=t;for(var e=0,i=this._layers;e<i.length;e++){this._setPaint(i[e],t)}}},s.prototype.setSelectedPaint=function(t){if(t){this.selectedPaint=t;for(var e=0,i=this._selectedLayers;e<i.length;e++){this._setPaint(i[e],t)}}},s.prototype.updatePaint=function(t){this.paint=i(i({},this.paint),t);for(var e=0,n=this._layers;e<n.length;e++){this._setPaint(n[e],this.paint)}},s.prototype.updateSelectedPaint=function(t){this.selectedPaint=i(i({},this.selectedPaint),t);for(var e=0,n=this._selectedLayers;e<n.length;e++){this._setPaint(n[e],this.selectedPaint)}},s.prototype._updateTooltip=function(t){var e=t.feature,i=t.layer;if(e&&i&&e.properties&&this.options.labelField){i.unbindTooltip();var n=e.properties[this.options.labelField];if(void 0!==n){var o=!this.options.labelOnHover;i.bindTooltip(String(n),{permanent:o,sticky:!1})}}},s.prototype._openPopup=function(t,e,n,s){var a,u;return void 0===e&&(e={}),o(this,void 0,void 0,(function(){var o,h,l,c,p,d,f,m,_,y,v,g,b,w,x,L=this;return r(this,(function(r){switch(r.label){case 0:return o=t.feature,h=t.layer,l=i({minWidth:300},e),c=l.minWidth,p=l.autoPan,d=l.maxWidth,m=null!=(f=l.closeButton)?f:!this.options.selectOnHover,y=[],v=function(t){y.push(t)},g=function(){_&&L._removePopup(_)},e.createPopupContent?[4,e.createPopupContent(i({layer:h,feature:o,target:this,type:n,close:g,onClose:v},di(o)))]:[3,2];case 1:return b=r.sent(),[3,3];case 2:b=e.popupContent,r.label=3;case 3:return b&&h&&(w={minWidth:c,autoPan:p,closeButton:m,closeOnClick:!1,autoClose:!1},B(d)&&(w.maxWidth=d),_=h.bindPopup(b,w),(null===(u=null===(a=this.options.popupOptions)||void 0===a?void 0:a.unselectOnClose)||void 0===u||u)&&(x=h.getPopup())&&x.once("remove",(function(){g()}),this),this._openedPopup.push([_,y,t]),_.openPopup(s)),[2]}}))}))},s.prototype._removePopup=function(t){var e,i;if(this.map){t.closePopup().unbindPopup();var n=this._openedPopup.findIndex((function(e){return e[0]===t}));if(-1!==n){for(var o=null===(i=null===(e=this.options.popupOptions)||void 0===e?void 0:e.unselectOnClose)||void 0===i||i,r=this._openedPopup[n],s=r[1],a=r[2],u=0,h=s;u<h.length;u++){(0,h[u])(a)}s.length=0,o&&this._unSelectLayer(a),this._openedPopup.splice(n,1)}}},s.prototype._setPaintEachLayer=function(t){var e=this;this._layers.forEach((function(i){e._setPaint(i,t)}))},s.prototype._setPaint=function(t,e){var i=void 0,n=t.layer,o=t.feature;if(n&&o&&(X(e)?i=e(o):Q(e)&&(i=e),i))if("point"===this.type&&"icon"===i.type){var r=n,s=this._createDivIcon(i);r.setIcon(s)}else"setStyle"in n&&n.setStyle(this._preparePaint(i))},s.prototype._preparePaint=function(t){if("get-paint"!==t.type){var e="line"===this.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(var n=0,o=e;n<o.length;n++){var r=o[n],s=r[0],a=r[1],u=t[a];B(this.options.opacity)&&-1!==a.toLowerCase().indexOf("opacity")&&(u=Number(u)*this.options.opacity),void 0!==u&&Object.defineProperty(i,s,{enumerable:!0,value:u})}return i}return si},s.prototype._getGeoJsonOptions=function(t,e){var n=this,o=t.paint,r={};return"function"==typeof o?"point"===e?r.pointToLayer=function(t,e){var i=o(t);return n._createPaintToLayer(i)(t,e)}:r={style:function(t){return n._preparePaint(i(i({},si),t?o(t):{type:"path"}))}}:r=this._createPaintOptions(o,e),r.onEachFeature=function(t,e){n._onEachFeature(t,e)},r},s.prototype._onEachFeature=function(t,e){var n=this,o=this.layer;if(o){var r=i({target:this,feature:t,layer:e},di(t));e.options.pane=this.pane,this._layers.push(r);var s=!0;if(this._filterFun&&(s=this._filterFun(r)),s){var a=this.options,u=a.popup,h=a.popupOptions,l=a.selectable,c=a.interactive,p=a.selectOnHover;e.options.interactive=!B(c)||c,o.addLayer(e),l&&(p?(e.on("mouseover",(function(){n._selectLayer(r,"hover")})),e.on("mouseout",(function(){n._unSelectLayer(r)}))):e.on("click",(function(t){return n._selectOnLayerClick(t)}),this)),this._handleMouseEvents(e),setTimeout((function(){u&&n._openPopup(i({target:n,layer:e,feature:t},di(t)),h,"api"),n._updateTooltip({layer:e,feature:t})}))}}},s.prototype._handleMouseEvents=function(t){var e=this,n=this.options,o=n.onMouseOut,r=n.onMouseOver,s=n.onClick||n.onLayerClick;s&&t.on("click",(function(n){var o=!!e._getSelected(t);s(i({selected:o},e._createMouseEvent(n)))}),this),o&&t.on("mouseout",(function(t){o(e._createMouseEvent(t))}),this),r&&t.on("mouseover",(function(t){r(e._createMouseEvent(t))}),this)},s.prototype._createMouseEvent=function(t){return function(t){var e=t.source,n=e.target.feature;return i({layer:t.layer,feature:n,event:ei(e),source:e},di(n))}({layer:this,source:t})},s.prototype._getSelected=function(t){return this._selectedLayers.find((function(e){return e.layer===t}))},s.prototype._selectOnLayerClick=function(t){l.exports.DomEvent.stopPropagation(t);var e=t.target,n=e.feature,o=i({target:this,layer:e,feature:n},di(n)),r=this._getSelected(e);r?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(r):this._selectLayer(o,"click",t.latlng)},s.prototype._selectLayer=function(t,e,n){var o=this;this.options.multiselect||(this.map._addUnselectCb((function(){o._unSelectLayer(t)})),this._selectedLayers.forEach((function(t){return o._unSelectLayer(t)}))),this._selectedLayers.push(t),this.selected=!0;var r=this.options,s=r.selectedPaint,a=r.popupOnSelect,u=r.popupOptions;if(s&&t.layer&&this._setPaint(t,s),a&&this._openPopup(t,u,e,n),this.options.onSelect){var h=t.feature?[t.feature]:[];this.options.onSelect(i({type:e,layer:this,features:h},di(h)))}},s.prototype._unSelectLayer=function(t){var e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0},s.prototype._createDivIcon=function(t){var e=n(t,[]);return new l.exports.DivIcon(i({className:""},e))},s.prototype._createPaintToLayer=function(t){var e=this;if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return function(i,n){var o=e._createDivIcon(t);return new l.exports.Marker(n,{icon:o})}}else if("pin"===t.type)return function(t,e){return new l.exports.Marker(e)};return function(n,o){return new l.exports.CircleMarker(o,e._preparePaint(i(i({},si),t)))}},s.prototype._createPaintOptions=function(t,e){var i={},n=t&&this._preparePaint(t)||{};return t&&(i.style=function(){return n}),"point"===e?i.pointToLayer=this._createPaintToLayer(t):"line"===e&&(n.stroke=!0),i},s.prototype._addMapClickListener=function(){var t=this.map;if(t){var e=this.options.unselectOnClick;(null==e||e)&&t.on("click",this.$unselect)}},s.prototype._removeMapClickListener=function(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)},s.prototype._addMapListener=function(){var t=this.map;if(t){var e=this.options,i=e.labelField,n=e.labelOnHover;this._addMapClickListener(),i&&!n&&(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}},s.prototype._removeMapListener=function(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)},s}(mi);function yi(t,e,i){var n=new XMLHttpRequest;for(var o in n.open("GET",t),n.responseType="arraybuffer",i)n.setRequestHeader(o,i[o]);return n.onload=function(){var t=new Uint8Array(this.response),i=new Blob([t],{type:"image/png"}),n=(window.URL||window.webkitURL).createObjectURL(i);e(n)},n.send(),function(){n.abort()}}var vi=function(t){function i(e,i,n){var o=t.call(this,e,i,n)||this;return o._abort=[],o}return e(i,t),i.prototype.cancelLoad=function(){this._abort&&(this._abort.forEach((function(t){return t()})),this._abort=[])},i.prototype._initImage=function(){t.prototype._initImage.call(this);var e=this.options.headers;if(e){var i=this._image,n=i.src;i.src="",this._abort.push(yi(n,(function(t){i.src=t}),e))}},i}(l.exports.ImageOverlay),gi=function(t){function i(e,i){var n=t.call(this,i)||this;n.defaultWmsParams={service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},n.options={crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100},n._url=e;var o,r={},s={};for(o in i)o in n.options?s[o]=i[o]:r[o]=i[o];return l.exports.Util.setOptions(n,s),n.wmsParams=l.exports.Util.extend({},n.defaultWmsParams,r),n}return e(i,t),i.prototype.setParams=function(t){l.exports.Util.extend(this.wmsParams,t),this.update()},i.prototype.getAttribution=function(){return this.options.attribution||""},i.prototype.onAdd=function(){return this.update(),this},i.prototype.onRemove=function(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this},i.prototype.getEvents=function(){return{moveend:D(this.update,this.options.setViewDelay)}},i.prototype.update=function(){var t=this;if(this._map){this.updateWmsParams();var e=this.getImageUrl();if(this._currentUrl!==e){this._currentUrl=e;var i=this.options.viewPortBuffer||0,n=this._map.getBounds().pad(i),o=new vi(e,n,{opacity:0,pane:this.options.pane,headers:this.options.headers});o.addTo(this._map),this._currentOverlay&&this._currentOverlay.cancelLoad(),o.once("load",(function(){t._map&&(o._url===t._currentUrl?(t._currentOverlay&&t._map.removeLayer(t._currentOverlay),t._currentOverlay=o,o.setOpacity(void 0!==t.options.opacity?t.options.opacity:1),!0===t.options.isBack&&o.bringToBack(),!1===t.options.isBack&&o.bringToFront(),void 0!==t.options.zIndex&&o.setZIndex(t.options.zIndex)):t._map.removeLayer(o))}),this);var r=this.options,s=r.minZoom,a=r.maxZoom;(s&&this._map.getZoom()<s||a&&this._map.getZoom()>a)&&this._map.removeLayer(o)}}},i.prototype.setOpacity=function(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)},i.prototype.bringToBack=function(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()},i.prototype.bringToFront=function(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()},i.prototype.setZIndex=function(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)},i.prototype.updateWmsParams=function(t){t||(t=this._map);var e=this.options.viewPortBuffer||0,i=t.getBounds().pad(e),n=t.getSize();if(0!==this.options.viewPortBuffer){var o=e+1;n.x=Math.ceil(n.x*o),n.y=Math.ceil(n.y*o)}var r=parseFloat(this.wmsParams.version),s=this.options.crs||t.options.crs,a=r>=1.3?"crs":"srs";if(s){var u=s.project(i.getNorthWest()),h=s.project(i.getSouthEast()),c={width:n.x,height:n.y};c[a]=s.code,c.bbox=(r>=1.3&&s===l.exports.CRS.EPSG4326?[h.y,u.x,u.y,h.x]:[u.x,h.y,h.x,u.y]).join(","),l.exports.Util.extend(this.wmsParams,c)}},i.prototype.getImageUrl=function(){var t=l.exports.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t},i}(l.exports.Layer),bi=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.addLayer=function(t){var e=t&&t.url;if(e){var n=(t=i({transparent:!0},t)).updateWmsParams;if(this.layer=new gi(e,i(i(i({pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay},t),t.params),t.nativeOptions)),n){var o=this.layer.updateWmsParams;this.layer.updateWmsParams=function(t){o.call(this,t),this.wmsParams=n(this.wmsParams)}}return this.layer}},n}(mi);
2
2
  /*!
3
3
  * leaflet.wms.js
4
4
  * A collection of Leaflet utilities for working with Web Mapping services.
5
5
  * (c) 2014-2016, Houston Engineering, Inc.
6
6
  * MIT License
7
- */function bi(t){return function(t){function i(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=t.apply(this,e)||this;return n.options.setViewDelay&&(n._update=D((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];(t=l.exports.GridLayer.prototype._update).call.apply(t,a([n],e,!1))}),n.options.setViewDelay)),n}return e(i,t),i.prototype.createTile=function(t,e){var i=this.getTileUrl(t),n=document.createElement("img");return n.abort=_i(i,(function(t){n.src=t,e(null,n)}),this.options.headers),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n},i.prototype._abortLoading=function(){var t=this._tiles,e=this._tileZoom;for(var i in t)if(t[i].coords.z!==e){var n=t[i].el;n.onload=l.exports.Util.falseFn,n.onerror=l.exports.Util.falseFn,n.complete||(n.abort&&n.abort(),n.src=l.exports.Util.emptyImageUrl,l.exports.DomUtil.remove(n),delete t[i])}},i}(t)}var wi=bi(function(t){function i(e,i){var n=t.call(this,e,i)||this;return Object.assign(n.options,i),n}return e(i,t),i}(l.exports.TileLayer)),xi=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return e(o,t),o.prototype.addLayer=function(t){if(this.options=Object.assign(this.options,t),t){var e=t.url,o=n(t,["url"]);if(e){var r=i({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom},o.nativeOptions);o.subdomains&&(r.subdomains=o.subdomains);return o.headers?new wi(e,i(i({},r),{headers:o.headers,setViewDelay:o.setViewDelay})):new l.exports.TileLayer(e,r)}}},o}(fi),Li=bi(function(t){function i(e,i){return t.call(this,e,i)||this}return e(i,t),i}(l.exports.TileLayer.WMS)),Pi=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return e(o,t),o.prototype.addLayer=function(t){Object.assign(this.options,t);var e=t.url,o=n(t,["url"]);if(e){var r=i({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format},t.nativeOptions);return o.headers?new Li(e,i(i({},r),{headers:o.headers})):new l.exports.TileLayer.WMS(e,r)}},o}(fi),Ci=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.addLayer=function(e){return t.prototype.addLayer.call(this,i(i({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},e),{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))},n}(xi);function Mi(t){return[[t[3],t[0]],[t[1],t[2]]]}var Ti=function(){function t(){this.options={target:"map"},this.layerAdapters=t.layerAdapters,this.controlAdapters=t.controlAdapters,this.emitter=new p.exports.EventEmitter,this._unselectCb=[],this._universalEvents=["move","zoom","zoomend","zoomstart","moveend","movestart"],this._positionEvents=["mousemove","mouseout","mouseover"]}return t.prototype.create=function(t){var e=this;if(this.options=i({},t),this.options.target){var n=this.options,o=n.zoom,r=n.center,s=n.maxZoom,a=n.minZoom,u=n.maxBounds,h=n.mapAdapterOptions;this.map=this.options.map||new l.exports.Map(this.options.target,i({attributionControl:!1,zoomControl:!1,maxBounds:u?Mi(u):void 0,maxZoom:s,minZoom:a,center:r&&[r[1],r[0]],zoom:o},h));var c=this.map.createPane("order-0");this.map._addUnselectCb=function(t){e._addUnselectCb(t)},c.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}},t.prototype.destroy=function(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()},t.prototype.getContainer=function(){return this.map&&this.map.getContainer()},t.prototype.getControlContainer=function(){var t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")},t.prototype.setCursor=function(t){this.map&&(this.map.getContainer().style.cursor=t)},t.prototype.setView=function(t,e){var i=this.map;if(i)if(Array.isArray(t)){var n=t[0],o=t[1];this.map&&("number"==typeof e?this.map.setView([o,n],e,{animate:!1}):this.setCenter([n,o]))}else{var r=t.zoom,s=t.center,a=t.maxBounds,u=t.bounds,h=t.minZoom,l=t.maxZoom;if(s&&void 0!==r?this.setView(s,r):(void 0!==r&&this.setZoom(r),s&&this.setCenter(s)),u&&this.fitBounds(u),void 0!==a)if(a){var c=Mi(a);i.setMaxBounds(c),i.setMinZoom(i.getBoundsZoom(c)),this._watchSizeChangeToUpdateMinZoom(c)}else i.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==l&&i.setMaxZoom(l),void 0!==h&&(this._stopWatchSizeChangeToUpdateMinZoom(),i.setMinZoom(h))}},t.prototype.setCenter=function(t){this.map&&this.map.panTo([t[1],t[0]])},t.prototype.getCenter=function(){var t=this.map;if(t){var e=t.getBounds().getCenter();return[e.lng,e.lat]}},t.prototype.setZoom=function(t){this.map&&this.map.setZoom(t)},t.prototype.getZoom=function(){var t;return null!==(t=this.map&&this.map.getZoom())&&void 0!==t?t:void 0},t.prototype.getBounds=function(){if(this.map){var t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}},t.prototype.fitBounds=function(t,e){if(void 0===e&&(e={}),this.map){var i=e.maxZoom,n=e.offset,o=e.padding,r={};i&&(r.maxZoom=i),o&&(r.padding=[o,o]),n&&(r.padding=n),this.map.fitBounds(Mi(t),r)}},t.prototype.getLayerAdapter=function(e){return t.layerAdapters[e]},t.prototype.createControl=function(t,e){return ei(t,e,this)},t.prototype.createButtonControl=function(t){return function(t,e){var i=document.createElement("a"),n=t.title||"";i.href="#",i.title=n,i.setAttribute("role","button"),i.setAttribute("aria-label",n),t.addClass&&i.classList.add(t.addClass),l.exports.DomEvent.disableClickPropagation(i),l.exports.DomEvent.on(i,"click",l.exports.DomEvent.stop),t.html instanceof HTMLElement?i.appendChild(t.html):"string"==typeof t.html&&(i.innerHTML=t.html);var o=function(e){e.stopPropagation(),t.onClick()};return ei({onAdd:function(){return void 0!==t.onClick&&i.addEventListener("click",o),i},onRemove:function(){var e=i.parentNode;e&&e.removeChild(i),void 0!==t.onClick&&i.removeEventListener("click",o)}},{bar:!0},e)}(t,this)},t.prototype.addControl=function(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t},t.prototype.removeControl=function(t){this.map&&this.map.removeControl(t)},t.prototype.removeLayer=function(t){t&&t.remove&&t.remove()},t.prototype.showLayer=function(t){this.map&&t.addTo(this.map)},t.prototype.hideLayer=function(t){t.remove()},t.prototype.setLayerOpacity=function(t,e){"setOpacity"in t&&t.setOpacity(e)},t.prototype.setLayerOrder=function(t,e,i){},t.prototype.onMapClick=function(t){var e=ti(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)},t.prototype.locate=function(t,e){var i=this.map;if(i&&(i.locate(t),e)){var n=e.locationfound,o=e.locationerror,r=function(t){n({lngLat:[t.latlng.lng,t.latlng.lat]})};void 0!==n&&i.on("locationfound",r,this),o&&i.on("locationerror",o,this);return{stop:function(){void 0!==n&&i.off("locationfound",r),o&&i.off("locationerror",o)}}}return{stop:function(){}}},t.prototype._addUnselectCb=function(t){for(var e=0,i=this._unselectCb;e<i.length;e++){(0,i[e])()}this._unselectCb.length=0,this._unselectCb.push(t)},t.prototype._watchSizeChangeToUpdateMinZoom=function(t){this._stopWatchSizeChangeToUpdateMinZoom();var e=this.getContainer(),i=this.map;e&&i&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((function(){i.setMinZoom(i.getBoundsZoom(t))})),this._resizeObserver.observe(e))},t.prototype._stopWatchSizeChangeToUpdateMinZoom=function(){var t=this.map;t&&t.setMinZoom(0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)},t.prototype._addMapListeners=function(){var t=this,e=this.map;if(e){e.on("click",(function(e){t.onMapClick(e)}));for(var i=function(i){e.on(i,(function(){return t.emitter.emit(i,t)}),e)},n=0,o=this._universalEvents;n<o.length;n++){i(o[n])}for(var r=function(i){e.on(i,(function(e){return t.emitter.emit(i,ti(e))}),e)},s=0,a=this._positionEvents;s<a.length;s++){r(a[s])}}},t.layerAdapters={GEOJSON:mi,IMAGE:gi,TILE:xi,WMS:Pi,OSM:Ci},t.controlAdapters={ZOOM:l.exports.Control.Zoom,ATTRIBUTION:ii},t.Map=l.exports.Map,t}();delete l.exports.Icon.Default.prototype._getIconUrl,l.exports.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});var Oi=function(t){function n(e){return e=i(i({},e),{mapAdapter:new Ti}),t.call(this,e)||this}return e(n,t),n.create=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return[2,new n(t).onLoad()]}))}))},n}($e);return window&&!window.NgwMap&&(window.NgwMap=Oi),Oi}();
7
+ */function wi(t){return function(t){function i(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=t.apply(this,e)||this;return n.options.setViewDelay&&(n._update=D((function(){for(var t,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];(t=l.exports.GridLayer.prototype._update).call.apply(t,a([n],e,!1))}),n.options.setViewDelay)),n}return e(i,t),i.prototype.createTile=function(t,e){var i=this.getTileUrl(t),n=document.createElement("img");return n.abort=yi(i,(function(t){n.src=t,e(null,n)}),this.options.headers),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n},i.prototype._abortLoading=function(){var t=this._tiles,e=this._tileZoom;for(var i in t)if(t[i].coords.z!==e){var n=t[i].el;n.onload=l.exports.Util.falseFn,n.onerror=l.exports.Util.falseFn,n.complete||(n.abort&&n.abort(),n.src=l.exports.Util.emptyImageUrl,l.exports.DomUtil.remove(n),delete t[i])}},i}(t)}var xi=wi(function(t){function i(e,i){var n=t.call(this,e,i)||this;return Object.assign(n.options,i),n}return e(i,t),i}(l.exports.TileLayer)),Li=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return e(o,t),o.prototype.addLayer=function(t){if(this.options=Object.assign(this.options,t),t){var e=t.url,o=n(t,["url"]);if(e){var r=i({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom},o.nativeOptions);o.subdomains&&(r.subdomains=o.subdomains);return o.headers?new xi(e,i(i({},r),{headers:o.headers,setViewDelay:o.setViewDelay})):new l.exports.TileLayer(e,r)}}},o}(mi),Pi=wi(function(t){function i(e,i){return t.call(this,e,i)||this}return e(i,t),i}(l.exports.TileLayer.WMS)),Ci=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return e(o,t),o.prototype.addLayer=function(t){Object.assign(this.options,t);var e=t.url,o=n(t,["url"]);if(e){var r=i({pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format},t.nativeOptions);return o.headers?new Pi(e,i(i({},r),{headers:o.headers})):new l.exports.TileLayer.WMS(e,r)}},o}(mi),Mi=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.prototype.addLayer=function(e){return t.prototype.addLayer.call(this,i(i({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'},e),{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}))},n}(Li);function Ti(t){return[[t[3],t[0]],[t[1],t[2]]]}var Oi=function(){function t(){this.options={target:"map"},this.layerAdapters=t.layerAdapters,this.controlAdapters=t.controlAdapters,this.emitter=new p.exports.EventEmitter,this._unselectCb=[],this._universalEvents=["move","zoom","zoomend","zoomstart","moveend","movestart"],this._positionEvents=["mousemove","mouseout","mouseover"]}return t.prototype.create=function(t){var e,n=this;if(this.options=i({},t),this.options.target){var o=(e=this.options).zoom,r=e.center,s=e.maxZoom,a=e.minZoom,u=e.maxBounds,h=e.mapAdapterOptions;this.map=this.options.map||new l.exports.Map(this.options.target,i({attributionControl:!1,zoomControl:!1,maxBounds:u?Ti(u):void 0,maxZoom:s,minZoom:a,center:r&&[r[1],r[0]],zoom:o},h));var c=this.map.createPane("order-0");this.map._addUnselectCb=function(t){n._addUnselectCb(t)},c.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}},t.prototype.destroy=function(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()},t.prototype.getContainer=function(){return this.map&&this.map.getContainer()},t.prototype.getControlContainer=function(){var t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")},t.prototype.setCursor=function(t){this.map&&(this.map.getContainer().style.cursor=t)},t.prototype.setView=function(t,e){var i=this.map;if(i)if(Array.isArray(t)){var n=t[0],o=t[1];this.map&&("number"==typeof e?this.map.setView([o,n],e,{animate:!1}):this.setCenter([n,o]))}else{var r=t.zoom,s=t.center,a=t.maxBounds,u=t.bounds,h=t.minZoom,l=t.maxZoom;if(s&&void 0!==r?this.setView(s,r):(void 0!==r&&this.setZoom(r),s&&this.setCenter(s)),u&&this.fitBounds(u),void 0!==a)if(a){var c=Ti(a);i.setMaxBounds(c),i.setMinZoom(i.getBoundsZoom(c)),this._watchSizeChangeToUpdateMinZoom(c)}else i.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==l&&i.setMaxZoom(l),void 0!==h&&(this._stopWatchSizeChangeToUpdateMinZoom(),i.setMinZoom(h))}},t.prototype.setCenter=function(t){this.map&&this.map.panTo([t[1],t[0]])},t.prototype.getCenter=function(){var t=this.map;if(t){var e=t.getBounds().getCenter();return[e.lng,e.lat]}},t.prototype.setZoom=function(t){this.map&&this.map.setZoom(t)},t.prototype.getZoom=function(){var t;return null!==(t=this.map&&this.map.getZoom())&&void 0!==t?t:void 0},t.prototype.getBounds=function(){if(this.map){var t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}},t.prototype.fitBounds=function(t,e){if(void 0===e&&(e={}),this.map){var i=e.maxZoom,n=e.offset,o=e.padding,r={};i&&(r.maxZoom=i),o&&(r.padding=[o,o]),n&&(r.padding=n),this.map.fitBounds(Ti(t),r)}},t.prototype.getLayerAdapter=function(e){return t.layerAdapters[e]},t.prototype.createControl=function(t,e){return ii(t,e,this)},t.prototype.createButtonControl=function(t){return function(t,e){var i=document.createElement("a"),n=t.title||"";i.href="#",i.title=n,i.setAttribute("role","button"),i.setAttribute("aria-label",n),t.addClass&&i.classList.add(t.addClass),l.exports.DomEvent.disableClickPropagation(i),l.exports.DomEvent.on(i,"click",l.exports.DomEvent.stop),t.html instanceof HTMLElement?i.appendChild(t.html):"string"==typeof t.html&&(i.innerHTML=t.html);var o=function(e){e.stopPropagation(),t.onClick()};return ii({onAdd:function(){return void 0!==t.onClick&&i.addEventListener("click",o),i},onRemove:function(){var e=i.parentNode;e&&e.removeChild(i),void 0!==t.onClick&&i.removeEventListener("click",o)}},{bar:!0},e)}(t,this)},t.prototype.addControl=function(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t},t.prototype.removeControl=function(t){this.map&&this.map.removeControl(t)},t.prototype.removeLayer=function(t){t&&t.remove&&t.remove()},t.prototype.showLayer=function(t){this.map&&t.addTo(this.map)},t.prototype.hideLayer=function(t){t.remove()},t.prototype.setLayerOpacity=function(t,e){"setOpacity"in t&&t.setOpacity(e)},t.prototype.setLayerOrder=function(t,e,i){},t.prototype.onMapClick=function(t){var e=ei(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)},t.prototype.locate=function(t,e){var i=this.map;if(i&&(i.locate(t),e)){var n=e.locationfound,o=e.locationerror,r=function(t){n({lngLat:[t.latlng.lng,t.latlng.lat]})};void 0!==n&&i.on("locationfound",r,this),o&&i.on("locationerror",o,this);return{stop:function(){void 0!==n&&i.off("locationfound",r),o&&i.off("locationerror",o)}}}return{stop:function(){}}},t.prototype._addUnselectCb=function(t){for(var e=0,i=this._unselectCb;e<i.length;e++){(0,i[e])()}this._unselectCb.length=0,this._unselectCb.push(t)},t.prototype._watchSizeChangeToUpdateMinZoom=function(t){this._stopWatchSizeChangeToUpdateMinZoom();var e=this.getContainer(),i=this.map;e&&i&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((function(){i.setMinZoom(i.getBoundsZoom(t))})),this._resizeObserver.observe(e))},t.prototype._stopWatchSizeChangeToUpdateMinZoom=function(){var t=this.map;t&&t.setMinZoom(0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)},t.prototype._addMapListeners=function(){var t=this,e=this.map;if(e){e.on("click",(function(e){t.onMapClick(e)}));for(var i=function(i){e.on(i,(function(){return t.emitter.emit(i,t)}),e)},n=0,o=this._universalEvents;n<o.length;n++){i(o[n])}for(var r=function(i){e.on(i,(function(e){return t.emitter.emit(i,ei(e))}),e)},s=0,a=this._positionEvents;s<a.length;s++){r(a[s])}}},t.layerAdapters={GEOJSON:_i,IMAGE:bi,TILE:Li,WMS:Ci,OSM:Mi},t.controlAdapters={ZOOM:l.exports.Control.Zoom,ATTRIBUTION:ni},t.Map=l.exports.Map,t}();delete l.exports.Icon.Default.prototype._getIconUrl,l.exports.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});var Ai=function(t){function n(e){return e=i(i({},e),{mapAdapter:new Oi}),t.call(this,e)||this}return e(n,t),n.create=function(t){return o(this,void 0,void 0,(function(){return r(this,(function(e){return[2,new n(t).onLoad()]}))}))},n}(ti);return window&&!window.NgwMap&&(window.NgwMap=Ai),Ai}();
8
8
  //# sourceMappingURL=ngw-leaflet.global.prod.js.map