"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2910],{61831:function(t,e,n){var i=n(41376),r=n(70492),o=n(76166),s=n(42010),a=n(6566),l=n(46583),u=n(99626),c=n(33248),h=n(80542),f=n(86923),d=n(90776),p=n(75059),v=n(19352),y=n(5162),_=n(12810),g=n(12016),m=n(40574);function b(t){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R(t,e){for(var n=0;n=93&&r--,r>=35&&r--;var o=null;if((r-=32)in this.keys_){var s=this.keys_[r];o=this.data_&&s in this.data_?this.data_[s]:s}return o}},{key:"forDataAtCoordinate",value:function(t,e,n){this.state==h.Z.EMPTY&&!0===n?(this.state=h.Z.IDLE,(0,g.Vx)(this,a.Z.CHANGE,(function(n){e(this.getData(t))}),this),this.loadInternal_()):!0===n?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))}},{key:"getKey",value:function(){return this.src_}},{key:"handleError_",value:function(){this.state=h.Z.ERROR,this.changed()}},{key:"handleLoad_",value:function(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=h.Z.LOADED,this.changed()}},{key:"loadInternal_",value:function(){if(this.state==h.Z.IDLE)if(this.state=h.Z.LOADING,this.jsonp_)(0,m.R6)(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{var t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}}},{key:"onXHRLoad_",value:function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var n;try{n=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(n)}else this.handleError_()}},{key:"onXHRError_",value:function(t){this.handleError_()}},{key:"load",value:function(){this.preemptive_?this.loadInternal_():this.setState(h.Z.EMPTY)}}]),n}(u.Z),L=function(t){O(n,t);var e=w(n);function n(t){var i;if(E(this,n),(i=e.call(this,{projection:(0,_.U2)("EPSG:3857"),state:l.Z.LOADING,zDirection:t.zDirection})).preemptive_=void 0===t.preemptive||t.preemptive,i.tileUrlFunction_=p.vU,i.template_=void 0,i.jsonp_=t.jsonp||!1,t.url)if(i.jsonp_)(0,m.R6)(t.url,i.handleTileJSONResponse.bind(Z(i)),i.handleTileJSONError.bind(Z(i)));else{var r=new XMLHttpRequest;r.addEventListener("load",i.onXHRLoad_.bind(Z(i))),r.addEventListener("error",i.onXHRError_.bind(Z(i))),r.open("GET",t.url),r.send()}else t.tileJSON?i.handleTileJSONResponse(t.tileJSON):(0,d.h)(!1,51);return i}return k(n,[{key:"onXHRLoad_",value:function(t){var e=t.target;if(!e.status||e.status>=200&&e.status<300){var n;try{n=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(n)}else this.handleTileJSONError()}},{key:"onXHRError_",value:function(t){this.handleTileJSONError()}},{key:"getTemplate",value:function(){return this.template_}},{key:"forDataAtCoordinateAndResolution",value:function(t,e,n,i){if(this.tileGrid){var r=this.tileGrid.getZForResolution(e,this.zDirection),o=this.tileGrid.getTileCoordForCoordAndZ(t,r);this.getTile(o[0],o[1],o[2],1,this.getProjection()).forDataAtCoordinate(t,n,i)}else!0===i?setTimeout((function(){n(null)}),0):n(null)}},{key:"handleTileJSONError",value:function(){this.setState(l.Z.ERROR)}},{key:"handleTileJSONResponse",value:function(t){var e,n=(0,_.U2)("EPSG:4326"),i=this.getProjection();if(void 0!==t.bounds){var r=(0,_.WO)(n,i);e=(0,f.Ne)(t.bounds,r)}var o=(0,v.Tl)(i),s=t.minzoom||0,a=t.maxzoom||22,u=(0,v.dl)({extent:o,maxZoom:a,minZoom:s});this.tileGrid=u,this.template_=t.template;var c=t.grids;if(c){if(this.tileUrlFunction_=(0,p.uR)(c,u),void 0!==t.attribution){var h=void 0!==e?e:o;this.setAttributions((function(e){return(0,f.kK)(h,e.extent)?[t.attribution]:null}))}this.setState(l.Z.READY)}else this.setState(l.Z.ERROR)}},{key:"getTile",value:function(t,e,n,i,r){var o=(0,y.lg)(t,e,n);if(this.tileCache.containsKey(o))return this.tileCache.get(o);var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,r),l=this.tileUrlFunction_(a,i,r),u=new x(s,void 0!==l?h.Z.IDLE:h.Z.EMPTY,void 0!==l?l:"",this.tileGrid.getTileCoordExtent(s),this.preemptive_,this.jsonp_);return this.tileCache.set(o,u),u}},{key:"useTile",value:function(t,e,n){var i=(0,y.lg)(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)}}]),n}(c.Z),D=n(54354),C="pk.eyJ1IjoiYWhvY2V2YXIiLCJhIjoiY2t0cGdwMHVnMGdlbzMxbDhwazBic2xrNSJ9.WbcTL9uj8JPAsnT9mgb7oQ",N=new s.Z({source:new o.Z({url:"https://api.tiles.mapbox.com/v4/mapbox.geography-class.json?secure&access_token="+C})}),P=new L({url:"https://api.tiles.mapbox.com/v4/mapbox.geography-class.json?secure&access_token="+C}),J=new s.Z({source:P}),I=new D.ZP({center:[0,0],zoom:1}),A=document.getElementById("map"),G=new i.Z({layers:[N,J],target:A,view:I}),H=document.getElementById("country-info"),M=document.getElementById("country-flag"),X=document.getElementById("country-name"),z=new r.Z({element:H,offset:[15,15],stopEvent:!1});G.addOverlay(z);var Y=function(t){var e=I.getResolution();P.forDataAtCoordinateAndResolution(t,e,(function(e){A.style.cursor=e?"pointer":"",e&&(M.src="data:image/png;base64,"+e.flag_png,X.innerHTML=e.admin),z.setPosition(e?t:void 0)}))};G.on("pointermove",(function(t){if(!t.dragging){var e=G.getEventCoordinate(t.originalEvent);Y(e)}})),G.on("click",(function(t){Y(t.coordinate)}))}},function(t){var e=function(e){return t(t.s=e)};e(9877),e(61831)}]); //# sourceMappingURL=utfgrid.js.map